* sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4 Suggested by Eli Zaretskii in
5 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6
7 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
8
9 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
10
11 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
12
13 * lisp.h (struct backtrace): Remove indirection for `function' field.
14 * xdisp.c (redisplay_internal):
15 * profiler.c (record_backtrace, sigprof_handler_1):
16 * alloc.c (Fgarbage_collect):
17 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
18 (Fbacktrace_frame): Adjust accordingly.
19
20 2012-09-28 Glenn Morris <rgm@gnu.org>
21
22 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
23 (Frun_hook_with_args_until_failure): Doc fixes.
24
25 2012-09-28 Eli Zaretskii <eliz@gnu.org>
26
27 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
28 Qautomatic_redisplay and change the symbol name. All users changed.
29
30 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
31
32 * profiler.c (sigprof_handler): Fix race condition.
33
34 2012-09-28 Glenn Morris <rgm@gnu.org>
35
36 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
37
38 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
39
40 Check more robustly for timer_settime.
41 * Makefile.in (LIB_TIMER_TIME): New macro.
42 (LIBES): Add it.
43 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
44 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
45 call timer_settime.
46
47 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
48
49 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
50
51 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
52
53 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
54
55 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
56
57 * character.h (MAYBE_UNIFY_CHAR): Remove.
58 * charset.c, charset.h (maybe_unify_char): Now static.
59 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
60 Since this stuff is now private to charset.c, there's no need for
61 a public macro and no need to inline by hand.
62
63 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
64 Stefan Monnier <monnier@iro.umontreal.ca>
65 Juanma Barranquero <lekktu@gmail.com>
66
67 * profiler.c: New file.
68 * Makefile.in (base_obj): Add profiler.o.
69 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
70 ($(BLD)/profiler.$(O)): New target.
71 * emacs.c (main): Call syms_of_profiler.
72 * alloc.c (Qautomatic_gc): New constant.
73 (MALLOC_PROBE): New macro.
74 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
75 (total_bytes_of_live_objects): New function.
76 (Fgarbage_collect): Use it. Record itself in backtrace_list.
77 Call malloc_probe for the memory profiler.
78 (syms_of_alloc): Define Qautomatic_gc.
79 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
80 race condition.
81 (struct backtrace): Move definition...
82 * lisp.h (struct backtrace): ..here.
83 (Qautomatic_gc, profiler_memory_running): Declare vars.
84 (malloc_probe, syms_of_profiler): Declare functions.
85 * xdisp.c (Qautomatic_redisplay): New constant.
86 (redisplay_internal): Record itself in backtrace_list.
87 (syms_of_xdisp): Define Qautomatic_redisplay.
88
89 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
90
91 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
92
93 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
94
95 Prefer POSIX timers if available.
96 They avoid a race if the timer is too close to the current time.
97 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
98 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
99 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
100
101 2012-09-25 Eli Zaretskii <eliz@gnu.org>
102
103 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
104 CHAR_STRING_ADVANCE.
105 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
106 STRING_CHAR_ADVANCE.
107
108 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
109
110 Move Vlibrary_cache to emacs.c and reset before dumping.
111
112 * lisp.h (reset_image_types): Declare.
113 [WINDOWSNT] (Vlibrary_cache): Declare.
114
115 * image.c (reset_image_types): New function.
116
117 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
118 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
119 (Fdump_emacs): Reset Vlibrary_cache and image_types.
120
121 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
122 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
123
124 * w32.h (Vlibrary_cache): Do not declare.
125
126 2012-09-25 Eli Zaretskii <eliz@gnu.org>
127
128 * w32proc.c (sys_signal): Handle all signals defined by the
129 MS-Windows runtime, not just SIGCHLD. Actually install the signal
130 handlers for signals supported by Windows. Don't override
131 term_ntproc as the handler for SIGABRT.
132 (sigaction): Rewrite to call sys_signal instead of duplicating its
133 code.
134 (sys_kill): Improve commentary.
135
136 * w32.c (term_ntproc): Accept (and ignore) one argument, for
137 consistency with a signature of a signal handler. All callers
138 changed.
139 (init_ntproc): Accept an argument DUMPING. If dumping, don't
140 install term_ntproc as a signal handler for SIGABRT, as that
141 should be done by the dumped Emacs.
142
143 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
144
145 * w32select.c (term_w32select): Protect against repeated
146 invocation by setting clipboard_owner to NULL after calling
147 DestroyWindow.
148
149 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
150 and term_ntproc to their modified signatures.
151
152 * character.c (char_string, string_char): Remove calls to
153 MAYBE_UNIFY_CHAR. See the discussion starting at
154 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
155 for the details.
156
157 2012-09-25 Chong Yidong <cyd@gnu.org>
158
159 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
160
161 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
162
163 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
164 when encountering an unknown bytecode.
165
166 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
167
168 image.c, indent.c: Use bool for booleans.
169 * dispextern.h (struct image_type): Members valid_p, load, init
170 now return bool, not int. All uses changed.
171 * image.c: Omit unnecessary static decls.
172 (x_create_bitmap_mask, x_build_heuristic_mask):
173 Return void, not int, since callers don't care about the return value.
174 (x_create_bitmap_mask, define_image_type, valid_image_p)
175 (struct image_keyword, parse_image_spec, image_spec_value)
176 (check_image_size, image_background)
177 (image_background_transparent, x_clear_image_1)
178 (postprocess_image, lookup_image, x_check_image_size)
179 (x_create_x_image_and_pixmap, xbm_image_p)
180 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
181 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
182 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
183 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
184 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
185 (png_image_p, init_png_functions, png_load_body, png_load)
186 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
187 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
188 (init_gif_functions, gif_load, imagemagick_image_p)
189 (imagemagick_load_image, imagemagick_load, svg_image_p)
190 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
191 (gs_load):
192 * nsimage.m (ns_load_image):
193 * nsterm.m (ns_defined_color):
194 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
195 * xfns.c (x_defined_color):
196 * xterm.c (x_alloc_lighter_color_for_widget)
197 (x_alloc_nearest_color_1, x_alloc_nearest_color)
198 (x_alloc_lighter_color):
199 * indent.c (disptab_matches_widthtab, current_column)
200 (scan_for_column, string_display_width, indented_beyond_p)
201 (compute_motion, vmotion, Fvertical_motion):
202 Use bool for booleans.
203
204 2012-09-24 Chong Yidong <cyd@gnu.org>
205
206 * chartab.c (Fset_char_table_default): Obsolete function removed.
207
208 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
209
210 Move pid_t related decls out of lisp.h.
211 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
212 (interruptible_wait_for_termination):
213 Move these decls from lisp.h to syswait.h, since they use pid_t.
214 Needed on FreeBSD; see Herbert J. Skuhra in
215 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
216 * callproc.c: Include syswait.h.
217
218 gnutls.c, gtkutil.c: Use bool for boolean.
219 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
220 (emacs_gnutls_handle_error):
221 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
222 (xg_hide_tooltip, xg_create_frame_widgets)
223 (create_dialog, xg_uses_old_file_dialog)
224 (xg_get_file_with_chooser, xg_get_file_with_selection)
225 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
226 (xg_item_label_same_p, xg_update_menubar)
227 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
228 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
229 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
230 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
231 (update_frame_tool_bar, free_frame_tool_bar):
232 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
233 * nsmenu.m (ns_update_menubar):
234 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
235 * xfns.c (Fx_show_tip) [USE_GTK]:
236 Use bool for boolean.
237 * gtkutil.c (xg_update_frame_menubar):
238 * xmenu.c (update_frame_menubar):
239 Return void, not int, since caller ignores return value.
240 * gtkutil.c (xg_change_toolbar_position):
241 Return void, not 1.
242
243 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
244
245 * makefile.w32-in (BLOCKINPUT_H): Remove.
246 (SYSSIGNAL_H): New macro.
247 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
248 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
249 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
250 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
251 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
252 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
253 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
254 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
255 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
256 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
257 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
258 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
259 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
260 ($(BLD)/w32xfns.$(O)): Update dependencies.
261
262 2012-09-23 Eli Zaretskii <eliz@gnu.org>
263
264 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
265 fatal_error_backtrace.
266
267 * w32proc.c (sys_kill): Undo last change: don't do anything when
268 invoked to deliver SIGABRT to our own process. This is now
269 handled by emacs_raise.
270
271 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
272
273 * w32term.c (w32_read_socket): Remove leftover reference to
274 interrupt_input_pending.
275
276 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
277
278 Do not use SA_NODEFER.
279 Problem reported by Dani Moncayo in
280 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
281 * alloc.c (die):
282 * sysdep.c (emacs_abort): Do not reset signal handler.
283 * emacs.c (terminate_due_to_signal): Reset signal handler here.
284 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
285 wanted even on POSIXish hosts, and it doesn't work on Windows.
286
287 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
288
289 * xterm.c (x_term_init): Call fixup_locale before and after calling
290 gtk_init (Bug#12392).
291
292 2012-09-23 Chong Yidong <cyd@gnu.org>
293
294 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
295 Vdynamic_library_alist.
296
297 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
298 (Fgnutls_available_p): Caller changed.
299
300 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
301 (Flibxml_parse_xml_region): Likewise.
302
303 * dispextern.h (struct image_type): Remove arg from init function.
304
305 * image.c (Finit_image_library, lookup_image_type)
306 (define_image_type): Remove now-unneeded second arg.
307 (init_xpm_functions, init_png_functions, init_jpeg_functions)
308 (init_tiff_functions, init_gif_functions, init_svg_functions):
309 Arglist and w32_delayed_load calling convention changed.
310 (gs_type): Remove init_gs_functions; there is no such function.
311 (valid_image_p, make_image): Fix caller to lookup_image_type.
312
313 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
314
315 Simplify and avoid signal-handling races (Bug#12471).
316 * alloc.c (die):
317 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
318 Avoid recursive loop if there's a fatal error in the function itself.
319 * atimer.c (pending_atimers):
320 * blockinput.h: Don't include "atimer.h"; no longer needed.
321 (interrupt_input_pending): Remove. All uses removed.
322 pending_signals now counts both atimers and ordinary interrupts.
323 This is less racy than having three separate pending-signal flags.
324 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
325 (input_blocked_p):
326 Rename from their upper-case counterparts BLOCK_INPUT,
327 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
328 INPUT_BLOCKED_P, and turn into functions. All uses changed.
329 This makes it easier to access volatile variables more accurately.
330 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
331 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
332 that's more reliable if the code is buggy and sets
333 interrupt_input_blocked to a negative value. All uses changed.
334 * atimer.c (deliver_alarm_signal):
335 Remove. No need to deliver this to the parent; any thread can
336 handle this signal now. All uses replaced by underlying handler.
337 * atimer.c (turn_on_atimers):
338 * dispnew.c (handle_window_change_signal):
339 * emacs.c (handle_danger_signal):
340 * keyboard.c (kbd_buffer_get_event):
341 Don't reestablish signal handler; not needed with sigaction.
342 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
343 (UNBLOCK_INPUT_TO):
344 Rework to avoid unnecessary accesses to volatile variables.
345 (UNBLOCK_INPUT_TO): Now a function.
346 (totally_unblock_input, unblock_input): New decls.
347 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
348 (init_data): Remove. Necessary stuff now done in init_signal.
349 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
350 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
351 (fatal_error_code): Remove; no longer needed.
352 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
353 it doesn't always backtrace. All uses changed. No need to reset
354 signal to default, since sigaction and/or die does that for us now.
355 Use emacs_raise (FOO), not kill (getpid (), FOO).
356 (main): Check more-accurately whether we're dumping.
357 Move fatal-error setup to sysdep.c
358 * floatfns.c: Do not include "syssignal.h"; no longer needed.
359 * gtkutil.c (xg_get_file_name, xg_get_font):
360 Remove no-longer-needed signal-mask manipulation.
361 * keyboard.c, process.c (POLL_FOR_INPUT):
362 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
363 * keyboard.c (read_avail_input): Remove.
364 All uses replaced by gobble_input.
365 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
366 (kbd_buffer_store_event_hold, gobble_input):
367 (record_asynch_buffer_change) [USABLE_SIGIO]:
368 (store_user_signal_events):
369 No need to mess with signal mask.
370 (gobble_input): If blocking input and there are terminals, simply
371 set pending_signals to 1 and return. All hooks changed to not
372 worry about whether input is blocked.
373 (process_pending_signals): Clear pending_signals before processing
374 them, in case a signal comes in while we're processing.
375 By convention callers now test pending_signals before calling us.
376 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
377 New functions, to support changes to blockinput.h.
378 (handle_input_available_signal): Now extern.
379 (reinvoke_input_signal): Remove. All uses replaced by
380 handle_async_input.
381 (quit_count): Now volatile, since a signal handler uses it.
382 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
383 All callers changed. Block SIGINT only if not already blocked.
384 Clear sigmask reliably, even if Fsignal returns, which it can.
385 Omit unnecessary accesses to volatile var.
386 (quit_throw_to_read_char): No need to restore sigmask.
387 * keyboard.c (gobble_input, handle_user_signal):
388 * process.c (wait_reading_process_output):
389 Call signal-handling code rather than killing ourselves.
390 * lisp.h: Include <float.h>, for...
391 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
392 (pending_signals): Now volatile.
393 (syms_of_data): Now const if IEEE floating point.
394 (handle_input_available_signal) [USABLE_SIGIO]:
395 (terminate_due_to_signal, record_child_status_change): New decls.
396 * process.c (create_process): Avoid disaster if memory is exhausted
397 while we're processing a vfork, by tightening the critical section
398 around the vfork.
399 (send_process_frame, process_sent_to, handle_pipe_signal)
400 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
401 ignores SIGPIPE.
402 (send_process): No need for setjmp/longjmp any more, since the
403 SIGPIPE stuff is now gone. Instead, report an error if errno
404 is EPIPE.
405 (record_child_status_change): Now extern. PID and W are now args.
406 Return void, not bool. All callers changed.
407 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
408 Remove. All uses removed. This bug should be fixed now in a
409 different way.
410 (wait_for_termination_1): Use waitpid rather than sigsuspend,
411 and record the child status change directly. This avoids the
412 need to futz with the signal mask.
413 (process_fatal_action): Move here from emacs.c.
414 (emacs_sigaction_flags): New function, containing
415 much of what used to be in emacs_sigaction_init.
416 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
417 caught by emacs, to make races less likely.
418 (deliver_process_signal): Rename from handle_on_main_thread.
419 All uses changed.
420 (BACKTRACE_LIMIT_MAX): Now at top level.
421 (thread_backtrace_buffer, threadback_backtrace_pointers):
422 New static vars.
423 (deliver_thread_signal, deliver_fatal_thread_signal):
424 New functions, for more-accurate delivery of thread-specific signals.
425 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
426 (deliver_arith_signal): Handle in this thread, not
427 in the main thread, since it's triggered by this thread.
428 (maybe_fatal_sig): New function.
429 (init_signals): New arg DUMPING so that we can be more accurate
430 about whether we're dumping. Caller changed.
431 Treat thread-specific signals differently from process-general signals.
432 Block all signals while handling fatal error; that's safer.
433 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
434 on IEEE hosts.
435 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
436 Ignore SIGPIPE unless batch.
437 (emacs_backtrace): Output backtrace for the appropriate thread,
438 which is not necessarily the main thread.
439 * syssignal.h: Include <stdbool.h>.
440 (emacs_raise): New macro.
441 * xterm.c (x_connection_signal): Remove; no longer needed
442 now that we use sigaction.
443 (x_connection_closed): No need to mess with sigmask now.
444 (x_initialize): No need to reset SIGPIPE handler here, since
445 init_signals does this for us now.
446
447 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
448
449 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
450 background rect may be larger (Bug#12245).
451
452 2012-09-23 Chong Yidong <cyd@gnu.org>
453
454 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
455
456 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
457
458 * .gdbinit: Just stop at fatal_error_backtrace.
459 See Stefan Monnier's request in
460 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
461 Remove no-longer-used query of system type.
462
463 2012-09-22 Chong Yidong <cyd@gnu.org>
464
465 * search.c (Freplace_match): Doc fix (Bug#12325).
466
467 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
468
469 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
470 (Fline_end_position): Doc fix.
471
472 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
473
474 2012-09-22 Chong Yidong <cyd@gnu.org>
475
476 * dispextern.h (struct image_type): Add new slot, storing a type
477 initialization function.
478
479 * image.c (define_image_type): Call the image initializer function
480 if it is defined. Arguments and return value changed.
481 (valid_image_p, make_image): Callers changed.
482 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
483 (gif_type, imagemagick_type, svg_type, gs_type):
484 Add initialization functions.
485 (Finit_image_library): Call lookup_image_type.
486 (CHECK_LIB_AVAILABLE): Macro deleted.
487 (lookup_image_type): Call define_image_type here, rather than via
488 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
489 (syms_of_image): Move define_image_type calls for xbm_type and
490 pbm_type to lookup_image_type.
491
492 2012-09-22 Eli Zaretskii <eliz@gnu.org>
493
494 * keyboard.c (timer_check_2): Move calculation of 'timers' and
495 'idle_timers' from here ...
496 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
497 lists, to avoid infloops when the timer does something stupid,
498 like reinvoke itself with the same or smaller time-out.
499 (Bug#12447)
500
501 2012-09-22 Martin Rudalics <rudalics@gmx.at>
502
503 * window.c (Fsplit_window_internal): Handle only Qt value of
504 Vwindow_combination_limit separately.
505 (Qtemp_buffer_resize): New symbol.
506 (Vwindow_combination_limit): New default value.
507 Rewrite doc-string.
508
509 2012-09-22 Eli Zaretskii <eliz@gnu.org>
510
511 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
512 the new overlay string. (Bug#10159)
513
514 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
515
516 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
517 or that fprintf is async-signal-safe. POSIX doesn't require
518 either assumption.
519
520 2012-09-22 Chong Yidong <cyd@gnu.org>
521
522 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
523 (Bug#8207).
524
525 2012-09-22 Kenichi Handa <handa@gnu.org>
526
527 * composite.c (composition_reseat_it): Handle the case that a
528 grapheme cluster is not covered by a single font (Bug#12352).
529
530 2012-09-21 Chong Yidong <cyd@gnu.org>
531
532 * image.c (define_image_type): Avoid adding duplicate types to
533 image_types (Bug#12463). Suggested by Jörg Walter.
534
535 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
536
537 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
538 (print_load_command_name): Add case LC_DATA_IN_CODE.
539 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
540
541 2012-09-21 Glenn Morris <rgm@gnu.org>
542
543 * eval.c (Frun_hook_with_args_until_success)
544 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
545
546 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
547
548 * fileio.c (Ffile_selinux_context): Only call freecon when
549 lgetfilecon succeeded.
550 (Fset_file_selinux_context): Likewise. (Bug#12444)
551
552 2012-09-21 Eli Zaretskii <eliz@gnu.org>
553
554 * xdisp.c (try_window_reusing_current_matrix): Under bidi
555 reordering, locate the cursor by calling set_cursor_from_row; if
556 that fails, clear the desired glyph matrix before returning a
557 failure indication to the caller. Fixes leaving garbled display
558 when fast scrolling with a down-key. (Bug#12403)
559 (compute_stop_pos_backwards): Fix a typo that caused crashes while
560 scrolling through multibyte text.
561
562 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
563
564 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
565 calling mark_vectorlike since that's the one that marks the window.
566 (mark_discard_killed_buffers): Mark the final cdr.
567 * window.h (struct window): Move prev/next_buffers to the
568 non-standard fields.
569 * window.c (make_window): Initialize prev/next_buffers manually.
570
571 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
572
573 Omit unused arg EXPECTED from socket hooks.
574 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
575 * nsterm.m (ns_term_init):
576 * termhooks.h (struct terminal.read_socket_hook):
577 * w32inevt.c (w32_console_read_socket):
578 * w32term.c (w32_read_socket):
579 * xterm.c (XTread_socket):
580 Omit unused arg EXPECTED. All callers changed.
581 (store_user_signal_events): Return void, not int, since callers no
582 longer care about the return value. All uses changed.
583
584 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
585
586 * w32gui.h (XParseGeometry): Do not declare.
587
588 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
589
590 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
591 Ignore 'expected'. See Eli Zaretskii in
592 <http://bugs.gnu.org/12471#8> (last line).
593
594 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
595 (XParseGeometry): Now static. Substitute extremal values for
596 values that are out of range.
597
598 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
599
600 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
601
602 * nsfns.m (XParseGeometry): Remove.
603 (Fx_create_frame): Call x_set_offset to correctly interpret
604 top_pos in geometry.
605
606 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
607 (Fx_parse_geometry): If there is a space in string, call
608 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
609
610 2012-09-17 Eli Zaretskii <eliz@gnu.org>
611
612 * search.c (scan_buffer): Use character positions in calls to
613 region_cache_forward and region_cache_backward, not byte
614 positions. (Bug#12196)
615
616 * w32term.c (w32_read_socket): Set pending_signals to 1, like
617 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
618
619 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
620 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
621 emacs_blocked_malloc, now deleted.
622
623 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
624
625 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
626 The workaround was for improving performance on Solaris 2.4, but
627 is getting in the way now. Emacs will still work if someone is
628 still running Solaris 2.4 in a museum somewhere; Sun dropped
629 support for Solaris 2.4 in 2003.
630 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
631 * process.c (create_process) [HAVE_WORKING_VFORK]:
632 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
633 since Emacs no longer uses vfork on that platform.
634
635 2012-09-17 Glenn Morris <rgm@gnu.org>
636
637 * emacs.c: Use COPYRIGHT.
638
639 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
640
641 Remove configure's --without-sync-input option (Bug#12450).
642 When auditing signal-handling in preparation for cleaning it up,
643 I found that SYNC_INPUT has race conditions and would be a real
644 pain to fix. Since it's an undocumented and deprecated
645 configure-time option, now seems like a good time to remove it.
646 Also see <http://bugs.gnu.org/11080#16>.
647 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
648 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
649 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
650 (malloc_hysteresis):
651 (check_depth) [XMALLOC_OVERRUN_CHECK]:
652 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
653 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
654 (dont_register_blocks, bytes_used_when_reconsidered)
655 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
656 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
657 [!SYSTEM_MALLOC && !SYNC_INPUT]:
658 Remove. All uses removed.
659 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
660 implementation, one that depends on whether the new macro
661 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
662 is defined.
663 * atimer.c (run_timers, handle_alarm_signal):
664 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
665 (handle_async_input, process_pending_signals)
666 (handle_input_available_signal, init_keyboard):
667 * nsterm.m (ns_read_socket):
668 * process.c (wait_reading_process_output):
669 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
670 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
671 (emacs_write):
672 * xterm.c (XTread_socket):
673 Assume SYNC_INPUT.
674 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
675 * eval.c (handling_signal): Remove. All uses removed.
676 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
677 All uses replaced with the SYNC_INPUT version.
678 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
679 Remove decls.
680 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
681 Now static.
682
683 * font.c (Ffont_shape_gstring): Remove unused local.
684
685 2012-09-16 Glenn Morris <rgm@gnu.org>
686
687 * Makefile.in (clean): No longer run nextstep's clean.
688
689 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
690 (ns_frag): Remove.
691 (ns-app): Move here from ns.mk, and simplify.
692 (clean): Simplify nextstep entry.
693 * ns.mk: Remove file.
694
695 2012-09-17 Kenichi Handa <handa@gnu.org>
696
697 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
698 not covert the last few charactes.
699
700 2012-09-16 Kenichi Handa <handa@gnu.org>
701
702 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
703 here, but just check the validity of glyphs in the glyph-string.
704
705 2012-09-16 Martin Rudalics <rudalics@gmx.at>
706
707 * window.c (Fwindow_parameter, Fset_window_parameter):
708 Accept any window as argument (Bug#12452).
709
710 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
711
712 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
713 to ns_term_init to avoid memory leak.
714
715 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
716 explicit retain/release.
717 (ns_term_init): Only allow one display. Initialize outerpool and
718 ns_*_types.
719
720 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
721
722 Port _setjmp fix to POSIXish hosts as well as Microsoft.
723 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
724 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
725 the Microsoft problem in a different way, by altering ../nt/config.nt.
726
727 2012-09-15 Eli Zaretskii <eliz@gnu.org>
728
729 * w32xfns.c:
730 * w32uniscribe.c:
731 * w32term.c:
732 * w32select.c:
733 * w32reg.c:
734 * w32proc.c:
735 * w32menu.c:
736 * w32inevt.c:
737 * w32heap.c:
738 * w32font.c:
739 * w32fns.c:
740 * w32console.c:
741 * w32.c:
742 * w16select.c: Remove inclusion of setjmp.h, as it is now included
743 by lisp.h. This completes removal of setjmp.h inclusion
744 erroneously announced in the previous commit. (Bug#12446)
745
746 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
747 more accurate.
748
749 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
750 not defined as a macro. The latter happens on MS-Windows.
751 (Bug#12446)
752
753 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
754
755 Port better to POSIX hosts lacking _setjmp (Bug#12446).
756 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
757 Some instances of '#include <setjmp.h>' removed, if the
758 only reason for the instance was because "lisp.h" was included.
759 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
760 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
761 and _longjmp with the new symbols. Emacs already uses _setjmp if
762 available, so this change affects only POSIXish hosts that have
763 sigsetjmp but not _setjmp, such as some versions of Solaris and
764 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
765 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
766 (png_load_body) [HAVE_PNG]:
767 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
768 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
769 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
770 since PNG requires jmp_buf. This is the only exception to the
771 general rule that we now use sys_setjmp and sys_longjmp.
772 This exception is OK since this code does not change the signal
773 mask or longjmp out of a signal handler.
774
775 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
776
777 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
778 Include "syssignal.h", for 'main_thread'.
779
780 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
781
782 Avoid out-of-range marker position (Bug#12426).
783 * insdel.c (replace_range, replace_range_2):
784 Adjust markers before overlays, as suggested by comments.
785 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
786 Remove redundant check before calling offset_intervals.
787
788 2012-09-14 Martin Rudalics <rudalics@gmx.at>
789
790 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
791 current buffer (Bug#12387).
792
793 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
794
795 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
796
797 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
798
799 Use a more backwards-compatible timer format (Bug#12430).
800 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
801 vector element, not from the 4th, since PSECS is now at the end.
802 (Fcurrent_idle_time): Doc fix.
803
804 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
805
806 Function to mark objects and remove killed buffers at once.
807 * alloc.c (discard_killed_buffers): Rename to ...
808 (mark_discard_killed buffers) ... new name. Add marking
809 of remaining objects. Fix comment. Adjust users.
810 (mark_object): Do not touch frame buffer lists here.
811 * frame.c (delete_frame): Reset frame buffer lists here.
812
813 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
814
815 Better workaround for GNOME bug when --enable-gcc-warnings.
816 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
817 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
818 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
819
820 Simplify SIGIO usage (Bug#12408).
821 The code that dealt with SIGIO was crufty and confusing, e.g., it
822 played tricks like "#undef SIGIO" but these tricks were not used
823 consistently. Simplify mostly by not #undeffing standard symbols,
824 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
825 or not as we please) rather than "defined SIGIO" (standard symbol
826 that we probably shouldn't #undef).
827 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
828 Modules that need it can include it.
829 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
830 * dispextern.h (ignore_sigio): New decl.
831 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
832 unconditionally, since it's now a no-op if !USABLE_SIGIO.
833 * emacs.c (shut_down_emacs):
834 * keyboard.c (kbd_buffer_store_event_hold):
835 Use ignore_sigio rather than invoking 'signal' directly.
836 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
837 for FIONREAD.
838 (FIONREAD, SIGIO): Do not #undef.
839 (tty_read_avail_input): Use #error rather than a syntax error.
840 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
841 for I_PIPE, used by SETUP_SLAVE_PTY.
842 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
843 * sysdep.c (croak): Remove; no longer needed. This bit of
844 temporary code, with Fred N. Fish's comment that it's temporary,
845 has been in Emacs since at least 1992!
846 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
847 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
848 * syssignal.h (croak): Remove decl.
849 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
850 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
851 now that we're termios-only.
852 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
853 * term.c (dissociate_if_controlling_tty): Use #error rather than
854 a run-time error.
855
856 Work around GCC and GNOME bugs when --enable-gcc-warnings.
857 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
858 to work around GNOME bug 683906.
859 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
860 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
861 This works around GCC bug 54561.
862
863 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
864
865 More fixes for 'volatile' and setjmp/longjmp.
866 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
867 * image.c (struct png_load_context) [HAVE_PNG]: New type.
868 (png_load_body) [HAVE_PNG]:
869 (jpeg_load_body) [HAVE_JPEG]:
870 New function, with most of the old parent function's body.
871 (png_load) [HAVE_PNG]:
872 (jpeg_load) [HAVE_JPEG]:
873 Invoke the new function, to avoid longjmp munging our locals.
874 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
875 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
876 longjmp is passed 2, as the C standard doesn't guarantee this.
877 Instead, store the failure code into mgr->failure_code.
878
879 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
880
881 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
882 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
883 (syms_of_keyboard): Remove support for unread-command-char.
884
885 2012-09-12 Eli Zaretskii <eliz@gnu.org>
886
887 * w32proc.c (sys_kill): If PID is our process ID and the signal is
888 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
889 violation. (Bug#12426)
890
891 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
892
893 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
894
895 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
896
897 * eval.c: Add `inhibit-debugger'.
898 (Qinhibit_debugger): New symbol.
899 (call_debugger): Bind it instead of Qdebug_on_error.
900 (maybe_call_debugger): Test Vinhibit_debugger.
901 (syms_of_eval): Define inhibit-debugger.
902 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
903 (syms_of_xdisp): Remove inhibit-debug-on-message.
904
905 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
906
907 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
908 If a nonvolatile local variable is written before a _longjmp to
909 the frame containing the variable, and is read after the _longjmp,
910 the value read is indeterminate. Some local variables of type
911 'struct handler' and 'struct catchtag' are used in this way, so
912 mark each of their slots as volatile if the slot can be set before
913 _longjmp and read afterwards.
914 * lisp.h (struct handler): var and chosen_clause are now volatile.
915 (struct catchtag): val, next, and pdlcount are now volatile.
916
917 * bidi.c (bidi_push_it, bidi_pop_it):
918 * fns.c (copy_hash_table):
919 * image.c (define_image_type):
920 * keyboard.c (kbd_buffer_store_event_hold):
921 * process.c (Fprocess_send_eof):
922 * xfaces.c (x_create_gc) [HAVE_NS]:
923 * xgselect.c (xg_select):
924 Prefer assignment to memcpy when either will do.
925
926 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
927 Use pointer-to-a-pointer to simplify and avoid a NILP check each
928 time an item is removed. No need to mark this function 'inline';
929 the compiler knows better than we do.
930
931 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
932
933 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
934 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
935 to change_frame_size (Bug#12388).
936 (windowDidResize:): Pass YES to updateFrameSize.
937
938 * nsterm.h: Add delay parameter to updateFrameSize.
939
940 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
941
942 Discard killed buffers from deleted window and frame objects.
943 This reduces an amount of references to killed buffers and
944 helps GC to reclaim them faster.
945 * alloc.c (discard_killed_buffers): New function.
946 (mark_object): Use it for deleted windows and frames.
947 (mark_object): If symbol's value is set up for a killed buffer
948 or deleted frame, restore it's global binding.
949 * data.c (swap_in_global_binding): Add GC notice.
950 (swap_in_symval_forwarding): Use convenient set_blv_where.
951 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
952 * window.h: ... to here.
953
954 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
955
956 Convenient macro to check whether the buffer is live.
957 * buffer.h (BUFFER_LIVE_P): New macro.
958 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
959 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
960
961 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
962
963 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
964 composition cases (Bug#12364).
965
966 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
967 overhang of succeeding glyphs overlapping box cursor.
968
969 * w32term.c (x_draw_glyph_string): Likewise.
970
971 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
972
973 Simplify, document, and port floating-point (Bug#12381).
974 The porting part of this patch fixes bugs on non-IEEE platforms
975 with frexp, ldexp, logb.
976 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
977 Now static.
978 * floatfns.c: Simplify discussion of functions that Emacs doesn't
979 support, by removing commented-out code and briefly listing the
980 C89 functions excluded. The commented-out stuff was confusing
981 maintenance, e.g., we thought we needed cbrt but it was commented out.
982 (logb): Remove decl; no longer needed.
983 (isfinite): New macro, if not already supplied.
984 (isnan): Don't replace any existing macro.
985 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
986 are present on all C89 platforms.
987 (Ffrexp): Do not special-case zero, as frexp does the right thing
988 for that case.
989 (Flogb): Do not use logb, as it doesn't have the desired meaning
990 on hosts that use non-base-2 floating point. Instead, stick with
991 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
992 frexp, to avoid getting an unspecified result.
993
994 * xdisp.c (Qinhibit_debug_on_message): Now static.
995
996 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
997
998 * nsterm.m (ns_update_begin): Set clip path to whole view by using
999 NSBezierPath (Bug#12131).
1000
1001 2012-09-10 Chong Yidong <cyd@gnu.org>
1002
1003 * fns.c (Fdelq, Fdelete): Doc fix.
1004
1005 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1006
1007 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1008 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1009
1010 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1011
1012 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1013 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1014 Use it.
1015
1016 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1017
1018 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1019 left fringe if the window has a left margin. This avoids leaving
1020 traces of the cursor because its leftmost pixel is not drawn over.
1021
1022 * dispnew.c (update_window_line): When the left margin area of a
1023 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1024 that screen line. (Bug#12277)
1025
1026 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1027
1028 Assume C89 or later for math functions (Bug#12381).
1029 This simplifies the code, and makes it a bit smaller and faster,
1030 and (most important) makes it easier to clean up signal handling
1031 since we can stop worring about floating-point exceptions in
1032 library code. That was a problem before C89, but the problem
1033 went away many years ago on all practical Emacs targets.
1034 * data.c, image.c, lread.c, print.c:
1035 Don't include <math.h>; no longer needed.
1036 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1037 might be autoconfigured, as that never happens.
1038 * data.c (fmod):
1039 * doprnt.c (DBL_MAX_10_EXP):
1040 * print.c (DBL_DIG):
1041 Remove. C89 or later always defines these.
1042 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1043 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1044 (arith_error, domain_error, domain_error2):
1045 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1046 no longer needed -- we simply return what C returns. All uses removed.
1047 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1048 the wrapped code.
1049 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1050 Remove. All uses expanded, as these macros are no longer used
1051 more than once and are now more trouble than they're worth.
1052 (Ftan): Use tan, not sin / cos.
1053 (Flogb): Assume C89 frexp.
1054 (fmod_float): Assume C89 fmod.
1055 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1056 (init_floatfns): Remove. All uses removed.
1057
1058 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1059
1060 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1061 compositeToPoint for OSX < 10.6 (Bug#12390).
1062
1063 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1064
1065 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1066 This produces more-accurate results.
1067
1068 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1069
1070 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1071 changes (Bug#12088).
1072
1073 2012-09-08 Chong Yidong <cyd@gnu.org>
1074
1075 * syntax.c (Fstring_to_syntax): Doc fix.
1076
1077 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1078
1079 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1080 in the internal border.
1081 (x_set_window_size): Remove static variables and their usage.
1082 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1083 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1084 Remove fringe/internal border adjustment (Bug#11052).
1085 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1086 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1087 (ns_fix_rect_ibw): Remove.
1088 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1089 (ns_dumpglyphs_box_or_relief): Ditto.
1090 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1091 adjustment.
1092 (ns_dumpglyphs_image): Ditto.
1093 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1094 border adjustment.
1095 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1096 their usage. Add fringe_extended_p and its use as in other terms.
1097 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1098 scroll bar was removed.
1099 (updateFrameSize): New function.
1100 (windowDidResize): Move code to updateFrameSize and call it.
1101
1102 * nsterm.h (EmacsView): Add updateFrameSize.
1103
1104 2012-09-07 Chong Yidong <cyd@gnu.org>
1105
1106 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1107
1108 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1109
1110 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1111
1112 More signal-handler cleanup (Bug#12327).
1113 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1114 Problem introduced when merging patches. Noted by Eli Zaretskii in
1115 <http://bugs.gnu.org/12327#67>.
1116 * floatfns.c: Comment fix.
1117 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1118 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1119 and anyway the declaration is harmless even if SIGDANGER is not defined.
1120 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1121 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1122 source files not surprisingly expected syssignal.h to define, or
1123 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1124 Include <sys/ioctl.h>, for FIONREAD.
1125 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1126 This eliminates a problem whereby other files mysteriously had
1127 to include "syssignal.h" before including "systty.h" if they
1128 wanted to use "#ifdef SIGIO".
1129
1130 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1131
1132 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1133
1134 * w32.c (sigemptyset): Empty the set.
1135 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1136
1137 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1138
1139 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1140
1141 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1142 (mark_object): Likewise for frame objects.
1143
1144 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1145
1146 * syssignal.h (handle_on_main_thread): Always declare,
1147 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1148 This ports to platforms without HAVE_PTHREAD.
1149
1150 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1151
1152 Signal-handler cleanup (Bug#12327).
1153 Emacs's signal handlers were written in the old 4.2BSD style with
1154 sigblock and sigmask and so forth, and this led to some
1155 inefficiencies and confusion. Rewrite these to use
1156 pthread_sigmask etc. without copying signal sets around. Also,
1157 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1158 'signal', and instead use functions that do not attempt to take
1159 over the system name space. This patch causes Emacs's text
1160 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1161 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1162 Do not include <signal.h> or "syssignal.h", as these
1163 modules do not use signals.
1164 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1165 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1166 Do not include <signal.h>, as "syssignal.h" does that for us now.
1167 * atimer.c (sigmask_atimers): New function.
1168 (block_atimers, unblock_atimers): New functions,
1169 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1170 All uses replaced.
1171 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1172 no longer needed here.
1173 * emacs.c (main): Inspect existing signal handler with sigaction,
1174 so that there's no need to block and unblock SIGHUP.
1175 * sysdep.c (struct save_signal): New member 'action', replacing
1176 old member 'handler'.
1177 (save_signal_handlers, restore_signal_handlers):
1178 Use sigaction instead of 'signal' to save and restore.
1179 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1180 New function. All users of 'signal' modified to use set_sighandler
1181 if they're writeonly, and to use sys_signal if they're read+write.
1182 (emacs_sigaction_init, forwarded_signal): New functions.
1183 (sys_signal): Remove. All uses replaced by calls to sigaction
1184 and emacs_sigaction_init, or by direct calls to 'signal'.
1185 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1186 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1187 all uses replaced by pthread_sigmask etc. calls.
1188 * syssignal.h: Include <signal.h>.
1189 (emacs_sigaction_init, forwarded_signal): New decls.
1190 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1191 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1192 (sigmask, sys_sigmask): Remove; no longer needed.
1193 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1194 (sigblock, sigunblock, sigfree):
1195 (sigsetmask) [!defined sigsetmask]:
1196 Remove. All uses replaced by pthread_sigmask.
1197 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1198 no longer need to be replaced, and its typical old uses
1199 are now done via emacs_sigaction_init and sigaction.
1200 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1201 (sys_sigdel): Remove; unused.
1202 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1203
1204 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1205
1206 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1207 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1208
1209 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1210
1211 Explicitly mark buffer_defaults and buffer_local_symbols.
1212 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1213 mark_local_symbols here.
1214 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1215 since special buffers aren't marked here any more.
1216 (allocate_buffer): Chain new buffer with all_buffers here...
1217 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1218 not here.
1219 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1220 (syms_of_buffer): Remove staticpro of the above.
1221 (init_buffer_once): Set names for buffer_defaults and
1222 buffer_local_symbols.
1223
1224 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1225
1226 Use bool for booleans in font-related modules.
1227 * font.c (font_intern_prop, font_style_to_value)
1228 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1229 (generate_otf_features, font_check_otf_features, font_check_otf)
1230 (font_match_p, font_list_entities, font_at):
1231 * fontset.c (fontset_id_valid_p, reorder_font_vector
1232 (fontset_find_font, Fset_fontset_font)
1233 (face_suitable_for_char_p) [0]:
1234 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1235 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1236 (m17n_flt_initialized, ftfont_shape_by_flt):
1237 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1238 * nsfont.m (nsfont_draw):
1239 * w32font.c (w32font_draw):
1240 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1241 Use bool for booleans.
1242 * font.h: Adjust to above API changes.
1243 (struct font, struct font_driver, struct font_driver_list):
1244 Use bool for booleans.
1245 (struct font): Remove useless member encoding_type.
1246 All users removed.
1247 * fontset.c, xftfont.c: Omit unnecessary static decls.
1248
1249 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1250
1251 * alloc.c (mark_object): Revert window marking code
1252 since it's unsafe for the Fset_window_configuration.
1253
1254 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1255
1256 Fix race conditions with signal handlers and errno (Bug#12327).
1257 Be more systematic about preserving errno whenever a signal
1258 handler returns, even if it's not in the main thread. Do this by
1259 renaming signal handlers to distinguish between signal delivery
1260 and signal handling. All uses changed.
1261 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1262 * data.c (deliver_arith_signal): Rename from arith_error.
1263 * dispnew.c (deliver_window_change_signal): Rename from
1264 window_change_signal.
1265 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1266 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1267 * keyboard.c (deliver_input_available_signal): Rename from
1268 input_available_signal.
1269 (deliver_user_signal): Rename from handle_user_signal.
1270 (deliver_interrupt_signal): Rename from interrupt_signal.
1271 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1272 (deliver_child_signal): Rename from sigchld_handler.
1273 * atimer.c (handle_alarm_signal):
1274 * data.c (handle_arith_signal):
1275 * dispnew.c (handle_window_change_signal):
1276 * emacs.c (handle_fatal_signal, handle_danger_signal):
1277 * keyboard.c (handle_input_available_signal):
1278 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1279 * process.c (handle_pipe_signal, handle_child_signal):
1280 New functions, with the actual signal-handling code taken from the
1281 original respective signal handlers, sans the sporadic attempts to
1282 preserve errno, since that's now done by handle_on_main_thread.
1283 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1284 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1285 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1286 Move to sysdep.c.
1287 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1288 Move initialization of main_thread to sysdep.c's init_signals.
1289 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1290 our usage, and simplifies the mainline code.
1291 (record_child_status_change): New static function, as a helper
1292 for handle_child_signal, and with most of the old child handler's
1293 contents.
1294 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1295 (handle_child_signal): Use the above.
1296 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1297 Moved here from emacs.c.
1298 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1299 code moved here from emacs.c's main function.
1300 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1301 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1302 This lets callers save and restore errno properly.
1303
1304 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1305
1306 Remove redundant or unused things here and there.
1307 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1308 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1309 * editfns.c (Fcompare_buffer_substrings): Likewise.
1310 * frame.h (struct terminal, struct font_driver_list):
1311 Remove redundant declarations.
1312 * window.h (Qleft, Qright): Likewise.
1313
1314 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1315
1316 Do not mark objects from deleted buffers, windows and frames.
1317 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1318 (mark_object): Likewise for windows and frames.
1319
1320 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1321
1322 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1323 buffer_defaults and buffer_local_symbols as valid objects.
1324 Return special value to denote them.
1325
1326 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1327
1328 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1329 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1330 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1331 (file_name_absolute_p, Fsubstitute_in_file_name):
1332 (check_executable, check_writable, Ffile_accessible_directory_p)
1333 (Fset_file_selinux_context, Fdefault_file_modes)
1334 (Finsert_file_contents, choose_write_coding_system)
1335 (Fwrite_region, build_annotations, a_write, e_write)
1336 (Fdo_auto_save):
1337 * filelock.c (boot_time_initialized, get_boot_time)
1338 (get_boot_time_1, lock_file_1, within_one_second):
1339 * floatfns.c (in_float):
1340 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1341 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1342 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1343 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1344 * window.c (compare_window_configurations):
1345 Use bool for booleans.
1346 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1347 (Fdefault_file_modes): Now mode_t, not int, for modes.
1348 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1349 (internal_delete_file): Now returns void, not a (boolean) int,
1350 since nobody was looking at the return value.
1351 * lisp.h, window.h: Adjust to above API changes.
1352
1353 * xdisp.c (set_message): Simplify and reindent last change.
1354
1355 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1356
1357 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1358
1359 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1360
1361 * eval.c (call_debugger): Make the function non-static so that we
1362 can call it from set_message.
1363
1364 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1365 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1366
1367 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1368
1369 Give more-useful info on a fatal error (Bug#12328).
1370 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1371 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1372 of doing the work ourselves.
1373 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1374 do most of the work.
1375 (fatal_error_backtrace): New function, taken from the guts
1376 of the old fatal_error_signal, but with a new option to output
1377 a backtrace.
1378 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1379 info about the signal than just its number.
1380 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1381 * sysdep.c: Include <execinfo.h>
1382 (emacs_backtrace): New function, taken partly from the previous
1383 code of the 'die' function.
1384 (emacs_abort): Call fatal_error_backtrace rather than abort.
1385
1386 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1387
1388 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1389 eager (load-time) macro-expansion.
1390 * lisp.mk (lisp): Add macroexp.
1391
1392 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1393
1394 Simplify redefinition of 'abort' (Bug#12316).
1395 Do not try to redefine the 'abort' function. Instead, redo
1396 the code so that it calls 'emacs_abort' rather than 'abort'.
1397 This removes the need for the NO_ABORT configure-time macro
1398 and makes it easier to change the abort code to do a backtrace.
1399 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1400 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1401 Remove; sysdep.c's emacs_abort now takes its place.
1402 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1403 'abort' changed to use 'emacs_abort'.
1404 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1405 (abort) [!defined abort]: Rename to ...
1406 (emacs_abort): ... new name.
1407 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1408 the place of the old 'abort' in emacs.c.
1409 * w32.c, w32fns.c (abort): Do not #undef.
1410 * w32.c (emacs_abort): Rename from w32_abort.
1411
1412 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1413
1414 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1415 offsets[j].dv, since the y axis of the screen coordinates points
1416 down, while the y axis of the font definition coordinates points
1417 up. This fixes display of Arabic diacritics such as KASRA and
1418 KASRATAN. (Bug#11860)
1419
1420 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1421
1422 Be more systematic about _setjmp vs setjmp.
1423 * alloc.c (test_setjmp, mark_stack):
1424 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1425 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1426 (png_load, my_error_exit, jpeg_load):
1427 * process.c (send_process_trap, send_process):
1428 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1429 The underscored versions are up to 30x faster on some hosts.
1430 Formerly, the code used setjmp+longjmp sometimes and
1431 _setjmp+_longjmp at other times, with no particular reason to
1432 prefer setjmp+longjmp.
1433
1434 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1435
1436 Fix minor problem found by static checking.
1437 * buffer.c (Fdelete_all_overlays): Return nil.
1438
1439 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1440
1441 * buffer.c (Fdelete_all_overlays): New function.
1442
1443 2012-09-03 Chong Yidong <cyd@gnu.org>
1444
1445 * gtkutil.c: Add extern decl for Qxft.
1446
1447 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1448
1449 * emacs.c, eval.c: Use bool for boolean.
1450 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1451 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1452 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1453 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1454 (main, decode_env_path, Fdaemon_initialized):
1455 * eval.c (call_debugger, Finteractive_p, interactive_p):
1456 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1457 (maybe_call_debugger, Fbacktrace):
1458 * process.c (read_process_output, exec_sentinel):
1459 Use bool for booleans.
1460 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1461 All callers changed.
1462 * eval.c (interactive_p): Omit always-true boolean argument
1463 EXCLUDE_SUBRS_P. All callers changed.
1464 * dispextern.h, lisp.h: Reflect above API changes.
1465 * firstfile.c (dummy): Use the address of 'main', whose signature
1466 won't change, instead of the address of 'initialize', whose
1467 signature just changed from int to bool.
1468 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1469 * msdos.c (fatal_error_in_progress): ... from here.
1470 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1471 of incrementing it.
1472 (redisplay_internal, unwind_redisplay): Simply clear
1473 REDISPLAYING_P when unwinding, instead of saving its previous,
1474 always-false value and then restoring it.
1475
1476 Clean up some extern decls.
1477 Mostly, this hoists extern decls out of .c files and into .h files.
1478 That way, we're more likely to catch errors if the interfaces change.
1479 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1480 declare xg_mark_data.
1481 * dispextern.h (x_frame_parm_handlers):
1482 * font.h (Qxft):
1483 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1484 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1485 (Qultra_bold, Qoblique, Qitalic):
1486 Move extern decl here from .c file.
1487 * alloc.c (xg_mark_data) [USE_GTK]:
1488 * doc.c (Qclosure):
1489 * eval.c (Qlexical_binding):
1490 * fns.c (time) [!HAVE_UNISTD_H]:
1491 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1492 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1493 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1494 * lread.c (Qinternal_interpreter_environment):
1495 * minibuf.c (Qbuffer):
1496 * process.c (QCfamily, QCfilter):
1497 * widget.c (free_frame_faces):
1498 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1499 * xfont.c (x_clear_errors):
1500 * xterm.c (x_frame_parm_handlers):
1501 Remove now-redundant extern decls.
1502 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1503 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1504 Now static.
1505 * xfaces.c: Remove unnecessary static decls.
1506 * xterm.c (updating_frame): Remove decl of nonexistent object.
1507
1508 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1509 when building globals.h, as the objects that are not built on
1510 this host are not needed to compile C files on this host.
1511
1512 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1513
1514 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1515
1516 * frame.h: Add missing prototype for x_wm_set_size_hint.
1517
1518 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1519
1520 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1521 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1522 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1523 (Fsubstitute_command_keys):
1524 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1525 (save_excursion_save, save_excursion_restore)
1526 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1527 (format_time_string, general_insert_function)
1528 (make_buffer_string, make_buffer_string_both)
1529 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1530 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1531 (copy_text, insert_1, insert_1_both, insert_from_string)
1532 (insert_from_string_before_markers, insert_from_string_1)
1533 (insert_from_buffer, insert_from_buffer_1, replace_range)
1534 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1535 (del_range_2, modify_region):
1536 * intervals.c (intervals_equal, balance_possible_root_interval)
1537 (adjust_intervals_for_insertion, merge_properties_sticky)
1538 (graft_intervals_into_buffer, lookup_char_property)
1539 (adjust_for_invis_intang, set_point_both)
1540 (get_property_and_range, compare_string_intervals)
1541 (set_intervals_multibyte_1, set_intervals_multibyte):
1542 * keyboard.c (decode_timer):
1543 Use bool for boolean.
1544 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1545 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1546
1547 2012-09-02 Chong Yidong <cyd@gnu.org>
1548
1549 * keymap.c (push_key_description): Print M-TAB as C-M-i
1550 (Bug#11758).
1551
1552 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1553
1554 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1555 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1556 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1557 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1558 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1559 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1560 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1561
1562 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1563
1564 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1565 more than one grapheme cluster passed to the shaper: compute the
1566 offset adjustment values separately for each cluster. (Bug#11860)
1567
1568 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1569 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1570 about implicit conversions from integer to pointer.
1571
1572 2012-09-01 Daniel Colascione <dancol@dancol.org>
1573
1574 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1575 system used too early.
1576
1577 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1578
1579 Better seed support for (random).
1580 * emacs.c (main): Call init_random.
1581 * fns.c (Frandom): Set the seed from a string argument, if given.
1582 Remove long-obsolete Gentzel cruft.
1583 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1584 (init_random): New function.
1585
1586 2012-09-01 Daniel Colascione <dancol@dancol.org>
1587
1588 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1589 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1590 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1591 x_wm_set_size_hint, x_query_colors, x_real_positions,
1592 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1593 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1594 all of which have been moved to common code.
1595
1596 * xfaces.c: Include TERM_HEADER instead of listing all possible
1597 window-system headers.
1598
1599 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1600 to match header.
1601
1602 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1603 directly accessing frame internals.
1604
1605 * w32font.h: Include font.h. Define syms_of_w32font and
1606 globals_of_w32font.
1607
1608 * process.c: Include TERM_HEADER instead of listing all possible
1609 window-system headers.
1610
1611 * nsterm.h: Remove declarations now in frame.h.
1612 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1613
1614 * menu.c: Include TERM_HEADER instead of listing all possible
1615 window-system headers.
1616
1617 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1618 window system.
1619
1620 * keyboard.c: Include TERM_HEADER instead of listing all possible
1621 window-system headers.
1622
1623 * image.c: Include TERM_HEADER instead of listing all possible
1624 window-system headers. Declare Vlibrary_cache when compiling for
1625 Windows.
1626
1627 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1628 window system declarations.
1629
1630 * frame.h: Move common functions here: set_frame_menubar,
1631 x_set_window_size, x_sync, x_get_focus_frame,
1632 x_set_mouse_position, x_set_mouse_pixel_position,
1633 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1634 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1635 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1636 x_activate_menubar, x_real_positions, x_bitmap_icon,
1637 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1638 and x_query_colors.
1639
1640 * frame.c: Include TERM_HEADER instead of listing all possible
1641 window-system headers.
1642
1643 * font.c: Include TERM_HEADER instead of listing all possible
1644 window-system headers.
1645
1646 * emacs.c: Include TERM_HEADER.
1647
1648 * dispnew.c: Include TERM_HEADER instead of listing all possible
1649 window-system headers.
1650
1651 * ccl.h: Include character.h.
1652
1653 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1654 the current window system; include in list of objects to link into
1655 Emacs.
1656
1657 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1658
1659 Remove mark_ttys function and fix tty_display_info initialization.
1660 * lisp.h (mark_ttys): Remove prototype.
1661 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1662 to mark_ttys because all possible values of 'top_frame' slot are
1663 the frames which are reachable from Vframe_list.
1664 * term.c (mark_ttys): Remove.
1665 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1666
1667 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1668
1669 Change struct frame bitfields from unsigned char to unsigned.
1670 * frame.h (struct frame): Change type of 'display_preempted',
1671 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1672 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1673 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1674 bitfields from unsigned char to unsigned.
1675
1676 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1677
1678 Remove unused member of struct x_output and struct w32_output.
1679 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1680 * w32term.h (struct w32_output): Likewise.
1681
1682 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1683
1684 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1685 does not become zero (Bug#12234).
1686
1687 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1688
1689 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1690 for GCC 4.7.1 x86-64.
1691
1692 2012-08-30 Glenn Morris <rgm@gnu.org>
1693
1694 * lread.c (init_lread): For out-of-tree builds, only add the
1695 source directory's site-lisp dir to the load-path if it exists,
1696 consistent with in-tree builds. (Bug#12302)
1697
1698 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1699
1700 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1701 button_values to NULL. Call setStykeMask so dialogs get a close button.
1702 (windowShouldClose:): Set window_closed.
1703 (dealloc): New member, free button_values.
1704 (process_dialog:): Make member function. Remove window argument,
1705 replace window with self. Count buttons and allocate and store values
1706 in button_values.
1707 (addButton:value:row:): value is int with the name tag. Call setTag
1708 with tag. Remove return self, declare return value as void.
1709 (addString:row:): Remove return self, declare return value as void.
1710 (addSplit): Remove return self, declare return value as void.
1711 (clicked:): Remove return self, declare return value as void.
1712 Set dialog_return to button_values[seltag]. Code formatting change.
1713 (initFromContents:isQuestion:): Adjust call to process_dialog.
1714 Code formatting change.
1715 (timeout_handler:): Set timer_fired to YES.
1716 (runDialogAt:): Set timer_fired to NO.
1717 Handle click on close button as quit.
1718
1719 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1720 Add window_closed and button_values. Add void as return value for
1721 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1722 Add process_dialog as new member.
1723
1724 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1725
1726 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1727 is not one of the heaps we manage. (Bug#12242)
1728
1729 2012-08-28 Glenn Morris <rgm@gnu.org>
1730
1731 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1732
1733 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1734
1735 * window.c (Fset_window_configuration): Remove handling of
1736 auto-buffer-name window parameter. Install revision of reverted
1737 fix.
1738
1739 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1740
1741 Do not allow to set major mode for a dead buffer.
1742 * buffer.c (Fset_buffer_major_mode): Signal an error
1743 if the buffer is dead.
1744 (Fother_buffer, other_buffer_safely): Remove redundant
1745 nested declaration.
1746
1747 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1748
1749 Always use set_buffer_if_live to restore original buffer at unwind.
1750 * buffer.h (record_unwind_current_buffer): New function.
1751 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1752 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1753 * undo.c, window.c: Adjust users.
1754 * buffer.c (set_buffer_if_live): Fix comment.
1755
1756 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1757
1758 Fix usage of set_buffer_internal.
1759 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1760 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1761 * coding.c (decode_coding): Omit redundant test.
1762 * fileio.c (decide_coding_unwind): Likewise.
1763 * fns.c (secure_hash): Likewise.
1764 * insdel.c (modify_region): Likewise.
1765 * keyboard.c (command_loop_1): Likewise.
1766 * print.c (PRINTFINISH): Likewise.
1767 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1768
1769 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1770
1771 * dispnew.c: Use bool for boolean.
1772 (frame_garbaged, display_completed, delayed_size_change)
1773 (fonts_changed_p, add_window_display_history)
1774 (add_frame_display_history, verify_row_hash)
1775 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1776 (row_equal_p, realloc_glyph_pool)
1777 (allocate_matrices_for_frame_redisplay)
1778 (showing_window_margins_p)
1779 (adjust_frame_glyphs_for_frame_redisplay)
1780 (build_frame_matrix_from_leaf_window, make_current)
1781 (mirrored_line_dance, mirror_line_dance, update_frame)
1782 (update_window_tree, update_single_window)
1783 (check_current_matrix_flags, update_window, update_text_area)
1784 (update_window_line, set_window_update_flags, scrolling_window)
1785 (update_frame_1, scrolling, buffer_posn_from_coords)
1786 (do_pending_window_change, change_frame_size)
1787 (change_frame_size_1, sit_for):
1788 Use bool for boolean.
1789 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1790 and remove last int (actually boolean) argument, which was always 0.
1791 All callers changed.
1792 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1793 * dispextern.h (struct composition_it): Use bool for boolean.
1794 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1795 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1796 * dired.c (file_name_completion):
1797 Use bool for boolean. (This was missed in an earlier change.)
1798
1799 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1800
1801 * window.c (Fset_window_configuration): Revert first part of
1802 last change.
1803
1804 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1805
1806 * nsterm.h (NSPanel): New class variable dialog_return.
1807
1808 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1809 Initialize dialog_return.
1810 (windowShouldClose:): Use stop instead of stopModalWithCode.
1811 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1812 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1813 event.
1814 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1815 modal loop returns.
1816
1817 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1818
1819 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1820 * composite.c (find_composition, composition_gstring_p)
1821 (composition_reseat_it, find_automatic_composition):
1822 * data.c (let_shadows_buffer_binding_p)
1823 (let_shadows_global_binding_p, set_internal, make_blv)
1824 (Fmake_variable_buffer_local, Fmake_local_variable)
1825 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1826 (cons_to_signed, arith_driver):
1827 * dbusbind.c (xd_in_read_queued_messages):
1828 * dired.c (directory_files_internal, file_name_completion):
1829 Use bool for booleans.
1830 * dired.c (file_name_completion):
1831 * process.h (fd_callback):
1832 Omit int (actually boolean) argument. It wasn't being used.
1833 All uses changed.
1834 * composite.h, lisp.h: Reflect above API changes.
1835
1836 * cmds.c, coding.c: Use bool for booleans.
1837 * cmds.c (move_point, Fself_insert_command):
1838 * coding.h (struct composition status, struct coding_system):
1839 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1840 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1841 (emacs_mule_char, decode_coding_emacs_mule)
1842 (encode_coding_emacs_mule, detect_coding_iso_2022)
1843 (decode_coding_iso_2022, encode_invocation_designation)
1844 (encode_designation_at_bol, encode_coding_iso_2022)
1845 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1846 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1847 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1848 (encode_coding_raw_text, detect_coding_charset)
1849 (decode_coding_charset, encode_coding_charset, detect_eol)
1850 (detect_coding, get_translation_table, produce_chars)
1851 (consume_chars, reused_workbuf_in_use)
1852 (make_conversion_work_buffer, code_conversion_save)
1853 (decode_coding_object, encode_coding_object)
1854 (detect_coding_system, char_encodable_p)
1855 (Funencodable_char_position, code_convert_region)
1856 (code_convert_string, code_convert_string_norecord)
1857 (Fset_coding_system_priority):
1858 * fileio.c (Finsert_file_contents):
1859 Use bool for booleans.
1860 * coding.h, lisp.h: Reflect above API changes.
1861 * coding.c: Remove unnecessary static function decls.
1862 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1863 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1864 not a boolean 'int', since callers never look at the return value.
1865 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1866 * coding.h (decoding_buffer_size, encoding_buffer_size)
1867 (emacs_mule_string_char): Remove unused extern decls.
1868 (struct iso_2022_spec, struct coding_system):
1869 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1870 (struct emacs_mule_spec): Remove unused field 'full_support'.
1871 All initializations removed.
1872 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1873
1874 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1875
1876 Fix spare memory change (Bug#12286).
1877 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1878 (valid_lisp_object_p): Likewise.
1879
1880 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1881
1882 * window.c (Fset_window_configuration): Record any window's old
1883 buffer if it's replaced (see Bug#8789). If the new current
1884 buffer doesn't appear in the selected window, go to its old
1885 point (Bug#12208).
1886
1887 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1888
1889 Special MEM_TYPE_SPARE to denote reserved memory.
1890 * alloc.c (enum mem_type): New memory type.
1891 (refill_memory_reserve): Use new type for spare memory.
1892 This prevents live_cons_p and live_string_p from incorrect
1893 detection of uninitialized objects from spare memory as live.
1894
1895 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1896
1897 Spelling fixes.
1898 * Makefile.in (.PHONY): versioclean -> versionclean.
1899
1900 Remove unused external symbols.
1901 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1902 * window.c (Qwindow_valid_p, decode_valid_window):
1903 Now static, not extern.
1904 * data.c (Qinterval): Remove; unused.
1905 (syms_of_data): Do not define 'interval'.
1906 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1907 * window.h (decode_valid_window):
1908 Remove decls.
1909
1910 * character.c, charset.c, chartab.c: Use bool for booleans.
1911 * character.c (lisp_string_width, string_count_byte8)
1912 (string_escape_byte8):
1913 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1914 (load_charset_map_from_file, map_charset_chars)
1915 (Fdefine_charset_internal, define_charset_internal)
1916 (Fdeclare_equiv_charset, find_charsets_in_text)
1917 (Ffind_charset_region, char_charset, Fiso_charset):
1918 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1919 (sub_char_table_set, sub_char_table_set_range)
1920 (char_table_set_range, optimize_sub_char_table)
1921 (map_sub_char_table):
1922 Use bool for boolean.
1923 * character.c (str_to_unibyte): Omit last boolean argument; it was
1924 always 0. All callers changed.
1925 * character.h, charset.h: Adjust to match previous changes.
1926 * character.h (char_printable_p): Remove decl of nonexistent function.
1927 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1928 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1929 are all boolean, so make them single-bit bitfields.
1930
1931 * lisp.h (ASET): Remove attempt to detect side effects.
1932 It was meant to be temporary and it often doesn't work,
1933 because when IDX has side effects the behavior of IDX==IDX
1934 is undefined. See Stefan Monnier in
1935 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1936
1937 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1938
1939 * lisp.h (functionp): New function (extracted from Ffunctionp).
1940 (FUNCTIONP): Use it.
1941 * eval.c (Ffunctionp): Use it.
1942
1943 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1944
1945 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1946 as that's faster and simpler than static storage. Don't bother
1947 with the g_main_context_query overhead if g_main_context_pending
1948 says no events are pending.
1949 (gfds, gfds_size): Remove these static vars.
1950 (xgselect_initialize): Remove; no longer needed.
1951 All uses and decls removed.
1952
1953 * emacs.c (fatal_error_signal_hook): Remove.
1954 All uses removed. This leftover from old code was always 0.
1955
1956 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1957 * casefiddle.c (casify_object, casify_region):
1958 * casetab.c (set_case_table):
1959 * category.c, category.h (word_boundary_p):
1960 * category.h (CHAR_HAS_CATEGORY):
1961 Use bool for booleans, instead of int.
1962
1963 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1964
1965 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1966
1967 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1968
1969 On assertion failure, print backtrace if available.
1970 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1971 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1972 * Makefile.in (LIB_EXECINFO): New macro.
1973 (LIBES): Use it.
1974
1975 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1976 * bytecode.c (exec_byte_code):
1977 * callint.c (check_mark, Fcall_interactively):
1978 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1979 (getenv_internal, sync_process_alive, call_process_exited):
1980 * lisp.h (USE_SAFE_ALLOCA):
1981 Use bool for booleans, instead of int.
1982 * lisp.h, process.h: Adjust prototypes to match above changes.
1983 * callint.c (Fcall_interactively): Don't assume the mark's
1984 offset fits in 'int'.
1985
1986 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1987
1988 * buffer.c, buffer.h: Use bool for boolean.
1989 * buffer.c (reset_buffer_local_variables)
1990 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1991 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1992 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1993 (overlay_touches_p, overlay_strings, Foverlay_put)
1994 (report_overlay_modification, call_overlay_mod_hooks):
1995 (mmap_enlarge, mmap_set_vars):
1996 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1997 Use bool for booleans, instead of int.
1998 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1999 since the 1-or-0 return value is always ignored anyway.
2000 (mmap_initialized_p):
2001 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2002 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2003
2004 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2005
2006 * bidi.c: Use bool for boolean.
2007 This is a bit more readable, and makes the text segment of bidi.o
2008 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2009 Presumably it's faster too.
2010 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2011 Now bool.
2012 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2013 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2014 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2015 (bidi_explicit_dir_char, bidi_level_of_next_char)
2016 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2017 Use bool for booleans, instead of int.
2018 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2019 (bidi_unshelve_cache): Adjust decls to match code.
2020
2021 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2022
2023 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2024 argument.
2025
2026 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2027
2028 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2029 * atimer.h: Include <stdbool.h>.
2030
2031 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2032
2033 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2034 compile time tests instead of run time tests on systems that do
2035 not use them.
2036 (FRAME_MAC_P): Remove leftover from deleted code.
2037 * frame.c (syms_of_frame): Remove leftover from deleted code.
2038
2039 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2040
2041 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2042
2043 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2044
2045 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2046 Otherwise, the compiler complains about (A?B:C) where B is void
2047 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2048 (fontset_add): Return void, for FONTSET_ADD.
2049
2050 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2051
2052 * alloc.c: Use bool for booleans.
2053 (gc_in_progress, abort_on_gc)
2054 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2055 (dont_register_blocks) [GC_MALLOC_CHECK]:
2056 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2057 (check_string_bytes, make_specified_string, memory_full)
2058 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2059 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2060 (mark_stack, valid_pointer_p, make_pure_string)
2061 (Fgarbage_collect, survives_gc_p, gc_sweep):
2062 Use bool for booleans, instead of int.
2063 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2064 Remove unused local.
2065 * alloc.c (PURE_POINTER_P):
2066 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2067 * editfns.c (Fformat):
2068 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2069 (Fdo_auto_save):
2070 * fns.c (sweep_weak_table):
2071 * lisp.h (suppress_checking, push_message, survives_gc_p)
2072 (make_pure_string, gc_in_progress, abort_on_gc):
2073 * lread.c (readchar, read1):
2074 * print.c (Fprin1_to_string):
2075 * xdisp.c (push_message):
2076 Use bool for booleans affected directly or indirectly by
2077 alloc.c's changes.
2078
2079 Make recently-introduced setters macros.
2080 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2081 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2082 (set_fontset_default, set_fontset_fallback): Rename from their
2083 upper-case counterparts, and make them functions rather than macros.
2084 This is more consistent with the other recently-introduced setters.
2085 These don't need to be inline, since they're local.
2086
2087 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2088
2089 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2090 the loop (Bug#12247).
2091
2092 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2093
2094 * lisp.h (vcopy): Use memcpy rather than our own loop.
2095 This fixes a performance regression introduced by the recent
2096 addition of vcopy. This means 'vcopy' will need to be modified
2097 for a copying collector, but that's OK. Also, tighten the
2098 checking in the assertion.
2099
2100 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2101
2102 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2103 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2104 non-base glyph for the width of the base character, according to
2105 what x_draw_composite_glyph_string_foreground expects.
2106 Generate WADJUST value according to composition_gstring_width's
2107 expectations, to produce correct width of the composed character.
2108 Reverse the sign of the DU offset produced by ScriptPlace.
2109
2110 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2111
2112 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2113
2114 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2115
2116 Avoid direct writes to contents member of struct Lisp_Vector.
2117 * lisp.h (vcopy): New function to copy data into vector.
2118 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2119 * fns.c (Ffillarray): Use ASET.
2120 * keyboard.c (timer_check_2): Use AREF and ASET.
2121 (append_tool_bar_item, Frecent_keys): Use vcopy.
2122 * lread.c (read_vector): Use ASET.
2123 * msdos.c (Frecent_doskeys): Use vcopy.
2124 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2125 (Finternal_merge_in_global_face): Use ASET and vcopy.
2126 * xfont.c (xfont_list_pattern): Likewise.
2127
2128 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2129
2130 * window.c (Fwindow_point): For the selected window always return
2131 the position of its buffer's point.
2132 (Fset_window_point): For the selected window always go in its
2133 buffer to the specified position.
2134
2135 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2136
2137 Setter macros for fontsets.
2138 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2139 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2140 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2141 Adjust users.
2142
2143 2012-08-20 Glenn Morris <rgm@gnu.org>
2144
2145 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2146 Don't assume that `ln -f' works.
2147
2148 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2149
2150 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2151 and later about non-assignments with no effect. See discussion at
2152 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2153 details.
2154
2155 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2156
2157 Inline setter functions for Lisp_Objects slots of struct specbinding.
2158 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2159 Adjust users.
2160
2161 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2162
2163 * window.c (select_window): Always make selected window's buffer
2164 current.
2165
2166 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2167
2168 Use AREF and ASET for docstrings of category tables.
2169 * category.h (CATEGORY_DOCSTRING): Use AREF.
2170 (SET_CATEGORY_DOCSTRING): Use ASET.
2171 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2172
2173 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2174
2175 Inline setter functions for hash table members.
2176 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2177 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2178 (set_hash_key_and_value, set_hash_index, set_hash_next)
2179 (set_hash_hash): New functions.
2180 * charset.c, fns.c: Adjust users.
2181
2182 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2183
2184 Inline getter and setter functions for per-buffer values.
2185 * buffer.h (per_buffer_default, set_per_buffer_default)
2186 (per_buffer_value, set_per_buffer_value): New functions.
2187 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2188 * buffer.c, data.c: Adjust users.
2189
2190 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2191
2192 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2193
2194 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2195
2196 Rely on <config.h> + <unistd.h> to declare 'environ',
2197 as gnulib does this if the system doesn't.
2198 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2199 Remove declaration. MS-Windows declares it on stdlib.h which is
2200 included by conf_post.h.
2201 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2202 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2203 * vm-limit.c: Include <unistd.h>, for 'environ'.
2204
2205 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2206 (start_of_data): Remove decl; mem-limits.h provides it.
2207
2208 * xdisp.c (handle_invisible_prop): Make it a bit faster
2209 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2210
2211 2012-08-19 Chong Yidong <cyd@gnu.org>
2212
2213 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2214 ends (Bug#3874).
2215
2216 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2217
2218 * .gdbinit: Use call instead of set when calling a function in the
2219 inferior.
2220
2221 * data.c (set_internal): Don't use set_blv_found.
2222 (Fkill_local_variable): Likewise.
2223
2224 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2225
2226 * nsfont.m (ns_ascii_average_width): Ensure the string
2227 ascii_printable is initialized with a null-terminated character
2228 array. Otherwise, it can contain undesired extra characters.
2229
2230 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2231
2232 port new setting code to Sun C 5.8 2005/10/13
2233 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2234 Return void, not Lisp_Object. Otherwise, the compiler
2235 complains about (A?B:C) where B is void and C is Lisp_Object
2236 when compiling CHAR_TABLE_SET, due to the recent change to
2237 the API of sub_char_table_set_contents.
2238
2239 2012-08-18 Chong Yidong <cyd@gnu.org>
2240
2241 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2242 for the string case (Bug#3874).
2243
2244 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2245
2246 * buffer.h (BSET): Remove (Bug#12215).
2247 Replace all uses with calls to new setter functions.
2248 (bset_bidi_paragraph_direction, bset_case_canon_table)
2249 (bset_case_eqv_table, bset_directory, bset_display_count)
2250 (bset_display_time, bset_downcase_table)
2251 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2252 (bset_last_selected_window, bset_local_var_alist)
2253 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2254 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2255 (bset_width_table):
2256 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2257 (bset_auto_fill_function, bset_auto_save_file_format)
2258 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2259 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2260 (bset_cache_long_line_scans, bset_case_fold_search)
2261 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2262 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2263 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2264 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2265 (bset_header_line_format, bset_indicate_buffer_boundaries)
2266 (bset_indicate_empty_lines, bset_invisibility_spec)
2267 (bset_left_fringe_width, bset_major_mode, bset_mark)
2268 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2269 (bset_name, bset_overwrite_mode, bset_pt_marker)
2270 (bset_right_fringe_width, bset_save_length)
2271 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2272 (bset_scroll_up_aggressively, bset_selective_display)
2273 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2274 (bset_word_wrap, bset_zv_marker):
2275 * category.c (bset_category_table):
2276 * syntax.c (bset_syntax_table):
2277 New setter functions.
2278
2279 * process.h (PSET): Remove (Bug#12215).
2280 Replace all uses with calls to new setter functions.
2281 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2282 (PROCESS_INLINE): New macro.
2283 (pset_childp): New setter function.
2284 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2285 * process.c (PROCESS_INLINE):
2286 Define to EXTERN_INLINE, so that the corresponding functions
2287 are compiled into code.
2288 (pset_buffer, pset_command, pset_decode_coding_system)
2289 (pset_decoding_buf, pset_encode_coding_system)
2290 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2291 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2292 (pset_type, pset_write_queue): New setter functions.
2293
2294 * window.h (WSET): Remove (Bug#12215).
2295 Replace all uses with calls to new setter functions.
2296 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2297 (WINDOW_INLINE): New macro.
2298 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2299 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2300 (wset_total_lines, wset_vertical_scroll_bar)
2301 (wset_window_end_pos, wset_window_end_valid)
2302 (wset_window_end_vpos): New setter functions.
2303 * window.c (WINDOW_INLINE):
2304 Define to EXTERN_INLINE, so that the corresponding functions
2305 are compiled into code.
2306 (wset_combination_limit, wset_dedicated, wset_display_table)
2307 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2308 (wset_new_normal, wset_new_total, wset_next_buffers)
2309 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2310 (wset_prev_buffers, wset_right_fringe_width)
2311 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2312 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2313 (wset_window_parameters):
2314 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2315 (wset_column_number_displayed, wset_region_showing):
2316 New setter functions.
2317
2318 * termhooks.h (TSET): Remove (Bug#12215).
2319 Replace all uses with calls to new setter functions.
2320 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2321 (TERMHOOKS_INLINE): New macro.
2322 (tset_charset_list, tset_selection_alist): New setter functions.
2323 * terminal.c (TERMHOOKS_INLINE):
2324 Define to EXTERN_INLINE, so that the corresponding functions
2325 are compiled into code.
2326 (tset_param_alist): New setter function.
2327
2328 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2329
2330 * keyboard.h (KSET): Remove (Bug#12215).
2331 Replace all uses with calls to new setter functions.
2332 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2333 (KEYBOARD_INLINE): New macro.
2334 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2335 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2336 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2337 New setter functions.
2338 * keyboard.c (KEYBOARD_INLINE):
2339 Define to EXTERN_INLINE, so that the corresponding functions
2340 are compiled into code.
2341 (kset_echo_string, kset_kbd_queue)
2342 (kset_keyboard_translate_table, kset_last_prefix_arg)
2343 (kset_last_repeatable_command, kset_local_function_key_map)
2344 (kset_overriding_terminal_local_map, kset_real_last_command)
2345 (kset_system_key_syms): New setter functions.
2346
2347 * frame.h (FSET): Remove (Bug#12215).
2348 Replace all uses with calls to new setter functions.
2349 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2350 (FRAME_INLINE): New macro.
2351 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2352 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2353 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2354 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2355 (fset_param_alist, fset_root_window, fset_scroll_bars)
2356 (fset_selected_window, fset_title, fset_tool_bar_items)
2357 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2358 * frame.c (FRAME_INLINE):
2359 Define to EXTERN_INLINE, so that the corresponding functions
2360 are compiled into code.
2361 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2362
2363 A few more naming-convention fixes for getters and setters.
2364 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2365 and rename from buffer_overlays_set_before.
2366 (set_buffer_overlays_after): Move here from buffer.h, and rename
2367 from buffer_overlays_set_after.
2368 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2369 All uses changed.
2370 (set_buffer_intervals): Rename from buffer_set_intervals.
2371 * intervals.c (set_interval_object): Move here from intervals.h,
2372 and rename from interval_set_object.
2373 (set_interval_left): Move here from intervals.h, and rename from
2374 interval_set_left.
2375 (set_interval_right): Move here from intervals.h, and rename from
2376 interval_set_right.
2377 (copy_interval_parent): Move here from intervals.h, and rename from
2378 interval_copy_parent.
2379 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2380 (set_interval_plist): Rename from interval_set_plist.
2381 Return void, not Lisp_Object, since no caller uses the result.
2382 * lisp.h (string_intervals): Rename from string_get_intervals.
2383 (set_string_intervals): Rename from string_set_intervals.
2384
2385 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2386 (set_char_table_contents): Rename from char_table_set_contents.
2387 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2388 All uses changed. See the end of
2389 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2390
2391 * lisp.h (CSET): Remove (Bug#12215).
2392 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2393 (set_char_table_purpose): New functions,
2394 replacing CSET. All uses changed. For example, replace
2395 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2396 "set_char_table_parent (char_table, parent);".
2397 The old version was confusing because it used the same name
2398 'parent' for two different things.
2399
2400 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2401
2402 Functions to get and set Lisp_Object fields of buffer-local variables.
2403 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2404 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2405 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2406 * data.c, eval.c, frame.c: Adjust users.
2407
2408 2012-08-17 Chong Yidong <cyd@gnu.org>
2409
2410 * xfaces.c (merge_face_vectors): If the target font specfies a
2411 font spec, make the font's attributes take precedence over
2412 directly-specified attributes.
2413 (merge_face_ref): Recognize :font.
2414
2415 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2416
2417 Do not use memcpy for copying intervals.
2418 * intervals.c (reproduce_interval): New function.
2419 (reproduce_tree, reproduce_tree_obj): Use it.
2420 (reproduce_tree_obj): Remove prototype.
2421
2422 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2423
2424 * lisp.h (duration_to_sec_usec): Remove unused decl.
2425
2426 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2427
2428 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2429 to an allocated instance of NSString, not to the class itself.
2430
2431 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2432
2433 * makefile.w32-in (C_CTYPE_H): New macro.
2434 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2435 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2436 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2437
2438 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2439
2440 Use ASCII tests for character types.
2441 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2442 * xfns.c, xterm.c:
2443 Don't include <ctype.h>; was not needed.
2444 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2445 * sysdep.c, xfaces.c:
2446 Include <c-ctype.h> instead of <ctype.h>.
2447 * nsterm.m: Include <c-ctype.h>.
2448 * charset.c (read_hex):
2449 * doc.c (Fsnarf_documentation):
2450 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2451 (DRIVE_LETTER) [DOS_NT]:
2452 (Ffile_name_directory, Fexpand_file_name)
2453 (Fsubstitute_in_file_name):
2454 * font.c (font_parse_xlfd, font_parse_fcname):
2455 * frame.c (x_set_font_backend):
2456 * gtkutil.c (xg_get_font):
2457 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2458 * nsimage.m (hexchar):
2459 * nsterm.m (ns_xlfd_to_fontname):
2460 * sysdep.c (system_process_attributes):
2461 * xfaces.c (hash_string_case_insensitive):
2462 Use C-locale tests instead of locale-specific tests for character
2463 types, since we want the ASCII interpretation here, not the
2464 interpretation suitable for whatever happens to be the current locale.
2465
2466 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2467
2468 Consistently check windows for validity/liveness
2469 (Bug#11984, Bug#12025, Bug#12026).
2470 * lisp.h (CHECK_VALID_WINDOW): New macro.
2471 * window.c (decode_window): Rename to decode_live_window.
2472 (decode_valid_window, Fwindow_valid_p): New functions.
2473 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2474 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2475 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2476 (Fwindow_prev_sibling, Fwindow_combination_limit)
2477 (Fset_window_combination_limit, Fwindow_use_time)
2478 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2479 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2480 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2481 (Fwindow_hscroll, Fset_window_hscroll)
2482 (Fwindow_redisplay_end_trigger)
2483 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2484 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2485 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2486 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2487 (Fwindow_end, Fset_window_point, Fset_window_start)
2488 (Fpos_visible_in_window_p, Fwindow_line_height)
2489 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2490 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2491 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2492 (Fset_window_parameter, Fwindow_display_table)
2493 (Fset_window_display_table, Fdelete_other_windows_internal)
2494 (Fset_window_buffer, Fset_window_new_total)
2495 (Fset_window_new_normal, Fdelete_window_internal)
2496 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2497 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2498 (Fwindow_scroll_bars): Check whether argument window is a valid or
2499 live window. Update doc-strings.
2500 (syms_of_window): New symbol Qwindow_valid_p.
2501 * keyboard.c (Fposn_at_x_y): Check whether argument
2502 frame_or_window denotes a valid window.
2503
2504 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2505
2506 Fix previous char table change.
2507 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2508 * chartab.c (optimize_sub_char_table): Likewise.
2509
2510 2012-08-16 Chong Yidong <cyd@gnu.org>
2511
2512 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2513
2514 * xfont.c (xfont_open):
2515 * xftfont.c (xftfont_open): Set the font's max_width field.
2516
2517 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2518 min_width to space_width and average_width to the average over
2519 printable ASCII characters.
2520 (ns_char_width): Code cleanup.
2521 (ns_ascii_average_width): New utility function.
2522
2523 * font.h (struct font): Update comments.
2524
2525 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2526
2527 Simple interface to set Lisp_Object fields of character tables.
2528 * lisp.h (CSET): New macro.
2529 (char_table_set_extras, char_table_set_contents)
2530 (sub_char_table_set_contents): New function.
2531 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2532 * syntax.c: Adjust users.
2533
2534 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2535
2536 * eval.c (eval_sub): Bind lexical-binding.
2537 * lread.c (Qlexical_binding): Make non-static.
2538
2539 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2540
2541 * nsmenu.m (popupSession): Remove.
2542 (pop_down_menu): Remove endModalSession.
2543 (timeout_handler:): New method.
2544 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2545 Call runModalForWindow. Check timer_fired when it returns.
2546 If not set, cancel timer and break out of loop.
2547 Otherwise loop again, with a new timeout.
2548
2549 * nsterm.m: Include fcntl.h if present.
2550 (fd_entry, t_readfds, inNsSelect): Remove.
2551 (select_writefds, select_valid, select_timeout, selfds)
2552 (select_mutex, apploopnr): Add.
2553 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2554 Otherwise call kbd_buffer_store_event.
2555 (ns_send_appdefined): Remove release of fd_entry.
2556 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2557 Increment and decrement apploopnr.
2558 (ns_select): If no file descriptors, just do a NSTimer.
2559 Otherwise copy read/write masks and start select thread (fd_handler).
2560 Start main loop and wait for application defined event.
2561 Inform select thread to stop selecting after main loop is exited.
2562 (ns_term_init): Create selfds pipe and set non-blocking.
2563 Initialize select_mutex. Start the select thread (fd_handler).
2564 (fd_handler:): Loop forever, wait for info from the main thread
2565 to either start or stop selecting. When select returns, send
2566 and appdefined event.
2567 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2568 If not call kbd_buffer_store_event.
2569
2570 * nsterm.h (EmacsApp): fd_handler takes id argument.
2571 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2572
2573 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2574
2575 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2576
2577 * region-cache.c (move_cache_gap): Update gap_len using the actual
2578 growth of the boundaries array. Do not change cache_len.
2579 (Bug#12196)
2580
2581 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2582
2583 Generalize and cleanup font subsystem checks.
2584 * font.h (FONT_DEBUG, font_assert): Remove.
2585 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2586 Change font_assert to eassert. Use eassert where appropriate.
2587
2588 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2589
2590 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2591
2592 2012-08-15 Chong Yidong <cyd@gnu.org>
2593
2594 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2595 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2596 extract the font descriptor instead of just the font name.
2597 In that case, return a font spec instead of a string.
2598 (x_last_font_name): Move to this file from xfns.c.
2599
2600 * xfns.c (Fx_select_font): The return value can also be a font
2601 spec. Move x_last_font_name management to gtkutil.c.
2602
2603 * xfaces.c: Make font weight and style symbols non-static.
2604
2605 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2606
2607 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2608 (bug#12117).
2609
2610 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2611
2612 * alloc.c (Fgarbage_collect): Use plural form consistently.
2613
2614 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2615
2616 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2617 iteration through the command loop. Fixes a problem whereby mouse
2618 movements are ignored until the first mouse click.
2619
2620 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2621
2622 Use bool, not int, for Lisp booleans.
2623 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2624 makes Emacs a bit smaller and presumably a bit faster.
2625 * lisp.h: Include <stdbool.h>.
2626 (struct Lisp_Boolfwd, defvar_bool):
2627 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2628 * regex.c [!emacs]: Include <stdbool.h>.
2629 (false, true): Remove; <stdbool.h> does this for us now.
2630
2631 2012-08-14 Chong Yidong <cyd@gnu.org>
2632
2633 * character.c (Fcharacterp): Doc fix (Bug#12076).
2634
2635 * data.c (Findirect_variable): Doc fix (Bug#11040).
2636
2637 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2638
2639 * editfns.c (Fformat): Doc fix (Bug#12059).
2640 (Fsave_current_buffer): Doc fix (Bug#11542).
2641
2642 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2643
2644 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2645 (bug#12022).
2646
2647 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2648
2649 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2650 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2651 * minibuf.c (choose_minibuf_frame, read_minibuf):
2652 * w32fns.c (x_create_tip_frame):
2653 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2654 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2655
2656 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2657
2658 * intervals.c (offset_intervals): Remove obsolete comment.
2659
2660 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2661
2662 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2663
2664 2012-08-14 Gergely Risko <gergely@risko.hu>
2665
2666 * coding.c (decode_coding): Record buffer modification before
2667 disabling undo_list (Bug#11773).
2668
2669 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2670
2671 Revert and cleanup some recent overlay changes.
2672 * buffer.h (enum overlay_type): Remove.
2673 (buffer_get_overlays, buffer_set_overlays): Likewise.
2674 (buffer_set_overlays_before, buffer_set_overlays_after):
2675 New function. Adjust users.
2676 (unchain_both): Add eassert.
2677
2678 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2679
2680 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2681
2682 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2683
2684 * gtkutil.c (xg_mark_data): Don't assume C99.
2685
2686 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2687
2688 * gtkutil.c (xg_frame_tb_info): New struct.
2689 (TB_INFO_KEY): New define.
2690 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2691 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2692 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2693 if not present.
2694 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2695 is up to date. Otherwise store new data.
2696 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2697
2698 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2699
2700 Use KSET for write access to Lisp_Object members of struct kboard.
2701 * keyboard.h (KSET): New macro.
2702 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2703 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2704 * xterm.c: Adjust users.
2705
2706 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2707
2708 Use BSET for write access to Lisp_Object members of struct buffer.
2709 * buffer.h (BSET): New macro.
2710 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2711 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2712 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2713 * window.c, xdisp.c, xfns.c: Adjust users.
2714
2715 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2716
2717 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2718
2719 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2720
2721 * nsterm.m (not_in_argv): New function.
2722 (application:openFile, application:openTempFile:):
2723 (application:openFileWithoutUI:, application:openFiles:): Open file
2724 if not_in_argv returns non-zero (bug#12171).
2725
2726 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2727 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2728 Define for Gtk+ versions less than 3.2.
2729 (xg_get_font_name): Use those functions/macros here.
2730 Reported by Frans Oilinki <moilinki@gmail.com>.
2731
2732 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2733
2734 * unexmacosx.c (copy_data_segment): Copy initialized data in
2735 statically linked libraries from input file rather than memory.
2736
2737 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2738 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2739 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2740
2741 2012-08-10 Glenn Morris <rgm@gnu.org>
2742
2743 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2744 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2745
2746 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2747
2748 Fix last change to allow compilation with low optimization levels.
2749 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2750 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2751
2752 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2753
2754 Use common inline syntax in intervals.h.
2755 * intervals.h (INTERVALS_INLINE): New macro.
2756 Change all users from LISP_INLINE.
2757
2758 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2759
2760 Define Qnone once for all platforms.
2761 * frame.c (Qnone): Define here.
2762 (syms_of_frame): DEFSYM it.
2763 * lisp.h (Qnone): New declaration.
2764 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2765 * xfns.c: Remove duplication. Adjust users.
2766
2767 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2768
2769 Remove unused macros from intervals.h.
2770 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2771 * intervals.c: Adjust comment.
2772
2773 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2774
2775 * w32fns.c <w32_unicode_gui>: New static variable.
2776 (globals_of_w32fns): Initialize it according to os_subtype.
2777 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2778 testing os_subtype.
2779
2780 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2781 Eli Zaretskii <eliz@gnu.org>
2782
2783 Fix bug #10299 with Unicode characters sent by customized
2784 keyboards created by MSKLC.
2785 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2786 (w32_init_class): Use it to initialize the Emacs class with either
2787 ANSI or Unicode API calls.
2788 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2789 later.
2790 (w32_wnd_proc): If the character code sent by WM_CHAR or
2791 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2792 original message. Call DefWindowProcW on NT and later.
2793
2794 2012-08-10 Glenn Morris <rgm@gnu.org>
2795
2796 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2797
2798 * lisp.h (DIRECTORY_SEP): Let configure set it.
2799
2800 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2801
2802 Use TSET for write access to Lisp_Object slots of struct terminal.
2803 * termhooks.h (TSET): New macro.
2804 * coding.c, terminal.c, xselect.c: Adjust users.
2805
2806 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2807
2808 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2809 the failing expression, include them in the error message.
2810 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2811 * lisp.h (internal_condition_case_n): Update declaration.
2812
2813 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2814
2815 Inline functions to examine and change buffer overlays.
2816 * buffer.c (unchain_both): New function.
2817 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2818 (buffer_has_overlays): New function.
2819 (enum overlay_type): New enum.
2820 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2821 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2822
2823 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2824
2825 Inline functions to examine and change buffer intervals.
2826 * alloc.c (mark_interval_tree): Remove.
2827 (MARK_INTERVAL_TREE): Simplify.
2828 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2829 * intervals.c (buffer_balance_intervals): New function.
2830 (graft_intervals_into_buffer): Adjust indentation.
2831 (set_intervals_multibyte): Simplify.
2832 * buffer.h (BUF_INTERVALS): Remove.
2833 (buffer_get_intervals, buffer_set_intervals): New function.
2834 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2835 * intervals.c, textprop.c: Adjust users.
2836
2837 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2838
2839 Inline functions to examine and change string intervals.
2840 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2841 (string_get_intervals, string_set_intervals): New function.
2842 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2843 * lread.c, print.c, textprop.c: Adjust users.
2844
2845 2012-08-08 Glenn Morris <rgm@gnu.org>
2846
2847 * lisp.mk (lisp): Remove language/persian.elc.
2848
2849 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2850
2851 Cleanup intervals.
2852 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2853 (NULL_INTERVAL_P): Likewise. Adjust users.
2854 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2855 Adjust comment. Move under #if 0.
2856 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2857 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2858
2859 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2860
2861 Check total length of intervals with eassert.
2862 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2863 * intervals.c: Change all users to eassert.
2864
2865 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2866
2867 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2868 Rename fields to match removal of FGET and WGET and disuse of
2869 INTERNAL_FIELD in Lisp_Cons.
2870
2871 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2872
2873 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2874 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2875 name since all xname users are fixed long time ago. Do not
2876 use INTERNAL_FIELD.
2877 (set_symbol_name, set_symbol_function, set_symbol_plist):
2878 (set_symbol_next, set_overlay_plist): New function.
2879 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2880 (struct Lisp_Overlay): Likewise.
2881 (CVAR, MVAR, SVAR): Remove.
2882 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2883 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2884 * xterm.c: Adjust users.
2885 * .gdbinit: Change to use name field of struct Lisp_Symbol
2886 where appropriate.
2887
2888 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2889
2890 Basic functions to set Lisp_Object and pointer slots of intervals.
2891 * intervals.h (interval_set_parent, interval_set_object):
2892 (interval_set_left, interval_set_right, interval_set_plist):
2893 (interval_copy_parent): New function.
2894 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2895 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2896 Adjust indentation.
2897 (INTERVAL_SIZE): Remove. Adjust users.
2898 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2899
2900 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2901
2902 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2903 * process.h (PGET): Remove.
2904 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2905 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2906
2907 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2908
2909 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2910 * window.h (WGET): Remove.
2911 (struct window): Do not use INTERNAL_FIELD.
2912 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2913 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2914 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2915 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2916 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2917 Adjust users.
2918
2919 2012-08-07 Chong Yidong <cyd@gnu.org>
2920
2921 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2922 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2923 (Fdelete_window_internal): Signal an error if the window is not on
2924 a live frame (Bug#12025).
2925
2926 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2927
2928 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2929 * frame.h (FGET): Remove.
2930 (struct frame): Do not use INTERNAL_FIELD.
2931 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2932 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2933 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2934 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2935
2936 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2937
2938 * w32.c: Silence compiler warnings.
2939 (map_w32_filename): Remove unused variable `is_fat'.
2940 (chase_symlinks): Add parentheses around expression.
2941
2942 2012-08-06 Glenn Morris <rgm@gnu.org>
2943
2944 * sysdep.c: Respect BROKEN_GETWD.
2945
2946 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2947 Let configure handle it.
2948 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2949
2950 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2951
2952 Use GCALIGNMENT where appropriate.
2953 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2954 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2955 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2956
2957 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2958
2959 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2960 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2961
2962 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2963
2964 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2965 that should be sufficient for everyone.
2966
2967 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2968
2969 * keyboard.c (timer_check_2): Add break so timer_check returns next
2970 timeout.
2971
2972 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2973
2974 Fix Windows build errors introduced after converting to WGET and WSET.
2975 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2976 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2977
2978 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2979
2980 * nsterm.m (ns_frame_rehighlight): Use FSET.
2981
2982 * nsmenu.m (ns_update_menubar): Use FSET.
2983
2984 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2985
2986 Separate read and write access to Lisp_Object slots of Lisp_Process.
2987 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2988 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2989
2990 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2991
2992 Separate read and write access to Lisp_Object slots of struct window.
2993 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2994 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2995 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2996 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2997 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2998 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2999 Adjust users.
3000
3001 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3002
3003 Fix Windows build errors introduced after converting to FGET and FSET.
3004 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3005 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3006 (w32_judge_scroll_bars): Change to use FSET.
3007 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3008
3009 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3010
3011 Fix replacement typo.
3012 * window.c (replace_window): Set root_window instead of
3013 selected_window. This fixes a total window subsystem
3014 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3015
3016 2012-08-06 Glenn Morris <rgm@gnu.org>
3017
3018 * lisp.mk (lisp): Add language/persian.elc.
3019
3020 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3021
3022 Separate read and write access to Lisp_Object slots of struct frame.
3023 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3024 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3025 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3026 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3027 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3028
3029 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3030
3031 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3032
3033 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3034
3035 Generalize common compile-time constants.
3036 * lisp.h (header_size, bool_header_size, word_size): Now here.
3037 (struct Lisp_Vector): Add comment.
3038 (struct Lisp_Bool_Vector): Move up to define handy constants.
3039 (VECSIZE, PSEUDOVECSIZE): Simplify.
3040 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3041 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3042 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3043 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3044 * xfont.c, xmenu.c: Use word_size where appropriate.
3045
3046 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3047
3048 * search.c (Freplace_match): Treat \? in the replacement text
3049 literally (Bug#8161).
3050
3051 2012-08-05 Chong Yidong <cyd@gnu.org>
3052
3053 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3054 * frame.c (Vdelete_frame_functions):
3055 * emacs.c (Vkill_emacs_hook): Doc fix.
3056
3057 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3058
3059 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3060 --with-x-toolkit=no builds.
3061 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3062
3063 2012-08-04 Chong Yidong <cyd@gnu.org>
3064
3065 * syntax.c (Fmodify_syntax_entry): Doc fix.
3066
3067 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3068
3069 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3070 * w32.c (init_environment): Change the default values of many
3071 environment variables in dflt_envvars[] to NULL, to avoid pushing
3072 them into environment when they were not already defined.
3073 Remove the code that deletes site-lisp subdirectories from the default
3074 value of EMACSLOADPATH, as it is no longer needed.
3075 (check_windows_init_file): Now external, not static.
3076 Use Vload_path as is, without adding anything, as this function is now
3077 called when Vload_path is already set up.
3078
3079 * w32.h (check_windows_init_file): Add prototype.
3080
3081 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3082 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3083 compatibility with Posix platforms.
3084 (main): Move the call to check_windows_init_file to here from
3085 w32.c.
3086 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3087 any, in the DEFALT argument into the root of the Emacs build or
3088 installation tree, as appropriate.
3089
3090 * callproc.c (init_callproc_1): Call decode_env_path instead of
3091 doing its equivalent by hand.
3092 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3093 the code that sets Vexec_path run on MS-Windows.
3094
3095 * lread.c (init_lread): Add comments to #ifdef's.
3096
3097 * msdos.c (dos_set_window_size, IT_update_begin)
3098 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3099 instead of direct references.
3100
3101 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3102
3103 Export DEFAULT_REHASH_* to GDB.
3104 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3105 Now constants, not macros.
3106
3107 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3108
3109 Remove unnecessary casts involving pointers.
3110 These casts are no longer needed now that we assume C89 or later,
3111 since they involve casting to or from void *.
3112 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3113 (make_pure_float, make_pure_vector):
3114 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3115 * macros.c (Fstart_kbd_macro):
3116 * menu.c (find_and_return_menu_selection):
3117 * minibuf.c (read_minibuf_noninteractive):
3118 * sysdep.c (closedir):
3119 * xdisp.c (x_produce_glyphs):
3120 * xfaces.c (compare_fonts_by_sort_order):
3121 * xfns.c (x_real_positions, select_visual):
3122 * xselect.c (x_stop_queuing_selection_requests)
3123 (x_get_window_property, x_get_window_property_as_lisp_data):
3124 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3125 Remove unnecessary pointer casts.
3126 * alloc.c (record_xmalloc): New function.
3127 * lisp.h (record_xmalloc): New decl.
3128 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3129 more like a function. This is because the pointer cast is not
3130 needed. All uses changed.
3131 * print.c (print_string, print_error_message): Avoid length recalc.
3132
3133 Improve fix for macroexp crash with debugging (Bug#12118).
3134 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3135 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3136 not supposed to be invoked from the garbage collector.
3137 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3138 (gc_aset): New function, which is like ASET but can be
3139 used in the garbage collector.
3140 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3141 (set_hash_index): Use it instead of ASET.
3142
3143 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3144
3145 Support symlinks on latest versions of MS-Windows.
3146 * w32.c: Include winioctl.h and aclapi.h.
3147 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3148 (revert_to_self): Forward declarations of static functions.
3149 <static BOOL g_b_init_get_security_info>:
3150 <g_b_init_create_symbolic_link>: New static flags.
3151 (globals_of_w32): Initialize them to zero.
3152 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3153 (map_w32_filename): Improve commentary. Simplify switch.
3154 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3155 headers (most versions of MinGW w32api don't).
3156 (get_security_info, create_symbolic_link)
3157 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3158 New functions.
3159 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3160 in the argument file name.
3161 (sys_access): Call unc_volume_file_attributes only if
3162 GetFileAttributes fails with network-related error codes.
3163 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3164 have the required privileges.
3165 (get_file_security_desc_by_name): Rename from
3166 get_file_security_desc.
3167 (stat_worker): New function, with most of the guts of 'stat', and
3168 with addition of handling of symlinks and support for 'lstat'.
3169 If possible, get file's attributes and security information by
3170 handle, not by name. Produce S_IFLNK bit for symlinks, when
3171 called from 'lstat'.
3172 (stat, lstat): New functions, call 'stat_worker'.
3173 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3174 symlinks when the underlying filesystem supports them.
3175
3176 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3177
3178 Fix macroexp crash on Windows with debugging (Bug#12118).
3179 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3180 checking subscripts; problem introduced with the recent
3181 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3182 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3183 since it's used in non-static inline functions now.
3184
3185 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3186 Don't assume buffer size fits in 'int'. Remove unused local.
3187
3188 Use C99-style 'extern inline' if available.
3189 * buffer.h (BUFFER_INLINE):
3190 * category.h (CATEGORY_INLINE):
3191 * character.h (CHARACTER_INLINE):
3192 * charset.h (CHARSET_INLINE):
3193 * composite.h (COMPOSITE_INLINE):
3194 * dispextern.h (DISPEXTERN_INLINE):
3195 * lisp.h (LISP_INLINE):
3196 * systime.h (SYSTIME_INLINE):
3197 New macro, replacing 'static inline' in this header.
3198 * buffer.h, category.h, character.h, charset.h, composite.h:
3199 * dispextern.h, lisp.h, systime.h:
3200 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3201 * alloc.c (LISP_INLINE):
3202 * buffer.c (BUFFER_INLINE):
3203 * category.c (CATEGORY_INLINE):
3204 * character.c (CHARACTER_INLINE):
3205 * charset.c (CHARSET_INLINE):
3206 * composite.c (COMPOSITE_INLINE):
3207 * dispnew.c (DISPEXTERN_INLINE):
3208 * sysdep.c (SYSTIME_INLINE):
3209 Define to EXTERN_INLINE, so that the corresponding functions
3210 are compiled into code.
3211 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3212 (INLINE_HEADER_END): New macros.
3213 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3214 since it's used in non-static inline functions now.
3215 (VALMASK) [!USE_LSB_TAG]: Likewise.
3216
3217 2012-08-02 Glenn Morris <rgm@gnu.org>
3218
3219 * s/: Remove empty directory.
3220
3221 * s/ms-w32.h: Move to ../nt/inc.
3222 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3223 Update for new ms-w32.h location.
3224
3225 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3226
3227 Port to Solaris 8.
3228 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3229
3230 2012-08-02 Glenn Morris <rgm@gnu.org>
3231
3232 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3233 hard-coding the path separator.
3234
3235 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3236
3237 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3238 This how ASET and AREF are supposed to work, and makes
3239 it easier to think about future improvements. See
3240 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3241 * charset.h (set_charset_attr): New function.
3242 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3243 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3244 (aref_addr): New function. All uses of &AREF(...) changed.
3245 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3246 (set_hash_index): New functions. All lvalue-style uses of
3247 HASH_KEY etc. changed.
3248 * keyboard.c (set_prop): New function. All lvalue-style uses
3249 of PROP changed.
3250
3251 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3252
3253 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3254 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3255 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3256 * nsfns.m (ns_set_name_as_filename): Likewise.
3257 * nsmenu.m (ns_update_menubar): Likewise.
3258 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3259
3260 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3261
3262 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3263 Adapt to latest changes in field names of the corresponding Lisp
3264 objects.
3265
3266 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3267
3268 2012-08-01 Glenn Morris <rgm@gnu.org>
3269
3270 * s/msdos.h: Remove file.
3271 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3272 * Makefile.in (S_FILE): Remove.
3273 (config_h): Remove S_FILE.
3274
3275 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3276
3277 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3278 Remove; moved to nt/config.nt.
3279
3280 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3281
3282 Use INTERNAL_FIELD for conses and overlays.
3283 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3284 Remove obsolete comment.
3285 (MVAR): New macro.
3286 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3287 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3288
3289 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3290
3291 Use INTERNAL_FIELD for symbols.
3292 * lisp.h (SVAR): New macro. Adjust users.
3293 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3294 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3295
3296 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3297
3298 Use INTERNAL_FIELD for processes.
3299 * process.h (PVAR): New macro. Adjust style.
3300 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3301 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3302
3303 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3304
3305 Use INTERNAL_FIELD for windows.
3306 * window.h (WVAR): New macro.
3307 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3308 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3309 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3310 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3311 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3312 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3313
3314 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3315
3316 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3317
3318 2012-08-01 Glenn Morris <rgm@gnu.org>
3319
3320 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3321 Move to configure.ac.
3322
3323 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3324
3325 * makefile.w32-in (CONFIG_H): Update dependencies.
3326 (CONF_POST_H): New macro.
3327
3328 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3329
3330 2012-07-31 Glenn Morris <rgm@gnu.org>
3331
3332 * Makefile.in (S_FILE): No longer set by configure.
3333
3334 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3335 is available.
3336 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3337
3338 * process.h (NULL_DEVICE):
3339 * emacs.c (SEPCHAR):
3340 * editfns.c (USER_FULL_NAME): Let configure set them.
3341
3342 * s/README, s/template.h: Remove files.
3343
3344 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3345
3346 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3347 Move to configure.ac.
3348
3349 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3350
3351 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3352 resulting renaming of 'struct frame' members.
3353
3354 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3355
3356 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3357 after introduction of FVAR.
3358
3359 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3360
3361 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3362
3363 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3364 instead of compositeToPoint.
3365 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3366
3367 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3368
3369 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3370
3371 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3372 * lisp.h (INTERNAL_FIELD): New macro.
3373 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3374 (BVAR): Change to use INTERNAL_FIELD.
3375 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3376 (KVAR): Change to use INTERNAL_FIELD.
3377 * frame.h (FVAR): New macro.
3378 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3379 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3380 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3381 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3382 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3383
3384 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3385
3386 Miscellaneous fixes for non-default X toolkits.
3387 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3388 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3389 Move under #ifdef USE_LUCID.
3390 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3391 definition and usage to avoid warnings.
3392
3393 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3394
3395 * nsterm.m (openFiles): Fix previous checkin.
3396
3397 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3398
3399 * indent.c (compute_motion): Remove unused local.
3400
3401 2012-07-31 Glenn Morris <rgm@gnu.org>
3402
3403 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3404
3405 * conf_post.h [USG5_4]:
3406 Move remaining contents of s/usg5-4-common.h here.
3407 * s/usg5-4-common.h: Remove file.
3408
3409 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3410 * s/irix6-5.h: Remove file.
3411
3412 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3413 * s/darwin.h: Remove file.
3414
3415 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3416 * s/hpux10-20.h: Remove file, which is now empty.
3417
3418 2012-07-30 Glenn Morris <rgm@gnu.org>
3419
3420 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3421 * Makefile.in (config_h): Add conf_post.h.
3422 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3423
3424 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3425
3426 * nsterm.m (ns_do_open_file): New variable.
3427 (ns_term_init): Set ns_do_open_file to YES after run returns.
3428 (openFile, openTempFile, openFileWithoutUI, openFiles):
3429 Open files only if ns_do_open_file.
3430
3431 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3432
3433 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3434 This no-op macro hasn't been needed for many years.
3435 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3436
3437 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3438 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3439 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3440 gdb_make_enums_visible.
3441 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3442 (DIRECTORY_SEP): Now a constant, not a macro.
3443
3444 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3445
3446 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3447 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3448
3449 * w32term.c <w32_keyboard_codepage>: Renamed from
3450 keyboard_codepage and now external. All users changed.
3451
3452 * w32term.h: Add declaration of w32_keyboard_codepage.
3453
3454 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3455 the codepage to translate keys to Unicode. If this argument is
3456 -1, use the value returned by GetConsoleCP. All callers changed.
3457
3458 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3459
3460 Update .PHONY listings in makefiles.
3461 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3462 bootstrap-clean, distclean, maintainer-clean, versioclean,
3463 extraclean, frc.
3464
3465 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3466 This is a bit clearer. Fix some commentary typos.
3467
3468 2012-07-30 Glenn Morris <rgm@gnu.org>
3469
3470 * s/netbsd.h: Let configure include signal.h if needed.
3471 Remove file, which is now empty.
3472
3473 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3474 Let configure set them.
3475 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3476 No more need to undefine.
3477
3478 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3479
3480 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3481 non-single-byte char when adding meta modifier. (Bug#12090)
3482
3483 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3484
3485 Convert safe_call to use variable number of arguments.
3486 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3487 (safe_call2): Fix comment.
3488 * lisp.h (safe_call): Adjust prototype.
3489 * coding.c (encode_coding_object): Change to use safe_call2.
3490 * xfaces.c (merge_face_heights): Change to use safe_call1.
3491
3492 2012-07-30 Glenn Morris <rgm@gnu.org>
3493
3494 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3495 does that unconditionally. Remove file, which is now empty.
3496
3497 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3498 Remove empty files.
3499
3500 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3501
3502 Export to GDB most of lisp.h's remaining object-like macros.
3503 * lisp.h (min, max): Move earlier, because they're used earlier now.
3504 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3505 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3506 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3507 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3508 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3509 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3510 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3511 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3512 Now constants, for GDB. They need not be macros.
3513 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3514 Now constants, for GDB, as well as macros, for static initializers.
3515 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3516 Move to after the definition of struct Lisp_Char_Table,
3517 since the former now needs that type defined.
3518 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3519 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3520 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3521 New enums, for gdb_make_enums_visible.
3522 (GLYPH_MODE_LINE_FACE): Remove; unused.
3523 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3524 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3525 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3526 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3527 enum maxargs, enum MAX_ALLOCA.
3528 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3529 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3530 no longer needed, now that they are done in lisp.h.
3531
3532 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3533
3534 Cleanup string bytes checking.
3535 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3536 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3537 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3538 (check_sblock, compact_small_strings): Simplify.
3539
3540 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3541
3542 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3543 These macros are confusing and no longer need to be defined, as
3544 the enum values now suffice. All uses replaced with definiens.
3545 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3546
3547 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3548
3549 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3550 ($(BLD)/w32console.$(O)): Update dependencies.
3551
3552 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3553
3554 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3555 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3556 time. Adjust users.
3557 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3558
3559 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3560
3561 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3562 setting sitelisp (Bug#12010).
3563
3564 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3565
3566 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3567
3568 * w32heap.c (cache_system_info):
3569 * w32.c (sys_rename):
3570 * w32proc.c (find_child_console, sys_kill): All users changed.
3571
3572 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3573
3574 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3575
3576 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3577
3578 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3579
3580 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3581
3582 Cleanup statistics calculation in Fgarbage_collect.
3583 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3584 Fix zombies percentage calculation. Simplify elapsed time calculation.
3585
3586 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3587
3588 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3589 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3590 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3591 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3592 (replace_range, replace_range_2, del_range_2): Change to eassert.
3593 * marker.c (byte_char_debug_check): Adjust style.
3594
3595 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3596
3597 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3598 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3599 long-ago-commented-out code that talks about "WIN32".
3600 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3601 All uses changed.
3602
3603 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3604
3605 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3606 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3607 Simplify by using alignof.
3608 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3609 * lisp.h: Include <stdalign.h>.
3610 (GCALIGNMENT): New macro and constant.
3611 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3612 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3613 (stdalign): New macro, if not already defined.
3614
3615 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3616
3617 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3618 * w32inevt.c: Include w32inevt.h.
3619 (w32_read_console_input): New inline function, calls either
3620 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3621 w32_console_unicode_input.
3622 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3623 (w32_kbd_patch_key, key_event): Use the codepage returned by
3624 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3625 (key_event): use uChar.UnicodeChar only if
3626 w32_console_unicode_input is non-zero.
3627
3628 * w32console.c: Include w32heap.h.
3629 <w32_console_unicode_input>: New global variable.
3630 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3631 family of Windows, zero otherwise.
3632
3633 * w32inevt.h: Declare w32_console_unicode_input.
3634
3635 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3636 --without-x. (Bug#11742)
3637
3638 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3639
3640 Adjust GDB to reflect pvec_type changes (Bug#12036).
3641 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3642 2012-07-04 changes to pseudovector representation.
3643 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3644
3645 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3646
3647 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3648 bus address.
3649 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3650
3651 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3652
3653 * alloc.c (listn): Fix the order the arguments are consed onto the
3654 list.
3655
3656 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3657 enumeration constants, as PURE and HEAP are too general, and clash
3658 with other headers and sources, such as gmalloc.c and the
3659 MS-Windows system headers. All users changed.
3660
3661 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3662
3663 Revert last save_excursion_save and save_excursion_restore changes.
3664 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3665 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3666
3667 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3668
3669 Fix recently-introduced typos in Windows port.
3670 Reported by Martin Rudalics <rudalics@gmx.at>.
3671 * w32.c (init_environment): Replace comma with semicolon.
3672 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3673
3674 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3675
3676 Improve GDB symbol export (Bug#12036).
3677 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3678 arms of an 'if', not using conditional expressions; otherwise GDB
3679 complains about the types in the unevaluated arm when the argument
3680 is an integer literal.
3681 (xgetint): Simplify expression.
3682 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3683 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3684 Zaretskii in <http://bugs.gnu.org/12036#13>.
3685 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3686 needed now that we have gdb_make_enums_visible.
3687 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3688 (enum enum_USE_LSB_TAG):
3689 New enum types, packaging up enums that need to be exported to GDB.
3690
3691 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3692
3693 Utility function to make a list from specified amount of objects.
3694 * lisp.h (enum constype): New datatype.
3695 (listn): New prototype.
3696 * alloc.c (listn): New function.
3697 (Fmemory_use_count, syms_of_alloc): Use it.
3698 * buffer.c (syms_of_buffer): Likewise.
3699 * callint.c (syms_of_callint): Likewise.
3700 * charset.c (define_charset_internal): Likewise.
3701 * coding.c (syms_of_coding): Likewise.
3702 * keymap.c (syms_of_keymap): Likewise.
3703 * search.c (syms_of_search): Likewise.
3704 * syntax.c (syms_of_syntax): Likewise.
3705 * w32.c (init_environment): Likewise.
3706 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3707 * xdisp.c (syms_of_xdisp): Likewise.
3708 * xfns.c (syms_of_xfns): Likewise.
3709
3710 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3711
3712 Fast save_excursion_save and save_excursion_restore.
3713 * lisp.h (struct Lisp_Excursion): New data type.
3714 (PVEC_EXCURSION): New pseudovector type.
3715 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3716 to deal with it. Adjust comments.
3717 (init_marker, attach_marker): New prototype.
3718 (unchain_marker): Adjust prototype.
3719 * marker.c (attach_marker): Change to global.
3720 (init_marker): New function.
3721 * alloc.c (Fmake_marker, build_marker): Use it.
3722 (build_marker): More easserts.
3723 (mark_object): Handle struct Lisp_Excursion.
3724 * editfns.c (save_excursion_save, save_excursion_restore):
3725 Reimplement to use struct Lisp_Excursion. Add comments.
3726
3727 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3728
3729 Fix export of symbols to GDB (Bug#12036).
3730 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3731 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3732 emacs.c, as this is a more-suitable home. Had this been done earlier
3733 the fix for 12036 would have avoided some of the problems noted in
3734 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3735 would have been more obvious.
3736 * emacs.c: Do not include <verify.h>; no longer needed.
3737 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3738 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3739 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3740 Remove; now done in lisp.h.
3741 * lisp.h (PUBLISH_TO_GDB): New macro.
3742 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3743 (DATA_SEG_BITS): Use it.
3744 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3745 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3746 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3747 not be usable in #if. This simplifies things.
3748
3749 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3750
3751 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3752
3753 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3754
3755 Simplify export of symbols to GDB (Bug#12036).
3756 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3757 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3758 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3759 Adjust to changes in lisp.h and emacs.c, by using
3760 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3761 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3762 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3763 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3764 instead of gdb_valbits.
3765 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3766 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3767 instead of gdb_array_mark_flag.
3768 (xboolvector): Get size from $->size, not $->header.size.
3769 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3770 (xreload, hook-run, hookpost-run): Remove.
3771 * emacs.c: Include <verify.h>.
3772 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3773 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3774 Remove.
3775 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3776 (gdb_USE_LSB_TAG): New enum constants.
3777 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3778 Also define these as enum constants, so they're visible to GDB.
3779 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3780 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3781 as constants, so they're visible to GDB.
3782 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3783 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3784 Now enum constants, not macros, so they're visible to GDB.
3785 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3786 more convenient now. All uses changed.
3787 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3788 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3789
3790 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3791
3792 Explicitly free restriction data that are not needed anymore.
3793 * editfns.c (save_restriction_restore): Free restriction data.
3794
3795 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3796
3797 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3798 add argument, tune behavior, and adjust all callers.
3799
3800 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3801
3802 Use typedef for EMACS_INT, EMACS_UINT.
3803 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3804 than macros. This simplifies debugging in the usual case, since
3805 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3806 and it allows expressions involving EMACS_INT casts.
3807 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3808
3809 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3810
3811 * nsterm.m (ns_read_socket): Return early if there is a modal
3812 window (Bug#12043).
3813
3814 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3815
3816 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3817 that FOCUS-FRAME can be omitted.
3818
3819 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3820
3821 Adjust buffer text indirection counters at the end of Fkill_buffer.
3822 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3823 buffer is definitely dead. This should really fix an issue reported
3824 by Christoph Scholtes again. (Bug#12007).
3825 (init_buffer_once): Initialize indirection counters of
3826 buffer_defaults and buffer_local_symbols (for sanity and safety).
3827
3828 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3829
3830 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3831 and continuation glyphs on tooltip frames, leave them at zero.
3832 Avoids continued lines in tooltips. (Bug#11832)
3833
3834 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3835
3836 Simplify copy_overlay.
3837 * buffer.c (copy_overlay): Simplify. Use build_marker.
3838 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3839
3840 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3841
3842 * print.c (print_object): Don't crash when a frame's name is nil
3843 or invalid. (Bug#12025)
3844
3845 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3846 it signals an error when a tooltip frame is being created.
3847
3848 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3849
3850 Cleanup miscellaneous objects allocation and initialization.
3851 * alloc.c (allocate_misc): Change to static. Add argument to
3852 specify the subtype. Adjust comment and users.
3853 (build_overlay): New function.
3854 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3855 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3856 (allocate_misc): Remove prototype.
3857 (build_overlay): Add prototype.
3858
3859 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3860
3861 Swap buffer text indirection counters in Fbuffer_swap_text.
3862 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3863 This avoids crash reported by Christoph Scholtes at
3864 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3865
3866 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3867
3868 * nsmenu.m (Popdown_data): New struct.
3869 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3870 free Popdown_data.
3871 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3872 (initWithContentRect): Make imgView and contentView non-static
3873 and autorelease them. Also autorelease img and matrix (Bug#12005).
3874 (dealloc): Remove (Bug#12005).
3875
3876 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3877
3878 Adjust consing_since_gc when objects are explicitly freed.
3879 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3880 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3881 (free_cons, free_misc): Subtract object size from consing_since_gc.
3882
3883 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3884
3885 Simplify and cleanup markers positioning code.
3886 * marker.c (attach_marker): More useful eassert.
3887 (live_buffer, set_marker_internal): New function.
3888 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3889 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3890
3891 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3892
3893 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3894 as it's limited by the amount of memory, not by INT_MAX.
3895
3896 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3897
3898 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3899 in special-event-map. See the discussion at
3900 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3901 for the reasons.
3902
3903 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3904 info.dwItemData. Fixes crashes on 64-bit Windows.
3905 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3906
3907 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3908
3909 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3910 (conversationIdentifier): Return value is NSInteger.
3911 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3912
3913 2012-07-21 Chong Yidong <cyd@gnu.org>
3914
3915 * window.c (decode_any_window): Signal an error if the window is
3916 on a dead frame (Bug#11984).
3917
3918 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3919
3920 Add indirection counting to speed up Fkill_buffer.
3921 * buffer.h (struct buffer): New member.
3922 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3923 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3924 base buffer indirection counter.
3925 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3926 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3927 through buffer list if indirection counter is 0.
3928
3929 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3930
3931 Extend the value returned by Fgarbage_collect with heap statistics.
3932 * alloc.c (Qheap): New symbol.
3933 (syms_of_alloc): DEFSYM it.
3934 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3935 (Fmemory_free): Remove.
3936 (syms_of_alloc): Don't defsubr it.
3937 * buffer.c (Fcompact_buffer): Remove.
3938 (syms_of_buffer): Don't defsubr it.
3939
3940 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3941
3942 Make maybe_gc inline.
3943 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3944 * lisp.h (consing_since_gc, gc_relative_threshold)
3945 (memory_full_cons_threshold): Revert declaration.
3946 (maybe_gc): Remove prototype, define as inline.
3947 * alloc.c: Remove old commented-out code.
3948 (consing_since_gc, gc_relative_threshold)
3949 (memory_full_cons_threshold): Revert to global.
3950 (maybe_gc): Remove.
3951
3952 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3953
3954 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3955 * lisp.h (build_unibyte_string): New function.
3956 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3957 * sysdep.c, w32fns.c, xfns.c: Use it.
3958 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3959 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3960 Adjust users accordingly.
3961 * font.h (font_open_by_name): Adjust prototype.
3962
3963 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3964
3965 Cleanup calls to Fgarbage_collect.
3966 * lisp.h (maybe_gc): New prototype.
3967 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3968 Remove declarations.
3969 * alloc.c (maybe_gc): New function.
3970 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3971 Make them static.
3972 * bytecode.c (MAYBE_GC): Use maybe_gc.
3973 * eval.c (eval_sub, Ffuncall): Likewise.
3974 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3975 to avoid dependency from auto-save feature.
3976
3977 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3978
3979 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3980 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3981 'for_each_per_buffer_object_at'.
3982 All uses changed. It's better to use upper-case for macros that
3983 cannot be implemented as functions, to give the reader a clue
3984 that they're special.
3985
3986 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3987
3988 * alloc.c (Fgarbage_collect): Tweak docstring.
3989
3990 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3991
3992 Tweak the value returned from Fgarbage_collect again.
3993 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3994 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3995 Adjust documentation.
3996 (total_vector_bytes): Rename to total_vector_slots, adjust
3997 accounting.
3998 (total_free_vector_bytes): Rename to total_free_vector_slots,
3999 adjust accounting.
4000 (Qstring_bytes, Qvector_slots): New symbols.
4001 (syms_of_alloc): DEFSYM them.
4002
4003 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4004
4005 Buffer compaction primitive which may be used from Lisp.
4006 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4007 (syms_of_buffer): Register Fcompact_buffer.
4008 * alloc.c (Fgarbage_collect): Use compact_buffer.
4009 * buffer.h (compact_buffer): New prototype.
4010 (struct buffer_text): New member.
4011
4012 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4013
4014 New macro to iterate over all buffers, miscellaneous cleanups.
4015 * lisp.h (all_buffers): Remove declaration.
4016 * buffer.h (all_buffers): Add declaration, with comment.
4017 (for_each_buffer): New macro.
4018 * alloc.c (Fgarbage_collect, mark_object): Use it.
4019 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4020 (init_buffer): Likewise.
4021 * data.c (Fset_default): Likewise.
4022 * coding.c (code_conversion_restore): Remove redundant check
4023 for dead buffer.
4024 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4025
4026 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4027
4028 Fix bug that created negative-length intervals.
4029 * intervals.c (merge_interval_right, merge_interval_left):
4030 Do not zero out this interval if it is absorbed by its children,
4031 as this interval's total length doesn't change in that case. See
4032 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4033
4034 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4035
4036 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4037 when invoking (make-bool-vector N t) and N is a positive
4038 multiple of 8 -- the last 8 bits were mistakenly cleared.
4039
4040 Remove some struct layout assumptions in bool vectors.
4041 * alloc.c (bool_header_size): New constant.
4042 (header_size, word_size): Move earlier, as they're now used earlier.
4043 Use 'word_size' in a few more places, where it's appropriate.
4044 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4045 padding before the data member of a bool vector.
4046 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4047 than doing the check by hand with an abort ().
4048
4049 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4050
4051 * eval.c (Fdefvar): Don't check constants since we only set the var if
4052 it's not yet defined anyway (bug#11904).
4053
4054 * lisp.h (last_undo_boundary): Declare new var.
4055 * keyboard.c (command_loop_1): Set it.
4056 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4057 were auto-added by the command loop (bug#11774).
4058
4059 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4060
4061 * w32font.c (Qsymbol): Remove local definition.
4062 (syms_of_w32font): Don't DEFSYM it.
4063
4064 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4065
4066 Fix sweep_vectors to handle large bool vectors correctly.
4067 * alloc.c (sweep_vectors): Account total_vector_bytes for
4068 bool vectors larger than VBLOCK_BYTES_MAX.
4069
4070 2012-07-18 Chong Yidong <cyd@gnu.org>
4071
4072 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4073 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4074
4075 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4076
4077 Return more descriptive data from Fgarbage_collect.
4078 Suggested by Stefan Monnier in
4079 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4080 * alloc.c (bounded_number): New function.
4081 (total_buffers, total_vectors): New variable.
4082 (total_string_size): Rename to total_string_bytes, adjust users.
4083 (total_vector_size): Rename to total_vector_bytes, adjust users.
4084 (sweep_vectors): Account total_vectors and total_vector_bytes.
4085 (Fgarbage_collect): New return value. Adjust documentation.
4086 (gc_sweep): Account total_buffers.
4087 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4088 (VECTOR_SIZE): Remove.
4089 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4090 (Qinterval, Qmisc): New symbols.
4091 (syms_of_data): Initialize them.
4092 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4093 (Qcons, Qbuffer): New declarations.
4094
4095 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4096
4097 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4098 Round up, not down. Improve doc.
4099
4100 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4101
4102 Restore old code in allocate_string_data to avoid Faset breakage.
4103 Reported by Julien Danjou <julien@danjou.info> in
4104 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4105 * alloc.c (allocate_string_data): Restore old code with minor
4106 adjustments, fix comment to explain this subtle issue.
4107
4108 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4109
4110 Remove FILE_SYSTEM_CASE.
4111 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4112
4113 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4114 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4115 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4116 call-process-region passes it through expand-file-name.
4117
4118 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4119
4120 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4121
4122 Fix crash when creating indirect buffer (Bug#11917)
4123 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4124 Don't handle unbound variables specially if non-zero.
4125 (Fbuffer_local_variables): Pass zero.
4126 (clone_per_buffer_values): Pass non-zero.
4127
4128 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4129
4130 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4131 to make the loop interruptible.
4132
4133 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4134
4135 * gnutls.c (emacs_gnutls_handshake): Only retry if
4136 GNUTLS_E_INTERRUPTED.
4137
4138 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4139
4140 Cleanup and convert miscellaneous checks to eassert.
4141 * alloc.c (mark_interval): Fix comment, partially rephrase
4142 old comment from intervals.h (see below).
4143 * intervals.c (find_interval, adjust_intervals_for_insertion)
4144 (delete_interval, adjust_intervals_for_deletion)
4145 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4146 Convert to eassert.
4147 (adjust_intervals_for_insertion, make_new_interval):
4148 Remove obsolete and unused code.
4149 * intervals.h (struct interval): Remove obsolete comment.
4150 * textprotp.c (erase_properties): Remove unused code.
4151 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4152 (Fremove_list_of_text_properties): Convert to eassert.
4153
4154 2012-07-17 Chong Yidong <cyd@gnu.org>
4155
4156 * editfns.c (Finsert_char): Doc fix.
4157
4158 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4159
4160 Fix previous change to make Fmemory_free always accurate.
4161 * alloc.c (make_interval): Update total_free_intervals.
4162 (make_float): Likewise for total_free_floats.
4163 (free_cons, Fcons): Likewise for total_free_conses.
4164 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4165 Likewise for total_free_vector_bytes.
4166 (Fmake_symbol): Likewise for total_free_symbols.
4167 (bytes_free): Remove.
4168
4169 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4170
4171 Simple free memory accounting feature.
4172 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4173 (sweep_vectors): Accumulate size of free vectors.
4174 (Fgarbage_collect): Setup bytes_free.
4175 (Fmemory_free): New function.
4176 (syms_of_alloc): Register it.
4177
4178 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4179
4180 Cleanup overlays checking.
4181 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4182 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4183 eassert and OVERLAYP.
4184 (sort_overlays): Change to use OVERLAYP.
4185
4186 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4187
4188 * editfns.c (Finsert_char): Make it interactive, and make the
4189 second arg optional. Copy interactive spec and docstring from
4190 ucs-insert.
4191
4192 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4193
4194 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4195 Unlike the other wrapped functions, fabs has an unspecified
4196 effect on errno.
4197
4198 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4199
4200 * nsterm.m (keyDown): Interpret flags without left/right bits
4201 as the left key (Bug#11670).
4202
4203 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4204
4205 Remove empty and useless init functions.
4206 * lisp.h (init_character_once, init_fns, init_image)
4207 (init_filelock, init_sound): Remove prototype.
4208 * character.c (init_character_once): Remove.
4209 * filelock.c (init_filelock): Likewise.
4210 * fns.c (init_fns): Likewise.
4211 * image.c (init_image): Likewise.
4212 * sound.c (init_sound): Likewise.
4213 * emacs.c (main): Adjust accordingly.
4214
4215 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4216
4217 * gtkutil.h: Tiny cleanups.
4218 (use_old_gtk_file_dialog): Remove useless declaration.
4219 (xg_uses_old_file_dialog): Add suggested const attribute.
4220
4221 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4222
4223 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4224 (bidi_paragraph_init): Use it to limit search forward for a strong
4225 directional character in abnormally large paragraphs full of
4226 neutral or weak characters. (Bug#11943)
4227
4228 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4229
4230 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4231 the toolbar (Bug#9451).
4232 (xg_make_tool_item): Give the widget event box a transparent
4233 background.
4234
4235 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4236
4237 Cleanup basic allocation variables and functions.
4238 * alloc.c (ignore_warnings, init_intervals, init_float)
4239 (init_cons, init_symbol, init_marker): Remove.
4240 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4241 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4242 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4243 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4244 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4245 (staticidx, init_alloc_once, init_strings, free_ablock):
4246 Remove redundant initialization.
4247 * fns.c (init_weak_hash_tables): Remove.
4248 * lisp.h (init_weak_hash_tables): Remove prototype.
4249
4250 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4251
4252 Use zero_vector where appropriate.
4253 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4254 accordingly.
4255 * lisp.h (zero_vector): New declaration.
4256 * font.c (null_vector): Remove.
4257 (syms_of_font): Remove initialization and staticpro.
4258 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4259 * keymap.c (Faccessible_keymaps): Likewise.
4260
4261 2012-07-15 Leo Liu <sdl.web@gmail.com>
4262
4263 * fringe.c: Fix typo in comments.
4264
4265 2012-07-14 Leo Liu <sdl.web@gmail.com>
4266
4267 * fringe.c: Add a new bitmap exclamation-mark.
4268
4269 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4270
4271 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4272
4273 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4274 (HAVE_MENUS): Don't define, defined by editing config.in with
4275 msdos/sed2v2.inp.
4276 (GMALLOC_INHIBIT_VALLOC): Don't define.
4277 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4278
4279 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4280
4281 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4282
4283 2012-07-14 Glenn Morris <rgm@gnu.org>
4284
4285 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4286 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4287 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4288
4289 2012-07-13 Glenn Morris <rgm@gnu.org>
4290
4291 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4292
4293 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4294 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4295
4296 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4297
4298 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4299 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4300 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4301 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4302 where appropriate.
4303 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4304 as boolean expression.
4305 (x_set_window_size): Remove unused variable toolbar.
4306 (ns_get_color_default, ns_mod_to_lisp): Remove.
4307 (ns_mouse_position): Remove unused variables xchar and ychar.
4308 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4309 (ns_set_vertical_scroll_bar): Remove unused variable count.
4310 (ns_delete_terminal): Remove unused variable i.
4311 (ns_term_init): Remove unused variables r, g and b.
4312 (mouseDown): Remove unused variable window.
4313 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4314 (initFrameFromEmacs): Remove unused variable vbextra.
4315 (mouseEntered): Remove unused variables p and dpyinfo.
4316 (mouseExited): Remove unused variables p and r.
4317 (ns_define_frame_cursor, ns_clear_frame_area)
4318 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4319 (menuDown): Assign [sender tag] to variable and cast the variable.
4320
4321 * nsterm.h (menuDown): Add id as type to argument sender.
4322 (ns_display_info_for_name): Add Lisp_Object argument.
4323 (ns_term_init): Add Lisp_Object argument.
4324 (ns_map_event_to_object): Add void argument.
4325 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4326 prototype with arguments and only declare if __OBJC__.
4327 (nxatoms_of_nsselect): Add void argument.
4328 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4329 (ns_alloc_autorelease_pool): Add void argument.
4330 (ns_release_autorelease_pool): Add void* argument.
4331 (ns_get_defaults_value): Add const char* argument.
4332
4333 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4334 (initFromContents): Use SSDATA where appropriate.
4335 (ns_update_menubar): Add braces to ambigous if-else.
4336 (initWithTitle): Put () around assignment in if statement.
4337 (ns_menu_show): Remove unused variables window and keymap.
4338 (update_frame_tool_bar): Remove unused variable selected_p.
4339 (initWithContentRect): Remove unused variable this_cmd_name.
4340
4341 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4342 appropriate.
4343 (setXBMColor): Remove unused variable len.
4344 (setPixmapData): Put () around assignment in loop statement.
4345
4346 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4347 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4348 where appropriate.
4349 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4350 around assignment in loop statement.
4351 (nsfont_open): Remove unused variable i.
4352 (nsfont_open): Remove unused variable len.
4353 (nsfont_draw): Remove unused variable cs.
4354
4355 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4356 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4357 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4358 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4359 (Fns_font_name, Fns_perform_service)
4360 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4361 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4362 (ns_set_name): Remove unused variable view.
4363 (x_set_menu_bar_lines): Remove unused variable olines.
4364 (x_set_tool_bar_lines): Remove unused variable root_window.
4365 (Fns_list_colors): Put () around assignment in while statement.
4366 (Fns_perform_service): Remove unused variable len.
4367 (Fns_display_usable_bounds): Remove unused variable top.
4368 (syms_of_nsfns): Remove unused variable i.
4369
4370 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4371 memcpy (Bug#11907).
4372
4373 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4374
4375 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4376 and free it with DestroyExceptionInfo (Bug#11558).
4377
4378 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4379
4380 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4381 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4382 Set here, not in nt/config.nt.
4383
4384 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4385
4386 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4387 cursor overflow into the last glyph on display line when the right
4388 fringe is off. (Bug#11832)
4389
4390 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4391
4392 * xdisp.c (produce_special_glyphs): Now static.
4393 * dispextern.h (produce_special_glyphs): Remove decl.
4394
4395 2012-07-13 Glenn Morris <rgm@gnu.org>
4396
4397 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4398 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4399
4400 * s/usg5-4-common.h (USG, USG5):
4401 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4402 * s/sol2-6.h (SOLARIS2):
4403 * s/irix6-5.h (IRIX6_5):
4404 * s/hpux10-20.h (USG, USG5, HPUX):
4405 * s/gnu-linux.h (USG, GNU_LINUX):
4406 * s/freebsd.h (BSD_SYSTEM):
4407 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4408 * s/cygwin.h (CYGWIN):
4409 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4410 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4411
4412 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4413
4414 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4415
4416 2012-07-13 Glenn Morris <rgm@gnu.org>
4417
4418 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4419
4420 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4421
4422 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4423 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4424
4425 2012-07-12 Glenn Morris <rgm@gnu.org>
4426
4427 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4428
4429 * process.c (init_process_emacs): Rename from init_process.
4430 The old name is also the name of a Mach system call.
4431 * lisp.h, emacs.c: Update for this name change.
4432 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4433 longer needed.
4434
4435 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4436
4437 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4438 memmove call that removes glyphs covered by the left truncation
4439 glyph. Improve commentary.
4440 (display_line): Fix display of continuation glyphs on GUI frames
4441 when the right fringe is turned off and variable-size fonts are
4442 used in the window. Move the code that appends a stretch glyph to
4443 produce_special_glyphs, so that it could be used for truncation
4444 and continuation glyphs alike.
4445 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4446 glyph of a suitably computed width, to align the special glyphs at
4447 the window margin. Code moved from display_line. (Bug#11832)
4448
4449 2012-07-12 Glenn Morris <rgm@gnu.org>
4450
4451 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4452
4453 * s/gnu-linux.h, s/hpux10-20.h:
4454 Do not unconditionally define HAVE_XRMSETDATABASE.
4455
4456 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4457
4458 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4459
4460 Fix typos that broke OS X build.
4461 Reported by Randal L. Schwartz in
4462 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4463 * nsterm.m (ns_timeout): Add missing local decl.
4464 (ns_get_color): snprintf -> sprintf, to fix typo.
4465
4466 2012-07-12 Glenn Morris <rgm@gnu.org>
4467
4468 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4469 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4470 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4471 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4472
4473 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4474 Move PTY_OPEN to configure.
4475
4476 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4477 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4478 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4479
4480 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4481
4482 Use empty_unibyte_string where applicable.
4483 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4484 * lread.c (read1): Likewise.
4485 * xsettings.c (syms_of_xsettings): Likewise.
4486
4487 2012-07-12 Glenn Morris <rgm@gnu.org>
4488
4489 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4490 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4491 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4492 * s/hpux10-20.h (RUN_TIME_REMAP):
4493 * s/bsd-common.h (TABDLY): Move to configure.
4494
4495 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4496
4497 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4498
4499 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4500 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4501
4502 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4503
4504 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4505 * s/template.h: Move NARROWPROTO to configure.
4506
4507 2012-07-11 Glenn Morris <rgm@gnu.org>
4508
4509 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4510 unused since 2011-01-17 change to systty.h.
4511
4512 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4513 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4514 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4515
4516 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4517
4518 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4519
4520 2012-07-11 Glenn Morris <rgm@gnu.org>
4521
4522 * s/darwin.h, s/gnu-linux.h, s/template.h:
4523 Move INTERRUPT_INPUT to configure.
4524
4525 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4526
4527 Minor adjustments to interning code.
4528 * lisp.h (intern, intern_c_string): Redefine as static inline
4529 wrappers for intern_1 and intern_c_string_1, respectively.
4530 (intern_1, intern_c_string_1): Rename prototypes.
4531 * lread.c (intern_1, intern_c_string_1, oblookup):
4532 Simplify Vobarray checking.
4533 * font.c (font_intern_prop): Likewise. Adjust comment.
4534 * w32font.c (intern_font_name): Likewise.
4535
4536 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4537
4538 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4539
4540 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4541 of Fcar/Fcdr if possible.
4542 * font.c (check_otf_features): Likewise.
4543 * fontset.c (Fnew_fontset): Likewise.
4544 * gnutls.c (Fgnutls_boot): Likewise.
4545 * minibuf.c (read_minibuf): Likewise.
4546 * msdos.c (IT_set_frame_parameters): Likewise.
4547 * xmenu.c (Fx_popup_dialog): Likewise.
4548 * w32menu.c (Fx_popup_dialog): Likewise.
4549
4550 2012-07-11 Glenn Morris <rgm@gnu.org>
4551
4552 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4553 since nothing has defined it on these platforms.
4554
4555 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4556 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4557
4558 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4559 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4560 Move CLASH_DETECTION to configure.
4561
4562 * s/gnu.h: Remove file, which is now empty.
4563
4564 * s/gnu.h, s/gnu-linux.h:
4565 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4566
4567 2012-07-11 John Wiegley <johnw@newartisans.com>
4568
4569 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4570 function attribute, so we only use it if it exists in the
4571 compiler.
4572
4573 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4574
4575 Avoid call to strlen in fast_c_string_match_ignore_case.
4576 * search.c (fast_c_string_match_ignore_case): Change to use
4577 length argument. Adjust users accordingly.
4578 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4579
4580 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4581
4582 Assume mkdir, rmdir.
4583 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4584 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4585
4586 Assume rename.
4587 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4588
4589 Assume perror.
4590 * s/hpux10-20.h (HAVE_PERROR): Remove.
4591 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4592 Remove dummy definition, as this problem was obsolete long ago.
4593
4594 Assume strerror.
4595 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4596
4597 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4598
4599 Avoid calls to strlen in font processing functions.
4600 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4601 (font_open_by_name): Change to use length argument.
4602 Adjust users accordingly.
4603 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4604 Adjust prototypes.
4605 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4606 Change to return ptrdiff_t.
4607 (xfont_list_pattern, xfont_match): Use length returned by
4608 xfont_decode_coding_xlfd.
4609 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4610
4611 2012-07-11 Glenn Morris <rgm@gnu.org>
4612
4613 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4614 Move DONT_REOPEN_PTY to configure.
4615
4616 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4617 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4618
4619 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4620
4621 Remove "#define unix" that is no longer needed (Bug#11905).
4622 * s/aix4-2.h (unix): Remove; no longer needed.
4623
4624 EMACS_TIME simplification (Bug#11875).
4625 This replaces macros (which typically do not work in GDB)
4626 with functions, typedefs and enums, making the code easier to debug.
4627 The functional style also makes code easier to read and maintain.
4628 * systime.h: Include <sys/time.h> on all hosts, not just if
4629 WINDOWSNT, since 'struct timeval' is needed in general.
4630 (EMACS_TIME): Now a typedef, not a macro.
4631 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4632 not macros.
4633 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4634 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4635 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4636 (EMACS_TIME_LE): Now functions, not macros.
4637 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4638 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4639 which are not functions. All uses rewritten to use:
4640 (make_emacs_time): New function.
4641 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4642 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4643 not functions. All uses rewritten to use the following, respectively:
4644 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4645 (add_emacs_time, sub_emacs_time): New functions.
4646 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4647 * fileio.c (Fcopy_file):
4648 * xterm.c (XTflash): Get the current time closer to when it's used.
4649 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4650
4651 * bytecode.c (targets): Suppress -Woverride-init warnings.
4652
4653 Simplify by avoiding confusing use of strncpy etc.
4654 * doc.c (Fsnarf_documentation):
4655 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4656 * frame.c (Fmake_terminal_frame):
4657 * gtkutil.c (get_utf8_string):
4658 * lread.c (openp):
4659 * nsmenu.m (ns_update_menubar):
4660 * regex.c (regerror):
4661 Prefer memcpy to strncpy and strncat when either will do.
4662 * fileio.c (Fsubstitute_in_file_name):
4663 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4664 (menu_separator_name_p):
4665 * nsmenu.m (ns_update_menubar):
4666 Prefer memcmp to strncmp when either will do.
4667 * nsterm.m: Include <ftoastr.h>.
4668 (ns_get_color):
4669 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4670 Prefer snprintf to strncpy.
4671 * nsterm.m (ns_term_init):
4672 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4673 * nsterm.m (ns_term_init):
4674 Avoid the need for strncpy, by using build_string or
4675 make_unibyte_string directly. Use dtoastr, not snprintf.
4676 * process.c (Fmake_network_process): Diagnose service names that
4677 are too long, rather than silently truncating them or creating
4678 non-null-terminated names.
4679 (Fnetwork_interface_info): Likewise, for interface names.
4680 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4681 Prefer sprintf to strncat.
4682 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4683 Prefer vsnprintf to vsprintf + strncpy.
4684
4685 2012-07-10 Glenn Morris <rgm@gnu.org>
4686
4687 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4688 Clarify fallback case.
4689
4690 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4691
4692 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4693 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4694 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4695 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4696 where argument type is known to be a Lisp_Cons.
4697
4698 2012-07-10 Tom Tromey <tromey@redhat.com>
4699
4700 * bytecode.c (BYTE_CODE_THREADED): New macro.
4701 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4702 (enum byte_code_op): New type.
4703 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4704 (exec_byte_code): Use them. Use token threading when applicable.
4705
4706 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4707
4708 Optimize pure C strings initialization.
4709 * lisp.h (make_pure_string): Fix prototype.
4710 (build_pure_c_string): New function, defined as static inline. This
4711 provides a better opportunity to optimize away calls to strlen when
4712 the function is called with compile-time constant argument.
4713 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4714 argument, adjust users accordingly. Use build_pure_c_string where
4715 appropriate.
4716 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4717 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4718 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4719
4720 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4721
4722 Avoid calls to strlen in miscellaneous functions.
4723 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4724 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4725 * lread.c (openp): Likewise.
4726
4727 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4728
4729 Avoid calls to strlen in path processing functions.
4730 * fileio.c (file_name_as_directory): Add comment. Change to add
4731 srclen argument and return the length of result. Adjust users
4732 accordingly.
4733 (directory_file_name): Fix comment. Change to add srclen argument,
4734 swap 1st and 2nd arguments to obey the common convention.
4735 Adjust users accordingly.
4736 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4737
4738 2012-07-10 Glenn Morris <rgm@gnu.org>
4739
4740 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4741 Move PENDING_OUTPUT_COUNT definition to configure.
4742
4743 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4744 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4745 * s/gnu.h (DATA_START): Move definitions to configure.
4746
4747 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4748 We include usg5-4-common.h, which defines them both.
4749
4750 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4751 O_RDONLY already includes it).
4752
4753 Stop ns builds setting the EMACSLOADPATH environment variable.
4754 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4755 Now it does not set EMACSLOADPATH, just returns the load-path string.
4756 * nsterm.h: Update accordingly.
4757 * lread.c [HAVE_NS]: Include nsterm.h.
4758 (init_lread) [HAVE_NS]: Use ns_load_path.
4759 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4760
4761 2012-07-09 Glenn Morris <rgm@gnu.org>
4762
4763 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4764 since the included bsd-common.h does so.
4765
4766 Stop ns builds setting the EMACSPATH environment variable.
4767 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4768 (ns_init_paths): Do not set EMACSPATH.
4769 * nsterm.h (ns_exec_path): Add it.
4770 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4771 Use ns_exec_path.
4772
4773 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4774
4775 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4776
4777 * process.c (wait_reading_process_output): 'waitchannels' was unset
4778 when read_kbd || !NILP (wait_for_cell); fix this.
4779
4780 Add GCC-style 'const' attribute to functions that can use it.
4781 * character.h (char_resolve_modifier_mask):
4782 * keyboard.h (make_ctrl_char):
4783 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4784 (init_character_once, next_almost_prime, init_fns, init_image)
4785 (flush_pending_output, init_sound):
4786 * mem-limits.h (start_of_data):
4787 * menu.h (finish_menu_items):
4788 Add ATTRIBUTE_CONST.
4789 * emacs.c (DEFINE_DUMMY_FUNCTION):
4790 Declare the dummy function with ATTRIBUTE_CONST.
4791 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4792 Add decls with ATTRIBUTE_CONST.
4793
4794 Minor improvements to make_formatted_string.
4795 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4796 where int is good enough, as vsprintf returns an int.
4797 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4798
4799 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4800
4801 Use make_formatted_string to avoid double length calculation.
4802 * lisp.h (make_formatted_string): New prototype.
4803 * alloc.c (make_formatted_string): New function.
4804 * buffer.c (Fgenerate_new_buffer_name): Use it.
4805 * dbus.c (syms_of_dbusbind): Likewise.
4806 * editfns.c (Fcurrent_time_zone): Likewise.
4807 * filelock.c (get_boot_time): Likewise.
4808 * frame.c (make_terminal_frame, set_term_frame_name)
4809 (x_report_frame_params): Likewise.
4810 * image.c (gs_load): Likewise.
4811 * minibuf.c (get_minibuffer): Likewise.
4812 * msdos.c (dos_set_window_size): Likewise.
4813 * process.c (make_process): Likewise.
4814 * xdisp.c (ensure_echo_area_buffers): Likewise.
4815 * xsettings.c (apply_xft_settings): Likewise.
4816
4817 2012-07-09 Glenn Morris <rgm@gnu.org>
4818
4819 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4820 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4821 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4822 * nsterm.h (ns_etc_directory): Add it.
4823 * callproc.c [HAVE_NS]: Include nsterm.h.
4824 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4825
4826 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4827
4828 Move marker debugging code under MARKER_DEBUG.
4829 * marker.c (MARKER_DEBUG): Move marker debugging code under
4830 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4831 for bootstrap with --enable-checking (~3x slowdown reported
4832 by Juanma Barranquero <lekktu@gmail.com>).
4833 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4834
4835 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4836
4837 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4838 See <http://bugs.gnu.org/11825#29>.
4839
4840 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4841
4842 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4843 has no font, use the frame's font. (Bug#11813)
4844 (display_line): Add commentary about displaying truncation glyphs
4845 on GUI frames.
4846 (produce_special_glyphs): Move here from term.c.
4847
4848 * term.c (produce_special_glyphs): Move to xdisp.c.
4849
4850 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4851 section.
4852
4853 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4854
4855 * xdisp.c (display_line): Avoid warning about implicit declaration
4856 of FRAME_FONT.
4857
4858 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4859
4860 * lisp.h: Remove empty conditional.
4861
4862 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4863
4864 * lread.c (load_path_check): Now static.
4865
4866 Fix some minor --with-ns problems found by static checking.
4867 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4868 (x_set_font) [!HAVE_X_WINDOWS]:
4869 * image.c (xpm_load_image) [HAVE_NS]:
4870 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4871 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4872 Remove unused local.
4873 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4874 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4875 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4876 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4877 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4878 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4879 Fix pointer signedness problem.
4880 * xfaces.c (FRAME_X_FONT_TABLE):
4881 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4882
4883 2012-07-07 Glenn Morris <rgm@gnu.org>
4884
4885 * lread.c (load_path_check): New function, split from init_lread.
4886 (init_lread): Reorganize. Motivation:
4887 If EMACSLOADPATH is set, check/warn about that rather than the
4888 defaults, which we are not going to use. Hence we can remove
4889 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4890 Don't warn if site-lisp directories are missing.
4891 If not installed, start from a blank load-path, since
4892 PATH_LOADSEARCH refers to the eventual installation directories.
4893
4894 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4895
4896 Support truncation and continuation glyphs on GUI frames, when
4897 fringes are disabled. (Bug#11832)
4898 * xdisp.c (init_iterator): Get dimensions of truncation and
4899 continuation glyphs even if on GUI frames.
4900 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4901 or both, are absent.
4902 (start_display, move_it_in_display_line_to): Handle the case of a
4903 GUI frame without a fringe to display continuation or truncation
4904 glyphs.
4905 (insert_left_trunc_glyphs): Support GUI frames: make sure
4906 truncation glyphs overwrite enough glyphs from the current line to
4907 have sufficient space in pixels.
4908 (display_line): Support truncation and continuation glyphs on GUI
4909 frames. If some spare pixels are left on the line after inserting
4910 the truncation glyphs, fill that space with a stretch glyph of a
4911 suitably computed width.
4912
4913 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4914 produce_glyphs, to support GUI sessions.
4915
4916 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4917
4918 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4919
4920 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4921
4922 Do not require float-time's arg to fit in time_t (Bug#11825).
4923 This works better on hosts where time_t is unsigned, and where
4924 float-time is applied to the (negative) difference between two times.
4925 * editfns.c (decode_time_components): Last arg is now double *,
4926 not int *, and means to store all the result as a double, without
4927 worrying about whether the seconds part fits in time_t.
4928 All callers changed.
4929 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4930 All callers changed.
4931 (Ffloat_time): Do not fail merely because the specified time falls
4932 outside of time_t range.
4933
4934 2012-07-07 Glenn Morris <rgm@gnu.org>
4935
4936 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4937 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4938 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4939
4940 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4941
4942 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4943 Update dependencies.
4944
4945 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4946
4947 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4948
4949 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4950 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4951 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4952 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4953 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4954 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4955
4956 * xfont.c (compare_font_names): Redo to omit the need for casts.
4957
4958 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4959
4960 * xfns.c (Fx_change_window_property): Doc fix.
4961 * w32fns.c (Fx_change_window_property): Doc fix.
4962
4963 * w32fns.c (Fx_window_property): Accept the same arguments as the
4964 X Windows version. Doc fix.
4965 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4966
4967 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4968 Eli Zaretskii <eliz@gnu.org>
4969
4970 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4971 Windows-specific code from nt/config.nt moved here.
4972 Obsolete settings removed.
4973
4974 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4975
4976 * process.c: Avoid unnecessary calls to gettime.
4977 (wait_reading_process_output): Don't get the time of day
4978 when gobbling data immediately and not waiting, as there's no need
4979 for it in that case. This removes a FIXME.
4980
4981 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4982
4983 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4984 is defined (Bug#11768).
4985
4986 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4987
4988 Fix marker debugging code.
4989 * marker.c (byte_char_debug_check): Do not perform the check
4990 if buffer is not multibyte.
4991 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4992 Call byte_char_debug_check with correct arguments.
4993
4994 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4995
4996 Compile marker debugging code only if ENABLE_CHECKING is defined.
4997 * marker.c (byte_char_debug_check, count_markers):
4998 Use only if ENABLE_CHECKING is defined.
4999 (byte_debug_flag): Remove.
5000 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5001 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5002
5003 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5004
5005 Avoid code repetition in marker-related functions.
5006 * marker.c (attach_marker): New function.
5007 (Fset_marker, set_marker_restricted, set_marker_both)
5008 (set_marker_restricted_both): Use it.
5009 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5010 Consistently rename charno to charpos.
5011 (marker_position): Add eassert.
5012 (marker_byte_position): Convert to eassert.
5013
5014 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5015
5016 Simplify list operations in unchain_overlay and unchain_marker.
5017 * buffer.c (unchain_overlay): Simplify. Add comment.
5018 * marker.c (unchain_marker): Simplify. Fix comments.
5019
5020 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5021
5022 Introduce fast path for the widely used marker operation.
5023 * alloc.c (build_marker): New function.
5024 * lisp.h (build_marker): New prototype.
5025 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5026 * composite.c (autocmp_chars): Likewise.
5027 * editfns.c (buildmark): Remove.
5028 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5029 (save_restriction_save): Use build_marker.
5030 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5031 * window.c (save_window_save): Likewise.
5032
5033 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5034
5035 Do not use Fdelete_overlay in delete_all_overlays
5036 to avoid redundant calls to unchain_overlay.
5037 * buffer.c (drop_overlay): New function.
5038 (delete_all_overlays, Fdelete_overlay): Use it.
5039 * minibuf.c (get_minibuffer): Fix comment.
5040
5041 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5042
5043 Port to OpenBSD 5.1 amd64.
5044 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5045 This is needed for OpenBSD, and should be harmless on all BSD systems.
5046 Also, include <sys/sysctl.h>, as it should be available on all
5047 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5048 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5049 use p_pid member, not kp_proc.pid.
5050
5051 2012-07-06 Glenn Morris <rgm@gnu.org>
5052
5053 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5054
5055 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5056
5057 More xmalloc and related cleanup.
5058 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5059 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5060 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5061 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5062 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5063 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5064 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5065 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5066 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5067 * xterm.c:
5068 Omit needless casts involving void * pointers and allocation.
5069 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5070 as the former is more robust if P's type is changed.
5071 Prefer xzalloc to xmalloc + memset 0.
5072 Simplify malloc-or-realloc to realloc.
5073 Don't worry about xmalloc returning a null pointer.
5074 Prefer xstrdup to xmalloc + strcpy.
5075 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5076 growing it.
5077 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5078 alloca of a constant.
5079
5080 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5081
5082 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5083 hscroll is larger than the line width. Fixes long and futile
5084 looping inside extend_face_to_end_of_line (on a TTY) producing
5085 glyphs that are not needed and thrown away.
5086
5087 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5088
5089 * marker.c (set_marker_restricted_both): Simplify by using
5090 clip_to_bounds.
5091
5092 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5093
5094 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5095
5096 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5097
5098 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5099 not defined (Bug#11768).
5100 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5101 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5102 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5103 followed by gtk_box_set_homogeneous (Bug#11768).
5104 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5105 (update_theme_scrollbar_width, xg_create_scroll_bar):
5106 Use gtk_scrollbar_new (Bug#11768).
5107 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5108 (is_box_type): New function (Bug#11768).
5109 (xg_tool_item_stale_p): Call is_box_type.
5110 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5111 with default display (Bug#11768).
5112
5113 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5114
5115 * xdisp.c (window_hscroll_limited): New function.
5116 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5117 coordinates when window's hscroll is set to insanely large
5118 values. (Bug#11857)
5119
5120 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5121
5122 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5123 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5124
5125 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5126
5127 Cleanup xmalloc.
5128 * lisp.h (xzalloc): New prototype. Omit needless casts.
5129 * alloc.c (xzalloc): New function. Omit needless casts.
5130 * charset.c: Omit needless casts. Convert all calls to
5131 xmalloc with following memset to xzalloc.
5132 * dispnew.c: Likewise.
5133 * fringe.c: Likewise.
5134 * image.c: Likewise.
5135 * sound.c: Likewise.
5136 * term.c: Likewise.
5137 * w32fns.c: Likewise.
5138 * w32font.c: Likewise.
5139 * w32term.c: Likewise.
5140 * xfaces.c: Likewise.
5141 * xfns.c: Likewise.
5142 * xterm.c: Likewise.
5143 * atimer.c: Omit needless casts.
5144 * buffer.c: Likewise.
5145 * callproc.c: Likewise.
5146 * ccl.c: Likewise.
5147 * coding.c: Likewise.
5148 * composite.c: Likewise.
5149 * doc.c: Likewise.
5150 * doprnt.c: Likewise.
5151 * editfns.c: Likewise.
5152 * emacs.c: Likewise.
5153 * eval.c: Likewise.
5154 * filelock.c: Likewise.
5155 * fns.c: Likewise.
5156 * gtkutil.c: Likewise.
5157 * keyboard.c: Likewise.
5158 * lisp.h: Likewise.
5159 * lread.c: Likewise.
5160 * minibuf.c: Likewise.
5161 * msdos.c: Likewise.
5162 * print.c: Likewise.
5163 * process.c: Likewise.
5164 * region-cache.c: Likewise.
5165 * search.c: Likewise.
5166 * sysdep.c: Likewise.
5167 * termcap.c: Likewise.
5168 * terminal.c: Likewise.
5169 * tparam.c: Likewise.
5170 * w16select.c: Likewise.
5171 * w32.c: Likewise.
5172 * w32reg.c: Likewise.
5173 * w32select.c: Likewise.
5174 * w32uniscribe.c: Likewise.
5175 * widget.c: Likewise.
5176 * xdisp.c: Likewise.
5177 * xmenu.c: Likewise.
5178 * xrdb.c: Likewise.
5179 * xselect.c: Likewise.
5180
5181 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5182
5183 * fileio.c (time_error_value): Check the right error number.
5184 Problem reported by Troels Nielsen in
5185 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5186
5187 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5188
5189 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5190 This should be fixed in a better way; see Eli Zaretskii in
5191 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5192 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5193
5194 * fileio.c (time_error_value): Rename from special_mtime.
5195 The old name's problems were noted by Eli Zaretskii in
5196 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5197
5198 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5199 This variable's comment says Emacs needs at least one GDB-visible
5200 symbol of type enum pvec_type, to work around GDB problems.
5201 The symbol's value doesn't matter.
5202
5203 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5204 that causes compilation to fail on pre-C99 compilers.
5205
5206 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5207
5208 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5209 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5210
5211 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5212
5213 * buffer.c (init_buffer_once): Fix initialization of
5214 headers for buffer_defaults and buffer_local_symbols.
5215 Reported by Juanma Barranquero <lekktu@gmail.com>.
5216
5217 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5218
5219 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5220 * lisp.h (enum pvec_type): Use fewer bits.
5221 (PSEUDOVECTOR_SIZE_BITS): New constant.
5222 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5223 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5224 change in pvec_type.
5225 (PSEUDOVECTOR_TYPEP): New macro.
5226 (TYPED_PSEUDOVECTORP): Use it.
5227 * fns.c (internal_equal): Adapt code to extract pvectype.
5228 * emacs.c (gdb_pvec_type): Update type.
5229 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5230 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5231 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5232 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5233 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5234 abusing vector->header.next.nbytes.
5235 (live_vector_p): Use PVEC_TYPE.
5236 (mark_object): Adapt code to extract pvectype. Use switch.
5237
5238 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5239
5240 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5241 Tighten new eassert a bit.
5242
5243 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5244
5245 Fix compilation with --enable-gcc-warnings and -O1
5246 optimization level.
5247 * doprnt.c (doprnt): Change type of tem to int, initialize
5248 to avoid compiler warning. Add eassert.
5249 * search.c (simple_search): Initialize match_byte to avoid
5250 compiler warning. Add eassert.
5251
5252 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5253
5254 Avoid weird behavior with large horizontal scrolls.
5255 Without this change, for example, large hscroll values would
5256 mess up Emacs's display on Fedora 15 x86, presumably due to
5257 overflows in int calculations in the display code.
5258 Also, if buffers had long lines, Emacs would freeze.
5259 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5260 (set_window_hscroll): New function, containing the old guts of
5261 Fset_window_hscroll. Return the clipped value.
5262 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5263 This avoids the need to check against PTRDIFF_MAX.
5264
5265 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5266
5267 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5268
5269 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5270
5271 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5272
5273 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5274 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5275 since GCC 4.4.6 issues a bogus warning for them.
5276
5277 Fix bugs in file timestamp newness comparisons.
5278 * fileio.c (Ffile_newer_than_file_p):
5279 * lread.c (Fload): Use full timestamp resolution of files,
5280 not just the 1-second resolution, so that files that are only
5281 slightly newer still count as newer.
5282 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5283 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5284
5285 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5286
5287 * fileio.c: Improve handling of file time marker. (Bug#11852)
5288 (special_mtime): New function.
5289 (Finsert_file_contents, Fverify_visited_file_modtime):
5290 Use it to set special mtime values consistently.
5291
5292 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5293
5294 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5295 marker for non-existing file. (Bug#11852)
5296
5297 2012-07-03 Glenn Morris <rgm@gnu.org>
5298
5299 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5300 and did not make it into globals.h).
5301
5302 2012-07-03 Tom Tromey <tromey@redhat.com>
5303
5304 * window.c (Fset_window_margins, Fset_window_fringes)
5305 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5306 * textprop.c (Fprevious_property_change): No longer static.
5307 * syntax.c (Fsyntax_table_p): No longer static.
5308 * process.c (Fget_process, Fprocess_datagram_address): No longer
5309 static.
5310 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5311 * keyboard.c (Fcommand_execute): No longer static.
5312 Remove EXFUN.
5313 * insdel.c (Fcombine_after_change_execute): No longer static.
5314 * image.c (Finit_image_library): No longer static.
5315 * fileio.c (Fmake_symbolic_link): No longer static.
5316 * eval.c (Ffetch_bytecode): No longer static.
5317 * editfns.c (Fuser_full_name): No longer static.
5318 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5319 No longer static.
5320 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5321 static.
5322 * dired.c (Ffile_attributes): No longer static.
5323 * composite.c (Fcomposition_get_gstring): No longer static.
5324 * callproc.c (Fgetenv_internal): No longer static.
5325
5326 * ccl.h: Remove EXFUNs.
5327 * buffer.h: Remove EXFUNs.
5328 * dispextern.h: Remove EXFUNs.
5329 * intervals.h: Remove EXFUNs.
5330 * fontset.h: Remove EXFUN.
5331 * font.h: Remove EXFUNs.
5332 * dosfns.c (system_process_attributes): Remove EXFUN.
5333 * keymap.h: Remove EXFUNs.
5334 * lisp.h: Remove EXFUNs.
5335 * w32term.h: Remove EXFUNs.
5336 * window.h: Remove EXFUNs.
5337 * xsettings.h: Remove EXFUN.
5338 * xterm.h: Remove EXFUN.
5339
5340 2012-07-03 Glenn Morris <rgm@gnu.org>
5341
5342 * lisp.h (Frandom): Make it visible to C.
5343 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5344 buffer for invisible buffers. (Bug#1229)
5345
5346 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5347
5348 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5349 values which aren't power of 2.
5350 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5351 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5352 accordingly.
5353
5354 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5355
5356 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5357
5358 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5359
5360 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5361
5362 * alloc.c (allocate_vector_block): Remove redundant
5363 calls to mallopt if DOUG_LEA_MALLOC is defined.
5364 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5365 avoid calls to mallopt if zero_vector is returned.
5366
5367 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5368
5369 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5370 is enabled, avoid dereferencing NULL current_sblock if
5371 running undumped.
5372
5373 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5374
5375 Cleanup basic buffer management.
5376 * buffer.h (struct buffer): Change layout to use generic vector
5377 marking code. Fix some comments. Change type of 'clip_changed'
5378 to bitfield. Remove unused #ifndef old.
5379 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5380 (GET_OVERLAYS_AT): Fix indentation.
5381 (for_each_per_buffer_object_at): New macro.
5382 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5383 (Fbuffer_local_variables): Use it.
5384 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5385 * alloc.c (allocate_buffer): Adjust to match new layout of
5386 struct buffer. Fix comment.
5387 (mark_overlay): New function.
5388 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5389 Lisp area of struct buffer.
5390 (mark_object): Use it. Adjust marking of misc objects
5391 and related comments.
5392
5393 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5394
5395 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5396 wrapper that is not needed because the wrapped code is a no-op (zero
5397 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5398 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5399
5400 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5401
5402 * alloc.c (mark_buffer): Simplify. Remove prototype.
5403 (mark_object): Add comment. Reorganize marking of vector-like
5404 objects. Use CHECK_LIVE for all vector-like objects except buffers
5405 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5406 Avoid redundant calls to mark_vectorlike for bool vectors.
5407
5408 2012-06-30 Glenn Morris <rgm@gnu.org>
5409
5410 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5411
5412 * epaths.in (PATH_SITELOADSEARCH): New.
5413 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5414 This is rather than relying on --enable-locallisppath elements
5415 having "site-lisp" in their names. (Bug#10208#25, 11658)
5416
5417 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5418
5419 * w32proc.c (sys_select): Accept and ignore one more argument.
5420
5421 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5422
5423 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5424 (pselect) [!MS_DOS]: Redirect to sys_select.
5425
5426 * sysdep.c: Don't include dos.h and dosfns.h.
5427
5428 * process.c (sys_select):
5429 * msdos.c (sys_select): Accept one more argument and ignore it.
5430
5431 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5432 adapt data types and code to that.
5433
5434 * dosfns.c:
5435 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5436 which clashes with the gnulib function of the same name.
5437
5438 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5439
5440 * font.c (font_style_to_value, font_style_symbolic)
5441 (font_prop_validate_style): Add type checks for values in
5442 font_style_table.
5443
5444 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5445 argument.
5446 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5447 uses.
5448
5449 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5450
5451 * xdisp.c (try_window_id): Undo last change.
5452
5453 * w32.c (getwd): Adjust commentary about startup_dir.
5454 (init_environment): Always call sys_access, even in non-MSVC
5455 builds. Don't chdir to the directory of the Emacs executable.
5456 This undoes code from 1997 which was justified by the need to
5457 "avoid conflicts when removing and renaming directories". But its
5458 downside was that every relative file name was being interpreted
5459 relative to the directory of the Emacs executable, which can never
5460 be TRT. In particular, it broke sys_access when called with
5461 relative file names.
5462 (sys_access): Map GetLastError to errno.
5463
5464 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5465
5466 * window.h (struct window): Change type of 'fringes_outside_margins'
5467 to bitfield. Fix comment. Adjust users accordingly.
5468 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5469 Adjust comment.
5470 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5471 to ptrdiff_t.
5472
5473 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5474
5475 * gnutls.c (emacs_gnutls_handshake):
5476 Add QUIT to make the loop interruptible.
5477
5478 2012-06-29 Glenn Morris <rgm@gnu.org>
5479
5480 * charset.c (init_charset): Make lack of etc/charsets fatal.
5481
5482 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5483
5484 * editfns.c (region_limit): Fix type mismatch.
5485
5486 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5487
5488 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5489 undefined. Convert from xassert to eassert.
5490 * nsmenu.m: Convert from xassert to eassert.
5491 * nsterm.m: Likewise.
5492
5493 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5494
5495 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5496
5497 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5498
5499 Avoid integer overflow on scroll-left and scroll-right.
5500 * window.c (HSCROLL_MAX): New macro.
5501 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5502 overflow when requested scroll falls outside ptrdiff_t range.
5503
5504 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5505
5506 * window.h (struct window): Change type of 'hscroll',
5507 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5508 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5509 Adjust users accordingly.
5510 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5511 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5512 from EMACS_INT to ptrdiff_t.
5513 (make_window): Omit redundant initialization.
5514
5515 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5516
5517 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5518
5519 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5520
5521 * window.h (struct window): Change type of 'use_time' and
5522 'sequence_number' from Lisp_Object to int.
5523 * frame.c (make_frame): Adjust users accordingly.
5524 * print.c (print_object): Likewise.
5525 * window.c (select_window, Fwindow_use_time, make_parent_window)
5526 (make_window): Likewise.
5527
5528 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5529
5530 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5531 enabled with --enable-checking=[all,glyphs] configure option.
5532 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5533 adjust comments accordingly.
5534 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5535 undefined, adjust comments accordingly.
5536 * image.c: Likewise.
5537 * scroll.c: Likewise.
5538 * w32fns.c: Likewise.
5539 * w32term.c: Likewise.
5540 * xdisp.c: Likewise.
5541 * xfaces.c: Likewise.
5542 * xfns.c: Likewise.
5543 * xterm.c: Likewise.
5544
5545 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5546
5547 Generalize run-time debugging checks.
5548 * dispextern.h (XASSERTS): Remove.
5549 * fontset.c (xassert): Remove.
5550 Convert from xassert to eassert.
5551 * alloc.c: Convert from xassert to eassert.
5552 * bidi.c: Likewise.
5553 * dispnew.c: Likewise.
5554 * fns.c: Likewise.
5555 * fringe.c: Likewise.
5556 * ftfont.c: Likewise.
5557 * gtkutil.c: Likewise.
5558 * image.c: Likewise.
5559 * keyboard.c: Likewise.
5560 * menu.c: Likewise.
5561 * process.c: Likewise.
5562 * scroll.c: Likewise.
5563 * sound.c: Likewise.
5564 * term.c: Likewise.
5565 * w32console.c: Likewise.
5566 * w32fns.c: Likewise.
5567 * w32term.c: Likewise.
5568 * window.c: Likewise.
5569 * xdisp.c: Likewise.
5570 * xfaces.c: Likewise.
5571 * xfns.c: Likewise.
5572 * xselect.c: Likewise.
5573 * xterm.c: Likewise.
5574
5575 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5576
5577 * fns.c (maybe_resize_hash_table): Output message when growing the
5578 purify-hashtable.
5579
5580 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5581
5582 * alloc.c (allocate_string_data): Remove dead code.
5583 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5584 avoid GCC warning about unused macro.
5585
5586 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5587
5588 * alloc.c (allocate_string): Omit intervals initialization.
5589 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5590 as in make_pure_string and make_pure_c_string.
5591
5592 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5593
5594 * alloc.c (allocate_string): Fix last change.
5595
5596 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5597
5598 * alloc.c (allocate_string): Remove two redundant calls
5599 to memset, add explicit initialization where appropriate.
5600
5601 2012-06-27 Glenn Morris <rgm@gnu.org>
5602
5603 * lisp.mk (lisp): Remove paths.elc.
5604
5605 2012-06-27 Chong Yidong <cyd@gnu.org>
5606
5607 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5608
5609 2012-06-26 John Wiegley <johnw@newartisans.com>
5610
5611 * unexmacosx.c (copy_data_segment): Add two section names used
5612 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5613
5614 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5615 when building with Clang.
5616
5617 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5618
5619 * eval.c (Fapply): Allow calling it with a single argument.
5620
5621 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5622
5623 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5624 _stricmp and _strnicmp.
5625 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5626
5627 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5628
5629 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5630 allocated window.
5631 (allocate_process): Likewise for new process.
5632 (allocate_terminal): Change to use offsetof.
5633 (allocate_frame): Likewise.
5634 * frame.c (make_frame): Omit redundant initialization.
5635 * window.c (make_parent_window): Use memset.
5636 (make_window): Omit redundant initialization.
5637 * process.c (make_process): Omit redundant initialization.
5638 * terminal.c (create_terminal): Likewise.
5639
5640 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5641
5642 * term.c (delete_tty): Remove redundant call to memset.
5643
5644 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5645
5646 * alloc.c: Remove build_string.
5647 * lisp.h: Define build_string as static inline. This provides
5648 a better opportunity to optimize away calls to strlen when the
5649 function is called with compile-time constant argument.
5650 * image.c (imagemagick_error): Convert to build_string.
5651 * w32proc.c (sys_spawnve): Likewise.
5652 * xterm.c (x_term_init): Likewise.
5653
5654 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5655
5656 Use sprintf return value instead of invoking strlen on result.
5657 In the old days this wasn't portable, since some sprintf
5658 implementations returned char *. But they died out years ago and
5659 Emacs already assumes sprintf returns int.
5660 Similarly for float_to_string.
5661 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5662 * ccl.c (ccl_driver):
5663 * character.c (string_escape_byte8):
5664 * data.c (Fnumber_to_string):
5665 * doprnt.c (doprnt):
5666 * print.c (print_object):
5667 * xdisp.c (message_dolog):
5668 * xfns.c (syms_of_xfns):
5669 Use sprintf or float_to_string result to avoid need to call strlen.
5670 * data.c (Fnumber_to_string):
5671 Use make_unibyte_string, since the string must be ASCII.
5672 * lisp.h, print.c (float_to_string): Now returns int length.
5673 * term.c (produce_glyphless_glyph):
5674 Use sprintf result rather than recomputing it.
5675
5676 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5677 * Makefile.in (ALL_CFLAGS):
5678 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5679 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5680
5681 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5682
5683 * dispextern.h (xstrcasecmp): Define to library function
5684 strcasecmp if available.
5685 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5686
5687 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5688
5689 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5690 Avoid comma operator.
5691 * menu.c (push_submenu_start, push_submenu_end)
5692 (push_left_right_boundary, push_menu_pane): Likewise.
5693 * msdos.c (dos_rawgetc): Likewise.
5694
5695 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5696
5697 * xfns.c (xic_create_fontsetname): Remove redundant calls
5698 to memset.
5699
5700 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5701
5702 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5703 sprintf already null-terminates its output.
5704
5705 * xfns.c (x_window): Remove redundant cast.
5706
5707 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5708
5709 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5710 `const char *' to `char *' to avoid compiler warning.
5711
5712 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5713
5714 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5715 instead of truncating it to 63 (admittedly a generous limit).
5716
5717 * process.c: Fix spelling and caps in comments.
5718
5719 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5720
5721 * emacs.c (setpgrp): Remove definition, unused.
5722 * sysdep.c (setpgrp): Remove definition, not used in this file.
5723
5724 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5725
5726 * makefile.w32-in: Update dependencies.
5727
5728 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5729
5730 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5731 (SYSTIME_H): Add nt/inc/sys/time.h.
5732
5733 * systime.h [WINDOWSNT]: Include sys/time.h.
5734
5735 * s/ms-w32.h (struct timespec): Definition moved from
5736 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5737
5738 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5741 * buffer.h (buffer_slot_type_mismatch):
5742 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5743 * eval.c (unwind_to_catch):
5744 * image.c (my_png_error, my_error_exit):
5745 * keyboard.c (quit_throw_to_read_char, user_error)
5746 (Fexit_recursive_edit, Fabort_recursive_edit):
5747 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5748 (wrong_type_argument, buffer_overflow, __executable_start)
5749 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5750 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5751 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5752 (fatal):
5753 (child_setup) [!DOS_NT]:
5754 * lread.c (end_of_file_error, invalid_syntax):
5755 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5756 * puresize.h (pure_write_error):
5757 * search.c (matcher_overflow):
5758 * sound.c (sound_perror, alsa_sound_perror):
5759 * sysdep.c, syssignal.h (croak):
5760 * term.c (maybe_fatal, vfatal):
5761 * textprop.c (text_read_only):
5762 * undo.c (user_error):
5763 * unexmacosx.c (unexec_error):
5764 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5765 Use _Noreturn rather than NO_RETURN.
5766 No need for separate decl merely because of _Noreturn.
5767 * sound.c (sound_warning, parse_sound):
5768 Remove unnecessary forward decls.
5769
5770 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5771
5772 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5773 * lisp.h (WAIT_READING_MAX): New macro.
5774 * dispnew.c (Fsleep_for, sit_for):
5775 * keyboard.c (kbd_buffer_get_event):
5776 * process.c (Faccept_process_output):
5777 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5778 This improves on the previous patch, which introduced a bug
5779 when time_t is unsigned and as wide as intmax_t.
5780 See <http://bugs.gnu.org/9000#51>.
5781
5782 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5783
5784 * dispnew.c (sit_for, Fsleep_for):
5785 * keyboard.c (kbd_buffer_get_event):
5786 * process.c (Faccept_process_output): Avoid compiler warnings when
5787 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5788
5789 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5790
5791 * makefile.w32-in: Update dependencies.
5792
5793 * w32.c (ltime): Add return type and declare static.
5794 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5795
5796 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5797
5798 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5799 Privately reported by Herbert J. Skuhra.
5800 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5801 All uses changed.
5802 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5803 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5804
5805 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5806
5807 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5808 last argument of make_unibyte_string.
5809
5810 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5811 language ID in the event parameters.
5812
5813 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5814 event.code, not the obscure "character set ID".
5815
5816 2012-06-23 Chong Yidong <cyd@gnu.org>
5817
5818 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5819
5820 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5821
5822 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5823 * w32.c (fdutimens): New function.
5824
5825 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5826
5827 * s/ms-w32.h (pselect): Redirect to sys_select.
5828
5829 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5830
5831 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5832 in the logic of incrementing and decrementing the value of
5833 use_relocatable_buffers.
5834
5835 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5836
5837 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5838 Privately reported by Herbert J. Skuhra.
5839 [__FreeBSD__]: Remove "*/" typo after "#include".
5840 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5841 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5842 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5843 Don't assume EMACS_TIME and struct timeval are the same type.
5844
5845 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5846
5847 Support higher-resolution time stamps (Bug#9000).
5848 The time stamps are only nanosecond-resolution at the C level,
5849 since that's the best that any real-world system supports now.
5850 But they are picosecond-resolution at the Lisp level, as that's
5851 easy, and leaves room for future OS improvements.
5852
5853 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5854 (LIBES): Use it.
5855
5856 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5857 Don't get current time unless it's needed.
5858
5859 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5860 now provides it if it's absent.
5861 (start_atimer): Port to higher-res time stamps.
5862 Check for time stamp overflow. Don't get current time more
5863 often than is needed.
5864
5865 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5866 Include systime.h, not time.h.
5867 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5868
5869 * dired.c: Include stat-time.h.
5870 (Ffile-attributes): File times now have higher resolution.
5871
5872 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5873 (struct image): Timestamp now has higher resolution.
5874
5875 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5876 has at least microseconds now. All uses removed.
5877 (update_frame, update_single_window, update_window, update_frame_1)
5878 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5879 (duration_to_sec_usec): Remove; no longer needed.
5880
5881 * editfns.c (time_overflow): Now extern.
5882 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5883 (float-time, Fformat_time_string, Fcurrent_time_string)
5884 (Fcurrent_time_zone): Accept and generate higher-resolution
5885 time stamps.
5886 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5887 (decode_time_components, lisp_seconds_argument): New functions.
5888 (make_time): Now static.
5889 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5890 Report an error if the time is invalid, rather than having the caller
5891 do that.
5892
5893 * fileio.c: Include <stat-time.h>
5894 (Fcopy_file): Copy higher-resolution time stamps.
5895 Prefer to set the time stamp via a file descriptor if that works.
5896 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5897 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5898 (Fvisited_file_modtime, Fset_visited_file_modtime):
5899 Support higher-resolution time stamps.
5900
5901 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5902
5903 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5904
5905 * image.c (prepare_image_for_display, clear_image_cache)
5906 (lookup_image): Port to higer-resolution time stamps.
5907
5908 * keyboard.c (start_polling, bind_polling_period):
5909 Check for time stamp overflow.
5910 (read_char, kbd_buffer_get_event, timer_start_idle)
5911 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5912 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5913 Port to higher-resolution time stamps. Do not assume time_t is signed.
5914 (decode_timer): New function. Timers are now vectors of length 9,
5915 not 8, to accommodate the picosecond component.
5916 (timer_check_2): Use it.
5917
5918 * nsterm.m (select_timeout, timeval_subtract): Remove.
5919 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5920 as they're a bit more accurate and handle overflow better.
5921 (ns_select): Change prototype to be compatible with pselect.
5922 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5923 * nsterm.h (ns_select): Adjust prototype.
5924
5925 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5926 us-resolution time stamps.
5927 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5928
5929 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5930
5931 * lisp.h (time_overflow): New decl.
5932 (wait_reading_process_output): First arg is now intmax_t, not int,
5933 to accommodate larger waits.
5934
5935 * process.h (struct Lisp_Process.read_output_delay):
5936 Now counts nanoseconds, not microseconds.
5937 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5938 EMACS_HAS_USECS.
5939 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5940 (wait_reading_process_output):
5941 Port to ns-resolution time stamps.
5942 (Faccept_process_output, wait_reading_process_output):
5943 Check for time stamp overflow. Do not assume time_t is signed.
5944 (select_wrapper): Remove; we now use pselect.
5945 (Fprocess_attributes): Now generates ns-resolution time stamps.
5946
5947 * sysdep.c: Include utimens.h. Don't include utime.h
5948 or worry about struct utimbuf; gnulib does that for us now.
5949 (gettimeofday): Remove; gnulib provides a substitute.
5950 (make_timeval): New function.
5951 (set_file_times): Now sets ns-resolution time stamps.
5952 New arg FD; all uses changed.
5953 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5954 (system_process_attributes):
5955 Now returns ns-resolution time stamp. All uses changed.
5956 Check for time stamp overflow.
5957
5958 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5959 provides a substitute now.
5960
5961 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5962 since it guarantees struct timespec.
5963 (EMACS_TIME): Now struct timespec, so that we can support
5964 ns-resolution time stamps.
5965 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5966 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5967 (EMACS_USECS): Remove.
5968 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5969 so multiply the arg by 1000 before storing it.
5970 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5971 New macros.
5972 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5973 Port to ns-resolution time stamps.
5974 (EMACS_TIME_NEG_P): Remove; replaced by....
5975 (EMACS_TIME_SIGN): New macro.
5976 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5977 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5978 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5979 (make_timeval, make_lisp_time, decode_time_components): New decls.
5980 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5981 that it mishandled time_t overflow. You can't compare by subtracting!
5982 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5983 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5984
5985 * term.c: Include <sys/time.h>.
5986 (timeval_to_Time): New function, for proper overflow wraparound.
5987 (term_mouse_position, term_mouse_click): Use it.
5988
5989 * undo.c (record_first_change): Support higher-resolution time stamps
5990 in the undo buffer.
5991 (Fprimitive_undo): Use them when restoring time stamps.
5992
5993 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5994 (w32_get_internal_run_time):
5995 Port to higher-resolution Emacs time stamps.
5996 (ltime): Now accepts single 64-bit integer, as that's more convenient
5997 for callers.
5998
5999 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6000
6001 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6002 for compatibility with pselect. Support ns-resolution time stamps.
6003
6004 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6005
6006 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6007 Check for time stamp overflow, and support ns-resolution time stamps.
6008
6009 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6010 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6011 (timeval_subtract): Remove; no longer needed.
6012 (XTflash, XTring_bell, x_wait_for_event):
6013 Port to ns-resolution time stamps. Don't assume time_t is signed.
6014
6015 2012-06-22 Chong Yidong <cyd@gnu.org>
6016
6017 * xdisp.c (x_consider_frame_title): Revert last change.
6018
6019 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6020
6021 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6022 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6023 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6024 staticidx goes up to 1597 out of 1600 = 0x640.)
6025
6026 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6027
6028 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6029 Otherwise, the umask might be mistakenly 0 while handling input signals.
6030
6031 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6032
6033 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6034
6035 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6036
6037 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6038 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6039 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6040 access to `contents' member of Lisp_Vector objects with AREF and ASET
6041 where appropriate.
6042
6043 2012-06-19 Chong Yidong <cyd@gnu.org>
6044
6045 * frame.c (delete_frame): When selecting a frame on a different
6046 text terminal, do not alter the terminal's top-frame.
6047
6048 * xdisp.c (format_mode_line_unwind_data): Record the target
6049 frame's selected window and its terminal's top-frame.
6050 (unwind_format_mode_line): Restore them.
6051 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6052 Callers changed.
6053 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6054 since tty frames can be explicitly named.
6055 (prepare_menu_bars): Likewise.
6056
6057 * term.c (Ftty_top_frame): New function.
6058
6059 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6060
6061 Port byte-code-meter to modern targets.
6062 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6063 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6064 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6065 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6066 (METER_1, METER_2): Simplify.
6067
6068 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6069
6070 * data.c (Fdefalias): Return `symbol' (bug#11686).
6071
6072 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6073
6074 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6075 gets killed during executing of this function (Bug#11665).
6076 Try to always return Qt when the buffer has been actually killed.
6077 (Vkill_buffer_query_functions): In doc-string say that functions
6078 run by this hook should not change the current buffer.
6079
6080 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6081
6082 Fix recently-introduced process.c problems found by static checking.
6083 * process.c (write_queue_push, write_queue_pop, send_process):
6084 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6085 (write_queue_pop): Fix pointer signedness problem.
6086 (send_process): Remove unused local.
6087
6088 2012-06-17 Chong Yidong <cyd@gnu.org>
6089
6090 * xdisp.c (redisplay_internal): No need to redisplay terminal
6091 frames that are not on top.
6092
6093 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6094
6095 * process.c (make_process): Initialize write_queue.
6096 (write_queue_push, write_queue_pop): New functions.
6097 (send_process): Use them to maintain correct ordering of process
6098 writes (Bug#10815).
6099
6100 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6101
6102 * lisp.h (eassert): Assume C89 or later.
6103 This removes the need for CHECK.
6104 (CHECK): Remove. Its comments about always evaluating its
6105 argument were confusing, as 'eassert' typically does not evaluate
6106 its argument.
6107
6108 * coding.c (produce_chars): Use ptrdiff_t, not int.
6109
6110 * xterm.c (x_draw_underwave): Check for integer overflow.
6111 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6112
6113 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6114
6115 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6116 referenced (Bug#11583).
6117
6118 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6119
6120 Implement wave-style variant of underlining.
6121 * dispextern.h (face_underline_type): New enum.
6122 (face): Add field for underline type.
6123 * nsterm.m (ns_draw_underwave): New function.
6124 (ns_draw_text_decoration): Use it.
6125 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6126 New functions.
6127 (x_draw_glyph_string): Use them.
6128 * xfaces.c (Qline, Qwave): New Lisp objects.
6129 (check_lface_attrs, merge_face_ref)
6130 (Finternal_set_lisp_face_attribute, realize_x_face):
6131 Handle wave-style underline face attributes.
6132 * xterm.c (x_draw_underwave): New function.
6133 (x_draw_glyph_string): Use it.
6134
6135 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6136
6137 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6138 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6139 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6140 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6141 ($(BLD)/w32select.$(O)): Update dependencies.
6142
6143 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6144
6145 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6146 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6147 * character.c (_fetch_multibyte_char_p): Remove.
6148 * alloc.c: Include "character.h" before "buffer.h".
6149 * bidi.c: Likewise.
6150 * buffer.c: Likewise.
6151 * bytecode.c: Likewise.
6152 * callint.c: Likewise.
6153 * callproc.c: Likewise.
6154 * casefiddle.c: Likewise.
6155 * casetab.c: Likewise.
6156 * category.c: Likewise.
6157 * cmds.c: Likewise.
6158 * coding.c: Likewise.
6159 * composite.c: Likewise.
6160 * dired.c: Likewise.
6161 * dispnew.c: Likewise.
6162 * doc.c: Likewise.
6163 * dosfns.c: Likewise.
6164 * editfns.c: Likewise.
6165 * emacs.c: Likewise.
6166 * fileio.c: Likewise.
6167 * filelock.c: Likewise.
6168 * font.c: Likewise.
6169 * fontset.c: Likewise.
6170 * fringe.c: Likewise.
6171 * indent.c: Likewise.
6172 * insdel.c: Likewise.
6173 * intervals.c: Likewise.
6174 * keyboard.c: Likewise.
6175 * keymap.c: Likewise.
6176 * lread.c: Likewise.
6177 * macros.c: Likewise.
6178 * marker.c: Likewise.
6179 * minibuf.c: Likewise.
6180 * nsfns.m: Likewise.
6181 * nsmenu.m: Likewise.
6182 * print.c: Likewise.
6183 * process.c: Likewise.
6184 * regex.c: Likewise.
6185 * region-cache.c: Likewise.
6186 * search.c: Likewise.
6187 * syntax.c: Likewise.
6188 * term.c: Likewise.
6189 * textprop.c: Likewise.
6190 * undo.c: Likewise.
6191 * unexsol.c: Likewise.
6192 * w16select.c: Likewise.
6193 * w32fns.c: Likewise.
6194 * w32menu.c: Likewise.
6195 * window.c: Likewise.
6196 * xdisp.c: Likewise.
6197 * xfns.c: Likewise.
6198 * xmenu.c: Likewise.
6199 * xml.c: Likewise.
6200 * xselect.c: Likewise.
6201
6202 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6203
6204 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6205 If all the glyphs of the glyph row came from strings, and we have no
6206 cursor positioning clues, put the cursor on the first glyph of the
6207 row.
6208 (handle_face_prop): Use chunk-relative overlay string index when
6209 indexing into it->string_overlays array. (Bug#11653)
6210 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6211 the rightmost. (Bug#11720)
6212
6213 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6214
6215 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6216 (CATEGORY_MEMBER): Enforce 1/0 value.
6217 * category.c (_temp_category_set): Remove.
6218
6219 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6220
6221 * window.c (Fdelete_other_windows_internal)
6222 (Fdelete_window_internal): Don't access frame's mouse highlight
6223 info of the initial frame. (Bug#11677)
6224
6225 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6226
6227 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6228 Assume USE_2_TAGS_FOR_INTS.
6229 (xreload): Adjust $tagmask width to match recent lisp.h change.
6230
6231 Simplify lisp.h in minor ways that should not affect code.
6232 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6233 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6234 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6235 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6236 (INTTYPEBITS): New macro, for clarity.
6237 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6238 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6239 Simplify now that USE_LSB_TAG is always defined.
6240 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6241 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6242
6243 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6244
6245 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6246
6247 2012-06-13 Glenn Morris <rgm@gnu.org>
6248
6249 * s/bsd-common.h (BSD4_3):
6250 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6251
6252 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6253
6254 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6255 instead of union.
6256 (XLI, XIL): Define.
6257 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6258 Use them.
6259 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6260 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6261 * alloc.c (widen_to_Lisp_Object): Remove.
6262 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6263 * frame.c (delete_frame): Remove outdated comment.
6264 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6265 USE_LISP_UNION_TYPE.
6266 (Fw32_unregister_hot_key): Likewise.
6267 (Fw32_toggle_lock_key): Likewise.
6268 * w32menu.c (add_menu_item): Likewise.
6269 (w32_menu_display_help): Use XIL instead of checking
6270 USE_LISP_UNION_TYPE.
6271 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6272 (init_heap): Likewise.
6273 * w32term.c (w32_read_socket): Update comment.
6274
6275 2012-06-13 Glenn Morris <rgm@gnu.org>
6276
6277 * s/usg5-4-common.h, src/s/unixware.h:
6278 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6279
6280 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6281
6282 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6283
6284 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6285 * alloc.c (make_number) [!defined make_number]:
6286 Remove, as lisp.h always defines this now.
6287 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6288 (roundup_size): Verify that it is a power of 2.
6289 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6290 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6291 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6292 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6293 USE_LSB_TAG now is always defined to be either 0 or 1.
6294 All uses changed.
6295 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6296 code works fine either way, and efficiency is not a concern here,
6297 as the union type is for debugging, not for production.
6298 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6299 Use an inline function on all platforms when using the union type,
6300 since this is simpler and 'static inline' can be used portably
6301 within Emacs now.
6302 (LISP_INITIALLY_ZERO): New macro.
6303 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6304 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6305
6306 2012-06-12 Glenn Morris <rgm@gnu.org>
6307
6308 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6309
6310 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6311
6312 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6313 Move BROKEN_SIGIO to configure.
6314
6315 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6316 Move NO_TERMIO to configure.
6317
6318 2012-06-12 Chong Yidong <cyd@gnu.org>
6319
6320 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6321 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6322 MagickExportImagePixels is undefined.
6323
6324 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6325
6326 * image.c (imagemagick_load_image): Remove unused label.
6327
6328 2012-06-11 Glenn Morris <rgm@gnu.org>
6329
6330 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6331 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6332 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6333 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6334
6335 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6336
6337 * alloc.c (make_byte_code): New function.
6338 (Fmake_byte_code): Use it. Don't purify here.
6339 * lread.c (read1): Use it as well to avoid extra allocation.
6340
6341 2012-06-11 Chong Yidong <cyd@gnu.org>
6342
6343 * image.c (imagemagick_load_image): Implement transparency.
6344
6345 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6346
6347 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6348 account for preceding backslashes. (Bug#11663)
6349
6350 2012-06-09 Chong Yidong <cyd@gnu.org>
6351
6352 * term.c: Support italics in capable terminals (Bug#9652).
6353 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6354 (turn_on_face): Output using TS_enter_italic_mode if available.
6355 Don't handle unused blinking and alt-charset cases.
6356 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6357 and tty_alt_charset_p cases.
6358 (tty_capable_p, init_tty): Support italics.
6359
6360 * termchar.h (struct tty_display_info): Add field for italics.
6361 Remove unused blink field.
6362
6363 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6364 Handle slant.
6365
6366 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6367 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6368 tty_alt_charset_p. Add tty_italic_p.
6369
6370 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6371
6372 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6373 dbus_type_is_basic if available.
6374 (xd_extract_signed, xd_extract_unsigned): Rename from
6375 extract_signed and extract_unsigned, respectively. Adapt callers.
6376
6377 2012-06-09 Chong Yidong <cyd@gnu.org>
6378
6379 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6380
6381 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6382 case (Bug#9752).
6383
6384 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6385
6386 * xdisp.c (vmessage): Treat frame message as multibyte.
6387 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6388 would generate the diagnostic "Making \302\247 buffer-local while
6389 let-bound!".
6390
6391 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6392
6393 * dispnew.c (showing_window_margins_p): Undo last change, which
6394 was done due to an inadvertent commit.
6395 (adjust_frame_glyphs_for_frame_redisplay): Do call
6396 showing_window_margins_p.
6397
6398 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6399
6400 * eval.c (Fmake_var_non_special): New primitive.
6401 (syms_of_eval): Defsubr it.
6402 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6403
6404 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6405
6406 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6407 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6408
6409 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6410
6411 * alloc.c (allocate_vectorlike): Fix last change.
6412
6413 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6414
6415 Block-based vector allocation of small vectors.
6416 * lisp.h (struct vectorlike_header): New field `nbytes',
6417 adjust comment accordingly.
6418 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6419 to denote vector blocks. Adjust users (live_vector_p,
6420 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6421 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6422 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6423 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6424 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6425 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6426 (roundup_size): New constant.
6427 (struct vector_block): New data type.
6428 (vector_blocks, vector_free_lists, zero_vector): New variables.
6429 (all_vectors): Rename to `large_vectors'.
6430 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6431 (sweep_vectors): New functions.
6432 (allocate_vectorlike): Return `zero_vector' as the only vector of
6433 0 items. Allocate new vector from block if vector size is less than
6434 or equal to VBLOCK_BYTES_MAX.
6435 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6436 (init_alloc_once): Add call to init_vectors.
6437
6438 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6439
6440 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6441
6442 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6443
6444 * doprnt.c (doprnt): Truncate multibyte char correctly.
6445 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6446 would mishandle a string argument "Xc" if X was a multibyte
6447 character of length 2: it would truncate after X's first byte
6448 rather than including all of X.
6449
6450 2012-06-06 Chong Yidong <cyd@gnu.org>
6451
6452 * buffer.c (word_wrap): Doc fix.
6453
6454 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6455
6456 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6457
6458 2012-06-03 Glenn Morris <rgm@gnu.org>
6459
6460 * xdisp.c (tool-bar-style): Doc fix.
6461
6462 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6463
6464 * Makefile.in (PAXCTL): Define.
6465 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6466 binary via PaX flags if the paxctl utility is available.
6467 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6468 Restore PaX flags to their default. (Bug#11398)
6469
6470 2012-06-03 Chong Yidong <cyd@gnu.org>
6471
6472 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6473 buffer (Bug#11226).
6474
6475 2012-06-03 Chong Yidong <cyd@gnu.org>
6476
6477 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6478 (note_mode_line_or_margin_highlight): If there is no help echo,
6479 use mode-line-default-help-echo. Handle the case where the mouse
6480 position is past the end of the mode line string.
6481
6482 * buffer.c (buffer_local_value_1): New function, split from
6483 Fbuffer_local_value; can return Qunbound.
6484 (Fbuffer_local_value): Use it.
6485 (Vmode_line_format): Docstring tweaks.
6486
6487 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6488
6489 * sysdep.c (system_process_attributes): Improve comment.
6490
6491 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6492
6493 * keyboard.c: Export real-this-command to Elisp.
6494 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6495 and DEFVAR it. Update all users.
6496
6497 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6498
6499 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6500
6501 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6502 Convert pctcpu and pctmem to Lisp float properly.
6503 Let the compiler fold better, as 100.0/0x8000 is exact.
6504
6505 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6506
6507 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6508 cons_block.
6509
6510 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6511
6512 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6513
6514 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6515
6516 For a 'struct window', replace some Lisp_Object fields to
6517 bitfields where appropriate, remove unused fields.
6518 * window.h (struct window): Remove unused 'last_mark_x' and
6519 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6520 change it's type from Lisp_Object to bitfield.
6521 Change type of 'force_start', 'optional_new_start',
6522 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6523 fields from Lisp_Object to bitfield. Adjust users accordingly.
6524
6525 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6526
6527 Pacify gcc -Wdouble-precision when using Xaw.
6528 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6529 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6530 Use 'float' consistently, rather than 'float' in most places
6531 and 'double' in a couple of places.
6532
6533 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6534
6535 * xdisp.c (handle_stop): Detect whether we have overlay strings
6536 loaded by testing it->current.overlay_string_index to be
6537 non-negative, instead of checking whether n_overlay_strings is
6538 positive. (Bug#11587)
6539
6540 2012-05-31 Chong Yidong <cyd@gnu.org>
6541
6542 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6543
6544 * doc.c (Fsubstitute_command_keys): Doc fix.
6545
6546 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6547
6548 * search.c (search_buffer): Remove calls to
6549 r_alloc_inhibit_buffer_relocation, as it is now called by
6550 maybe_unify_char, which was the cause of relocation of buffer text
6551 in bug#11519.
6552
6553 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6554
6555 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6556 for the duration of call to load_charset, to avoid problems with
6557 callers of maybe_unify_char that access buffer text through C
6558 pointers.
6559
6560 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6561 decrement the inhibition flag, instead of just setting or
6562 resetting it.
6563
6564 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6565
6566 Remove obsolete '#define static' cruft.
6567 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6568 This #undef was "temporary" in 2000; it is no longer needed
6569 now that '#define static' has gone away.
6570 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6571 (gray_bitmap_bits): Remove; no longer needed.
6572 All uses replaced with definiens.
6573 * xterm.c: Include "bitmaps/gray.xbm".
6574
6575 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6576
6577 Clean up __executable_start, monstartup when --enable-profiling.
6578 The following changes affect the code only when profiling.
6579 * dispnew.c (__executable_start): Rename from safe_bcopy.
6580 Define only on platforms that need it.
6581 * emacs.c: Include <sys/gmon.h> when profiling.
6582 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6583 (__executable_start): Remove decl, since lisp.h does it now.
6584 (safe_bcopy): Remove decl; no longer has that name.
6585 (main): Coalesce #if into single bit of code, for simplicity.
6586 Cast pointers to uintptr_t, since standard libraries want integers
6587 and not pointers.
6588 * lisp.h (__executable_start): New decl.
6589
6590 2012-05-31 Glenn Morris <rgm@gnu.org>
6591
6592 * image.c (Fimagemagick_types): Doc fix.
6593
6594 2012-05-30 Jim Meyering <meyering@redhat.com>
6595
6596 * callproc.c (Fcall_process_region): Include directory component
6597 in mkstemp error message (Bug#11586).
6598
6599 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6600
6601 * alloc.c, lisp.h (make_pure_vector): Now static.
6602
6603 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6604
6605 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6606 Move to byte-run.el.
6607 (Fautoload): Do the hash-doc more carefully.
6608 * data.c (Fdefalias): Purify definition, except for keymaps.
6609 (Qdefun): Move from eval.c.
6610 * lisp.h (Qdefun): Remove.
6611 * lread.c (read1): Tiny simplification.
6612
6613 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6614
6615 Do not create empty overlays with the evaporate property (Bug#9642).
6616 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6617 Bug#9642, but explicitly check that the buffer the overlay would
6618 be moved to is live and rearrange lines to make sure that errors
6619 will not put the overlay in an inconsistent state.
6620 (Fdelete_overlay): Cosmetics.
6621
6622 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6623
6624 * w32term.c (my_bring_window_to_top): New function.
6625 (x_raise_frame): Use handle returned by DeferWindowPos, which
6626 could be different from the original one.
6627 Call my_bring_window_to_top instead of my_set_foreground_window.
6628 (Bug#11513)
6629
6630 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6631 by calling BringWindowToTop.
6632
6633 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6634 (WM_EMACS_END): Increase by one.
6635
6636 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6637
6638 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6639 This avoids undefined behavior that might cause the eassert
6640 to not catch an out-of-range value.
6641
6642 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6643
6644 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6645 Update dependencies.
6646
6647 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6648
6649 * bidi.c (bidi_mirror_char): Fix last change.
6650
6651 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6652
6653 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6654 when referring to sectname field in printf format.
6655
6656 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6657
6658 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6659 Only r_alloc_inhibit_buffer_relocation needed to be added;
6660 the others were already declared.
6661
6662 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6663 before checking whether it's out of range. Put the check inside
6664 eassert. See
6665 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6666
6667 2012-05-27 Ken Brown <kbrown@cornell.edu>
6668
6669 * callproc.c (Fcall_process): Restore a line that was accidentally
6670 commented out in the 2011-02-13 change (bug#11547).
6671
6672 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6673
6674 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6675 defined on ralloc.c.
6676
6677 * buffer.c [REL_ALLOC]: Remove prototypes of
6678 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6679 they are now on lisp.h.
6680
6681 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6682
6683 * search.c (search_buffer): Use it to inhibit relocation of buffer
6684 text while re_search_2 is doing its job, because re_search_2 is
6685 passed C pointers to buffer text. (Bug#11519)
6686
6687 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6688 Update value to 24.
6689
6690 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6691 state after an additional call to move_it_in_display_line_to, keep
6692 the values of it->max_ascent and it->max_descent found for the
6693 entire line.
6694 (pos_visible_p): Revert the comparison against bottom_y to what it
6695 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6696 (Bug#11464)
6697
6698 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6699
6700 Fix coding-related core dumps with gcc -ftrapv.
6701 The code was computing A - B, where A and B are pointers, and B is
6702 random garbage. This can lead to core dumps on platforms that
6703 have special pointer registers, and it also leads to core dumps on
6704 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6705 A - B only when B is initialized properly.
6706 * coding.c (coding_set_source, coding_set_destination): Return void.
6707 (coding_change_source, coding_change_destinations): New functions,
6708 with the old behaviors of coding_set_source and coding_set_destination.
6709 All callers that need an offset changed to use these new functions.
6710
6711 2012-05-26 Glenn Morris <rgm@gnu.org>
6712
6713 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6714
6715 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6716
6717 Extend mouse support on W32 text-mode console.
6718 * xdisp.c (draw_row_with_mouse_face):
6719 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6720
6721 * w32console.c: Include window.h.
6722 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6723 New functions.
6724 (initialize_w32_display): Initialize mouse-highlight data.
6725
6726 * w32inevt.c: Include termchar.h and window.h.
6727 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6728 moves, call note_mouse_highlight. If help_echo changed, call
6729 gen_help_event to produce help-echo message in the echo area.
6730 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6731 highlight info.
6732
6733 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6734
6735 * lread.c (read1): Simplify slightly to avoid an overflow warning
6736 with GCC 4.7.0 on x86-64.
6737
6738 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6739
6740 * bidi.c (bidi_mirror_char): Revert last change: an int is
6741 definitely wide enough here.
6742
6743 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6744
6745 Fix integer width and related bugs (Bug#9874).
6746 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6747 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6748 (string_bytes, check_sblock, allocate_string_data):
6749 (compact_small_strings, Fmake_bool_vector, make_string)
6750 (make_unibyte_string, make_multibyte_string)
6751 (make_string_from_bytes, make_specified_string)
6752 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6753 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6754 (mark_vectorlike):
6755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6756 (allocate_pseudovector):
6757 Use int, not EMACS_INT, where int is wide enough.
6758 (inhibit_garbage_collection, Fgarbage_collect):
6759 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6760 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6761 int might not be wide enough.
6762 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6763 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6764 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6765 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6766 (bidi_level_of_next_char, bidi_move_to_visually_next):
6767 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6768 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6769 (Fkill_buffer, Fset_buffer_major_mode)
6770 (advance_to_char_boundary, Fbuffer_swap_text)
6771 (Fset_buffer_multibyte, overlays_at, overlays_in)
6772 (overlay_touches_p, struct sortvec, record_overlay_string)
6773 (overlay_strings, recenter_overlay_lists)
6774 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6775 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6776 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6777 (Foverlay_recenter, last_overlay_modification_hooks_used)
6778 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6779 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6780 (validate_region): Omit unnecessary test for b <= e,
6781 since that's guaranteed by the previous test.
6782 (adjust_overlays_for_delete): Avoid pos + length overflow.
6783 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6784 (report_overlay_modification):
6785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6786 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6787 Omit pointer cast, which isn't needed anyway, and doesn't work
6788 after the EMACS_INT -> ptrdiff_t change.
6789 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6790 * buffer.h: Adjust decls to match defn changes elsewhere.
6791 (struct buffer_text, struct buffer):
6792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6793 Use EMACS_INT, not int, where int might not be wide enough.
6794 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6795 not int, to avoid needless 32-bit limit on 64-bit hosts.
6796 (exec_byte_code): Use tighter memory-full test, one that checks
6797 for alloca overflow. Don't compute the address of the object just
6798 before an array, as that's not portable. Use EMACS_INT, not
6799 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6800 * callint.c (Fcall_interactively):
6801 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6802 * callproc.c (call_process_kill, Fcall_process):
6803 Don't assume pid_t fits into an Emacs fixnum.
6804 (call_process_cleanup, Fcall_process, child_setup):
6805 Don't assume pid_t fits into int.
6806 (call_process_cleanup, Fcall_process, delete_temp_file)
6807 (Fcall_process_region):
6808 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6809 (Fcall_process): Simplify handling of volatile integers.
6810 Use int, not EMACS_INT, where int will do.
6811 * casefiddle.c (casify_object, casify_region, operate_on_word)
6812 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6814 (casify_object): Avoid integer overflow when overallocating buffer.
6815 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6816 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6817 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6818 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6819 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6820 integers are now checked earlier. All uses replaced with XINT.
6821 (ccl_driver):
6822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6823 For CCL_MapSingle, check that content and value are in int range.
6824 (ccl_driver, Fregister_code_conversion_map):
6825 Check that Vcode_version_map_vector is a vector.
6826 (resolve_symbol_ccl_program): Check that vector header is in range.
6827 Always copy the vector, so that we can check its contents reliably
6828 now rather than having to recheck each instruction as it's being
6829 executed. Check that vector words fit in 'int'.
6830 (ccl_get_compiled_code, Fregister_ccl_program)
6831 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6832 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6833 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6834 contents are in range.
6835 (Fccl_execute_on_string): Check that status is in range.
6836 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6837 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6838 Accept and return EMACS_INT, not int, because callers can pass values
6839 out of 'int' range.
6840 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6841 (multibyte_chars_in_text, parse_str_as_multibyte)
6842 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6843 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6844 (string_escape_byte8, Fget_byte):
6845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6846 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6847 avoid mishandling large integers.
6848 * character.h: Adjust decls to match defn changes elsewhere.
6849 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6850 (Ffind_charset_region):
6851 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6852 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6853 (load_charset_map_from_vector, Fdefine_charset_internal):
6854 Don't assume fixnum fits in int.
6855 (load_charset_map_from_vector, Fmap_charset_chars):
6856 Remove now-unnecessary CHECK_NATNUMs.
6857 (Fdefine_charset_internal): Check ranges here, more carefully.
6858 Don't rely on undefined behavior with signed left shift overflow.
6859 Don't assume unsigned int fits into fixnum, or that fixnum fits
6860 into unsigned int. Don't require max_code to be a valid fixnum;
6861 that's not true for gb10830 4-byte on a 32-bit host. Allow
6862 invalid_code to be a cons, for the same reason. Require code_offset
6863 to be a character. Avoid int overflow if max_char is close
6864 to INT_MAX.
6865 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6866 this is intended anyway and avoids some undefined behavior.
6867 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6868 INDEX_TO_CODE_POINT, as that's what it expects.
6869 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6870 * charset.h (DECODE_CHAR): Return int, not unsigned;
6871 this is what was intended anyway, and it avoids undefined behavior.
6872 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6873 integer-overflow issues.
6874 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6875 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6876 where the argument is EMACS_INT, and this behavior is not intended.
6877 * chartab.c (Fmake_char_table, Fset_char_table_range)
6878 (uniprop_get_decoder, uniprop_get_encoder):
6879 Don't assume fixnum fits in int.
6880 * cmds.c (move_point): New function, that does the gist of
6881 Fforward_char and Fbackward_char, but does so while checking
6882 for integer overflow more accurately.
6883 (Fforward_char, Fbackward_char): Use it.
6884 (Fforward_line, Fend_of_line, internal_self_insert)
6885 (internal_self_insert):
6886 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6887 Fix a FIXME, by checking for integer overflow when calculating
6888 target_clm and actual_clm.
6889 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6890 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6891 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6892 (coding_alloc_by_making_gap, alloc_destination)
6893 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6894 (encode_coding_utf_16, detect_coding_emacs_mule)
6895 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6896 (detect_coding_iso_2022, decode_coding_iso_2022)
6897 (encode_invocation_designation, encode_designation_at_bol)
6898 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6899 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6900 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6901 (encode_coding_ccl, encode_coding_raw_text)
6902 (detect_coding_charset, decode_coding_charset)
6903 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6904 (produce_composition, produce_charset, produce_annotation)
6905 (decode_coding, handle_composition_annotation)
6906 (handle_charset_annotation, consume_chars, decode_coding_gap)
6907 (decode_coding_object, encode_coding_object, detect_coding_system)
6908 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6909 (code_convert_region, code_convert_string)
6910 (Fdefine_coding_system_internal)
6911 (coding_set_source, coding_set_destination):
6912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6913 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6914 (Fdefine_coding_system_internal):
6915 Don't assume fixnums fit in int.
6916 (decode_coding_gap, decode_coding_object, encode_coding_object)
6917 (Fread_coding_system, Fdetect_coding_region)
6918 (Funencodable_char_position, Fcheck_coding_systems_region)
6919 (get_translation, handle_composition_annotation, consume_chars):
6920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6921 (consume_chars): Rewrite to not calculate an address outside buffer.
6922 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6923 Don't access memory outside of the args array.
6924 (Fdefine_coding_system_internal): Check for charset-id overflow.
6925 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6926 result of ENCODE_CHAR.
6927 * coding.h: Adjust decls to match defn changes elsewhere.
6928 (struct coding_system):
6929 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6930 * composite.c (get_composition_id, find_composition)
6931 (run_composition_function, update_compositions)
6932 (compose_text, composition_gstring_put_cache)
6933 (composition_gstring_p, composition_gstring_width)
6934 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6935 (composition_compute_stop_pos, composition_reseat_it)
6936 (composition_update_it, struct position_record)
6937 (find_automatic_composition, composition_adjust_point)
6938 (Fcomposition_get_gstring, Ffind_composition_internal):
6939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6940 (update_compositions):
6941 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6942 * composite.h: Adjust decls to match defn changes elsewhere.
6943 (struct composition):
6944 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6945 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6946 Do not attempt to compute the address of the object just before a
6947 buffer; this is not portable.
6948 (Faref, Faset):
6949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6950 (Faset): Use int, not EMACS_INT, where int is wide enough.
6951 (Fstring_to_number): Don't assume fixnums fit in int.
6952 (Frem): Don't assume arg is nonnegative.
6953 * dbusbind.c (xd_append_arg): Check for integers out of range.
6954 (Fdbus_call_method): Don't overflow the timeout int.
6955 (extract_signed, extract_unsigned): New functions.
6956 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6957 (xd_get_connection_references): Return ptrdiff_t, not int.
6958 All uses changed.
6959 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6960 (xd_read_message_1):
6961 Use int, not unsigned, where the dbus API uses int.
6962 (Fdbus_message_internal): Don't overflow mtype.
6963 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6964 * dired.c (directory_files_internal, file_name_completion, scmp)
6965 (file_name_completion_stat):
6966 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6967 (file_name_completion): Don't overflow matchcount.
6968 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6969 * dispextern.h: Adjust decls to match defn changes elsewhere.
6970 (struct text_pos, struct glyph, struct bidi_saved_info)
6971 (struct bidi_string_data, struct bidi_it, struct composition_it)
6972 (struct it):
6973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6974 (struct display_pos, struct composition_it, struct it):
6975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6976 * dispnew.c (increment_matrix_positions)
6977 (increment_row_positions, mode_line_string)
6978 (marginal_area_string):
6979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6980 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6981 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6982 (duration_to_sec_usec): New function, to check for overflow better.
6983 (Fsleep_for, sit_for): Use it.
6984 * doc.c (get_doc_string, store_function_docstring):
6985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6986 (get_doc_string, Fsnarf_documentation):
6987 Use int, not EMACS_INT, where int is wide enough.
6988 (get_doc_string):
6989 Use SAFE_ALLOCA, not alloca.
6990 Check for overflow when converting EMACS_INT to off_t.
6991 * doprnt.c (doprnt):
6992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6993 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6994 Don't assume uid_t fits into fixnum.
6995 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6996 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6997 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6998 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6999 (general_insert_function)
7000 (Finsert_char, make_buffer_string, make_buffer_string_both)
7001 (update_buffer_properties, Fbuffer_substring)
7002 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7003 (Fsubst_char_in_region, check_translation)
7004 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7005 (transpose_markers, Ftranspose_regions):
7006 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7007 (clip_to_bounds): Move to lisp.h as an inline function).
7008 (Fconstrain_to_field): Don't assume integers are nonnegative.
7009 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7010 (Fsubst_char_in_region, Fsave_restriction):
7011 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7012 (Femacs_pid): Don't assume pid_t fits into fixnum.
7013 (lo_time): Use int, not EMACS_INT, when int suffices.
7014 (lisp_time_argument): Check for usec out of range.
7015 (Fencode_time): Don't assume fixnum fits in int.
7016 (Fuser_login_name, Fuser_full_name): Signal an error
7017 if a uid argument is out of range, rather than relying on
7018 undefined behavior.
7019 (Fformat_time_string): Remove now-unnecessary check.
7020 lisp_time_argument checks for out-of-range usec now.
7021 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7022 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7023 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7024 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7025 (init_cmdargs, Fdump_emacs):
7026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7027 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7028 the bottom (typically) 32 bits of the fixnum.
7029 * eval.c (specpdl_size, call_debugger):
7030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7031 (when_entered_debugger, Fbacktrace_debug):
7032 Don't assume fixnum can fit in int.
7033 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7034 the object just before a buffer; this is not portable.
7035 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7036 (grow_specpdl, unbind_to):
7037 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7038 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7039 (grow_specpdl): Simplify allocation by using xpalloc.
7040 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7041 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7042 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7044 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7045 (a_write, e_write):
7046 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7047 (Fcopy_file, non_regular_nbytes, read_non_regular)
7048 (Finsert_file_contents):
7049 Use int, not EMACS_INT, where int is wide enough.
7050 (READ_BUF_SIZE): Verify that it fits in int.
7051 (Finsert_file_contents): Check that counts are in proper range,
7052 rather than assuming fixnums fit into ptrdiff_t etc.
7053 Don't assume fixnums fit into int.
7054 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7055 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7056 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7057 (string_char_to_byte, string_byte_to_char)
7058 (string_make_multibyte, string_to_multibyte)
7059 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7060 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7061 (substring_both, Fdelete, internal_equal, Ffillarray)
7062 (Fclear_string, mapcar1)
7063 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7064 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7065 (larger_vector, make_hash_table, maybe_resize_hash_table)
7066 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7067 (Fmaphash, secure_hash):
7068 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7069 (concat): Check for string index and length overflow.
7070 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7071 (Frequire):
7072 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7073 (larger_vector): New API (vec, incr_min, size_max) replaces old
7074 one (vec, new_size, init). This catches size overflow.
7075 INIT was removed because it was always Qnil.
7076 All callers changed.
7077 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7078 the upper bound on a hash table index size.
7079 (make_hash_table, maybe_resize_hash_table): Use it.
7080 (secure_hash): Computer start_byte and end_byte only after
7081 they're known to be in ptrdiff_t range.
7082 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7083 (Ffont_get_glyphs, Ffont_at):
7084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7085 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7086 (Flist_fonts, Fopen_font):
7087 Don't assume fixnum can fit in int.
7088 (check_gstring): Don't assume index can fit in int.
7089 (font_match_p): Check that fixnum is a character, not a nonnegative
7090 fixnum, since the later code needs to stuff it into an int.
7091 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7092 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7093 conversion overflow issues.
7094 (Fopen_font): Check for integer out of range.
7095 (Ffont_get_glyphs): Don't assume index can fit in int.
7096 * font.h: Adjust decls to match defn changes elsewhere.
7097 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7098 integer overflow.
7099 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7100 printmax_t, where ptrdiff_t is wide enough.
7101 (Finternal_char_font):
7102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7103 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7104 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7105 (Fset_frame_position, x_set_frame_parameters)
7106 (x_set_line_spacing, x_set_border_width)
7107 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7108 Check that fixnums are in proper range for system types.
7109 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7110 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7111 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7112 Use SAFE_ALLOCA_LISP, not alloca.
7113 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7114 intptr_t is wide enough.
7115 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7116 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7117 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7118 Check for fixnum out of range.
7119 * ftfont.c (ftfont_list): Don't assume index fits in int.
7120 Check that fixnums are in proper range for system types.
7121 (ftfont_shape_by_flt):
7122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7123 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7124 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7125 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7126 Check that fixnums are in proper range for system types.
7127 * gnutls.h: Adjust decls to match defn changes elsewhere.
7128 * gtkutil.c (xg_dialog_run):
7129 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7130 (update_frame_tool_bar):
7131 Check that fixnums are in proper range for system types.
7132 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7133 (lookup_image): Check that fixnums are in range for system types.
7134 * indent.c (last_known_column, last_known_column_point):
7135 (current_column_bol_cache):
7136 (skip_invisible, current_column, check_display_width):
7137 (check_display_width, scan_for_column, current_column_1)
7138 (Findent_to, Fcurrent_indentation, position_indentation)
7139 (indented_beyond_p, Fmove_to_column, compute_motion):
7140 (Fcompute_motion, Fvertical_motion):
7141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7142 (last_known_column_modified): Use EMACS_INT, not int.
7143 (check_display_width):
7144 (Fcompute_motion):
7145 Check that fixnums and floats are in proper range for system types.
7146 (compute_motion): Don't assume index or fixnum fits in int.
7147 (compute_motion, Fcompute_motion):
7148 Use int, not EMACS_INT, when it is wide enough.
7149 (vmotion): Omit local var start_hpos that is always 0; that way
7150 we don't need to worry about overflow in expressions involving it.
7151 * indent.h: Adjust decls to match defn changes elsewhere.
7152 (struct position):
7153 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7154 Use int, not EMACS_INT, where int is wide enough.
7155 Remove unused members ovstring_chars_done and tab_offset;
7156 all uses removed.
7157 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7158 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7159 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7160 (make_gap, copy_text, insert, insert_and_inherit)
7161 (insert_before_markers, insert_before_markers_and_inherit)
7162 (insert_1, count_combining_before, count_combining_after)
7163 (insert_1_both, insert_from_string)
7164 (insert_from_string_before_markers, insert_from_string_1)
7165 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7166 (adjust_after_replace, adjust_after_insert, replace_range)
7167 (replace_range_2, del_range, del_range_1, del_range_byte)
7168 (del_range_both, del_range_2, modify_region)
7169 (prepare_to_modify_buffer, signal_before_change)
7170 (signal_after_change, Fcombine_after_change_execute):
7171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7172 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7173 (balance_an_interval, split_interval_right, split_interval_left)
7174 (find_interval, next_interval, update_interval)
7175 (adjust_intervals_for_insertion, delete_node, delete_interval)
7176 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7177 (static_offset_intervals, offset_intervals)
7178 (merge_interval_right, merge_interval_left, make_new_interval)
7179 (graft_intervals_into_buffer, temp_set_point_both)
7180 (temp_set_point, set_point, adjust_for_invis_intang)
7181 (set_point_both, move_if_not_intangible, get_property_and_range)
7182 (get_local_map, copy_intervals, copy_intervals_to_string)
7183 (compare_string_intervals, set_intervals_multibyte_1):
7184 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7185 * intervals.h: Adjust decls to match defn changes elsewhere.
7186 (struct interval):
7187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7188 * keyboard.c (this_command_key_count, this_single_command_key_start)
7189 (before_command_key_count, before_command_echo_length, echo_now)
7190 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7191 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7192 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7193 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7194 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7195 (last_non_minibuf_size, last_point_position, echo_truncate)
7196 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7197 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7198 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7199 (stuff_buffered_input):
7200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7201 (last_auto_save, command_loop_1, read_char):
7202 Use EMACS_INT, not int, to avoid integer overflow.
7203 (record_char): Avoid overflow in total_keys computation.
7204 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7205 * keyboard.h: Adjust decls to match defn changes elsewhere.
7206 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7207 (Fkey_description, Fdescribe_vector, Flookup_key):
7208 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7209 (click_position): New function, to check that positions are in range.
7210 (Fcurrent_active_maps):
7211 (describe_command):
7212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7213 (Faccessible_keymaps, Fkey_description):
7214 (preferred_sequence_p):
7215 Don't assume fixnum can fit into int.
7216 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7217 Check for integer overflow in size calculations.
7218 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7219 avoid mishandling large integers.
7220 * lisp.h: Adjust decls to match defn changes elsewhere.
7221 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7222 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7223 (struct Lisp_Marker):
7224 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7225 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7226 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7227 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7228 All callers changed.
7229 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7230 Assume the arg has valid form, since it always does.
7231 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7232 unsigned integer system type.
7233 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7234 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7235 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7236 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7237 (duration_to_sec_usec): New decl.
7238 * lread.c (read_from_string_index, read_from_string_index_byte)
7239 (read_from_string_limit, readchar, unreadchar, openp)
7240 (read_internal_start, read1, oblookup):
7241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7242 (Fload, readevalloop, Feval_buffer, Feval_region):
7243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7244 (openp): Check for out-of-range argument to 'access'.
7245 (read1): Use int, not EMACS_INT, where int is wide enough.
7246 Don't assume fixnum fits into int.
7247 Fix off-by-one error that can read outside a buffer.
7248 (read_filtered_event): Use duration_to_sec_usec
7249 to do proper overflow checking on durations.
7250 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7251 in size calculation.
7252 (Fexecute_kbd_macro):
7253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7255 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7256 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7257 (set_marker_both, set_marker_restricted_both, marker_position)
7258 (marker_byte_position, Fbuffer_has_markers_at):
7259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7260 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7261 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7262 It now merely ensures that the menu is large enough, without
7263 necessarily growing it, as this avoids some integer overflow issues.
7264 All callers changed.
7265 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7266 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7267 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7268 Use SAFE_ALLOCA_LISP, not alloca.
7269 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7270 to EMACS_INT. Check that fixnums are in proper range for system types.
7271 * minibuf.c (minibuf_prompt_width, string_to_object)
7272 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7273 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7275 (get_minibuffer, read_minibuf_unwind):
7276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7277 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7278 this simplifies overflow checking. All callers changed.
7279 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7280 (Ftest_completion):
7281 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7282 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7283 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7284 Check that fixnums are in proper range for system types.
7285 (Fx_create_frame, Fx_show_tip):
7286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7287 * nsfont.m (ns_findfonts, nsfont_list_family):
7288 Don't assume fixnum fits in long.
7289 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7290 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7291 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7292 wide enough.
7293 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7295 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7296 (PRINTDECLARE, PRINTPREPARE):
7297 (strout, print_string):
7298 (print, print_preprocess, print_check_string_charset_prop)
7299 (print_object):
7300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7301 (PRINTDECLARE):
7302 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7303 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7304 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7305 (printchar, strout): Use xpalloc to catch size calculation overflow.
7306 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7307 (print_error_message): Use SAFE_ALLOCA, not alloca.
7308 (print_object): Use int, not EMACS_INT, where int is wide enough.
7309 (print_depth, new_backquote_output, print_number_index):
7310 Use ptrdiff_t, not int, where int might not be wide enough.
7311 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7312 (Fset_process_window_size, Fformat_network_address)
7313 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7314 (sigchld_handler):
7315 Check that fixnums are in proper range for system types.
7316 (Fsignal_process): Simplify by avoiding a goto.
7317 Check for process-ids out of pid_t range rather than relying on
7318 undefined behavior.
7319 (process_tick, update_tick): Use EMACS_INT, not int.
7320 (Fformat_network_address, read_process_output, send_process)
7321 (Fprocess_send_region, status_notify):
7322 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7323 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7324 (wait_reading_process_output, read_process_output, exec_sentinel):
7325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7326 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7327 (Faccept_process_output): Use duration_to_sec_usec to do proper
7328 overflow checking on durations.
7329 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7330 Don't assume pid_t fits in int.
7331 * process.h (struct Lisp_Process): Members tick and update_tick
7332 are now of type EMACS_INT, not int.
7333 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7334 configured --with-wide-int.
7335 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7336 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7337 * search.c (looking_at_1, string_match_1):
7338 (fast_string_match, fast_c_string_match_ignore_case)
7339 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7340 (scan_newline, find_before_next_newline, search_command)
7341 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7342 (set_search_regs, wordify):
7343 (Freplace_match):
7344 (Fmatch_data):
7345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7346 (string_match_1, search_buffer, set_search_regs):
7347 (Fmatch_data):
7348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7349 (wordify): Check for overflow in size calculation.
7350 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7351 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7352 Check that fixnums are in proper range for system types.
7353 * sound.c (struct sound_device)
7354 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7356 (Fplay_sound_internal):
7357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7358 * syntax.c (struct lisp_parse_state, find_start_modiff)
7359 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7360 (Fparse_partial_sexp):
7361 Don't assume fixnums can fit in int.
7362 (struct lisp_parse_state, find_start_pos, find_start_value)
7363 (find_start_value_byte, find_start_begv)
7364 (update_syntax_table, char_quoted, dec_bytepos)
7365 (find_defun_start, prev_char_comend_first, back_comment):
7366 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7367 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7369 (Finternal_describe_syntax_value): Check that match_lisp is a
7370 character, not an integer, since the code stuffs it into int.
7371 (scan_words, scan_sexps_forward):
7372 Check that fixnums are in proper range for system types.
7373 (Fforward_word):
7374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7375 (scan_sexps_forward):
7376 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7377 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7378 * syntax.h: Adjust decls to match defn changes elsewhere.
7379 (struct gl_state_s):
7380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7381 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7382 MOST_POSITIVE_FIXNUM.
7383 * sysdep.c (wait_for_termination_1, wait_for_termination)
7384 (interruptible_wait_for_termination, mkdir):
7385 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7386 (emacs_read, emacs_write):
7387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7388 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7389 and double all fit in int.
7390 * term.c (set_tty_color_mode):
7391 Check that fixnums are in proper range for system types.
7392 * termhooks.h (struct input_event):
7393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7394 * textprop.c (validate_interval_range, interval_of)
7395 (Fadd_text_properties, set_text_properties_1)
7396 (Fremove_text_properties, Fremove_list_of_text_properties)
7397 (Ftext_property_any, Ftext_property_not_all)
7398 (copy_text_properties, text_property_list, extend_property_ranges)
7399 (verify_interval_modification):
7400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7401 (Fnext_single_char_property_change)
7402 (Fprevious_single_char_property_change):
7403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7404 (copy_text_properties):
7405 Check for integer overflow in index calculation.
7406 * undo.c (last_boundary_position, record_point, record_insert)
7407 (record_delete, record_marker_adjustment, record_change)
7408 (record_property_change):
7409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7410 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7411 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7412 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7413 (Fx_hide_tip, Fx_file_dialog):
7414 * w32menu.c (set_frame_menubar):
7415 Use ptrdiff_t, not int, for consistency with rest of code.
7416 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7417 (select_window, Fdelete_other_windows_internal)
7418 (window_scroll_pixel_based, window_scroll_line_based)
7419 (Frecenter, Fset_window_configuration):
7420 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7421 (Fset_window_hscroll, run_window_configuration_change_hook)
7422 (set_window_buffer, temp_output_buffer_show, scroll_command)
7423 (Fscroll_other_window, Frecenter):
7424 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7425 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7426 Don't assume fixnum fits in int.
7427 (Fset_window_scroll_bars):
7428 Check that fixnums are in proper range for system types.
7429 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7430 (string_pos, c_string_pos, number_of_chars, init_iterator)
7431 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7432 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7433 (compute_display_string_end, handle_face_prop)
7434 (face_before_or_after_it_pos, handle_invisible_prop)
7435 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7436 (display_prop_intangible_p, string_buffer_position_lim)
7437 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7438 (get_overlay_strings_1, get_overlay_strings)
7439 (iterate_out_of_display_property, forward_to_next_line_start)
7440 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7441 (get_next_display_element, set_iterator_to_next)
7442 (get_visually_first_element, compute_stop_pos_backwards)
7443 (handle_stop_backwards, next_element_from_buffer)
7444 (move_it_in_display_line_to, move_it_in_display_line)
7445 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7446 (add_to_log, message_dolog, message_log_check_duplicate)
7447 (message2, message2_nolog, message3, message3_nolog
7448 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7449 (current_message_1, truncate_echo_area, truncate_message_1)
7450 (set_message, set_message_1, store_mode_line_noprop)
7451 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7452 (text_outside_line_unchanged_p, check_point_in_composition)
7453 (reconsider_clip_changes)
7454 (redisplay_internal, set_cursor_from_row, try_scrolling)
7455 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7456 (redisplay_window, find_last_unchanged_at_beg_row)
7457 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7458 (trailing_whitespace_p, find_row_edges, display_line)
7459 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7460 (display_mode_element, store_mode_line_string)
7461 (pint2str, pint2hrstr, decode_mode_spec)
7462 (display_count_lines, display_string, draw_glyphs)
7463 (x_produce_glyphs, x_insert_glyphs)
7464 (rows_from_pos_range, mouse_face_from_buffer_pos)
7465 (fast_find_string_pos, mouse_face_from_string_pos)
7466 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7468 (safe_call, init_from_display_pos, handle_fontified_prop)
7469 (handle_single_display_spec, load_overlay_strings)
7470 (with_echo_area_buffer, setup_echo_area_for_printing)
7471 (display_echo_area, echo_area_display)
7472 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7473 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7474 (redisplay_window, dump_glyph_row, display_mode_line)
7475 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7476 (handle_display_spec, display_prop_string_p):
7477 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7478 (handle_single_display_spec, build_desired_tool_bar_string)
7479 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7480 (get_specified_cursor_type):
7481 Check that fixnums are in proper range for system types.
7482 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7483 (Flookup_image_map):
7484 Don't assume fixnums fit in int.
7485 (compare_overlay_entries):
7486 Avoid mishandling comparisons due to subtraction overflow.
7487 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7488 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7489 (handle_tool_bar_click):
7490 Use int, not unsigned, since we prefer signed and the signedness
7491 doesn't matter here.
7492 (get_next_display_element, next_element_from_display_vector):
7493 Use int, not EMACS_INT, when int is wide enough.
7494 (start_hourglass): Use duration_to_sec_usec to do proper
7495 overflow checking on durations.
7496 * xfaces.c (Fbitmap_spec_p):
7497 Check that fixnums are in proper range for system types.
7498 (compare_fonts_by_sort_order):
7499 Avoid mishandling comparisons due to subtraction overflow.
7500 (Fx_family_fonts, realize_basic_faces):
7501 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7502 (Fx_family_fonts):
7503 Don't assume fixnum fits in int.
7504 Use SAFE_ALLOCA_LISP, not alloca.
7505 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7506 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7507 (face_at_buffer_position, face_for_overlay_string)
7508 (face_at_string_position):
7509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7510 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7511 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7512 (Fx_show_tip):
7513 Check that fixnums are in proper range for system types.
7514 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7515 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7516 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7517 (Fx_change_window_property): Don't assume fixnums fit in int.
7518 * xfont.c (xfont_chars_supported):
7519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7520 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7521 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7522 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7523 * xml.c (parse_region):
7524 * xrdb.c (magic_file_p):
7525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7526 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7527 (x_get_local_selection, x_reply_selection_request)
7528 (x_handle_selection_request, wait_for_property_change):
7529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7530 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7531 short is wide enough.
7532 (x_send_client_event): Don't assume fixnum fits in int.
7533 * xterm.c (x_x_to_emacs_modifiers):
7534 Don't assume EMACS_INT overflows nicely into int.
7535 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7536 may come from Lisp.
7537 (handle_one_xevent): NATNUMP can eval its arg twice.
7538 (x_connection_closed):
7539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7540 * xterm.h: Adjust decls to match defn changes elsewhere.
7541 (struct scroll_bar): Use struct vectorlike_header
7542 rather than rolling our own approximation.
7543 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7544
7545 2012-05-25 Glenn Morris <rgm@gnu.org>
7546
7547 * lisp.mk (lisp): Update for more files being compiled now.
7548
7549 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7550
7551 * lread.c: Remove `read_pure' which makes no difference.
7552 (read_pure): Remove var.
7553 (unreadpure): Remove function.
7554 (readevalloop): Don't call read_list with -1 flag.
7555 (read1, read_vector): Don't test read_pure any more.
7556 (read_list): Simplify.
7557
7558 * fileio.c, character.h: Minor style tweaks.
7559
7560 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7561
7562 * window.h (clip_changed): Remove useless declaration.
7563
7564 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7565
7566 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7567 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7568
7569 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7570
7571 Remove src/m/*.
7572 This directory predates autoconf and is no longer needed nowadays.
7573 Move its few remaining bits of functionality to where they're needed.
7574 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7575 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7576 * m/template.h: Remove.
7577 * Makefile.in (M_FILE): Remove. All uses removed.
7578 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7579 * lisp.h (USE_LSB_TAG):
7580 * mem-limits.h (EXCEEDS_LISP_PTR):
7581 Use VAL_MAX, not VALBITS, in #if.
7582 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7583 (EMACS_UINT): Define unconditionally now.
7584 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7585 (BITS_PER_EMACS_INT): New constants, replacing
7586 what used to be in config.h, but not useful in #if.
7587 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7588 define them any more.
7589 (VAL_MAX): New macro.
7590 (VALMASK): Use it.
7591 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7592 BITS_PER_EMACS_INT, in #if.
7593 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7594 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7595 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7596 * s/ms-w32.h (DATA_START):
7597 Move here from removed file m/intel386.h.
7598 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7599 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7600
7601 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7602
7603 Assume C89 or later.
7604 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7605 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7606 (xrealloc):
7607 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7608 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7609 * textprop.c, tparam.c (NULL): Remove.
7610 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7611 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7612 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7613 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7614 * xterm.c (input_signal_count): Assume volatile works.
7615
7616 2012-05-21 Ken Brown <kbrown@cornell.edu>
7617
7618 * xgselect.c (xg_select): Fix first argument in call to 'select'
7619 (bug#11508).
7620
7621 2012-05-20 Ken Brown <kbrown@cornell.edu>
7622
7623 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7624 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7625
7626 2012-05-19 Ken Brown <kbrown@cornell.edu>
7627
7628 * xfns.c (x_in_use): Remove `static' qualifier.
7629 * xterm.h (x_in_use): Declare.
7630 * xgselect.c: Include xterm.h.
7631 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7632 and `display_arg' (bug#9754).
7633
7634 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7635
7636 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7637
7638 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7639 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7640
7641 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7642
7643 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7644
7645 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7646 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7647
7648 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7649 reference to image_cache->refcount.
7650 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7651
7652 2012-05-17 Juri Linkov <juri@jurta.org>
7653
7654 * search.c (Fword_search_regexp, Fword_search_backward)
7655 (Fword_search_forward, Fword_search_backward_lax)
7656 (Fword_search_forward_lax): Move functions to isearch.el
7657 (bug#10145, bug#11381).
7658
7659 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7660
7661 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7662
7663 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7664
7665 * lread.c (init_obarray): Declare Qt and Qnil as special.
7666
7667 2012-05-14 Glenn Morris <rgm@gnu.org>
7668
7669 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7670 Put "libexec" before "bin", for the sake of init_callproc_1.
7671
7672 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7673
7674 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7675
7676 * unexaix.c: Port to more-recent AIX compilers.
7677 (report_error, report_error_1, make_hdr, copy_sym)
7678 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7679 Make arguments const char *, not char *, to avoid violations of C
7680 standard and to fix some AIX warnings reported by Gilles Pion.
7681
7682 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7683
7684 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7685 already have overlays loaded.
7686 (handle_single_display_spec): Before returning without displaying
7687 fringe bitmap, synchronize the bidi iterator with the main display
7688 iterator, by calling iterate_out_of_display_property.
7689 (iterate_out_of_display_property): Detect buffer iteration by
7690 testing that it->string is a Lisp string.
7691 (get_next_display_element): When the current object is exhausted,
7692 and there's something on it->stack, call set_iterator_to_next to
7693 proceed with what's on the stack, instead of returning zero.
7694 (set_iterator_to_next): If called at the end of a Lisp string,
7695 proceed to consider_string_end without incrementing string
7696 position. Don't increment display vector index past the end of
7697 the display vector. (Bug#11417)
7698 (pos_visible_p): Don't report a position visible when move_it_to
7699 stopped at the last line of window, which happens to be scanned
7700 backwards by the bidi iteration. (Bug#11464)
7701
7702 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7703
7704 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7705 and right-margin display specs even if the spec is invalid or we
7706 are on a TTY, and thus unable to display on the fringes.
7707 That's because the text with the property will not be displayed anyway,
7708 so we need to signal to the caller that this is a "replacing"
7709 display spec. This fixes display when the spec is invalid or we
7710 are on a TTY.
7711
7712 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7713
7714 * unexaix.c (make_hdr): Fix typo in prototype.
7715 This bug broke the build on AIX. Problem reported by Gilles Pion.
7716
7717 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7718
7719 * keyboard.c (kbd_buffer_get_event): Read special events also in
7720 batch mode. (Bug#11415)
7721
7722 2012-05-12 Glenn Morris <rgm@gnu.org>
7723
7724 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7725
7726 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7727
7728 * lisp.mk (lisp): Add newcomment.elc.
7729
7730 2012-05-12 Glenn Morris <rgm@gnu.org>
7731
7732 * Makefile.in (MKDIR_P): New, set by configure.
7733 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7734
7735 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7736
7737 Remove unused function hourglass_started.
7738 * dispextern.h (hourglass_started):
7739 * w32fns.c (hourglass_started):
7740 * xdisp.c (hourglass_started): Remove.
7741
7742 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7743
7744 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7745 Update dependencies.
7746
7747 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7748
7749 * xgselect.c (xg_select): Put maxfds+1 into a var.
7750 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7751
7752 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7753
7754 2012-05-10 Dave Abrahams <dave@boostpro.com>
7755
7756 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7757 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7758
7759 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7760
7761 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7762 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7763 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7764 Initialize xd_registered_buses.
7765
7766 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7767
7768 Untag more efficiently if USE_LSB_TAG.
7769 This is based on a proposal by YAMAMOTO Mitsuharu in
7770 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7771 For an admittedly artificial (nth 8000 longlist) benchmark on
7772 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7773 Emacs's overall text size by 1%.
7774 * lisp.h (XUNTAG): New macro.
7775 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7776 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7777 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7778 * eval.c (Fautoload):
7779 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7780 * frame.h (XFRAME): Use XUNTAG.
7781
7782 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7783 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7784 Remove unportable assumptions about print widths of types like
7785 dbus_uint32_t.
7786 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7787 intptr_t when converting between pointer and integer, to avoid GCC
7788 warnings about wrong width.
7789
7790 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7791
7792 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7793 stack for each reader_thread, instead of defaulting to 8MB
7794 determined by the linker. This avoids failures in creating
7795 subprocesses on Windows 7, see the discussion in this thread:
7796 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7797
7798 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7799
7800 Fix up display of the *Minibuf-0* buffer in the mini window.
7801 * keyboard.c (read_char): Don't clear the echo area if there's no
7802 message to clear.
7803 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7804 contents of *Minibuf-0*) if there's no message displayed in its stead.
7805
7806 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7807
7808 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7809 batch mode.
7810
7811 2012-05-06 Chong Yidong <cyd@gnu.org>
7812
7813 * lisp.mk (lisp): Update.
7814
7815 2012-05-05 Jim Meyering <meyering@redhat.com>
7816
7817 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7818
7819 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7820
7821 * data.c (PUT_ERROR): New macro.
7822 (syms_of_data): Use it. Add new error type `user-error'.
7823 * undo.c (user_error): New function.
7824 (Fprimitive_undo): Use it.
7825 * print.c (print_error_message): Adjust print style for `user-error'.
7826 * keyboard.c (user_error): New function.
7827 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7828
7829 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7830
7831 Do not limit current-time-string to years 1000..9999.
7832 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7833 (Fcurrent_time_string): Support any year that is supported by the
7834 underlying localtime representation. Don't use asctime, as it
7835 has undefined behavior for years outside the range -999..9999.
7836
7837 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7838
7839 Fix race conditions involving setenv, gmtime, localtime, asctime.
7840 Without this fix, interrupts could mess up code that uses these
7841 nonreentrant functions, since setting TZ invalidates existing
7842 tm_zone or tzname values, and since most of these functions return
7843 pointers to static storage.
7844 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7845 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7846 Grow the critical sections to include not just invoking
7847 localtime/gmtime, but also accessing these functions' results
7848 including their tm_zone values if any, and any related TZ setting.
7849 (format_time_string): Last arg is now struct tm *, not struct tm **,
7850 so that the struct tm is saved in the critical section.
7851 All callers changed. Simplify allocation of initial buffer, partly
7852 motivated by the fact that memory allocation needs to be outside
7853 the critical section.
7854
7855 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7856
7857 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7858 with RESET_INTERVAL.
7859
7860 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7861 Remove duplicated buffer name initialization.
7862
7863 2012-05-02 Jim Meyering <jim@meyering.net>
7864
7865 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7866
7867 * xfns.c (x_window): Use xstrdup (Bug#11375).
7868
7869 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7870
7871 * xdisp.c (pos_visible_p): If already at a newline from the
7872 display string before the 'while' loop, don't walk back the glyphs
7873 from it3.glyph_row. Solves assertion violation when the display
7874 string begins with a newline (egg.el). (Bug#11367)
7875
7876 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7877
7878 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7879 Move to simple.el.
7880
7881 2012-05-01 Glenn Morris <rgm@gnu.org>
7882
7883 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7884 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7885 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7886 All were removed before 23.1.
7887
7888 * dispnew.c: Remove HAVE_LIBNCURSES test;
7889 it is always true on relevant platforms.
7890
7891 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7892 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7893
7894 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7895
7896 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7897
7898 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7899 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7900 Remove.
7901
7902 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7903
7904 Do not avoid creating empty evaporating overlays (Bug#9642).
7905 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7906 That is, do not delete an evaporating overlay if it becomes
7907 empty after its bounds are adjusted to fit within its buffer.
7908 This fix caused other problems, and I'm reverting it until we get
7909 to the bottom of them.
7910
7911 2012-04-27 Chong Yidong <cyd@gnu.org>
7912
7913 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7914
7915 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7916
7917 * xdisp.c (pos_visible_p): If the window start position is beyond
7918 ZV, start the display from buffer beginning. Prevents assertion
7919 violation in init_iterator when the minibuffer window is scrolled
7920 via the scroll bar.
7921
7922 * window.c (window_scroll_pixel_based): Likewise.
7923
7924 2012-04-27 Chong Yidong <cyd@gnu.org>
7925
7926 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7927
7928 2012-04-27 Glenn Morris <rgm@gnu.org>
7929
7930 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7931 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7932
7933 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7934
7935 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7936 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7937
7938 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7939
7940 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7941 display element, check also the underlying string or buffer
7942 character. (Bug#11341)
7943
7944 * w32menu.c: Include w32heap.h.
7945 (add_menu_item): If the call to AppendMenuW (via
7946 unicode_append_menu) fails, disable Unicode menus only if we are
7947 running on Windows 9X/Me.
7948
7949 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7950
7951 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7952 (xgetint): Add missing shift for LSB tags.
7953
7954 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7955
7956 * keyboard.c (read_char): Don't wipe echo area for select window
7957 events: These might get delayed via `mouse-autoselect-window'
7958 (Bug#11304).
7959
7960 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7961
7962 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7963 manipulation of :loaded-from data.
7964
7965 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7966
7967 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7968 now a cons (bug#11311).
7969
7970 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7971
7972 Do not create empty overlays with the evaporate property (Bug#9642).
7973 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7974 if it becomes empty after its bounds are adjusted to fit within
7975 its buffer. Without this fix, in a nonempty buffer (let ((o
7976 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7977 yields an empty overlay that has the evaporate property, which is
7978 not supposed to happen.
7979
7980 Fix minor GTK3 problems found by static checking.
7981 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7982 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7983 (struct _EmacsFixedClass, emacs_fixed_get_type):
7984 Move decls here from emacsgtkfixed.h, since they needn't be public.
7985 (emacs_fixed_get_type): Now static.
7986 (emacs_fixed_class_init): Omit unused local.
7987 (emacs_fixed_child_type): Remove; unused.
7988 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7989 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7990 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7991 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7992 (EMACS_FIXED_GET_CLASS): Remove; unused.
7993 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7994
7995 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7996 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7997
7998 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7999
8000 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8001 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8002 (__malloc_size_t, __malloc_ptrdiff_t):
8003 Remove. All uses removed, replaced by the definiens if needed,
8004 since we can assume C89 or better now.
8005 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8006 (protect_malloc_state, align, get_contiguous_space)
8007 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8008 (malloc_atfork_handler_child, malloc_enable_thread)
8009 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8010 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8011 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8012 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8013 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8014 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8015 Define using prototypes, not old style.
8016 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8017 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8018 (align): Don't assume that signed integer overflow wraps around.
8019 Omit unused local var.
8020 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8021 (_free_internal_nolock, memalign, mallochook, reallochook):
8022 Omit no-longer-needed casts.
8023 (valloc): Use getpagesize, not __getpagesize.
8024 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8025 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8026
8027 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8028
8029 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8030
8031 Move functions from C to Lisp. Make non-blocking method calls
8032 the default. Implement further D-Bus standard interfaces.
8033
8034 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8035 (QCdbus_request_name_allow_replacement)
8036 (QCdbus_request_name_replace_existing)
8037 (QCdbus_request_name_do_not_queue)
8038 (QCdbus_request_name_reply_primary_owner)
8039 (QCdbus_request_name_reply_in_queue)
8040 (QCdbus_request_name_reply_exists)
8041 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8042 (QCdbus_registered_serial, QCdbus_registered_method)
8043 (QCdbus_registered_signal): New Lisp objects.
8044 (XD_DEBUG_MESSAGE): Use sizeof.
8045 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8046 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8047 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8048 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8049 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8050 (xd_signature, xd_append_arg): Allow float for integer types.
8051 (xd_get_connection_references): New function.
8052 (xd_get_connection_address): Rename from xd_initialize.
8053 Return cached address.
8054 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8055 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8056 level.
8057 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8058 Return number of refcounts.
8059 (Fdbus_get_unique_name): Make stronger parameter check.
8060 (Fdbus_message_internal): New defun.
8061 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8062 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8063 (Fdbus_send_signal, Fdbus_register_service)
8064 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8065 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8066 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8067 (Vdbus_compiled_version, Vdbus_runtime_version)
8068 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8069 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8070 (Vdbus_message_type_signal): New defvars.
8071 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8072 Adapt docstring.
8073
8074 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8075
8076 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8077 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8078 Do not assume ptrdiff_t is the same width as 'int'.
8079
8080 * alloc.c: Handle unusual debugging option combinations.
8081 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8082 since the two debugging options are incompatible.
8083 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8084 is defined.
8085 (mem_init, mem_insert, mem_insert_fixup):
8086 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8087 (NEED_MEM_INSERT): Remove; no longer needed.
8088
8089 2012-04-22 Leo Liu <sdl.web@gmail.com>
8090
8091 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8092
8093 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8094
8095 * sysdep.c [__FreeBSD__]: Minor cleanups.
8096 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8097 Use Emacs indenting style more consistently. Avoid some casts.
8098 Use 'double' consistently rather than mixing 'float' and 'double'.
8099
8100 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8101
8102 * sysdep.c (list_system_processes, system_process_attributes):
8103 Add implementation for FreeBSD (Bug#5243).
8104
8105 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8106
8107 * lisp.mk (lisp): Update.
8108
8109 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8110
8111 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8112 It is never used otherwise.
8113
8114 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8115
8116 * print.c (print_preprocess): Only check print_depth if print-circle
8117 is nil.
8118 (print_object): Check for cycles even when print-circle is nil and
8119 print-gensym is t, but only check print_depth if print-circle is nil.
8120
8121 2012-04-20 Chong Yidong <cyd@gnu.org>
8122
8123 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8124 set the status to "failed" and ensure that sentinel is run.
8125
8126 2012-04-20 Glenn Morris <rgm@gnu.org>
8127
8128 * process.c (Fset_process_inherit_coding_system_flag)
8129 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8130 (Fmake_network_process, Fmake_serial_process): Doc fix.
8131
8132 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8133
8134 * xdisp.c (string_buffer_position_lim): Limit starting position to
8135 BEGV.
8136 (set_cursor_from_row): If called for a mode-line or header-line
8137 row, return zero immediately.
8138 (try_cursor_movement): If inside continuation line, don't back up
8139 farther than the first row after the header line, if any.
8140 Don't consider the header-line row as "partially visible", even if
8141 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8142
8143 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8144
8145 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8146 (bug#11238).
8147
8148 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8149 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8150
8151 configure: new option --enable-gcc-warnings (Bug#11207)
8152 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8153 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8154 (ALL_CFLAGS): Use new macros rather than old.
8155 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8156 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8157 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8158 -Wunused-result, -Wunused-variable. This should go away once
8159 the Emacs and Gnulib regex code is merged.
8160 (xmalloc, xrealloc): Now static.
8161
8162 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8163
8164 * dired.c (Fsystem_groups): Remove unused local.
8165
8166 2012-04-17 Glenn Morris <rgm@gnu.org>
8167
8168 * dired.c (Fsystem_users): Doc fix.
8169
8170 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8171
8172 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8173 (syms_of_dired): Add them.
8174
8175 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8176
8177 Fix minor alloc.c problems found by static checking.
8178 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8179 New extern decls, to avoid calling undeclared functions.
8180 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8181 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8182 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8183 (NEED_MEM_INSERT): New macro.
8184 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8185 Remove one incorrect comment and fix another.
8186
8187 Fix minor ralloc.c problems found by static checking.
8188 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8189 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8190 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8191 (r_alloc_sbrk): Now static.
8192
8193 Improve ralloc.c interface checking.
8194 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8195 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8196 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8197 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8198 [REL_ALLOC]: ... to here, to check interface.
8199 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8200 Remove decls. This fixes an "It stinks!".
8201
8202 * alloc.c (which_symbols): Fix alignment issue / type clash.
8203
8204 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8205
8206 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8207 (struct Lisp_Misc_Any): Likewise.
8208 (struct Lisp_Free): Likewise.
8209 * alloc.c (union aligned_Lisp_Symbol): Define.
8210 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8211 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8212 (union aligned_Lisp_Misc): Define.
8213 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8214 aligned_Lisp_Misc instead of union Lisp_Misc.
8215 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8216
8217 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8218
8219 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8220 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8221 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8222 * s/netbsd.h, s/sol2-6.h:
8223 Remove definition of GC_MARK_STACK, since the default now works.
8224 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8225 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8226 no longer the default.
8227 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8228
8229 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8230
8231 * lread.c (lisp_file_lexically_bound_p):
8232 Fix hang at ";-*-\n" (bug#11238).
8233
8234 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8235
8236 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8237 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8238
8239 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8240
8241 * nsterm.m (constrainFrameRect): Always constrain when there is only
8242 one screen (Bug#10962).
8243
8244 2012-04-13 Ken Brown <kbrown@cornell.edu>
8245
8246 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8247
8248 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8249
8250 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8251
8252 2012-04-11 Daniel Colascione <dancol@dancol.org>
8253
8254 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8255 against is gone. It's better to use vfork now so that when Cygwin
8256 gains a new, working vfork, we use it automatically (bug#10398).
8257
8258 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8259
8260 * window.c (save_window_save): Obey window-point-insertion-type.
8261
8262 2012-04-11 Glenn Morris <rgm@gnu.org>
8263
8264 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8265
8266 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8267
8268 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8269
8270 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8271
8272 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8273 (force_quit_count): New var.
8274 (handle_interrupt): Use it.
8275
8276 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8277
8278 * w32.c (w32_delayed_load): Record the full path of the library
8279 being loaded (bug#10424).
8280
8281 2012-04-09 Glenn Morris <rgm@gnu.org>
8282
8283 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8284 not just in the obarray, before snarfing them. (Bug#11036)
8285
8286 * Makefile.in ($(leimdir)/leim-list.el):
8287 Pass EMACS rather than BUILT_EMACS.
8288
8289 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8290
8291 * process.c (make_process):
8292 * process.h: Add integer `gnutls_handshakes_tried' member to
8293 process struct.
8294
8295 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8296 Add convenience `GNUTLS_LOG2i' macro.
8297
8298 * gnutls.c (gnutls_log_function2i): Convenience log function.
8299 (emacs_gnutls_read): Use new log functions,
8300 `gnutls_handshakes_tried' process member, and
8301 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8302 attempts per process (connection).
8303
8304 2012-04-09 Chong Yidong <cyd@gnu.org>
8305
8306 * eval.c (Fuser_variable_p, user_variable_p_eh)
8307 (lisp_indirect_variable): Functions deleted.
8308 (Fdefvar): Caller changed.
8309
8310 * callint.c (Finteractive, Fcall_interactively):
8311 * minibuf.c (Fread_variable): Callers changed.
8312
8313 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8314
8315 * xdisp.c (set_cursor_from_row): If the display string appears in
8316 the buffer at position that is closer to point than the position
8317 after the display string, display the cursor on the first glyph of
8318 the display string. Fixes cursor display when a 'display' text
8319 property immediately follows invisible text. (Bug#11094)
8320
8321 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8322
8323 composite.c: use 'double' consistently
8324 * composite.c (get_composition_id): Use 'double' consistently
8325 instead of converting 'float' to 'double' and vice versa; this is
8326 easier to understand and avoids a GCC warning.
8327
8328 2012-04-09 Glenn Morris <rgm@gnu.org>
8329
8330 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8331 preparation for dumping it with emacs. (Bug#4789)
8332 (leimdir): New variable.
8333 ($(leimdir)/leim-list.el): New rule.
8334 (emacs$(EXEEXT)): Depend on leim-list.el.
8335
8336 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8337 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8338 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8339
8340 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8341
8342 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8343 proper alignment.
8344
8345 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8346
8347 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8348 Remove unused local variable.
8349
8350 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8351
8352 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8353 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8354 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8355 objects, as mark_maybe_pointer will catch them otherwise.
8356 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8357 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8358
8359 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8360
8361 Fix typo that broke non-Windows builds.
8362 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8363
8364 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8365
8366 Support building on MS-Windows with libxml2.
8367
8368 * makefile.w32-in (OBJ2): Add xml.$(O).
8369 (GLOBAL_SOURCES): Add xml.c.
8370 ($(BLD)/xml.$(O)): New dependency list.
8371
8372 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8373 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8374 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8375 [!WINDOWSNT]: New macros.
8376 (init_libxml2_functions, libxml2_loaded_p): New functions.
8377 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8378 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8379 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8380 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8381 linked in).
8382 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8383 Call init_libxml2_functions before calling libxml2 functions.
8384 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8385
8386 * emacs.c: Don't include libxml/parser.h.
8387 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8388 xmlCleanupParser directly.
8389
8390 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8391
8392 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8393
8394 * indent.c (Fvertical_motion): If there is a display string at
8395 point, use it.vpos to compute how many lines to backtrack after
8396 move_it_to point. (Bug#11133)
8397
8398 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8399
8400 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8401 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8402 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8403 macros related to unification of CJK characters. For the details,
8404 see the discussion following the message here:
8405 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8406
8407 2012-04-04 Chong Yidong <cyd@gnu.org>
8408
8409 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8410
8411 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8412
8413 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8414 instead of alloca. (Bug#11138)
8415
8416 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8417
8418 * w32menu.c (is_simple_dialog): Properly check lisp types.
8419 (Bug#11141)
8420
8421 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8422
8423 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8424 position we get to after a call to move_it_to fails the
8425 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8426 only if we wind up in a string from display property. (Bug#11063)
8427
8428 * window.c (Fdelete_other_windows_internal): Invalidate the row
8429 and column information about mouse highlight, so that redisplay
8430 restores it after reallocating the glyph matrices. (Bug#7464)
8431
8432 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8433 string comes from a `display' text property, use the buffer
8434 position of that property as if we actually saw that position in
8435 the row's glyphs.
8436 (move_it_by_lines): Remove the assertion that
8437 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8438 violated when there's a before-string at the beginning of a line.
8439 (Bug#11063)
8440
8441 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8442
8443 * xdisp.c (append_space_for_newline): If the default face was
8444 remapped, use the remapped face for the appended newline.
8445 (extend_face_to_end_of_line): Use the remapped default face for
8446 extending the face to the end of the line.
8447 (display_line): Call extend_face_to_end_of_line when the default
8448 face was remapped. (Bug#11068)
8449
8450 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8451
8452 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8453
8454 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8455
8456 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8457
8458 2012-03-27 Glenn Morris <rgm@gnu.org>
8459
8460 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8461 Doc fixes.
8462
8463 2012-03-26 Kenichi Handa <handa@m17n.org>
8464
8465 * dispextern.h (struct glyph): Fix previous change. Change the
8466 bit length of glyphless.ch to 25 (Bug#11082).
8467
8468 2012-03-26 Chong Yidong <cyd@gnu.org>
8469
8470 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8471 (command_loop_1): Use it; inhibit selection update for
8472 handle-select-window too (Bug#8996).
8473
8474 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8475
8476 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8477
8478 2012-03-25 Kenichi Handa <handa@m17n.org>
8479
8480 * dispextern.h (struct glyph): Change the bit length of
8481 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8482
8483 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8484
8485 * s/ms-w32.h (tzname): Include time.h before redirecting to
8486 _tzname. Fixes the MSVC build. (Bug#9960)
8487
8488 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8489
8490 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8491 characters.
8492
8493 * xterm.c (XTread_socket): Only modify handling_signal if
8494 !SYNC_INPUT. (Bug#11080)
8495
8496 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8497
8498 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8499 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8500 when fetching a multibyte character consumes more bytes than
8501 CHAR_BYTES returns, due to unification of CJK characters in
8502 string_char. (Bug#11073)
8503
8504 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8505
8506 * process.c (wait_reading_process_output): Handle pty disconnect
8507 by refraining from sending oneself a SIGCHLD (bug#10933).
8508
8509 2012-03-22 Chong Yidong <cyd@gnu.org>
8510
8511 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8512
8513 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8514 Mark string as coming from a prefix property.
8515 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8516 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8517
8518 2012-03-21 Chong Yidong <cyd@gnu.org>
8519
8520 * xfaces.c (Vface_remapping_alist): Doc fix.
8521
8522 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8523
8524 * w32proc.c (Fw32_set_console_codepage)
8525 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8526 Doc fixes.
8527
8528 2012-03-20 Chong Yidong <cyd@gnu.org>
8529
8530 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8531 to reflect default non-nil value of redisplay-dont-pause.
8532
8533 2012-03-19 Kenichi Handa <handa@m17n.org>
8534
8535 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8536 it fit in a valid range (Bug#11003).
8537
8538 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8539
8540 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8541 that is not from display property, accept the row as a "cursor
8542 row" if one of the string's character has a non-nil `cursor'
8543 property. Fixes cursor positioning when there are newlines in
8544 overlay strings, e.g. in icomplete.el. (Bug#11035)
8545
8546 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8547
8548 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8549
8550 2012-03-12 Chong Yidong <cyd@gnu.org>
8551
8552 * eval.c (inhibit_lisp_code): Rename from
8553 inhibit_window_configuration_change_hook; move from window.c.
8554
8555 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8556 * window.c (run_window_configuration_change_hook)
8557 (syms_of_window): Callers changed.
8558
8559 2012-03-11 Chong Yidong <cyd@gnu.org>
8560
8561 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8562
8563 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8564
8565 2012-03-10 Chong Yidong <cyd@gnu.org>
8566
8567 * frame.c (other_visible_frames): Don't assume the selected frame
8568 is visible (Bug#10955).
8569
8570 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8571
8572 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8573
8574 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8575
8576 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8577 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8578 zero (Bug#10954).
8579
8580 2012-03-03 Glenn Morris <rgm@gnu.org>
8581
8582 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8583
8584 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8585
8586 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8587 position past the first glyph_row that ends at ZV. (Bug#10902)
8588 (redisplay_window, next_element_from_string): Fix typos in
8589 comments.
8590 (redisplay_window): Pass to move_it_vertically the margin in
8591 pixels, not in screen lines.
8592
8593 2012-03-02 Glenn Morris <rgm@gnu.org>
8594
8595 * buffer.c (buffer-list-update-hook): Doc fix.
8596
8597 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8598
8599 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8600 push_it before setting up the iterator for the first overlay
8601 string, even if we have an empty string loaded.
8602 (next_overlay_string): If there's an empty string on the iterator
8603 stack, pop the stack. (Bug#10903)
8604
8605 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8606
8607 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8608 Suggested by Stefan Monnier in
8609 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8610 * alloc.c (widen_to_Lisp_Object): New static function.
8611 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8612 and widening them to Lisp_Objects. This would work even if
8613 USE_LSB_TAG is defined and wide integers are used, which might
8614 happen in a future version of Emacs.
8615
8616 2012-02-25 Chong Yidong <cyd@gnu.org>
8617
8618 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8619 Doc fix.
8620
8621 * xselect.c (Fx_selection_exists_p): Doc fix.
8622 (x_clipboard_manager_save_all): Print an informative message
8623 before saving to clipboard manager.
8624
8625 2012-02-24 Chong Yidong <cyd@gnu.org>
8626
8627 * keyboard.c (process_special_events): Handle all X selection
8628 requests in kbd_buffer, not just the next one (Bug#8869).
8629
8630 2012-02-23 Chong Yidong <cyd@gnu.org>
8631
8632 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8633 call when setting menu-bar-lines and tool-bar-lines parameters.
8634 (unwind_create_frame_1): New helper function.
8635
8636 * window.c (inhibit_window_configuration_change_hook): New var.
8637 (run_window_configuration_change_hook): Obey it.
8638 (syms_of_window): Initialize it.
8639
8640 2012-02-22 Chong Yidong <cyd@gnu.org>
8641
8642 * xterm.c (x_draw_image_relief): Add missing type check for
8643 Vtool_bar_button_margin (Bug#10743).
8644
8645 2012-02-21 Chong Yidong <cyd@gnu.org>
8646
8647 * fileio.c (Vfile_name_handler_alist): Doc fix.
8648
8649 * buffer.c (Fget_file_buffer): Protect against invalid file
8650 handler return value.
8651
8652 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8653
8654 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8655 when computing $valmask.
8656
8657 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8658 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8659 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8660 It's useless in that case, and it can cause problems on hosts
8661 that allocate halves of EMACS_INT values separately.
8662 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8663 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8664 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8665 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8666 it avoids undefined behavior on hosts where shifting right by more
8667 than the word width has undefined behavior.
8668
8669 2012-02-19 Chong Yidong <cyd@gnu.org>
8670
8671 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8672 (Funhandled_file_name_directory, Ffile_name_as_directory)
8673 (Fdirectory_file_name, Fexpand_file_name)
8674 (Fsubstitute_in_file_name): Protect against invalid file handler
8675 return values (Bug#10845).
8676
8677 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8678
8679 * .gdbinit (pitx): Fix incorrect references to fields of the
8680 iterator stack.
8681
8682 2012-02-17 Chong Yidong <cyd@gnu.org>
8683
8684 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8685
8686 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8687
8688 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8689 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8690
8691 2012-02-15 Chong Yidong <cyd@gnu.org>
8692
8693 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8694 marked as special. Also, starting docstrings with * is obsolete.
8695
8696 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8697
8698 * gnutls.c (emacs_gnutls_write): Fix last change.
8699
8700 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8701
8702 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8703 send_process.
8704
8705 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8706
8707 * keymap.c (Fsingle_key_description): Handle char ranges.
8708
8709 2012-02-12 Chong Yidong <cyd@gnu.org>
8710
8711 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8712 as that creates a dangerous corner case.
8713
8714 * window.c (Fdelete_window_internal): Invalidate the mouse
8715 highlight (Bug#9904).
8716
8717 2012-02-12 Glenn Morris <rgm@gnu.org>
8718
8719 * xselect.c (Fx_own_selection_internal)
8720 (Fx_get_selection_internal, Fx_disown_selection_internal)
8721 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8722 * nsselect.m (Fx_own_selection_internal)
8723 (Fx_disown_selection_internal, Fx_selection_exists_p)
8724 (Fx_selection_owner_p, Fx_get_selection_internal):
8725 Sync docs and argument specs with the xselect.c versions.
8726
8727 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8728
8729 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8730
8731 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8732
8733 * w32select.c (Fx_selection_exists_p): Sync doc string and
8734 argument list with xselect.c. (Bug#10783)
8735
8736 * w16select.c (Fx_selection_exists_p): Sync doc string and
8737 argument list with xselect.c. (Bug#10783)
8738
8739 2012-02-10 Glenn Morris <rgm@gnu.org>
8740
8741 * fns.c (Fsecure_hash): Doc fix.
8742
8743 2012-02-09 Kenichi Handa <handa@m17n.org>
8744
8745 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8746
8747 2012-02-07 Chong Yidong <cyd@gnu.org>
8748
8749 * buffer.c (Fbuffer_local_variables)
8750 (buffer_lisp_local_variables): Handle unbound vars correctly;
8751 don't let Qunbound leak into Lisp.
8752
8753 2012-02-07 Glenn Morris <rgm@gnu.org>
8754
8755 * image.c (Fimagemagick_types): Doc fix.
8756
8757 * image.c (imagemagick-render-type): Change it from a lisp object
8758 to an integer. Move the doc here from the lisp manual.
8759 Treat all values not equal to 0 the same.
8760
8761 2012-02-06 Chong Yidong <cyd@gnu.org>
8762
8763 * doc.c (store_function_docstring): Avoid applying docstring of
8764 alias to base function (Bug#2603).
8765
8766 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8767
8768 * .gdbinit (pp1, pv1): Remove redundant defines.
8769 (pr): Use pp.
8770
8771 2012-02-04 Chong Yidong <cyd@gnu.org>
8772
8773 * nsterm.m: Declare a global (Bug#10694).
8774
8775 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8776
8777 * w32.c (get_emacs_configuration_options):
8778 Include --enable-checking, if specified, in the return value.
8779
8780 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8781
8782 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8783 after rounding frame sizes. (Bug#9723)
8784
8785 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8786
8787 * keyboard.c (adjust_point_for_property): Don't position point
8788 before BEGV. (Bug#10696)
8789
8790 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8791
8792 Handle overflow when computing char display width (Bug#9496).
8793 * character.c (char_width): Return EMACS_INT, not int.
8794 (char_width, c_string_width): Check for overflow when
8795 computing the width; this is possible now that individual
8796 characters can have unbounded width. Problem introduced
8797 by merge from Emacs 23 on 2012-01-19.
8798
8799 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8800
8801 * dbusbind.c (Fdbus_register_method): Mention the return value
8802 :ignore in the docstring.
8803
8804 2012-02-02 Glenn Morris <rgm@gnu.org>
8805
8806 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8807
8808 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8809 Unconditionally set to t. (Bug#10673)
8810 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8811 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8812 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8813
8814 2012-02-02 Kenichi Handa <handa@m17n.org>
8815
8816 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8817 0, do not call append_composite_glyph.
8818
8819 2012-02-02 Kenichi Handa <handa@m17n.org>
8820
8821 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8822 NULL (Bug#6988).
8823 (x_produce_glyphs): If the component of a composition is a null
8824 string, set it->pixel_width to 1 to avoid zero-width glyph.
8825
8826 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8827
8828 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8829 first 2 arguments are identical. This makes inserting large
8830 output from a subprocess an order of magnitude faster on
8831 MS-Windows, where all sbrk'ed memory is always contiguous.
8832
8833 2012-01-31 Glenn Morris <rgm@gnu.org>
8834
8835 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8836 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8837 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8838
8839 2012-01-29 Glenn Morris <rgm@gnu.org>
8840
8841 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8842
8843 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8844
8845 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8846
8847 2012-01-28 Chong Yidong <cyd@gnu.org>
8848
8849 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8850
8851 2012-01-26 Chong Yidong <cyd@gnu.org>
8852
8853 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8854
8855 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8856 repeat counts (Bug#10507).
8857
8858 2012-01-26 Glenn Morris <rgm@gnu.org>
8859
8860 * lread.c (syms_of_lread): Doc fix.
8861
8862 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8863
8864 * coding.c (encode_designation_at_bol): Change return value to
8865 EMACS_INT.
8866
8867 2012-01-25 Chong Yidong <cyd@gnu.org>
8868
8869 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8870
8871 2012-01-21 Chong Yidong <cyd@gnu.org>
8872
8873 * floatfns.c (Fcopysign): Make the second argument non-optional,
8874 since nil is not allowed anyway.
8875
8876 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8877
8878 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8879 (send_process): Likewise.
8880
8881 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8882
8883 * window.c (save_window_save, Fcurrent_window_configuration)
8884 (Vwindow_persistent_parameters): Do not use Qstate.
8885 Rewrite doc-strings.
8886
8887 2012-01-19 Kenichi Handa <handa@m17n.org>
8888
8889 * character.c (char_width): New function.
8890 (Fchar_width, c_string_width, lisp_string_width):
8891 Use char_width (Bug#9496).
8892
8893 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8894
8895 * window.c (Vwindow_persistent_parameters): New variable.
8896 (Fset_window_configuration, save_window_save): Handle persistent
8897 window parameters.
8898
8899 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8900
8901 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8902 thrashing the stack of the thread. (Bug#9087)
8903
8904 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8905
8906 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8907
8908 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8909
8910 * xdisp.c (rows_from_pos_range): Handle the case where the
8911 highlight ends on a newline. (Bug#10464)
8912 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8913 he end column for display of highlight that ends on a newline
8914 before a R2L line.
8915
8916 2012-01-11 Glenn Morris <rgm@gnu.org>
8917
8918 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8919 from load-path also when installation-directory is nil. (Bug#10208)
8920
8921 2012-01-10 Glenn Morris <rgm@gnu.org>
8922
8923 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8924
8925 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8926 Update template values to be closer to their typical values these days.
8927
8928 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8929
8930 * xdisp.c (rows_from_pos_range): Accept additional argument
8931 DISP_STRING, and accept any glyph in a row whose object is that
8932 string as eligible for mouse highlight. Fixes mouse highlight of
8933 display strings from overlays. (Bug#10464)
8934
8935 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8936
8937 emacs: fix an auto-save permissions race condition (Bug#10400)
8938 * fileio.c (auto_saving_dir_umask): New static var.
8939 (Fmake_directory_internal): Use it.
8940 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8941 creating the directory. The old code temporarily assigns
8942 too-generous permissions to the directory.
8943 (do_auto_save_eh): Clear it.
8944 (Fdo_auto_save): Catch all errors, not just file errors, so
8945 that the var is always cleared.
8946
8947 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8948
8949 * search.c (scan_buffer): Pass character positions to
8950 know_region_cache, not byte positions. (Bug#6540)
8951
8952 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8953
8954 * w32.c (sys_rename): Report EXDEV when rename of a directory
8955 fails because the target is on another logical disk. (Bug#10284)
8956
8957 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8958
8959 * xterm.c (x_embed_request_focus): New function.
8960
8961 * xterm.h: Add prototype.
8962
8963 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8964
8965 2012-01-05 Glenn Morris <rgm@gnu.org>
8966
8967 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8968
8969 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8970
8971 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8972 Load gnutls_transport_set_lowat only if GnuTLS version is below
8973 2.11.1.
8974 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8975 GnuTLS versions below 2.11.1.
8976
8977 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8978
8979 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8980 to the doc string advising against its use for altering the way
8981 windows are scrolled.
8982
8983 2011-12-28 Kenichi Handa <handa@m17n.org>
8984
8985 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8986 coding-system ASCII compatible only when it does not produce BOM
8987 on encoding (Bug#10383).
8988
8989 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8990
8991 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8992 can scroll.
8993 (create_and_show_popup_menu): Always use menu_position_func for
8994 Gtk3 (Bug#10361).
8995
8996 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8997
8998 * callint.c (Fcall_interactively): Don't truncate prompt string.
8999
9000 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9001
9002 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9003 property that ends at ZV, so that the bidi iteration could be
9004 resumed from there (after widening). (Bug#10360)
9005
9006 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9007
9008 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9009
9010 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9011
9012 * nsterm.m (x_free_frame_resources):
9013 Release f->output_data.ns->miniimage.
9014 (ns_index_color): Fix indentation. Do not retain
9015 color_table->colors[i].
9016
9017 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9018 before returning.
9019
9020 * nsfns.m (x_set_background_color): Assign return value from
9021 ns_index_color to face-background instead of NSColor*.
9022 (ns_implicitly_set_icon_type): Fix indentation.
9023 Change assignment in for loop to comparison.
9024
9025 * emacs.c (ns_pool): New variable.
9026 (main): Assign ns_pool.
9027 (Fkill_emacs): Call ns_release_autorelease_pool.
9028
9029 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9030 autorelease fdesc, release fdAttrs and tdict.
9031 (ns_get_covering_families): Release charset.
9032 (ns_findfonts): Release NSFontDescriptor created with new.
9033 (ns_uni_to_glyphs): Fix indentation.
9034 (setString): Release attrStr before assigning new value.
9035
9036 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9037
9038 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9039 and NS_IMPL_COCOA.
9040 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9041 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9042
9043 2011-12-18 David Reitter <reitter@cmu.edu>
9044
9045 * nsterm.m (ns_term_init): Subscribe for notifications
9046 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9047 to method trackingNotification in EmacsMenu.
9048
9049 * nsmenu.m (trackingMenu): New variable.
9050 (trackingNotification): New method (from Aquamacs).
9051 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9052 from Aquamacs (Bug#7030).
9053
9054 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9055
9056 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9057 (symbol_to_nsstring): Fix indentation.
9058 (ns_symbol_to_pb): New function.
9059 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9060 (Fns_rotate_cut_buffers_internal): Remove.
9061 (Fns_store_selection_internal): Rename from
9062 Fns_store_cut_buffer_internal.
9063 (ns_get_foreign_selection, Fx_own_selection_internal)
9064 (Fx_disown_selection_internal, Fx_selection_exists_p)
9065 (Fns_get_selection_internal, Fns_store_selection_internal):
9066 Use ns_symbol_to_pb and check if return value is nil.
9067 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9068 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9069 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9070 renamed to Sns_store_selection_internal.
9071 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9072 and remove this function.
9073 (ns_handle_selection_clear): Remove, never used.
9074 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9075 here.
9076
9077 2011-12-17 Ken Brown <kbrown@cornell.edu>
9078
9079 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9080 GID is unknown (Bug#10257).
9081
9082 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9083
9084 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9085 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9086 which caused a build failure on GNU/Linux IA-64. This problem was
9087 introduced by my 2011-10-07 patch.
9088
9089 2011-12-15 Juri Linkov <juri@jurta.org>
9090
9091 * image.c (imagemagick_error): New function. (Bug#10112)
9092 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9093 Use `imagemagick_error' where ImageMagick functions return
9094 `MagickFalse'.
9095 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9096 proper order.
9097
9098 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9099
9100 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9101 fill background (Bug#8992).
9102
9103 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9104
9105 * window.c (Vwindow_combination_resize)
9106 (Vwindow_combination_limit): Use t instead of non-nil in
9107 doc-strings.
9108 (Vrecenter_redisplay): Add first sentence of doc-string on
9109 separate line.
9110 (Frecenter): Fix doc-string typo.
9111
9112 2011-12-11 Kenichi Handa <handa@m17n.org>
9113
9114 * coding.c (Funencodable_char_position): Pay attention to the
9115 buffer text relocation (Bug#9389).
9116
9117 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9118
9119 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9120 gtk_init (Bug#10100).
9121
9122 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9123
9124 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9125 IT->string is nil. (Bug#10263)
9126
9127 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9128
9129 * nsterm.h (x_free_frame_resources): Declare.
9130
9131 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9132 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9133
9134 * nsterm.h (ns_get_defaults_value): Declare.
9135
9136 * nsterm.m (ns_default): Call ns_get_defaults_value.
9137
9138 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9139
9140 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9141 (Bug#10170)
9142
9143 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9144
9145 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9146 that where the value of an _OBJC_* symbol points to is in the .bss
9147 section (Bug#10240).
9148
9149 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9150
9151 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9152 after the loop to call ccl_driver at least once (Bug#8619).
9153
9154 2011-12-08 Kenichi Handa <handa@m17n.org>
9155
9156 * ftfont.c (get_adstyle_property): Fix previous change
9157 (Bug#10233).
9158
9159 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9160
9161 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9162 dirs from the default value of EMACSLOADPATH (bug#10208).
9163
9164 2011-12-07 Glenn Morris <rgm@gnu.org>
9165
9166 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9167 installation and source directories as well. (Bug#10208)
9168
9169 2011-12-06 Chong Yidong <cyd@gnu.org>
9170
9171 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9172
9173 2011-12-06 Glenn Morris <rgm@gnu.org>
9174
9175 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9176 as an error, not just -1. (Bug#10217)
9177
9178 2011-12-05 Chong Yidong <cyd@gnu.org>
9179
9180 * keyboard.c (process_special_events): New function.
9181 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9182
9183 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9184
9185 * coding.c (encode_designation_at_bol): Don't use uninitialized
9186 local variable (Bug#9318).
9187
9188 2011-12-05 Kenichi Handa <handa@m17n.org>
9189
9190 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9191 return Qnil (Bug#8046, Bug#10193).
9192
9193 2011-12-05 Kenichi Handa <handa@m17n.org>
9194
9195 * coding.c (encode_designation_at_bol): New args charbuf_end and
9196 dst. Return the number of produced bytes. Callers changed.
9197 (coding_set_source): Return how many bytes coding->source was
9198 relocated.
9199 (coding_set_destination): Return how many bytes
9200 coding->destination was relocated.
9201 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9202 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9203
9204 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9205
9206 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9207 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9208 macro (Bug#9318).
9209
9210 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9211
9212 The following changes are to fix Bug#9318.
9213
9214 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9215 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9216 (encode_coding_iso_2022, encode_coding_sjis)
9217 (encode_coding_big5, encode_coding_charset): Use the above macros.
9218
9219 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9220
9221 * lisp.h (process_quit_flag): Fix external declaration.
9222
9223 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9224
9225 Don't macro-inline non-performance-critical code.
9226 * eval.c (process_quit_flag): New function.
9227 * lisp.h (QUIT): Use it.
9228
9229 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9230
9231 * nsfns.m (get_geometry_from_preferences): New function.
9232 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9233
9234 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9235
9236 * emacs.c (Qkill_emacs): Define.
9237 (syms_of_emacs): Initialize it.
9238 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9239 Qquit_flag to `kill-emacs' instead.
9240 (quit_throw_to_read_char): Add parameter `from_signal'.
9241 All callers changed. Call Fkill_emacs if requested and safe.
9242 * lisp.h (QUIT): Call Fkill_emacs if requested.
9243
9244 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9245
9246 * widget.c (update_wm_hints): Return if wmshell is null.
9247 (widget_update_wm_size_hints): New function.
9248
9249 * widget.h (widget_update_wm_size_hints): Declare.
9250
9251 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9252 widget_update_wm_size_hints (Bug#10104).
9253
9254 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9255
9256 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9257 before a newline, prepare the bidi iterator for consuming the
9258 newline, and keep the current paragraph direction. (Bug#10183)
9259 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9260
9261 2011-12-02 Juri Linkov <juri@jurta.org>
9262
9263 * search.c (Fword_search_regexp): New Lisp function created from
9264 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9265 (Fword_search_backward, Fword_search_forward)
9266 (Fword_search_backward_lax, Fword_search_forward_lax):
9267 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9268 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9269
9270 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9271
9272 * fileio.c (Finsert_file_contents): Move after-change-function call
9273 to before the "handled:" label, since all "goto handled" appear in
9274 cases where the *-change-functions have already been properly called
9275 (bug#10117).
9276
9277 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9278
9279 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9280 waiting for input. (Bug#10169)
9281
9282 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9283
9284 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9285 verifies glyph row's hash code--we have just reallocated the
9286 glyphs, so their contents can be complete garbage. (Bug#10164)
9287
9288 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9289
9290 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9291
9292 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9293
9294 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9295 attributes are tested _before_ calling verify_row_hash, to protect
9296 against GCC re-ordering of the tests. (Bug#10164)
9297
9298 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9299
9300 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9301
9302 * xterm.c (handle_one_xevent): Only set async_visible and friends
9303 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9304 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9305 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9306
9307 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9310 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9311 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9312 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9313 All uses changed to use GCPRO1 etc.
9314 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9315 Revert to old implementation (i.e., before 2011-03-11).
9316
9317 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9318
9319 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9320 of scroll runs so as to avoid assigning disabled bogus rows and
9321 unnecessary graphics copy operations.
9322
9323 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9324
9325 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9326 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9327 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9328 (malloc, free, realloc, calloc): Redirect to e_* only when
9329 compiling Emacs.
9330
9331 * lisp.h (GCTYPEBITS): Move before first use.
9332 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9333 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9334 this macro definition.
9335
9336 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9337 _MSC_VER.
9338
9339 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9340
9341 * gtkutil.c (xg_create_frame_widgets):
9342 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9343 present with Gtk+ 2.0.
9344
9345 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9346
9347 * fileio.c (Finsert_file_contents): Undo previous change; see
9348 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9349
9350 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9351
9352 Rename locals to avoid shadowing.
9353 * fileio.c (Finsert_file_contents):
9354 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9355 * process.c (wait_reading_process_output):
9356 Rename inner 'proc' to 'p' to avoid shadowing.
9357 Indent for consistency with usual Emacs style.
9358
9359 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9360
9361 * xdisp.c (redisplay_window): If cursor row is not fully visible
9362 after recentering, and scroll-conservatively is set to a large
9363 number, scroll window by a few more lines to make the cursor fully
9364 visible and out of scroll-margin. (Bug#10105)
9365 (start_display): Don't move to the next line if the display should
9366 start at a newline that is part of a display vector or an overlay
9367 string. (Bug#10119)
9368
9369 2011-11-24 Juri Linkov <juri@jurta.org>
9370
9371 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9372 after the `MagickPingImage' call. (Bug#10112)
9373
9374 2011-11-23 Chong Yidong <cyd@gnu.org>
9375
9376 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9377
9378 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9379
9380 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9381 making another buffer current. (Bug#10114)
9382
9383 2011-11-23 Glenn Morris <rgm@gnu.org>
9384
9385 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9386
9387 2011-11-23 Chong Yidong <cyd@gnu.org>
9388
9389 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9390 using it (Bug#5984).
9391
9392 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9393
9394 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9395 and header-lines, as they don't have one computed for them.
9396 (Bug#10098)
9397
9398 * .gdbinit (prow): Make displayed values more self-explaining.
9399 Add row's hash code.
9400
9401 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9402
9403 * process.c (wait_reading_process_output): Fix asynchrounous
9404 GnuTLS socket handling on some versions of the GnuTLS library.
9405 (wait_reading_process_output): Add comment and URL.
9406
9407 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9408
9409 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9410
9411 2011-11-21 Chong Yidong <cyd@gnu.org>
9412
9413 * window.c (Fnext_window, Fprevious_window): Doc fix.
9414
9415 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9416
9417 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9418
9419 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9420
9421 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9422
9423 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9424
9425 * window.c (Fset_window_combination_limit): Rename argument
9426 STATUS to LIMIT.
9427 (Vwindow_combination_limit): Remove "status" from doc-string.
9428
9429 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9430
9431 * m/ibms390.h: Remove.
9432 * m/ibms390x.h: Don't include "ibms390.h".
9433
9434 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9435
9436 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9437 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9438
9439 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9440
9441 * casetab.c (Fset_case_table):
9442 * charset.c (Fcharset_after): Fix typos.
9443
9444 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9445
9446 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9447 Otherwise, valgrind does not work on some platforms.
9448 Problem reported by Andreas Schwab in
9449 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9450 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9451 is set, removing the need for VIRT_ADDRESS_VARIES.
9452 (PURE_P): Use a more-efficient implementation that needs just one
9453 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9454 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9455 to 4 (xorl, subq, cmpq, setbe).
9456 * alloc.c (pure): Always extern now, since that's the
9457 VIRT_ADDR_VARIES behavior.
9458 (PURE_POINTER_P): Use a single comparison, not two, for
9459 consistency with the new puresize.h.
9460 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9461 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9462 Remove VIRT_ADDR_VARIES no longer needed.
9463
9464 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9465
9466 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9467 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9468 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9469 behave as if the cursor position were at the window margin.
9470
9471 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9472 and the cursor position is out of bounds, behave as if the cursor
9473 position were at the window margin. (Bug#10075)
9474
9475 2011-11-18 Chong Yidong <cyd@gnu.org>
9476
9477 * window.c (Fwindow_combination_limit): Make first argument
9478 non-optional, since it is meaningless for live windows like the
9479 selected window.
9480
9481 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9482
9483 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9484
9485 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9486
9487 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9488 (graft_intervals_into_buffer): Simplify.
9489
9490 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9491
9492 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9493 hash values of the two rows.
9494 (copy_row_except_pointers): Preserve the used[] arrays and the
9495 hash values of the two rows. (Bug#10035)
9496 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9497
9498 * xdisp.c (row_hash): New function, body extracted from
9499 compute_line_metrics.
9500 (compute_line_metrics): Call row_hash, instead of computing the
9501 hash code inline.
9502
9503 * dispnew.c (verify_row_hash): Call row_hash for computing the
9504 hash code of a row, instead of duplicating code from xdisp.c.
9505
9506 * dispextern.h (row_hash): Add prototype.
9507
9508 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9509
9510 * frame.c (delete_frame): Don't delete the terminal when the last
9511 X frame is closed if emacs is built with GTK toolkit.
9512
9513 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9514
9515 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9516
9517 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9518
9519 * window.c (Vwindow_splits): Rename to
9520 Vwindow_combination_resize. Suggested by Juri Linkov.
9521 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9522 of Vwindow_splits.
9523
9524 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9525
9526 * nsfns.m (Fns_font_name):
9527 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9528
9529 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9530
9531 * window.h (window): Rename slot "nest" to "combination_limit".
9532 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9533 (Fset_window_nest): Rename to Fset_window_combination_limit.
9534 (Vwindow_nest): Rename to Vwindow_combination_limit.
9535 (recombine_windows, make_parent_window, make_window)
9536 (Fsplit_window_internal, saved_window)
9537 (Fset_window_configuration, save_window_save): Rename all
9538 occurrences of window_nest to window_combination_limit.
9539
9540 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9541
9542 * image.c (imagemagick_load_image): Fix typo.
9543
9544 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9545
9546 * xdisp.c (display_line): Move the call to
9547 highlight_trailing_whitespace before the call to
9548 compute_line_metrics, since the latter needs to see the final
9549 faces of all the glyphs to compute ROW's hash value.
9550 Fixes assertion violations in row_equal_p. (Bug#10035)
9551
9552 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9553
9554 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9555 just return (bug#10044).
9556
9557 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9558
9559 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9560 with user-defined heap size. Bump the default size of the temacs
9561 heap to 27MB, to avoid memory warning when running temacs.
9562 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9563
9564 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9565 current_matrix and desired_matrix. (Bug#9990)
9566 (verify_row_hash) [XASSERTS]: New function.
9567 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9568 that the hash value of glyph rows is correct.
9569
9570 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9571
9572 * window.h (window): Remove splits slot.
9573 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9574 (Fdelete_other_windows_internal, make_parent_window)
9575 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9576 (Fset_window_configuration, save_window_save): Don't deal with
9577 split status of windows.
9578 (saved_window): Remove splits slot.
9579 (Vwindow_splits): Rewrite doc-string.
9580
9581 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9582
9583 * xfns.c (unwind_create_frame):
9584 * nsfns.m (unwind_create_frame):
9585 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9586 Vframe_list (Bug#9999).
9587
9588 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9589
9590 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9591
9592 2011-11-11 Kenichi Handa <handa@m17n.org>
9593
9594 * callproc.c (Fcall_process): Set the member dst_multibyte of
9595 process_coding.
9596
9597 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9598
9599 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9600 avoid a crash (bug#9496).
9601
9602 2011-11-09 Chong Yidong <cyd@gnu.org>
9603
9604 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9605 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9606
9607 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9608
9609 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9610
9611 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9612
9613 Avoid some portability problems by eschewing 'extern inline' functions.
9614 The trivial performance wins aren't worth the portability hassles; see
9615 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9616 et seq.
9617 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9618 (window_box_width, window_box_left, window_box_left_offset)
9619 (window_box_right, window_box_right_offset): Undo previous change,
9620 by removing the "extern"s.
9621 * intervals.c (adjust_intervals_for_insertion)
9622 (adjust_intervals_for_deletion): Undo previous change,
9623 making these static again.
9624 (offset_intervals, temp_set_point_both, temp_set_point)
9625 (copy_intervals_to_string): No longer inline.
9626 * xdisp.c (window_text_bottom_y, window_box_width)
9627 (window_box_height, window_box_left_offset)
9628 (window_box_right_offset, window_box_left, window_box_right)
9629 (window_box): No longer inline.
9630
9631 2011-11-08 Chong Yidong <cyd@gnu.org>
9632
9633 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9634 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9635 Signal an error if not a live window.
9636 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9637 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9638
9639 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9640
9641 * lisp.h (syms_of_abbrev): Remove declaration.
9642 Reported by CHENG Gao <chenggao@royau.me>.
9643
9644 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9645
9646 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9647 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9648 of temacs in GUI mode.
9649
9650 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9651
9652 * window.h: Declare delete_all_child_windows instead of
9653 delete_all_subwindows.
9654 * window.c (Fwindow_nest, Fset_window_nest)
9655 (Fset_window_new_total, Fset_window_new_normal)
9656 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9657 (delete_all_subwindows): Rename to delete_all_child_windows.
9658 (Fdelete_other_windows_internal, Fset_window_configuration):
9659 Call delete_all_child_windows instead of delete_all_subwindows.
9660 * frame.c (delete_frame): Call delete_all_child_windows instead
9661 of delete_all_subwindows.
9662
9663 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9664
9665 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9666 This is also needed for porting to any host where GC_MARK_STACK is
9667 not GC_MAKE_GCPROS_NOOPS.
9668 (which_symbols): Use it.
9669
9670 2011-11-07 Kenichi Handa <handa@m17n.org>
9671
9672 * coding.c (coding_set_destination): Check coding->src_pos only
9673 when coding->src_object is a buffer (bug#9910).
9674
9675 * process.c (send_process): Set the member src_multibyte of coding
9676 to 0 (bug#9911) when sending a unibyte text.
9677
9678 * callproc.c (Fcall_process): Set the member src_multibyte of
9679 process_coding to 0 (bug#9912).
9680
9681 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9682
9683 * xmenu.c (cleanup_widget_value_tree): New function.
9684 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9685 calling free_menubar_widget_value_tree directly (Bug#9830).
9686
9687 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9688
9689 Fix some portability problems with 'inline'.
9690 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9691 (window_box_width, window_box_left, window_box_left_offset)
9692 (window_box_right, window_box_right_offset): Declare extern.
9693 Otherwise, these inline functions do not conform to C99 and
9694 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9695 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9696 * intervals.c (adjust_intervals_for_insertion)
9697 (adjust_intervals_for_deletion): Now extern, because otherwise the
9698 extern inline functions 'offset_intervals' couldn't refer to it.
9699 (static_offset_intervals): Remove.
9700 (offset_intervals): Rewrite using the old contents of
9701 static_offset_intervals. The old version didn't conform to C99
9702 because an extern inline function contained a reference to an
9703 identifier with static linkage.
9704
9705 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9706
9707 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9708 GC.
9709
9710 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9711
9712 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9713 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9714 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9715 return Qleft_to_right.
9716
9717 2011-11-06 Chong Yidong <cyd@gnu.org>
9718
9719 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9720 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9721 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9722 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9723 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9724 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9725 (Fwindow_vscroll): Doc fix.
9726 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9727 argument, since it makes no sense to pass a live window and for
9728 consistency with window-child.
9729
9730 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9731
9732 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9733 support MSVC.
9734
9735 2011-11-05 Jason Rumney <jasonr@gnu.org>
9736
9737 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9738 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9739 fonts (Bug#6029).
9740 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9741 bitwise arithmetic preventing use of unicode-sip and non-truetype
9742 opentype fonts.
9743
9744 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9745
9746 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9747 "emacs"-only part.
9748
9749 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9750 initialization code to keep similarity to xfns.c after changes
9751 from 2011-11-05.
9752
9753 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9754
9755 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9756 (unwind_create_frame): New function (Bug#9943).
9757 (Fx_create_frame): Restructure code to be more similar to the one in
9758 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9759 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9760 Move terminal->reference_count++ just before making the frame official
9761 (Bug#9943).
9762
9763 * nsterm.m (x_free_frame_resources): New function.
9764 (x_destroy_window): Move code to x_free_frame_resources.
9765
9766 * xfns.c (unwind_create_frame): Fix comment.
9767 (Fx_create_frame, x_create_tip_frame):
9768 Move terminal->reference_count++ just before making the frame
9769 official. Move initialization of image_cache_refcount and
9770 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9771
9772 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9773
9774 Support MSVC build with newer versions of Visual Studio.
9775 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9776 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9777 nt/gmake.defs.
9778
9779 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9780 which are not supported by MSVC.
9781 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9782 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9783 bitfields.
9784 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9785 types in bitfields.
9786 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9787
9788 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9789
9790 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9791
9792 Support MSVC build with newer versions of Visual Studio.
9793 * w32.c: Don't include w32api.h for MSVC.
9794 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9795
9796 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9797 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9798 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9799 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9800 e_* cousins.
9801 (alloca) [_MSC_VER]: Define to _alloca.
9802
9803 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9804
9805 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9806
9807 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9808
9809 * xdisp.c (note_mouse_highlight): If either of
9810 previous/next-single-property-change returns nil, treat that as
9811 the beginning or the end of the buffer. (Bug#9955)
9812
9813 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9814
9815 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9816 label is not null (Bug#9951).
9817 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9818 may be NULL.
9819
9820 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9821
9822 * window.c (Fwindow_body_size): Mention in the doc string that the
9823 return value is in frame's canonical units. (Bug#9949)
9824
9825 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9826
9827 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9828
9829 * w32fns.c (unwind_create_frame): If needed, free the glyph
9830 matrices of the partially constructed frame. (Bug#9943)
9831 * xfns.c (unwind_create_frame): Likewise.
9832
9833 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9834
9835 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9836 Don't stop backward scan on the continuation glyph, even though
9837 its CHARPOS is positive.
9838 (mouse_face_from_buffer_pos, note_mouse_highlight):
9839 Rename cover_string to disp_string.
9840
9841 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9842
9843 * window.c (temp_output_buffer_show): Don't use
9844 Vtemp_buffer_show_specifiers.
9845 (Vtemp_buffer_show_specifiers): Remove unused variable.
9846
9847 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9848
9849 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9850 past the beginning of the current glyph matrix.
9851
9852 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9853
9854 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9855 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9856 HAVE_GTK3 (Bug#9869).
9857
9858 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9859 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9860
9861 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9862
9863 * xterm.c: Declare x_handle_net_wm_state to return int.
9864 (handle_one_xevent): Check if we are iconified but don't have
9865 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9866 (get_current_wm_state): Return non-zero if not hidden,
9867 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9868 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9869 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9870 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9871
9872 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9873
9874 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9875 so that this new function doesn't get optimized away by a
9876 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9877
9878 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9879
9880 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9881
9882 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9883
9884 Fix the `xbytecode' command.
9885 * .gdbinit (xprintbytestr): New command.
9886 (xwhichsymbols): Rename from `which'; all callers changed.
9887 (xbytecode): Print the byte-code string as well.
9888
9889 2011-10-29 Kim Storm <storm@cua.dk>
9890
9891 * alloc.c (which_symbols): New function.
9892
9893 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9894
9895 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9896 line. (Bug#9903)
9897
9898 2011-10-29 Glenn Morris <rgm@gnu.org>
9899
9900 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9901 Not clear what it was for, and it causes various bugs. (Bug#9839)
9902
9903 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9904
9905 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9906 possible random value that matches one of those tested as
9907 condition to clear the mouse face.
9908
9909 2011-10-28 Chong Yidong <cyd@gnu.org>
9910
9911 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9912
9913 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9914
9915 * window.c (make_window): Initialize phys_cursor_on_p.
9916
9917 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9918
9919 * lisp.h (struct Lisp_Symbol): Update comments.
9920
9921 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9922
9923 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9924
9925 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9926
9927 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9928 <oslsachem@gmail.com> for helping to debug this.
9929
9930 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9931 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9932 (g_b_init_get_glyph_outline_w): New static variables.
9933 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9934 (GetGlyphOutlineW_Proc): New typedefs.
9935 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9936 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9937 New functions.
9938 (w32font_open_internal, compute_metrics):
9939 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9940 instead of calling the "wide" APIs directly.
9941
9942 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9943
9944 * w32.h (syms_of_w32font): Add prototype.
9945
9946 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9947
9948 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9949 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9950 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9951 (Fmove_to_window_line): Doc fix.
9952
9953 2011-10-27 Chong Yidong <cyd@gnu.org>
9954
9955 * process.c (make_process): Set gnutls_state to NULL.
9956
9957 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9958 non-NULL, regardless of GNUTLS_INITSTAGE.
9959 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9960 an error. Set process slots as soon as we allocate them.
9961
9962 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9963
9964 2011-10-27 Chong Yidong <cyd@gnu.org>
9965
9966 * gnutls.c (emacs_gnutls_deinit): New function.
9967 Deallocate credentials structures as well as calling gnutls_deinit.
9968 (Fgnutls_deinit, Fgnutls_boot): Use it.
9969
9970 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9971 (deactivate_process): Call emacs_gnutls_deinit.
9972
9973 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9974
9975 * image.c (x_create_x_image_and_pixmap):
9976 * w32.c (sys_rename, w32_delayed_load):
9977 * w32font.c (fill_in_logfont):
9978 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9979
9980 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9981
9982 * w32fns.c (w32_default_color_map): New function,
9983 extracted from Fw32_default_color_map.
9984 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9985
9986 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9987
9988 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9989
9990 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9991
9992 * keyboard.c (test_undefined): New function (bug#9751).
9993 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9994
9995 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9996
9997 * sysdep.c (init_sys_modes): Fix the check for the controlling
9998 terminal (Bug#6649).
9999
10000 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10001
10002 * dispextern.h (struct bidi_it): New member next_en_type.
10003
10004 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10005 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10006 current character, check also for next_en_type being WEAK_EN.
10007 (bidi_resolve_weak): Don't enter the expensive loop if the current
10008 position is before next_en_pos. Record the bidi type of the first
10009 non-ET, non-BN character we find, in addition to its position.
10010 (bidi_level_of_next_char): Invalidate next_en_type when
10011 next_en_pos is over-stepped.
10012
10013 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10014
10015 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10016 * editfns.c: Rewrite current-time-zone so that it invokes
10017 the equivalent of (format-time-string "%Z") to get the time zone name.
10018 This fixes a bug when the time zone name contains characters that
10019 need converting from the system time locale to Emacs internal format.
10020 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10021 that patch fixed format-time-string to do the conversion, but
10022 I forgot to fix current-time-zone.
10023 (format_time_string): New function, containing most of
10024 what Fformat_time_string used to contain.
10025 (Fformat_time_string): Rewrite in terms of format_time_string.
10026 This doesn't change this function's behavior.
10027 (current-time-zone): Rewrite to use format_time_string.
10028 This fixes the bug reported by Michael Schierl in
10029 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10030 Jason Rumney's 2007-06-07 change worked around this bug, but
10031 didn't fix it.
10032 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10033
10034 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10035
10036 * xdisp.c (start_display): If the character at POS is displayed
10037 via a display vector, reset IT->current.dpvec_index to zero.
10038 (try_window_reusing_current_matrix): If a line ends in a display
10039 vector or the next line starts in a display vector, continue
10040 redrawing the window even though the character position of
10041 start_row was reached.
10042 (Bug#9771, part 2)
10043
10044 2011-10-18 Chong Yidong <cyd@gnu.org>
10045
10046 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10047 with nobreak-char-display too.
10048
10049 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10050
10051 Fix part 3 of bug#9771.
10052 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10053 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10054 non-neutral characters if the current character is a paragraph
10055 separator (a.k.a. Newline). This avoids running the same
10056 expensive loop twice, once when we consume the preceding newline
10057 and the other time when the line actually needs to be displayed.
10058 Avoid the loop when we see neutrals on the base embedding level
10059 following a character whose directionality is the same as the
10060 paragraph's. This avoids running the expensive loop when a line
10061 ends in a long sequence of neutrals, like control characters.
10062 Add assertion against STRONG_AL type. Slightly rearrange code
10063 that determines the type of a neutral given the first non-neutral
10064 that follows it.
10065 (bidi_level_of_next_char): Set next_en_pos to zero when
10066 invalidating its info.
10067
10068 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10069
10070 * xdisp.c (push_display_prop): Determine whether to record string
10071 or buffer position by IT->string, not by IT->method. Allow
10072 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10073 (move_it_vertically_backward): Don't look for character position
10074 immediately after the newline when in a continuation line.
10075 (Bug#9771, part 1)
10076
10077 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10078
10079 * window.c (coordinates_in_window): Rewrite and delabelize
10080 vertical border check. (Bug#5357) (Bug#9618)
10081
10082 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10083
10084 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10085 errors in XSetWindowBorder (bug#9310).
10086
10087 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10088
10089 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10090 avoid crash when xmalloc overrun checking is enabled.
10091
10092 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10093
10094 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10095 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10096 cursor motion with <left> and <right> arrow keys.
10097
10098 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10099 some callers set that themselves.
10100
10101 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10102
10103 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10104 display string and the previous row comes from the same string and
10105 is empty. (Bug#9739) (Bug#9738)
10106
10107 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10108
10109 * doc.c (get_doc_string): Encode file name (bug#9735).
10110
10111 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10112
10113 * bidi.c (bidi_level_of_next_char):
10114 * xdisp.c (get_visually_first_element): Remove old incorrect
10115 comments regarding the Unicode Line Separator character.
10116
10117 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10118
10119 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10120
10121 * alloc.c (Fgc_status): Do not access beyond zombies array
10122 boundary if nzombies > MAX_ZOMBIES.
10123 * alloc.c (dump_zombies): Add missing format specifier.
10124
10125 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10126
10127 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10128 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10129
10130 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10131 Some packages use them to denote characters with modifiers.
10132
10133 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10134
10135 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10136 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10137 matching a pp-number. Rename parameter var to var1.
10138
10139 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10140
10141 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10142
10143 2011-10-08 Glenn Morris <rgm@gnu.org>
10144
10145 * callint.c (Fcall_interactively): Give a more explicit error for the
10146 'c' case with a non-character input. (Bug#8479)
10147
10148 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10149
10150 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10151 lines.
10152 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10153 lines that are hscrolled on the left.
10154
10155 * dispnew.c (buffer_posn_from_coords): Account for a possible
10156 presence of header-line. (Bug#4426)
10157
10158 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10159
10160 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10161 Don't advertise functionality which we discourage or doesn't work.
10162
10163 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10164
10165 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10166 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10167 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10168 this makes Emacs dump core during garbage collection on rare
10169 occasions. sizeof is obviously inferior to offsetof here, so
10170 stick with offsetof.
10171 (GC_POINTER_ALIGNMENT): New macro.
10172 (mark_memory): Omit 3rd (offset) arg; caller changed.
10173 Don't assume EMACS_INT alignment is the same as pointer alignment.
10174
10175 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10176
10177 * keyboard.c (read_key_sequence_remapped): New var.
10178 (read_key_sequence): Compute remapping in the right buffer.
10179 (command_loop_1): Use read_key_sequence's remapping directly.
10180
10181 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10182
10183 * dired.c (file_name_completion): Don't expand file name.
10184 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10185 before checking file name handler.
10186
10187 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10188 they've been requested explicitly (bug#9591).
10189
10190 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10191
10192 * keymap.c (Fsingle_key_description): Use make_specified_string
10193 instead of build_string to build string from push_key_description.
10194 (Bug#5193)
10195
10196 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10197
10198 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10199 This fixes a Y2038 bug on 64-bit hosts.
10200 * buffer.c (reset_buffer):
10201 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10202 (Fclear_buffer_auto_save_failure):
10203 Use 0, not -1, to represent an unset failure time, since time_t
10204 might not be signed.
10205
10206 Remove dependency on glibc malloc internals.
10207 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10208 Move back here from lisp.h, but with their new implementations.
10209 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10210 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10211 * charset.c (charset_table_init): New static var.
10212 (syms_of_charset): Use it instead of xmalloc. This removes a
10213 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10214 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10215 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10216 Move back to alloc.c.
10217 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10218 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10219
10220 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10221
10222 * nsterm.m (windowDidResize): Call x_set_window_size only when
10223 ns_in_resize is true. Otherwise set pixelwidth/height and
10224 call change_frame_size (Bug#9628).
10225
10226 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10227
10228 Port --enable-checking=all to Fedora 14 x86-64.
10229 * charset.c (syms_of_charset): Also account for glibc malloc's
10230 internal overhead when calculating the initial malloc maximum.
10231
10232 Port --enable-checking=all to Fedora 14 x86.
10233 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10234 Move to lisp.h.
10235 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10236 (overrun_check_realloc, overrun_check_free):
10237 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10238 That way, xmalloc returns a properly-aligned pointer even if
10239 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10240 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10241 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10242 into account when calculating the initial malloc maximum.
10243 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10244 Move here from alloc.c, so that charset.c can use it too.
10245 Properly align; the old code wasn't right for common 32-bit hosts
10246 when configured with --enable-checking=all.
10247 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10248 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10249
10250 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10251
10252 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10253 use EDOM.
10254
10255 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10256
10257 * xdisp.c (compute_display_string_end): If there's no display
10258 string at CHARPOS, return -1.
10259
10260 * bidi.c (bidi_fetch_char): When compute_display_string_end
10261 returns a negative value, treat the character as a normal
10262 character not covered by a display string. (Bug#9624)
10263
10264 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10265
10266 * lread.c (Fread_from_string): Fix typo in docstring.
10267
10268 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10269
10270 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10271 newline, reseat the iterator instead of bidi-iterating there one
10272 character at a time. (Bug#9610)
10273 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10274 TO_CHARPOS if the bidi iterator is at base embedding level.
10275
10276 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10277
10278 * lread.c (readevalloop): Use correct code for NBSP.
10279 (read1): Likewise. (Bug#9608)
10280
10281 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10282
10283 * dbusbind.c (Fdbus_register_signal): When service is not
10284 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10285
10286 2011-09-25 Glenn Morris <rgm@gnu.org>
10287
10288 * buffer.c (truncate-lines): Doc fix.
10289
10290 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10291
10292 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10293 (Fset_window_next_buffers): Doc fix.
10294
10295 2011-09-24 Glenn Morris <rgm@gnu.org>
10296
10297 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10298
10299 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10300
10301 Fix minor problems found by static checking.
10302 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10303 * indent.c (Fvertical_motion): Fix == vs = typo.
10304
10305 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10306
10307 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10308 Default value is now t. Doc fix.
10309
10310 * indent.c (Fvertical_motion): Compute and apply the overshoot
10311 logic when moving up, not only when moving down. Fix the
10312 confusing name and values of the it_overshoot_expected variable;
10313 logic changes accordingly. (Bug#9254) (Bug#9549)
10314
10315 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10316 CHARPOS is covered by a display string which includes newlines.
10317 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10318 is covered by a display string with embedded newlines.
10319
10320 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10321
10322 * dbusbind.c (Fdbus_register_signal): Add match rule to
10323 Vdbus_registered_objects_table. (Bug#9581)
10324 (Fdbus_register_method, Vdbus_registered_objects_table):
10325 Fix docstring.
10326
10327 2011-09-24 Jim Meyering <meyering@redhat.com>
10328
10329 do not ignore write error for any output size
10330 The previous change was incomplete.
10331 While it makes emacs --batch detect the vast majority of stdout
10332 write failures, errors were still ignored whenever the output size is
10333 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10334 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10335 && echo FAIL: ignored write error
10336 FAIL: ignored write error
10337 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10338 && echo FAIL: ignored write error
10339 FAIL: ignored write error
10340 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10341
10342 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10343
10344 * emacs.c (Fkill_emacs): In noninteractive mode exit
10345 non-successfully if a write error occurred on stdout. (Bug#9574)
10346
10347 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10348
10349 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10350 the xassert test.
10351
10352 * dispextern.h (struct it): Update the comment documenting what
10353 can it->OBJECT be.
10354
10355 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10356
10357 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10358 a display string, extend search for cursor position to end of row.
10359 (find_row_edges): If the row ends in a newline from a display
10360 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10361 Handle the case of a display string with multiple newlines.
10362 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10363 non-empty line. Fixes confusing cursor motion with arrow keys at
10364 the beginning of a line that starts with whitespace.
10365
10366 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10367
10368 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10369 (bug#9493).
10370
10371 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10372
10373 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10374 boolean (Bug#9154).
10375
10376 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10377
10378 * xdisp.c (display_line): Record maximum and minimum buffer
10379 positions even if no glyphs were produced (e.g., by a zero-width
10380 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10381 buffer positions that will be removed from the glyph row because
10382 they don't fit.
10383 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10384 column is beyond frame width: don't subtract 1 "pixel" when
10385 computing width of the stretch.
10386 (reseat_at_next_visible_line_start): Undo the change made on
10387 2011-09-17 that saved paragraph information and restored it after
10388 the call to `reseat'. (Bug#9545)
10389
10390 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10391
10392 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10393 and turn window cursor on if cleared (Bug#9415).
10394
10395 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10396
10397 * search.c (boyer_moore): Take unibyte characters from pattern
10398 literally. (Bug#9458)
10399
10400 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10401
10402 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10403
10404 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10405
10406 Fix minor problem found by static checking.
10407 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10408 initialized, to pacify gcc -Wuninitialized.
10409
10410 * fileio.c: Report proper errno when syscall falls.
10411 (Finsert_file_contents): Save and restore errno,
10412 so that report_file_error outputs the correct diagnostic.
10413 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10414
10415 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10416
10417 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10418
10419 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10420
10421 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10422 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10423
10424 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10425
10426 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10427 about the current paragraph and restore it after the call to reseat.
10428
10429 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10430 (bidi_find_paragraph_start): Search back for paragraph beginning
10431 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10432 (bidi_move_to_visually_next): Only trigger paragraph-related
10433 computations when the last character is a newline or at EOB, not
10434 just any NEUTRAL_B. (Bug#9470)
10435
10436 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10437 truncated lines if point is covered by a display string. (Bug#9524)
10438
10439 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10440
10441 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10442 (cons_to_x_long): New function.
10443 (lisp_data_to_selection_data): Use it. Correct the test for
10444 short-versus-long data; it was negated. Break out of vector
10445 loop, for efficiency, when a long datum is discovered.
10446
10447 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10448
10449 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10450
10451 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10452
10453 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10454 GCC PR/17406) by declaring this function with external scope.
10455
10456 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10457
10458 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10459 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10460
10461 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10462
10463 * editfns.c (Fformat): Correctly handle text properties on "%%".
10464
10465 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10466
10467 * xterm.c (x_draw_composite_glyph_string_foreground):
10468 * w32term.c (x_draw_composite_glyph_string_foreground):
10469 * term.c (encode_terminal_code):
10470 * composite.c (composition_update_it, get_composition_id):
10471 * xdisp.c (get_next_display_element)
10472 (fill_composite_glyph_string): Add comments about special meaning
10473 of TAB characters in a composition.
10474
10475 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10476
10477 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10478 This occurs when processing a multibyte format.
10479 Problem reported by Wolfgang Jenker.
10480
10481 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10482
10483 * xdisp.c (try_cursor_movement): Only check for exact match if
10484 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10485
10486 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10487
10488 Remove unused external symbols.
10489 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10490 * xdisp.c (calc_pixel_width_or_height): Now static.
10491 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10492 * indent.c (check_display_width):
10493 * w32term.c: Fix comment to match code.
10494 * xterm.c, xterm.h (x_catching_errors): Remove.
10495
10496 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10497
10498 * xselect.c: Use signed conversions more consistently (Bug#9498).
10499 (selection_data_to_lisp_data): Assume incoming selection data are
10500 signed integers, not unsigned. This is to be consistent with
10501 outgoing selection data, which was modified to use signed integers
10502 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10503 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10504 expects long, not unsigned long.
10505
10506 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10507
10508 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10509 computation of loop end. Reported by Johan Bockgård
10510 <bojohan@gnu.org>.
10511
10512 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10513
10514 * frame.c (Fother_visible_frames_p): Function deleted.
10515
10516 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10517
10518 * indent.c (compute_motion): Process display vector front to back
10519 rather than the other way around. (Bug#2496)
10520
10521 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10522
10523 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10524
10525 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10526
10527 * minibuf.c (Fread_from_minibuffer): Doc fix.
10528
10529 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10530
10531 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10532 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10533
10534 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10535
10536 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10537 value for non-existent files.
10538
10539 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10540
10541 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10542 set its "size" to -1. This will set the modtime_size field of
10543 the corresponding buffer to -1, which is what
10544 verify-visited-file-modtime expects for files that do not exist.
10545 (Bug#9139)
10546
10547 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10548
10549 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10550 here ...
10551 * lisp.h: ... from here. push_key_description is no longer
10552 defined in keyboard.c, so its declaration should not be in
10553 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10554 logically belongs with push_key_description.
10555
10556 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10557
10558 * buffer.h: Include <sys/types.h> instead of <time.h>.
10559 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10560 Problem reported by Herbert J. Skuhra.
10561
10562 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10563
10564 * xml.c (parse_region): Make the parsing work for
10565 non-comment-starting XML files again (bug#9144).
10566
10567 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10568
10569 * image.c (gif_load): Fix calculation of bottom and right corner.
10570 (Bug#9468)
10571
10572 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10573
10574 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10575 redisplay in small windows.
10576
10577 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10578
10579 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10580
10581 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10582
10583 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10584 Operate on live windows only.
10585
10586 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10587
10588 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10589
10590 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10591
10592 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10593 only under bidi iteration.
10594
10595 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10596
10597 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10598
10599 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10600
10601 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10602 Without this fix, the command to link temacs failed due to an
10603 undefined symbol __builtin_isnan. This is because
10604 /usr/include/iso/math_c99.h #defines isnan(x) to
10605 __builtin_isnan(x), but the bundled gcc, which identifies itself
10606 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10607 a __builtin_isnan.
10608 * floatfns.c (isnan): #undef, and then #define to a clone of
10609 what's in data.c.
10610 (Fisnan): Always define, since it's always available now.
10611 (syms_of_floatfns): Always define isnan at the Lisp level.
10612
10613 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10614
10615 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10616
10617 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10618
10619 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10620 The previous code assumed that file offsets (off_t values) fit in
10621 EMACS_INT variables, which is not true on typical 32-bit hosts.
10622 The code messed up by falsely reporting buffer overflow in cases
10623 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10624 when "big" contains more than 2**29 bytes, even though this
10625 inserts just one byte and does not overflow the buffer.
10626 (Finsert_file_contents): Store file offsets as off_t
10627 values, not as EMACS_INT values. Check for overflow when
10628 converting between EMACS_INT and off_t. When checking for
10629 buffer overflow or for overlap, take the offsets into account.
10630 Don't use EMACS_INT for small values where int suffices.
10631 When checking for overlap, fix a typo: ZV was used where
10632 ZV_BYTE was intended.
10633 (Fwrite_region): Don't assume off_t fits into 'long'.
10634 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10635
10636 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10637
10638 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10639
10640 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10641
10642 sprintf-related integer and memory overflow issues (Bug#9412).
10643
10644 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10645 (esprintf, exprintf, evxprintf): New functions.
10646 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10647 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10648 (modify_event_symbol): Do not assume that the length of
10649 name_alist_or_stem is safe to alloca and fits in int.
10650 (Fexecute_extended_command): Likewise for function name and binding.
10651 (Frecursion_depth): Wrap around reliably on integer overflow.
10652 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10653 since some callers pass EMACS_INT values.
10654 (Fsingle_key_description): Don't crash if symbol name contains more
10655 than MAX_ALLOCA bytes.
10656 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10657 (get_minibuffer): Arg is now EMACS_INT, not int.
10658 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10659 (esprintf, exprintf, evxprintf): New decls.
10660 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10661
10662 * dbusbind.c (signature_cat): New function.
10663 (xd_signature, Fdbus_register_signal):
10664 Do not overrun buffer; instead, report string overflow.
10665
10666 * dispnew.c (add_window_display_history): Don't overrun buffer.
10667 Truncate instead; this is OK since it's just a log.
10668
10669 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10670 even if the time zone offset is outlandishly large.
10671 Don't mishandle offset == INT_MIN.
10672
10673 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10674 when creating daemon; the previous buffer-overflow check was incorrect.
10675
10676 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10677 which has the guts of the old verror function.
10678
10679 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10680 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10681
10682 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10683 (font_unparse_xlfd): Don't blindly alloca long strings.
10684 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10685 fits in int, when using sprintf. Use single snprintf to count
10686 length of string rather than counting it via multiple sprintfs;
10687 that's simpler and more reliable.
10688 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10689 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10690 sprintf, in case result does not fit in int.
10691
10692 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10693 (fontset_from_font): Print it.
10694
10695 * frame.c (tty_frame_count): Now printmax_t, not int.
10696 (make_terminal_frame, set_term_frame_name): Print it.
10697 (x_report_frame_params): In X, window IDs are unsigned long,
10698 not signed long, so print them as unsigned.
10699 (validate_x_resource_name): Check for implausibly long names,
10700 and don't assume name length fits in 'int'.
10701 (x_get_resource_string): Don't blindly alloca invocation name;
10702 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10703 not fit in int.
10704
10705 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10706 (xg_check_special_colors, xg_set_geometry):
10707 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10708
10709 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10710 Use esprintf, not sprintf, in case result does not fit in int.
10711
10712 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10713 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10714 it as a large positive number.
10715 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10716 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10717
10718 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10719 in case result does not fit in int.
10720
10721 * print.c (float_to_string): Detect width overflow more reliably.
10722 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10723 buffer overrun. Don't assume list length fits in 'int'. Treat
10724 print length of 0 as 0, not as infinity; to be consistent with other
10725 uses of print length in this function. Don't overflow print length
10726 index. Don't assume hash table size fits in 'long', or that
10727 vectorlike size fits in 'unsigned long'.
10728
10729 * process.c (make_process): Use printmax_t, not int, to format
10730 process-name gensyms.
10731
10732 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10733
10734 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10735 to avoid potential buffer overrun.
10736
10737 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10738 if X resource line is longer than 512 bytes.
10739
10740 * xfns.c (x_window): Make sprintf buffer a bit bigger
10741 to avoid potential buffer overrun.
10742
10743 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10744
10745 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10746
10747 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10748
10749 Integer overflow fixes for scrolling, etc.
10750 Without these, Emacs silently mishandles large integers sometimes.
10751 For example, "C-u 4294967297 M-x recenter" was treated as if
10752 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10753
10754 * xdisp.c (try_window_id): Check Emacs fixnum range before
10755 converting to 'int'.
10756
10757 * window.c (window_scroll_line_based, Frecenter):
10758 Check that an Emacs fixnum is in range before assigning it to 'int'.
10759 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10760 values converted from Emacs fixnums.
10761 (Frecenter): Don't wrap around a line count if it is out of 'int'
10762 range; instead, treat it as an extreme value.
10763 (Fset_window_configuration, compare_window_configurations):
10764 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10765
10766 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10767 that can exceed INT_MAX. Check that EMACS_INT value is in range
10768 before assigning it to the (possibly-narrower) index.
10769 (match_limit): Don't assume that a fixnum can fit in 'int'.
10770
10771 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10772 exceed INT_MAX.
10773
10774 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10775 (Fvertical_motion): Don't wrap around LINES values that don't fit
10776 in 'int'. Instead, treat them as extreme values. This is good
10777 enough for windows, which can't have more than INT_MAX lines anyway.
10778
10779 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10780
10781 * Require libxml/parser.h to avoid compilation warning.
10782
10783 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10784
10785 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10786 since this reportedly can destroy thread storage.
10787
10788 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10789
10790 * syntax.c (find_defun_start): Update all cache variables if
10791 exiting early (Bug#9401).
10792
10793 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10794
10795 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10796
10797 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10798 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10799 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10800
10801 * term.c (tty_append_glyph): New function.
10802 (produce_stretch_glyph): Static function and its prototype deleted.
10803
10804 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10805 Add prototypes.
10806
10807 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10808
10809 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10810 when checking :margin (Bug#9390).
10811 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10812 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10813 so that the name doesn't mislead. All uses changed.
10814
10815 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10816
10817 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10818 set_tty_hooks.
10819
10820 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10821
10822 * xdisp.c (move_it_to): Don't bail out early when reaching
10823 position beyond to_charpos, if we are scanning backwards.
10824 (move_it_vertically_backward): When DY == 0, make sure we get to
10825 the first character in the line after the newline.
10826
10827 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10828
10829 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10830 (ccl_driver): Do not generate an out-of-range pointer.
10831 (Fccl_execute_on_string): Remove unnecessary check for
10832 integer overflow, noted by Stefan Monnier in
10833 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10834 Remove a FIXME that didn't need fixing.
10835 Simplify the newly-introduced buffer reallocation code.
10836
10837 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10838
10839 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10840
10841 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10842
10843 Integer and memory overflow issues (Bug#9196).
10844
10845 * doc.c (get_doc_string): Rework so that
10846 get_doc_string_buffer_size is the actual buffer size, rather than
10847 being 1 less than the actual buffer size; this makes xpalloc more
10848 convenient.
10849
10850 * image.c (x_allocate_bitmap_record, cache_image):
10851 * xselect.c (Fx_register_dnd_atom):
10852 Simplify previous changes by using xpalloc.
10853
10854 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10855 since either will do and ptrdiff_t is convenient with xpalloc.
10856
10857 * charset.c (charset_table_size)
10858 (struct charset_sort_data.priority): Now ptrdiff_t.
10859 (charset_compare): Don't overflow if priorities differ greatly.
10860 (Fsort_charsets): Don't assume list length fits in int.
10861 Check for size-calculation overflow when allocating sort data.
10862 (syms_of_charset): Allocate an initial charset table that is
10863 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10864
10865 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10866
10867 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10868 The actual value is always <= INT_MAX, and leaving it unsigned made
10869 overflow checking harder.
10870
10871 * dispextern.h (struct glyph_matrix.rows_allocated)
10872 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10873 with xpalloc. The values are still always <= INT_MAX.
10874
10875 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10876
10877 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10878 (SAFE_NALLOCA): New macro.
10879
10880 * region-cache.c (struct boundary.pos, find_cache_boundary)
10881 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10882 (set_cache_region, invalidate_region_cache)
10883 (revalidate_region_cache, know_region_cache, region_cache_forward)
10884 (region_cache_backward, pp_cache):
10885 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10886 so that ptrdiff_t * can be passed to xpalloc.
10887 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10888 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10889 (pp_cache): Don't assume cache_len fits in int.
10890 * region-cache.h: Adjust extern decls to match.
10891
10892 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10893 EMACS_INT, since either will do, for xpalloc.
10894
10895 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10896 (xnmalloc, xnrealloc, xpalloc): New functions.
10897
10898 * bidi.c (bidi_shelve_header_size): New constant.
10899 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10900 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10901
10902 * bidi.c (bidi_cache_shrink):
10903 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10904 (overlay_strings):
10905 Don't update size of array until after memory allocation succeeds,
10906 because xmalloc/xrealloc may not return.
10907 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10908 now that we have proper integer overflow checking.
10909 (record_overlay_string, overlay_strings): Catch overflows when
10910 calculating size of overlay_str_buf.
10911
10912 * callproc.c (Fcall_process): Check for size overflow when
10913 calculating size of args2.
10914 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10915 Normally we prefer signed values, but sticking with ptrdiff_t would
10916 require adding more-complicated checks.
10917
10918 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10919 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10920 Redo buffer-overflow calculations to avoid integer overflow.
10921 Add a FIXME comment where memory seems to be over-allocated.
10922
10923 * character.c (Fstring): Check for size-calculation overflow.
10924
10925 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10926 unnecessary integer overflow. Check for size overflow.
10927 (encode_coding_object): Don't update size until xmalloc succeeds.
10928
10929 * composite.c (get_composition_id): Check for overflow in glyph
10930 length calculations.
10931
10932 Integer and memory overflow fixes for display code.
10933 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10934 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10935 (scrolling_window): Check for overflow in size calculations.
10936 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10937 Don't assume glyph table len fits in int.
10938 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10939 (row_table_size): Now ptrdiff_t, not int.
10940 (scrolling_window): Avoid overflow in size calculations.
10941 Don't update size until allocation succeeds.
10942 * fns.c (concat): Check for overflow in size calculations.
10943 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10944 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10945 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10946
10947 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10948 (get_doc_string): Check for size calculation overflow.
10949 Don't update size until allocation succeeds.
10950 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10951 EMACS_INT, where ptrdiff_t will do.
10952 (Fsubstitute_command_keys): Check for string overflow.
10953
10954 * editfns.c (set_time_zone_rule): Don't assume environment length
10955 fits in int.
10956 (message_length): Now ptrdiff_t, not int.
10957 (Fmessage_box): Don't update size until allocation succeeds.
10958 Don't assume message length fits in int.
10959 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10960
10961 * emacs.c (main): Do not reallocate argv, since there is a null at
10962 the end that can be overwritten, and this way there's no need to
10963 worry about size-calculation overflow.
10964 (sort_args): Check for size-calculation overflow.
10965
10966 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10967 alloc succeeds.
10968 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10969
10970 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10971 (x_set_scroll_bar_width, x_figure_window_size):
10972 Check for integer overflow.
10973 (x_set_alpha): Do not assume XINT fits in int.
10974
10975 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10976 This is for the members text_lines, text_cols, total_lines, total_cols,
10977 where the system imposes an 'int' limit.
10978
10979 * fringe.c (Fdefine_fringe_bitmap):
10980 Don't update size until alloc works.
10981
10982 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10983 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10984
10985 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10986 Check for size-calculation overflow.
10987 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10988 do, as we prefer signed integers.
10989 (id_to_widget.max_size, id_to_widget.used)
10990 (xg_store_widget_in_map, xg_remove_widget_from_map)
10991 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10992 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10993 Use and return ptrdiff_t, not int.
10994 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10995 * gtkutil.h: Change prototypes to match the above.
10996
10997 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10998 are duplicate now that they've been promoted to lisp.h.
10999 (x_allocate_bitmap_record, x_alloc_image_color)
11000 (make_image_cache, cache_image, xpm_load):
11001 Don't update size until alloc is done.
11002 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11003 (x_detect_edges):
11004 Check for size calculation overflow.
11005 (ct_colors_allocated_max): New constant.
11006 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11007 overflow.
11008
11009 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11010 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11011 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11012 Use ptrdiff_t, not int, to count maps.
11013 (read_char_minibuf_menu_prompt): Check for overflow in size
11014 calculations. Don't update size until allocation succeeds.
11015 Redo calculations to avoid overflow.
11016 * keyboard.h: Change prototypes to match the above.
11017
11018 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11019 to count maps.
11020 (current_minor_maps): Check for size calculation overflow.
11021 * keymap.h: Change prototypes to match the above.
11022
11023 * lread.c (read1, init_obarray): Don't update size until alloc done.
11024
11025 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11026 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11027
11028 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11029 Now ptrdiff_t, not int.
11030 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11031 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11032
11033 * process.c (Fnetwork_interface_list): Check for overflow
11034 in size calculation.
11035
11036 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11037
11038 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11039 overflow. Don't bother calling xmalloc when xrealloc will do.
11040
11041 * search.c (Freplace_match): Check for size calculation overflow.
11042 (Fset_match_data): Don't assume list lengths fit in 'int'.
11043
11044 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11045 for command line length. Do not attempt to address one before the
11046 beginning of an array, as that's not portable.
11047
11048 * term.c (max_frame_lines): Remove; unused.
11049 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11050 not int.
11051 (encode_terminal_code, calculate_costs): Check for size
11052 calculation overflow.
11053 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11054 table lengths and related sizes. Don't update size until alloc
11055 done. Redo calculations to avoid overflow.
11056 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11057
11058 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11059 subtracting pointers.
11060 (gobble_line): Check for overflow more carefully. Don't update size
11061 until alloc done.
11062
11063 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11064 Don't update size until alloc done.
11065 Redo size calculations to avoid overflow.
11066 Check for size calculation overflow.
11067 (main) [DEBUG]: Fix typo in invoking tparam1.
11068
11069 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11070 Use ptrdiff_t, not int, for sizes.
11071 (store_mode_line_noprop_char): Don't update size until alloc done.
11072
11073 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11074 Use ptrdiff_t, not int, for sizes.
11075 (Finternal_make_lisp_face, cache_face):
11076 Check for size calculation overflow.
11077 (cache_face): Treat size calculation overflows as if they were
11078 memory exhaustion (the usual treatment), rather than aborting.
11079
11080 * xfns.c (x_encode_text, x_set_name_internal)
11081 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11082 sizes, since they can exceed INT_MAX in size. Check for size
11083 calculation overflow.
11084
11085 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11086 (xg_select): Check for size calculation overflow.
11087 Don't update size until alloc done.
11088
11089 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11090 as sprintf is limited to int lengths.
11091
11092 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11093 (X_LONG_MIN): New macros.
11094 Use them to make the following changes clearer.
11095 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11096 This change doesn't affect the value now, but it may help remind
11097 future maintainers not to raise the value too much later.
11098 (SELECTION_QUANTUM): Remove, replacing with ...
11099 (selection_quantum): ... new function, which avoids overflow.
11100 All uses changed.
11101 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11102 assumption that selection length fits in 'int'.
11103 (x_reply_selection_request, x_handle_selection_request)
11104 (x_get_window_property, receive_incremental_selection)
11105 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11106 (lisp_data_to_selection_data, clean_local_selection_data):
11107 Use ptrdiff_t, not int, to record length of selection.
11108 (x_reply_selection_request, x_get_window_property)
11109 (receive_incremental_selection, x_property_data_to_lisp):
11110 Redo calculations to avoid overflow.
11111 (x_reply_selection_request): When sending hint, ceiling it at
11112 X_LONG_MAX rather than relying on wraparound overflow to send
11113 something.
11114 (x_get_window_property, receive_incremental_selection)
11115 (lisp_data_to_selection_data, x_property_data_to_lisp):
11116 Check for size-calculation overflow.
11117 (x_get_window_property, receive_incremental_selection)
11118 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11119 Don't store size until memory allocation succeeds.
11120 (x_get_window_property): Plug memory leak on memory exhaustion.
11121 Don't double-block input; malloc is safe here. Don't assume 2**34
11122 - 4 fits in unsigned long. Add an xassert to check
11123 XGetWindowProperty overflow. Be more careful about overflow
11124 calculations, and distinguish size from memory overflow better.
11125 (receive_incremental_selection): When tracing, don't assume
11126 unsigned int is less than INT_MAX.
11127 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11128 harmful) conversions of unsigned short to int.
11129 (lisp_data_to_selection_data): Don't assume that integers
11130 in the range -65535 through -1 fit in an X unsigned short.
11131 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11132 result parameters unless successful. Rely on cons_to_unsigned
11133 to report problems with elements; the old code wasn't right anyway.
11134 (x_check_property_data): Check for int overflow; we cannot use
11135 a wider type due to X limits.
11136 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11137
11138 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11139
11140 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11141 (x_term_init): Check for size calculation overflow.
11142 (x_color_cells): Don't store size until memory allocation succeeds.
11143 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11144 Don't assume alloca size is less than MAX_ALLOCA.
11145 (x_term_init): Don't assume length fits in int (sprintf is limited
11146 to int size).
11147
11148 Use ptrdiff_t for composition IDs.
11149 * character.c (lisp_string_width):
11150 * composite.c (composition_table_size, n_compositions)
11151 (get_composition_id, composition_gstring_from_id):
11152 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11153 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11154 * window.c (Frecenter):
11155 Use ptrdiff_t, not int, for composition IDs.
11156 * composite.c (get_composition_id): Check for integer overflow.
11157 * composite.h: Adjust prototypes to match the above changes.
11158
11159 Use ptrdiff_t for hash table indexes.
11160 * category.c (hash_get_category_set):
11161 * ccl.c (ccl_driver):
11162 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11163 * coding.c (coding_system_charset_list, detect_coding_system):
11164 * coding.h (struct coding_system.id):
11165 * composite.c (get_composition_id, gstring_lookup_cache):
11166 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11167 * image.c (xpm_get_color_table_h):
11168 * lisp.h (hash_lookup, hash_put):
11169 * minibuf.c (Ftest_completion):
11170 Use ptrdiff_t for hash table indexes, not int (which is too
11171 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11172 32-bit --with-wide-int hosts).
11173
11174 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11175 Add a FIXME comment about memory leaks.
11176 (syms_of_charset): Don't assume xmalloc returns.
11177
11178 Don't assume that stated character widths fit in int.
11179 * character.c (Fchar_width, c_string_width, lisp_string_width):
11180 * character.h (CHAR_WIDTH):
11181 * indent.c (MULTIBYTE_BYTES_WIDTH):
11182 Use sanitize_char_width to avoid undefined and/or bad behavior
11183 with outlandish widths.
11184 * character.h (sanitize_tab_width): Rename from sanitize_width,
11185 now that we have two such functions. All uses changed.
11186 (sanitize_char_width): New inline function.
11187
11188 Don't assume that tab-width fits in int.
11189 * character.h (sanitize_width): New inline function.
11190 (SANE_TAB_WIDTH): New macro.
11191 (ASCII_CHAR_WIDTH): Use it.
11192 * indent.c (sane_tab_width): Remove. All uses replaced by
11193 SANE_TAB_WIDTH (current_buffer).
11194 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11195
11196 * fileio.c: Integer overflow issues with file modes.
11197 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11198
11199 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11200 Remove unreachable code.
11201 (read_hex, load_charset_map_from_file): Check for integer overflow.
11202
11203 * xterm.c: Don't go over XClientMessageEvent limit.
11204 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11205 (x_send_scroll_bar_event): Likewise. Check that the size does not
11206 exceed limits imposed by XClientMessageEvent, as well as the usual
11207 ptrdiff_t and size_t limits.
11208
11209 * keyboard.c: Overflow, signedness and related fixes.
11210 (make_lispy_movement): Use same integer type in forward decl
11211 that is used in the definition.
11212 (read_key_sequence, keyremap_step):
11213 Change bufsize argument back to int, undoing my 2011-03-30 change.
11214 We prefer signed types, and int is wide enough here.
11215 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11216 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11217 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11218 length, not size_t. Use ptrdiff_t for index, not int.
11219 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11220 possibility of integer overflow.
11221
11222 Overflow, signedness and related fixes for images.
11223
11224 * dispextern.h (struct it.stack[0].u.image.image_id)
11225 (struct_it.image_id, struct image.id, struct image_cache.size)
11226 (struct image_cache.used, struct image_cache.ref_count):
11227 * gtkutil.c (update_frame_tool_bar):
11228 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11229 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11230 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11231 * nsmenu.m (update_frame_tool_bar):
11232 * xdisp.c (calc_pixel_width_or_height):
11233 * xfns.c (image_cache_refcount):
11234 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11235 on typical 64-bit hosts.
11236
11237 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11238 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11239 Omit unnecessary casts to int.
11240 (parse_image_spec): Check that integers fall into 'int' range
11241 when the callers expect that.
11242 (image_ascent): Redo ascent calculation to avoid int overflow.
11243 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11244 (lookup_image): Remove unnecessary tests.
11245 (xbm_image_p): Locals are now of int, not EMACS_INT,
11246 since parse_image_check makes sure they fit into int.
11247 (png_load, gif_load, svg_load_image):
11248 Prefer int to unsigned where either will do.
11249 (tiff_handler): New function, combining the cores of the
11250 old tiff_error_handler and tiff_warning_handler.
11251 This function is rewritten to use vsnprintf and thereby avoid
11252 stack buffer overflows. It uses only the features of vsnprintf
11253 that are common to both POSIX and native Microsoft.
11254 (tiff_error_handler, tiff_warning_handler): Use it.
11255 (tiff_load, gif_load, imagemagick_load_image):
11256 Don't assume :index value fits in 'int'.
11257 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11258 (imagemagick_load_image): Check that crop parameters fit into
11259 the integer types that MagickCropImage accepts. Don't assume
11260 Vimagemagick_render_type has a nonnegative value. Don't assume
11261 size_t fits in 'long'.
11262 (gs_load): Use printmax_t to print the widest integers possible.
11263 Check for integer overflow when computing image height and width.
11264
11265 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11266
11267 * xdisp.c (redisplay_window): Don't force window start if point
11268 will be invisible in the resulting window. (Bug#9324)
11269
11270 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11271
11272 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11273 the display spec is of the form `(space ...)'.
11274 (handle_display_spec): Return the value returned by
11275 handle_single_display_spec, not just 1 or zero.
11276 (handle_single_display_spec): If the display spec is of the form
11277 `(space ...)', and specifies display in the text area, return 2
11278 rather than 1.
11279 (try_cursor_movement): Check for the need to scroll more
11280 accurately, and prefer exact match for point under bidi.
11281 Don't advance `row' beyond the last row of the window.
11282
11283 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11284 into disp_prop; all users changed.
11285
11286 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11287 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11288 for the text covered by the display property.
11289
11290 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11291
11292 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11293 Change return value to nil.
11294 (Frecord_buffer): Delete unused function.
11295
11296 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11297
11298 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11299 buffers, return left-to-right.
11300 (set_cursor_from_row): Consider candidate row a win if its glyph
11301 represents a newline and point is on that newline. Fixes cursor
11302 positioning on the newline at EOL of R2L text within L2R
11303 paragraph, and vice versa.
11304 (try_cursor_movement): Check continued rows, in addition to
11305 continuation rows. Fixes unwarranted scroll when point enters a
11306 continued line of R2L text within an L2R paragraph, or vice versa.
11307 (cursor_row_p): Consider the case of point being equal to
11308 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11309 from the end of a short line to the beginning of a continued line
11310 of R2L text within L2R paragraph.
11311 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11312 composed characters.
11313
11314 * bidi.c (bidi_check_type): Use xassert.
11315 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11316 members.
11317
11318 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11319
11320 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11321 a character.
11322
11323 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11324
11325 * nsfont.m (ns_otf_to_script): Fix typo.
11326
11327 2011-08-22 Kenichi Handa <handa@m17n.org>
11328
11329 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11330 extra slot even if the purpose is char-code-property-table.
11331
11332 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11333
11334 * xdisp.c (redisplay_window): When computing centering_position,
11335 account for the height of the header line. (Bug#8874)
11336
11337 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11338 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11339 candidate is selected by the mouse, and that candidate has a
11340 composed character under the mouse.
11341
11342 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11343 coordinates reported by pos-visible-in-window-p for a composed
11344 character in column zero.
11345
11346 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11347
11348 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11349
11350 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11351
11352 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11353 consider it a hit if to_charpos is anywhere in the range of the
11354 composed buffer positions.
11355
11356 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11357
11358 * image.c (gif_load): Don't assume that each subimage has the same
11359 dimensions as the base image. Handle disposal method that is
11360 "undefined" by the gif spec (Bug#9335).
11361
11362 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11363
11364 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11365 (Fcondition_case): Document `debug' symbol in error handler.
11366
11367 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11368
11369 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11370 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11371 from an Org mode buffer to a Speedbar frame.
11372
11373 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11374 a composition, take its buffer position from IT->cmp_it.charpos.
11375 Fixes cursor positioning at the beginning of a line that begins
11376 with a composed character.
11377
11378 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11379
11380 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11381 character bidirectional type, use STRONG_L instead. Fixes crashes
11382 in a buffer produced by `describe-categories'.
11383
11384 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11385 members before the level stack, so they would be saved and
11386 restored when copying iterator state. Fixes incorrect reordering
11387 around TABs covered by display properties.
11388
11389 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11390
11391 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11392
11393 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11394
11395 * eval.c (internal_condition_case, internal_condition_case_1)
11396 (internal_condition_case_2, internal_condition_case_n):
11397 Remove unnecessary aborts (Bug#9081).
11398
11399 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11400
11401 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11402 has no `load' handler, try opening the file locally. (Bug#9311)
11403
11404 2011-08-16 Ken Brown <kbrown@cornell.edu>
11405
11406 * gmalloc.c: Expand comment.
11407
11408 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11409
11410 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11411 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11412
11413 2011-08-16 Ken Brown <kbrown@cornell.edu>
11414
11415 Fix memory allocation problems in Cygwin build (Bug#9273).
11416
11417 * unexcw.c ( __malloc_initialized): Declare external variable.
11418 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11419
11420 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11421 New variables.
11422 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11423 dumped emacs.
11424 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11425 in the static heap.
11426 [CYGWIN] (special_realloc): New function.
11427 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11428 requests to realloc storage in the static heap.
11429
11430 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11431
11432 * bidi.c (bidi_initialize): Remove unused local.
11433
11434 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11435
11436 * bidimirror.h:
11437 * biditype.h: Remove file.
11438 * makefile.w32-in ($(BLD)/bidi.$(O)):
11439 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11440
11441 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11442
11443 * chartab.c: Improve commentary for the uniprop_table API.
11444
11445 * bidi.c (bidi_paragraph_init): Support zero value of
11446 bidi_ignore_explicit_marks_for_paragraph_level.
11447 (bidi_initialize): Use uniprop_table instead of including
11448 biditype.h and bidimirror.h.
11449
11450 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11451 coordinates of the iterator when restoring from ppos_it.
11452 (Bug#9296)
11453
11454 2011-08-14 Kenichi Handa <handa@m17n.org>
11455
11456 * process.c (create_process): Call setup_process_coding_systems
11457 after the pid of the process is set to -1 (Bug#8162).
11458
11459 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11460
11461 * xdisp.c (move_it_in_display_line_to): Don't invoke
11462 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11463 ppos_it. Fixes vertical cursor motion when line beginning is
11464 covered by an image. (Bug#9296)
11465
11466 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11467
11468 * nsterm.h (ns_run_ascript): Declare.
11469 (NSAPP_DATA2_RUNASSCRIPT): Define.
11470
11471 * nsfns.m (as_script, as_result, as_status): New static variables.
11472 (ns_run_ascript): New function.
11473 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11474 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11475 the event loop. Get status from as_status (Bug#7276).
11476
11477 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11478 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11479 the event loop (Bug#7276).
11480
11481 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11482
11483 * gnutls.c (QCgnutls_bootprop_priority)
11484 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11485 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11486 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11487 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11488 (QCgnutls_bootprop_verify_hostname_error)
11489 (QCgnutls_bootprop_callbacks_verify): Rename from
11490 Qgnutls_bootprop_..., all uses changed.
11491
11492 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11493 uses changed.
11494
11495 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11496
11497 * xfaces.c (Qframe_set_background_mode): Now static.
11498 * dispextern.h (Qframe_set_background_mode): Remove decl.
11499
11500 * process.c (Fnetwork_interface_info): Declare local only if needed.
11501
11502 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11503
11504 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11505 (Fnetwork_interface_list): Allocate in increments of bytes instead
11506 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11507 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11508 sockaddr.
11509 (struct ifflag_def): notrailers is smart on OSX.
11510 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11511 Get hardware address with getifaddrs if available.
11512
11513 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11514
11515 * xdisp.c (iterate_out_of_display_property): xassert that
11516 IT->position is set to within IT->object's boundaries. Break from
11517 the loop as soon as EOB is reached; avoids infloops in redisplay
11518 when IT->position is set up wrongly due to some bug.
11519 Set IT->current to match the bidi iterator unconditionally.
11520 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11521 entry. Force push_it to save on the stack the current
11522 buffer/string position, to be restored by pop_it. Fix flags in
11523 the iterator structure wrt the object coming from a display
11524 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11525 properties. (Bug#9284)
11526
11527 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11528
11529 * fontset.c (fontset_get_font_group): Add proper type checks.
11530 (Bug#9172)
11531
11532 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11533
11534 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11535 and LC_VERSION_MIN_MACOSX.
11536 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11537 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11538
11539 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11540
11541 * xdisp.c (forward_to_next_line_start): Allow to use the
11542 no-display-properties-and-no-overlays under bidi display.
11543 Set disp_pos in the bidi iterator to avoid searches for display
11544 properties and overlays.
11545
11546 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11547
11548 * editfns.c (Fset_time_zone_rule): Document relationship with the
11549 setenv function.
11550
11551 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11552 the font entity extracted from the cache (Bug#8109).
11553
11554 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11555
11556 * composite.c (autocmp_chars): Don't reset point. That is done by
11557 restore_point_unwind (Bug#5984).
11558
11559 2011-08-07 Juri Linkov <juri@jurta.org>
11560
11561 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11562 to show the arg `TIME' instead of `TIMEVAL'.
11563
11564 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11565
11566 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11567 display property strides EOL and includes a newline, as in
11568 longlines-mode. (Bug#9254)
11569 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11570 word-wrap under bidirectional display. (Bug#9224)
11571
11572 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11573 is non-zero, even if the data buffer is NULL. Fixes a crash in
11574 vertical-motion with longlines-mode. (Bug#9254)
11575
11576 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11577
11578 * bidi.c <bidi_cache_total_alloc>: Now static.
11579 (bidi_initialize): Initialize bidi_cache_total_alloc.
11580
11581 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11582 cache. (Bug#9221)
11583
11584 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11585 amount allocated this far in `bidi_cache_total_alloc'.
11586 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11587 non-zero, only free the data buffer without restoring the cache
11588 contents. All callers changed.
11589
11590 * dispextern.h (bidi_unshelve_cache): Update prototype.
11591
11592 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11593 (move_it_in_display_line, move_it_to)
11594 (move_it_vertically_backward, move_it_by_lines): Replace the call
11595 to xfree to an equivalent call to bidi_unshelve_cache.
11596 (move_it_in_display_line_to): Fix logic of returning
11597 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11598
11599 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11600
11601 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11602 came from a string character with a `cursor' property. (Bug#9229)
11603
11604 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11605
11606 * Makefile.in (LIB_PTHREAD): New variable.
11607 (LIBES): Add LIB_PTHREAD (Bug#9216).
11608
11609 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11610 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11611
11612 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11613
11614 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11615
11616 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11617
11618 * xterm.c (x_find_topmost_parent): New function.
11619 (x_set_frame_alpha): Find topmost parent window with
11620 x_find_topmost_parent and set the property there also (bug#9181).
11621 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11622
11623 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11624
11625 * callproc.c (Fcall_process): Avoid vfork clobbering
11626 the local vars buffer, coding_systems, current_dir.
11627
11628 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11629
11630 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11631
11632 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11633
11634 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11635 so that it is not optimized away.
11636
11637 * xdisp.c (compute_display_string_pos): Remove unused local.
11638
11639 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11640
11641 Fix slow cursor motion and scrolling in large buffers with
11642 selective display, like Org Mode buffers. (Bug#9218)
11643
11644 * dispextern.h (struct bidi_it): New member disp_prop_p.
11645
11646 * xdisp.c: Remove one-slot cache of display string positions.
11647 (compute_display_string_pos): Accept an additional argument
11648 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11649 for a display string or property. If found, set DISP_PROP_P
11650 non-zero.
11651
11652 * bidi.c (bidi_fetch_char): Accept an additional argument
11653 DISP_PROP_P, and pass it to compute_display_string_pos.
11654 Only handle text covered by a display string if DISP_PROP_P is returned
11655 non-zero. All callers of bidi_fetch_char changed.
11656
11657 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11658
11659 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11660
11661 2010-12-03 Don March <don@ohspite.net>
11662
11663 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11664 last character M-[char] is translated to ESC [char] (bug#7541).
11665
11666 2011-08-02 Kenichi Handa <handa@m17n.org>
11667
11668 * lisp.h (uniprop_table): Extern it.
11669
11670 * chartab.c (uniprop_table): Make it non-static.
11671
11672 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11673
11674 * xdisp.c (forward_to_next_line_start): Accept additional argument
11675 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11676 on the newline.
11677 (reseat_at_next_visible_line_start): Use the bidi iterator state
11678 returned by forward_to_next_line_start to restore the state of
11679 it->bidi_it after backing up to previous newline. (Bug#9212)
11680
11681 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11682
11683 * regex.c (re_comp): Protoize.
11684 (re_exec): Fix return type.
11685 (regexec): Fix type of `ret'. (Bug#9203)
11686
11687 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11688
11689 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11690 This is needed if max-image-size is a floating-point number.
11691
11692 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11693
11694 * print.c (print_object): Print empty symbol as ##.
11695
11696 * lread.c (read1): Read ## as empty symbol.
11697
11698 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11699
11700 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11701 setting frame foreground color (Bug#9175).
11702 (x_set_background_color): Likewise.
11703
11704 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11705 contents (Bug#9176).
11706 (EmacsTooltip -init): Remove bezels and add shadows to
11707 tooltip windows.
11708
11709 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11710 or scroll bar (Bug#8470).
11711
11712 * nsfont.m (nsfont_open): Remove assignment to voffset and
11713 unnecessary vars hshink, expand, hd, full_height, min_height.
11714 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11715
11716 * nsterm.h (nsfont_info): Remove voffset field.
11717
11718 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11719
11720 Implement strike-through and overline on NextStep (Bug#8863).
11721
11722 * nsfont.m (nsfont_open): Use underline position provided by font,
11723 instead of hard-coded value of 2.
11724 (nsfont_draw): Call ns_draw_text_decoration instead.
11725
11726 * nsterm.h: Add declaration for ns_draw_text_decoration.
11727
11728 * nsterm.m (ns_draw_text_decoration): New function for drawing
11729 underline, overline, and strike-through.
11730 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11731 ns_draw_text_decoration. Change treatment of cursor drawing to
11732 accommodate underlining, etc.
11733
11734 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11735
11736 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11737 default.
11738
11739 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11740
11741 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11742 Without this fix, if a signal arrives just after memory fills up,
11743 'malloc' might be invoked reentrantly.
11744
11745 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11746 In other words, assume that every image size is allowed, on non-X
11747 hosts. This assumption is probably wrong, but it lets Emacs compile.
11748
11749 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11750
11751 * regex.c (re_iswctype): Convert return values to boolean.
11752
11753 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11754
11755 * xdisp.c (compute_display_string_pos): Don't use cached display
11756 string position if the buffer had its restriction changed.
11757 (Bug#9184)
11758
11759 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11760
11761 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11762
11763 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11764
11765 Integer signedness and overflow and related fixes. (Bug#9079)
11766
11767 * bidi.c: Integer size and overflow fixes.
11768 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11769 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11770 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11771 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11772 (bidi_find_other_level_edge):
11773 Use ptrdiff_t instead of EMACS_INT where either will do.
11774 This works better on 32-bit hosts configured --with-wide-int.
11775 (bidi_cache_ensure_space): Check for size-calculation overflow.
11776 Use % rather than repeated addition, for better worst-case speed.
11777 Don't set bidi_cache_size until after xrealloc returns, because it
11778 might not return.
11779 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11780 (bidi_cache_ensure_space): Also check that the bidi cache size
11781 does not exceed that of the largest Lisp string or buffer. See Eli
11782 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11783
11784 * alloc.c (__malloc_size_t): Remove.
11785 All uses replaced by size_t. See Andreas Schwab's note
11786 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11787
11788 * image.c: Improve checking for integer overflow.
11789 (check_image_size): Assume that f is nonnull, since
11790 it is always nonnull in practice. This is one less thing to
11791 worry about when checking for integer overflow later.
11792 (x_check_image_size): New function, which checks for integer
11793 overflow issues inside X.
11794 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11795 This removes the need for a memory_full check.
11796 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11797 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11798 (xbm_read_bitmap_data): Change locals back to 'int', since
11799 their values must fit in 'int'.
11800 (xpm_load_image, png_load, tiff_load):
11801 Invoke x_create_x_image_and_pixmap earlier,
11802 to avoid much needless work if the image is too large.
11803 (tiff_load): Treat overly large images as if
11804 x_create_x_image_and_pixmap failed, not as malloc failures.
11805 (gs_load): Use x_check_image_size.
11806
11807 * gtkutil.c: Omit integer casts.
11808 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11809 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11810
11811 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11812
11813 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11814 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11815 would wrongly return t on a 64-bit host.
11816
11817 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11818 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11819 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11820 and therefore cause GCC to emit a bogus diagnostic in some cases.
11821
11822 * image.c: Integer signedness and overflow and related fixes.
11823 This is not an exhaustive set of fixes, but it's time to
11824 record what I've got.
11825 (lookup_pixel_color, check_image_size): Remove redundant decls.
11826 (check_image_size): Don't assume that arbitrary EMACS_INT values
11827 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11828 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11829 (tiff_load, imagemagick_load_image):
11830 Check for overflow in size calculations.
11831 (x_create_x_image_and_pixmap): Remove unnecessary test for
11832 xmalloc returning NULL; that can't happen.
11833 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11834 (xpm_color_bucket): Use better integer hashing function.
11835 (xpm_cache_color): Don't possibly over-allocate memory.
11836 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11837 (gif_memory_source):
11838 Use ptrdiff_t, not int or size_t, to record sizes.
11839 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11840 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11841 either works, as we prefer signed integers.
11842 (tiff_read_from_memory, tiff_write_from_memory):
11843 Return tsize_t, not size_t, since that's what the TIFF API wants.
11844 (tiff_read_from_memory): Don't fail simply because the read would
11845 go past EOF; instead, return a short read.
11846 (tiff_load): Omit no-longer-needed casts.
11847 (Fimagemagick_types): Don't assume size fits into 'int'.
11848
11849 Improve hashing quality when configured --with-wide-int.
11850 * fns.c (hash_string): New function, taken from sxhash_string.
11851 Do not discard information about ASCII character case; this
11852 discarding is no longer needed.
11853 (sxhash-string): Use it. Change sig to match it. Caller changed.
11854 * lisp.h: Declare it.
11855 * lread.c (hash_string): Remove, since we now use fns.c's version.
11856 The fns.c version returns a wider integer if --with-wide-int is
11857 specified, so this should help the quality of the hashing a bit.
11858
11859 * emacs.c: Integer overflow minor fix.
11860 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11861 Define only if GNU_LINUX.
11862 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11863
11864 * dispnew.c: Integer signedness and overflow fixes.
11865 Remove unnecessary forward decls, that were a maintenance hassle.
11866 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11867 All uses changed.
11868 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11869 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11870 (prepare_desired_row, line_draw_cost):
11871 Use int, not unsigned, where either works.
11872 (save_current_matrix, restore_current_matrix):
11873 Use ptrdiff_t, not size_t, where either works.
11874 (init_display): Check for overflow more accurately, and without
11875 relying on undefined behavior.
11876
11877 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11878 Remove, replacing with the new symbols in lisp.h. All uses changed.
11879 * fileio.c (make_temp_name):
11880 * filelock.c (lock_file_1, lock_file):
11881 * xdisp.c (message_dolog):
11882 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11883 Use pMd etc. instead.
11884 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11885 replacing the pWIDE etc. symbols removed from editfns.c.
11886
11887 * keyboard.h (num_input_events): Now uintmax_t.
11888 This is (very slightly) less likely to mess up due to wraparound.
11889 All uses changed.
11890
11891 * buffer.c: Integer signedness fixes.
11892 (alloc_buffer_text, enlarge_buffer_text):
11893 Use ptrdiff_t rather than size_t when either will do, as we prefer
11894 signed integers.
11895
11896 * alloc.c: Integer signedness and overflow fixes.
11897 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11898 (__malloc_size_t): Default to size_t, not to int.
11899 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11900 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11901 Prefer ptrdiff_t to size_t when either would do, as we prefer
11902 signed integers.
11903 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11904 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11905 Now const. Initialize with values that are in range even if char
11906 is signed.
11907 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11908 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11909 These functions do the right thing with sizes > 2**32.
11910 (check_depth): Now ptrdiff_t, not int.
11911 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11912 Adjust to new way of storing sizes. Check for size overflow bugs
11913 in rest of code.
11914 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11915 slightly wrong anyway, as it missed one instance of
11916 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11917 (refill_memory_reserve): Omit needless cast to size_t.
11918 (mark_object_loop_halt): Mark as externally visible.
11919
11920 * xselect.c: Integer signedness and overflow fixes.
11921 (Fx_register_dnd_atom, x_handle_dnd_message):
11922 Use ptrdiff_t, not size_t, since we prefer signed.
11923 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11924 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11925 x_dnd_atoms_size and x_dnd_atoms_length.
11926
11927 * doprnt.c: Prefer signed to unsigned when either works.
11928 * eval.c (verror):
11929 * doprnt.c (doprnt):
11930 * lisp.h (doprnt):
11931 * xdisp.c (vmessage):
11932 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11933 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11934 prefer signed arithmetic to avoid comparison confusion.
11935 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11936 but is a bit tricky.
11937
11938 Assume freestanding C89 headers, string.h, stdlib.h.
11939 * data.c, doprnt.c, floatfns.c, print.c:
11940 Include float.h unconditionally.
11941 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11942 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11943 * regex.c: Likewise for stddef.h, string.h.
11944 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11945 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11946 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11947 (STDC_HEADERS): Remove obsolete defines.
11948 * sysdep.c: Include limits.h unconditionally.
11949
11950 Assume support for memcmp, memcpy, memmove, memset.
11951 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11952 * regex.c (memcmp, memcpy):
11953 Remove; we assume C89 now.
11954
11955 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11956 (__malloc_safe_bcopy): Remove; no longer needed.
11957
11958 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11959 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11960 well either way, and we prefer signed to unsigned.
11961
11962 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11963
11964 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11965 closes the connection while we're reading (bug#9182).
11966
11967 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11968
11969 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11970 are specified (Bug#9168).
11971
11972 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11973
11974 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11975 Found by GCC static checking and --with-wide-int on a 32-bit host.
11976
11977 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11978
11979 * xdisp.c (compute_display_string_pos): Fix logic of caching
11980 previous display string position. Initialize cached_prev_pos to
11981 -1. Fixes slow-down at the beginning of a buffer.
11982
11983 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11984
11985 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11986 for attrs[LFACE_FONTSET_INDEX].
11987
11988 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11989
11990 * xml.c (parse_region): Remove unused local
11991 that was recently introduced.
11992
11993 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11994
11995 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11996 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11997
11998 * xdisp.c (move_it_in_display_line_to): Record the best matching
11999 position for TO_CHARPOS while scanning the line, and restore it on
12000 exit if none of the characters scanned was an exact match.
12001 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12002 when exact match is impossible due to invisible text, and the
12003 lines are truncated.
12004
12005 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12006
12007 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12008 for OSX >= 10.7.
12009
12010 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12011
12012 Fix a significant slow-down of cursor motion with C-n, C-p,
12013 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12014 auto-repeat under bidi redisplay in fontified buffers.
12015 * xdisp.c (compute_stop_pos_backwards): New function.
12016 (next_element_from_buffer): Call compute_stop_pos_backwards to
12017 find a suitable prev_stop when we find ourselves before
12018 base_level_stop.
12019 (reseat): Don't look for prev_stop, as that could mean a very long
12020 run.
12021 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12022 <cached_disp_overlay_modiff>: Cache for last found display string
12023 position.
12024 (compute_display_string_pos): Return the cached position if asked
12025 about the same buffer in the same area of character positions, and
12026 the buffer wasn't changed since the time the display string
12027 position was cached.
12028
12029 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12030
12031 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12032 is an integer, which is important for empty lines. (Bug#9149)
12033
12034 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12035
12036 * frame.c (Fmodify_frame_parameters): In tty case, update the
12037 default face if necessary (Bug#4238).
12038
12039 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12040
12041 * editfns.c (Fstring_to_char): No need to explain what a character
12042 is in the docstring (Bug#6576).
12043
12044 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12045
12046 * xml.c (parse_region): Make sure we always return a tree.
12047
12048 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12049
12050 * xml.c (parse_region): If a document contains only comments,
12051 return that, too.
12052
12053 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12054
12055 * xml.c (make_dom): Return comments, too.
12056
12057 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12058
12059 Port to OpenBSD.
12060 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12061 and the surrounding thread.
12062 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12063 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12064 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12065 timer goes off.
12066 * s/openbsd.h (BROKEN_SIGIO): Define.
12067 * unexelf.c (unexec) [__OpenBSD__]:
12068 Don't update the .mdebug section of the Alpha COFF symbol table.
12069
12070 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12071
12072 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12073 (bug#8460).
12074
12075 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12076
12077 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12078 This fixes some race conditions on the permissions of any newly
12079 created file.
12080
12081 * alloc.c (valid_pointer_p): Use pipe, not open.
12082 This fixes some permissions issues when debugging.
12083
12084 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12085 If fchown fails to set both uid and gid, try to set just gid,
12086 as that is sometimes allowed. Adjust the file's mode to eliminate
12087 setuid or setgid bits that are inappropriate if fchown fails.
12088
12089 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12090
12091 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12092 to compare Lisp_Objects.
12093 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12094 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12095 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12096
12097 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12098
12099 * lread.c (read_integer): Unread even EOF character.
12100 (read1): Likewise. Properly record start position of symbol.
12101
12102 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12103 symbol character follows.
12104
12105 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12106
12107 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12108 This works around a problem with the previous change to Fcopy_file.
12109 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12110 and without this change, GCC might complain about discarding
12111 fchown's return value.
12112
12113 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12114
12115 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12116
12117 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12118
12119 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12120
12121 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12122
12123 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12124 it's used from the C level.
12125
12126 * process.c: Use the same condition for POLL_FOR_INPUT in both
12127 keyboard.c and process.c (bug#1858).
12128
12129 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12130
12131 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12132 (Fgnutls_boot): Use it.
12133
12134 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12135
12136 * doc.c (Fsubstitute_command_keys): Revert last change.
12137
12138 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12139
12140 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12141 quotes the next character, and doesn't affect other longer
12142 sequences (bug#8935).
12143
12144 * lread.c (syms_of_lread): Clarify that is isn't only
12145 `eval-buffer' and `eval-defun' that's affected by
12146 `lexical-binding' (bug#8460).
12147
12148 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12149
12150 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12151 bidi redisplay when a line includes both an image and is truncated.
12152
12153 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12154
12155 Fix minor problems found by static checking.
12156 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12157 (elsz): Now a signed constant, not a size_t var. We prefer signed
12158 types to unsigned, to avoid integer comparison confusion. Without
12159 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12160 "cannot optimize loop, the loop counter may overflow", a symptom
12161 of the confusion.
12162 * indent.c (Fvertical_motion): Mark locals as initialized.
12163 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12164
12165 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12166
12167 * search.c (Fre_search_backward): Mention `case-fold-search' in
12168 all the re_search_* functions (bug#8138).
12169
12170 * keyboard.c (Fopen_dribble_file): Document when the file is
12171 closed (bug#8056).
12172
12173 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12174
12175 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12176 bidi_cache_idx.
12177
12178 Support bidi reordering of display and overlay strings.
12179 * xdisp.c (compute_display_string_pos)
12180 (compute_display_string_end): Accept additional argument STRING.
12181 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12182 (reseat_to_string): Initialize bidi_it->string.s and
12183 bidi_it->string.schars.
12184 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12185 NULL (avoids a crash in bidi_paragraph_init).
12186 Initialize itb.string.lstring.
12187 (init_iterator): Call bidi_init_it only of a valid
12188 buffer position was specified. Initialize paragraph_embedding to
12189 L2R.
12190 (reseat_to_string): Initialize the bidi iterator.
12191 (display_string): If we need to ignore text properties of
12192 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12193 original value of -1 will not work with bidi.)
12194 (compute_display_string_pos): First arg is now struct
12195 `text_pos *'; all callers changed. Support display properties on
12196 Lisp strings.
12197 (compute_display_string_end): Support display properties on Lisp
12198 strings.
12199 (init_iterator, reseat_1, reseat_to_string): Initialize the
12200 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12201 when iterating on a string not from display properties).
12202 (compute_display_string_pos, compute_display_string_end):
12203 Fix calculation of the object to scan. Fixes an error when using
12204 arrow keys.
12205 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12206 base_level_stop; instead, set base_level_stop to BEGV.
12207 Fixes crashes in vertical-motion.
12208 (next_element_from_buffer): Improve commentary for when
12209 the iterator is before prev_stop.
12210 (init_iterator): Initialize bidi_p from the default value of
12211 bidi-display-reordering, not from buffer-local value. Use the
12212 buffer-local value only if initializing for buffer iteration.
12213 (handle_invisible_prop): Support invisible properties on strings
12214 that are being bidi-reordered.
12215 (set_iterator_to_next): Support bidi reordering of C strings and
12216 Lisp strings.
12217 (next_element_from_string): Support bidi reordering of Lisp
12218 strings.
12219 (handle_stop_backwards): Support Lisp strings as well.
12220 (display_string): Support display of R2L glyph rows.
12221 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12222 (init_iterator): Don't initialize it->bidi_p for strings
12223 here.
12224 (reseat_to_string): Initialize it->bidi_p for strings here.
12225 (next_element_from_string, next_element_from_c_string)
12226 (next_element_from_buffer): Add xassert's for correspondence
12227 between IT's object being iterated and it->bidi_it.string
12228 structure.
12229 (face_before_or_after_it_pos): Support bidi iteration.
12230 (next_element_from_c_string): Handle the case of the first string
12231 character that is not the first one in the visual order.
12232 (get_visually_first_element): New function, refactored from common
12233 parts of next_element_from_buffer, next_element_from_string, and
12234 next_element_from_c_string.
12235 (tool_bar_lines_needed, redisplay_tool_bar)
12236 (display_menu_bar): Force left-to-right direction. Add a FIXME
12237 comment for making that be controlled by a user option.
12238 (push_it, pop_it): Save and restore the state of the
12239 bidi iterator. Save and restore the bidi_p flag.
12240 (pop_it): Iterate out of display property for string iteration as
12241 well.
12242 (iterate_out_of_display_property): Support iteration over strings.
12243 (handle_single_display_spec): Set up it->bidi_it for iteration
12244 over a display string, and call bidi_init_it.
12245 (handle_single_display_spec, next_overlay_string)
12246 (get_overlay_strings_1, push_display_prop): Set up the bidi
12247 iterator for displaying display or overlay strings.
12248 (forward_to_next_line_start): Don't use the shortcut if
12249 bidi-iterating.
12250 (back_to_previous_visible_line_start): If handle_display_prop
12251 pushed the iterator stack, restore the internal state of the bidi
12252 iterator by calling bidi_pop_it same number of times.
12253 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12254 and we are bidi-iterating, don't decrement the iterator position;
12255 instead, set the first_elt flag in the bidi iterator, to produce
12256 the same effect.
12257 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12258 (push_display_prop): xassert that we are iterating a buffer.
12259 (push_it, pop_it): Save and restore paragraph_embedding member.
12260 (handle_single_display_spec, next_overlay_string)
12261 (get_overlay_strings_1, reseat_1, reseat_to_string)
12262 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12263 correctly. Don't assume unibyte strings are not bidi-reordered.
12264 (compute_display_string_pos)
12265 (compute_display_string_end): Fix handling the case of C string.
12266 (push_it, pop_it): Save and restore from_disp_prop_p.
12267 (handle_single_display_spec, push_display_prop): Set the
12268 from_disp_prop_p flag.
12269 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12270 (pop_it): Call iterate_out_of_display_property only if we are
12271 popping after iteration over a string that came from a display
12272 property. Fix a typo in popping stretch info. Add an assertion
12273 for verifying that the iterator position is in sync with the bidi
12274 iterator.
12275 (handle_single_display_spec, get_overlay_strings_1)
12276 (push_display_prop): Fix initialization of paragraph direction for
12277 string when that of the parent object is not yet determined.
12278 (reseat_1): Call bidi_init_it to resync the bidi
12279 iterator with IT's position. (Bug#7616)
12280 (find_row_edges): If ROW->start.pos gives position
12281 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12282 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12283 Reset the from_disp_prop_p flag.
12284 (SAVE_IT, RESTORE_IT): New macros.
12285 (pos_visible_p, face_before_or_after_it_pos)
12286 (back_to_previous_visible_line_start)
12287 (move_it_in_display_line_to, move_it_in_display_line)
12288 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12289 (try_scrolling, redisplay_window, display_line): Use them when
12290 saving a temporary copy of the iterator and restoring it back.
12291 (back_to_previous_visible_line_start, reseat_1)
12292 (init_iterator): Empty the bidi cache "stack".
12293 (move_it_in_display_line_to): If iterator ended up at
12294 EOL, but we never saw any buffer positions smaller than
12295 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12296 motion in bidi-reordered lines.
12297 (move_it_in_display_line_to): Record prev_method and prev_pos
12298 immediately before the call to set_iterator_to_next. Fixes cursor
12299 motion in bidi-reordered lines with stretch glyphs and strings
12300 displayed in margins. (Bug#8133) (Bug#8867)
12301 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12302 TO_CHARPOS.
12303 (pos_visible_p): Support positions in bidi-reordered lines.
12304 Save and restore bidi cache.
12305
12306 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12307 (bidi_paragraph_info): Delete unused struct.
12308 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12309 (bidi_cache_start): New variable.
12310 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12311 to zero.
12312 (bidi_cache_fetch_state, bidi_cache_search)
12313 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12314 (bidi_cache_find, bidi_peek_at_next_level)
12315 (bidi_level_of_next_char, bidi_find_other_level_edge)
12316 (bidi_move_to_visually_next): Compare cache index with
12317 bidi_cache_start rather than with zero.
12318 (bidi_fetch_char): Accept new argument STRING; all callers
12319 changed. Support iteration over a string. Support strings with
12320 display properties. Support unibyte strings. Fix the type of
12321 `len' according to what STRING_CHAR_AND_LENGTH expects.
12322 (bidi_paragraph_init, bidi_resolve_explicit_1)
12323 (bidi_resolve_explicit, bidi_resolve_weak)
12324 (bidi_level_of_next_char, bidi_move_to_visually_next):
12325 Support iteration over a string.
12326 (bidi_set_sor_type, bidi_resolve_explicit_1)
12327 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12328 can now be zero (for strings); special values 0 and -1 were
12329 changed to -1 and -2, respectively.
12330 (bidi_char_at_pos): New function.
12331 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12332 Call it instead of FETCH_MULTIBYTE_CHAR.
12333 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12334 initialized to valid values.
12335 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12336 values.
12337 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12338 the test for valid cached positions. Fix the logic for looking up
12339 the sentinel state in the cache. GCPRO the Lisp string we are
12340 iterating.
12341 (bidi_push_it, bidi_pop_it): New functions.
12342 (bidi_initialize): Initialize the bidi cache start stack pointer.
12343 (bidi_cache_ensure_space): New function, refactored from part of
12344 bidi_cache_iterator_state. Don't assume the required size is just
12345 one BIDI_CACHE_CHUNK away.
12346 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12347 (bidi_count_bytes, bidi_char_at_pos): New functions.
12348 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12349 always valid if bidi_cache_idx is valid.
12350 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12351 is valid if it's going to be used.
12352 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12353 (bidi_cache_fetch_state, bidi_cache_search)
12354 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12355 (bidi_cache_iterator_state, bidi_cache_find)
12356 (bidi_find_other_level_edge, bidi_cache_start_stack):
12357 All variables related to cache indices are now EMACS_INT.
12358
12359 * dispextern.h (struct bidi_string_data): New structure.
12360 (struct bidi_it): New member `string'. Make flag members be 1-bit
12361 fields, and put them last in the struct.
12362 (compute_display_string_pos, compute_display_string_end):
12363 Update prototypes.
12364 (bidi_push_it, bidi_pop_it): Add prototypes.
12365 (struct iterator_stack_entry): New members bidi_p,
12366 paragraph_embedding, and from_disp_prop_p.
12367 (struct it): Member bidi_p is now a bit field 1 bit wide.
12368 (bidi_shelve_cache, bidi_unshelve_cache):
12369 Declare prototypes.
12370
12371 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12372 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12373 and vector-like objects.
12374
12375 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12376 cache around display iteration.
12377
12378 * window.c (Fwindow_end, window_scroll_pixel_based)
12379 (displayed_window_lines, Frecenter): Save and restore the bidi
12380 cache around display iteration.
12381
12382 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12383
12384 * editfns.c (Fdelete_region): Clarify the use of the named
12385 parameters (bug#6788).
12386
12387 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12388
12389 * indent.c (Fvertical_motion): Set and restore w->pointm when
12390 saving and restoring the window's buffer (Bug#9006).
12391
12392 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12393
12394 * editfns.c (Fstring_to_char): Clarify just what is returned
12395 (bug#6576). Text by Eli Zaretskii.
12396
12397 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12398
12399 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12400
12401 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12402
12403 * buffer.c (mmap_find): Fix a typo.
12404
12405 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12406
12407 Fix execution of x selection hooks.
12408 * xselect.c (Qx_lost_selection_functions)
12409 (Qx_sent_selection_functions): New vars.
12410 (syms_of_xselect): DEFSYM them.
12411 (x_handle_selection_request): Pass Qx_sent_selection_functions
12412 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12413 (x_handle_selection_clear,x_clear_frame_selections):
12414 Pass Qx_lost_selection_functions rather than
12415 Vx_lost_selection_functions to Frun_hook_with_args.
12416
12417 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12418
12419 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12420 The old code sometimes used this field without initializing it.
12421
12422 * alloc.c (gc_sweep): Don't read past end of array.
12423 In theory, the old code could also have corrupted Emacs internals,
12424 though it'd be very unlikely.
12425
12426 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12427
12428 * character.c (Fcharacterp): Don't advertise optional ignored
12429 argument. (Bug#4026)
12430
12431 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12432
12433 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12434 key" (bug#4257).
12435
12436 * window.c (Fset_window_start): Doc fix (bug#4199).
12437 (Fset_window_hscroll): Ditto.
12438
12439 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12440
12441 Fix minor new problems caught by GCC 4.6.1.
12442 * term.c (init_tty): Remove unused local.
12443 * xsettings.c (store_monospaced_changed): Define this function only
12444 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12445 not used otherwise.
12446
12447 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12448
12449 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12450
12451 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12452
12453 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12454 are the mini-buffer and the echo area (bug#3320).
12455
12456 * term.c (init_tty): Remove support for supdup, c10 and perq
12457 terminals, which are no longer supported (bug#1482).
12458
12459 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12460
12461 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12462
12463 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12464
12465 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12466 for non-popups (Bug#3642).
12467
12468 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12469
12470 * alloc.c (reset_malloc_hooks): Protoize.
12471 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12472 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12473 * cm.c (losecursor): Likewise.
12474 * data.c (fmod): Likewise.
12475 * dispnew.c (swap_glyphs_in_rows): Likewise.
12476 * emacs.c (memory_warning_signal): Likewise.
12477 * floatfns.c (float_error): Likewise.
12478 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12479 (otf_open, font_otf_capability, generate_otf_features)
12480 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12481 Likewise.
12482 * image.c (pbm_read_file): Likewise.
12483 * indent.c (string_display_width): Likewise.
12484 * intervals.c (check_for_interval, search_for_interval)
12485 (inc_interval_count, count_intervals, root_interval)
12486 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12487 * lread.c (defalias): Likewise.
12488 * ralloc.c (r_alloc_check): Likewise.
12489 * regex.c (set_image_of_range_1, set_image_of_range)
12490 (regex_grow_registers): Likewise.
12491 * sysdep.c (strerror): Likewise.
12492 * termcap.c (valid_filename_p, tprint, main): Likewise.
12493 * tparam.c (main): Likewise.
12494 * unexhp9k800.c (run_time_remap, save_data_space)
12495 (update_file_ptrs, read_header, write_header, calculate_checksum)
12496 (copy_file, copy_rest, display_header): Likewise.
12497 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12498 Likewise.
12499 * xdisp.c (check_it): Likewise.
12500 * xfaces.c (register_color, unregister_color, unregister_colors):
12501 Likewise.
12502 * xfns.c (print_fontset_result): Likewise.
12503 * xrdb.c (member, fatal, main): Likewise.
12504
12505 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12506
12507 Fix minor problems found by static checking (Bug#9031).
12508 * chartab.c (char_table_set_range, map_sub_char_table):
12509 Remove unused locals.
12510 (uniprop_table): Now static.
12511 * composite.c (_work_char): Remove unused static var.
12512
12513 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12514
12515 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12516
12517 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12518
12519 * gtkutil.c (qttip_cb): Remove code without function.
12520
12521 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12522
12523 * w32.c (pthread_sigmask): New stub.
12524
12525 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12526
12527 Use pthread_sigmask, not sigprocmask (Bug#9010).
12528 sigprocmask is portable only for single-threaded applications, and
12529 Emacs can be multi-threaded when it uses GTK.
12530 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12531 (LIBES): Use it.
12532 * callproc.c (Fcall_process):
12533 * process.c (create_process):
12534 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12535 Use pthread_sigmask, not sigprocmask.
12536
12537 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12538
12539 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12540 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12541 wrong (Bug#8591).
12542
12543 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12544
12545 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12546 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12547 (xg_hide_tooltip): Fix comment.
12548
12549 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12550 in registerServicesMenuSendTypes.
12551 (validRequestorForSendType): Don't check ns_return_types.
12552
12553 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12554 ns_return_type.
12555
12556 2011-07-08 Jason Rumney <jasonr@gnu.org>
12557
12558 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12559 SH_SHOW for hidden windows (Bug#5482).
12560
12561 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12562 frame struct members of non-existent frames (Bug#6284).
12563
12564 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12565
12566 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12567 variable firstTime not needed on OSX >= 10.6.
12568 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12569 >= 10.5. Use setKnobProportion, setDoubleValue.
12570
12571 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12572 (MAC_OS_X_VERSION_10_5): Define if not defined.
12573 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12574 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12575 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12576
12577 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12578 cString and lossyCString on OSX >= 10.4.
12579
12580 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12581 sizeToFit on OSX >= 10.2.
12582
12583 * nsimage.m (allocInitFromFile): Don't use deprecated method
12584 bestRepresentationForDevice on OSX >= 10.6.
12585
12586 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12587 to avoid warning.
12588
12589 * emacs.c: Declare unexec_init_emacs_zone.
12590
12591 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12592
12593 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12594
12595 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12596 on svcsMenu (Bug#8842).
12597
12598 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12599 ns_return_types.
12600 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12601
12602 * nsterm.m (QUTF8_STRING): Declare.
12603 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12604 (validRequestorForSendType): Return type is (id).
12605 Change indexOfObjectIdenticalTo to indexOfObject.
12606 Check if we have local selection before returning self (Bug#8842).
12607 (writeSelectionToPasteboard): Put local selection into paste board
12608 if we have a local selection (Bug#8842).
12609 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12610
12611 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12612 (ns_get_local_selection): Declare.
12613
12614 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12615
12616 * keymap.c (describe_map_tree): Don't insert a double newline at
12617 the end of the buffer (bug#1169) and return whether we inserted
12618 something.
12619
12620 * callint.c (Fcall_interactively): Change "reading args" to
12621 "providing args" to try to clarify what it does (bug#1010).
12622
12623 2011-07-07 Kenichi Handa <handa@m17n.org>
12624
12625 * composite.c (composition_compute_stop_pos): Ignore a static
12626 composition starting before CHARPOS (Bug#8915).
12627
12628 * xdisp.c (handle_composition_prop): Likewise.
12629
12630 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12631
12632 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12633 (Bug#9015)
12634
12635 2011-07-07 Kenichi Handa <handa@m17n.org>
12636
12637 * character.h (unicode_category_t): New enum type.
12638
12639 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12640 (Qchar_code_property_table): New variable.
12641 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12642 (UNIPROP_COMPRESSED_FORM_P): New macros.
12643 (char_table_ascii): Uncompress the compressed values.
12644 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12645 Uncompress the compressed values.
12646 (sub_char_table_ref_and_range): Likewise.
12647 (char_table_ref_and_range): Uncompress the compressed values.
12648 (sub_char_table_set): New arg is_uniprop. Callers changed.
12649 Uncompress the compressed values.
12650 (sub_char_table_set_range): Args changed. Callers changed.
12651 (char_table_set_range): Adjuted for the above change.
12652 (map_sub_char_table): Delete args default_val and parent. Add arg
12653 top. Give decoded values to a Lisp function.
12654 (map_char_table): Adjust for the above change. Give decoded
12655 values to a Lisp function. Gcpro more variables.
12656 (uniprop_table_uncompress)
12657 (uniprop_decode_value_run_length): New functions.
12658 (uniprop_decoder, uniprop_decoder_count): New variables.
12659 (uniprop_get_decoder, uniprop_encode_value_character)
12660 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12661 New functions.
12662 (uniprop_encoder, uniprop_encoder_count): New variables.
12663 (uniprop_get_encoder, uniprop_table)
12664 (Funicode_property_table_internal, Fget_unicode_property_internal)
12665 (Fput_unicode_property_internal): New functions.
12666 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12667 Sunicode_property_table_internal, Sget_unicode_property_internal,
12668 and Sput_unicode_property_internal. Defvar_lisp
12669 char-code-property-alist.
12670
12671 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12672 Vunicode_category_table.
12673
12674 * font.c (font_range): Adjust for the change of
12675 Vunicode_category_table.
12676
12677 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12678
12679 * m/iris4d.h: Remove file, move contents ...
12680 * s/irix6-5.h: ... here.
12681
12682 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12683
12684 Remove unportable assumption about struct layout (Bug#8884).
12685 * alloc.c (mark_buffer):
12686 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12687 (clone_per_buffer_values): Don't assume that
12688 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12689 This isn't true in general, and it's particularly not true
12690 if Emacs is configured with --with-wide-int.
12691 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12692 New macros, used in the buffer.c change.
12693
12694 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12695
12696 * xsettings.c: Use both GConf and GSettings if both are available.
12697 (store_config_changed_event): Add comment.
12698 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12699 (store_tool_bar_style_changed): New functions.
12700 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12701 (struct xsettings): Move font inside HAVE_XFT.
12702 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12703 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12704 Move inside HAVE_XFT.
12705 (something_changed_gsettingsCB): Rename from something_changedCB.
12706 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12707 also.
12708 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12709 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12710 (something_changed_gconfCB): Rename from something_changedCB.
12711 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12712 (parse_settings): Move check for font inside HAVE_XFT.
12713 (read_settings, apply_xft_settings): Add comment.
12714 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12715 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12716 call store_font_name_changed.
12717 (xft_settings_event): Add comment.
12718 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12719 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12720 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12721 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12722 (xsettings_initialize): Call init_gsettings last.
12723 (xsettings_get_system_font, xsettings_get_system_normal_font):
12724 Add comment.
12725
12726 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12727
12728 Random fixes. E.g., (random) never returned negative values.
12729 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12730 subseconds part to the entropy, as that's a bit more random.
12731 Prefer signed to unsigned, since the signedness doesn't matter and
12732 in general we prefer signed. When given a limit, use a
12733 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12734 latter isn't right if USE_2_TAGS_FOR_INTS.
12735 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12736 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12737
12738 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12739
12740 * textprop.c (text_property_stickiness):
12741 Obey Vtext_property_default_nonsticky.
12742 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12743 * w32fns.c (syms_of_w32fns):
12744 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12745
12746 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12747
12748 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12749 This is more efficient than Ffile_directory_p and avoids a minor race.
12750
12751 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12752
12753 * buffer.c (Foverlay_put): Say what the return value is
12754 (bug#7835).
12755
12756 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12757 is a directory before asking whether to use the file name
12758 (bug#7564).
12759 (barf_or_query_if_file_exists): Make the "File is a directory"
12760 error be more correct.
12761
12762 * fns.c (Frequire): Remove the mention of the .gz files, since
12763 that's installation-specific, but keep the mention of
12764 `get-load-suffixes'.
12765
12766 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12767
12768 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12769 Report string overflow if the output is too long.
12770
12771 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12772
12773 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12774 (syms_of_gnutls): Remove duplicate DEFSYM for
12775 Qgnutls_bootprop_verify_hostname_error, an error for
12776 Qgnutls_bootprop_verify_error (which is no longer used).
12777
12778 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12779 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12780 Also (re)move comments that are misplaced or no longer relevant.
12781
12782 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12783
12784 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12785
12786 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12787
12788 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12789 and background color parameters if they have been changed.
12790
12791 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12792
12793 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12794
12795 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12796
12797 * xsettings.c (SYSTEM_FONT): Define only when used.
12798 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12799
12800 * keymap.c (access_keymap_1): Now static.
12801
12802 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12803
12804 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12805 leave any prefix arg for the up event (Bug#1586).
12806
12807 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12808
12809 * lread.c (syms_of_lread): Mention single symbols defined by
12810 `defvar' or `defconst' (bug#7154).
12811
12812 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12813 (Frequire): Mention get-load-suffixes.
12814
12815 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12816
12817 * window.h (window): Remove clone_number slot.
12818 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12819 Remove.
12820 (make_parent_window, make_window, saved_window)
12821 (Fset_window_configuration, save_window_save): Don't deal with
12822 clone numbers.
12823 * buffer.c (Qclone_number): Remove declaration.
12824 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12825
12826 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12827
12828 Add multiple inheritance to keymaps.
12829 * keymap.c (Fmake_composed_keymap): New function.
12830 (Fset_keymap_parent): Simplify.
12831 (fix_submap_inheritance): Remove.
12832 (access_keymap_1): New function extracted from access_keymap to handle
12833 embedded parents and handle lists of maps.
12834 (access_keymap): Use it.
12835 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12836 (Fcopy_keymap): Handle embedded parents.
12837 (Fcommand_remapping, define_as_prefix): Simplify.
12838 (Fkey_binding): Simplify.
12839 (syms_of_keymap): Move minibuffer-local-completion-map,
12840 minibuffer-local-filename-completion-map,
12841 minibuffer-local-must-match-map, and
12842 minibuffer-local-filename-must-match-map to Elisp.
12843 (syms_of_keymap): Defsubr make-composed-keymap.
12844 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12845 (parse_menu_item): Trivial simplification.
12846
12847 2011-07-01 Glenn Morris <rgm@gnu.org>
12848
12849 * Makefile.in (SETTINGS_LIBS): Fix typo.
12850
12851 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12852
12853 * coding.c (Fencode_coding_string): Record the last coding system
12854 used, as the function doc string says (bug#8738).
12855
12856 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12857
12858 * xsettings.c (store_monospaced_changed): Take new font as arg and
12859 check for change against current_mono_font.
12860 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12861 (emacs_settings_constructor, emacs_settings_get_property)
12862 (emacs_settings_set_property, emacs_settings_class_init)
12863 (emacs_settings_init, gsettings_obj): Remove.
12864 (something_changedCB): New function for HAVE_GSETTINGS.
12865 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12866 with value as argument.
12867 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12868 g_settings_new (Bug#8967). Do not create gsettings_obj.
12869 Remove calls to g_settings_bind. Connect something_changedCB to
12870 "changed".
12871
12872 * xgselect.c: Add defined (HAVE_GSETTINGS).
12873 (xgselect_initialize): Ditto.
12874
12875 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12876 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12877 xg_select.
12878
12879 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12880
12881 * eval.c (struct backtrace): Simplify and port the data structure.
12882 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12883 signed bit field, as this assumption is not portable and it makes
12884 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12885 "char debug_on_exit : 1" as this is not portable either; instead,
12886 use the portable "unsigned int debug_on_exit : 1". Remove unused
12887 member evalargs. Remove obsolete comments about cc bombing out.
12888
12889 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12890
12891 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12892 Let HAVE_GSETTINGS override HAVE_GCONF.
12893 (store_monospaced_changed): New function.
12894 (EMACS_SETTINGS): A new type derived from GObject to handle
12895 GSettings notifications.
12896 (emacs_settings_constructor, emacs_settings_get_property)
12897 (emacs_settings_set_property, emacs_settings_class_init):
12898 New functions.
12899 (gsettings_client, gsettings_obj): New variables.
12900 (GSETTINGS_SCHEMA): New define.
12901 (something_changedCB): Call store_monospaced_changed.
12902 (init_gsettings): New function.
12903 (xsettings_initialize): Call init_gsettings.
12904 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12905 to NULL.
12906
12907 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12908 GCONF_CFLAGS/LIBS.
12909
12910 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12911
12912 * window.c (resize_root_window, grow_mini_window)
12913 (shrink_mini_window): Rename Qresize_root_window to
12914 Qwindow_resize_root_window and Qresize_root_window_vertically to
12915 Qwindow_resize_root_window_vertically.
12916
12917 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12918
12919 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12920
12921 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12922
12923 * makefile.w32-in: Redesign dependencies so they reflect more
12924 clearly which files are directly included by each source file,
12925 and not through other includes.
12926
12927 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12928
12929 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12930 (sort_overlays, overlay_strings): When an overlay's clone number
12931 matches the window's clone number process the overlay even if
12932 the overlay's window property doesn't match the current window.
12933
12934 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12935 (Fwindow_hchild): Rename to Fwindow_left_child.
12936 (Fwindow_next): Rename to Fwindow_next_sibling.
12937 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12938 (resize_window_check): Rename to window_resize_check.
12939 (resize_window_apply): Rename to window_resize_apply.
12940 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12941 (Fdelete_other_windows_internal, resize_frame_windows)
12942 (Fsplit_window_internal, Fdelete_window_internal)
12943 (grow_mini_window, shrink_mini_window)
12944 (Fresize_mini_window_internal): Fix callers accordingly.
12945
12946 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12947
12948 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12949 (emacs_fixed_set_min_size): Remove.
12950 (emacs_fixed_new): Take frame as argument.
12951
12952 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12953 (_EmacsFixedPrivate): Remove minwidth/height.
12954 Add struct frame *f.
12955 (emacs_fixed_init): Initialize priv->f.
12956 (get_parent_class, emacs_fixed_set_min_size): Remove.
12957 (emacs_fixed_new): Set priv->f to argument.
12958 (emacs_fixed_get_preferred_width)
12959 (emacs_fixed_get_preferred_height): Use min_width/height from
12960 frames size_hint to set minimum and natural (Bug#8919).
12961 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12962 and use min_width/height from frames size_hint to set
12963 min_width/height (Bug#8919).
12964
12965 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12966 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12967 Fix indentation.
12968
12969 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12970
12971 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12972 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12973 called at ZV.
12974
12975 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12976
12977 * process.c (wait_reading_process_output): Bypass select if
12978 waiting for a cell while ignoring keyboard input, and input is
12979 pending. Suggested by Jan Djärv (Bug#8869).
12980
12981 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12982
12983 Use gnulib's dup2 module instead of rolling our own.
12984 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12985
12986 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12987
12988 * dispnew.c (scrolling_window): Before scrolling, turn off a
12989 mouse-highlight in the window being scrolled.
12990
12991 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12992
12993 Move DEFSYM to lisp.h and use everywhere.
12994
12995 * character.h (DEFSYM): Move declaration...
12996 * lisp.h (DEFSYM): ...here.
12997
12998 * gnutls.c:
12999 * minibuf.c:
13000 * w32menu.c:
13001 * w32proc.c:
13002 * w32select.c: Don't include character.h.
13003
13004 * alloc.c (syms_of_alloc):
13005 * buffer.c (syms_of_buffer):
13006 * bytecode.c (syms_of_bytecode):
13007 * callint.c (syms_of_callint):
13008 * casefiddle.c (syms_of_casefiddle):
13009 * casetab.c (init_casetab_once):
13010 * category.c (init_category_once, syms_of_category):
13011 * ccl.c (syms_of_ccl):
13012 * cmds.c (syms_of_cmds):
13013 * composite.c (syms_of_composite):
13014 * dbusbind.c (syms_of_dbusbind):
13015 * dired.c (syms_of_dired):
13016 * dispnew.c (syms_of_display):
13017 * doc.c (syms_of_doc):
13018 * editfns.c (syms_of_editfns):
13019 * emacs.c (syms_of_emacs):
13020 * eval.c (syms_of_eval):
13021 * fileio.c (syms_of_fileio):
13022 * fns.c (syms_of_fns):
13023 * frame.c (syms_of_frame):
13024 * fringe.c (syms_of_fringe):
13025 * insdel.c (syms_of_insdel):
13026 * keymap.c (syms_of_keymap):
13027 * lread.c (init_obarray, syms_of_lread):
13028 * macros.c (syms_of_macros):
13029 * msdos.c (syms_of_msdos):
13030 * print.c (syms_of_print):
13031 * process.c (syms_of_process):
13032 * search.c (syms_of_search):
13033 * sound.c (syms_of_sound):
13034 * syntax.c (init_syntax_once, syms_of_syntax):
13035 * terminal.c (syms_of_terminal):
13036 * textprop.c (syms_of_textprop):
13037 * undo.c (syms_of_undo):
13038 * w32.c (globals_of_w32):
13039 * window.c (syms_of_window):
13040 * xdisp.c (syms_of_xdisp):
13041 * xfaces.c (syms_of_xfaces):
13042 * xfns.c (syms_of_xfns):
13043 * xmenu.c (syms_of_xmenu):
13044 * xsettings.c (syms_of_xsettings):
13045 * xterm.c (syms_of_xterm): Use DEFSYM.
13046
13047 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13048
13049 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13050
13051 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13052
13053 Integer and buffer overflow fixes (Bug#8873).
13054
13055 * print.c (printchar, strout): Check for string overflow.
13056 (PRINTPREPARE, printchar, strout):
13057 Don't set size unless allocation succeeds.
13058
13059 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13060 for sizes. Check for string overflow more accurately.
13061 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13062
13063 * macros.c: Integer and buffer overflow fixes.
13064 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13065 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13066 Use ptrdiff_t, not int, for sizes.
13067 Don't increment bufsize until after realloc succeeds.
13068 Check for size-calculation overflow.
13069 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13070
13071 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13072
13073 * lread.c: Integer overflow fixes.
13074 (read_integer): Radix is now EMACS_INT, not int,
13075 to improve quality of diagnostics for out-of-range radices.
13076 Calculate buffer size correctly for out-of-range radices.
13077 (read1): Check for integer overflow in radices, and in
13078 read-circle numbers.
13079 (read_escape): Avoid int overflow.
13080 (Fload, openp, read_buffer_size, read1)
13081 (substitute_object_recurse, read_vector, read_list, map_obarray):
13082 Use ptrdiff_t, not int, for sizes.
13083 (read1): Use EMACS_INT, not int, for sizes.
13084 Check for size overflow.
13085
13086 * image.c (cache_image): Check for size arithmetic overflow.
13087
13088 * lread.c: Integer overflow issues.
13089 (saved_doc_string_size, saved_doc_string_length)
13090 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13091 Now ptrdiff_t, not int.
13092 (read1): Don't assume doc string length fits in int. Check for
13093 out-of-range doc string lengths.
13094 (read_list): Don't assume file position fits in int.
13095 (read_escape): Check for hex character overflow.
13096
13097 2011-06-22 Leo Liu <sdl.web@gmail.com>
13098
13099 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13100 Move to minibuffer.el.
13101
13102 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13103
13104 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13105 The following patches are for when GLYPH_DEBUG && !XASSERT.
13106 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13107 * dispnew.c (flush_stdout):
13108 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13109 Mark as externally visible.
13110 * dispnew.c (check_window_matrix_pointers): Now static.
13111 * dispnew.c (window_to_frame_vpos):
13112 * xfns.c (unwind_create_frame):
13113 * xterm.c (x_check_font): Remove unused local.
13114 * scroll.c (CHECK_BOUNDS):
13115 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13116 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13117 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13118 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13119 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13120 Now static.
13121 (debug_method_add): Use va_list and vsprintf rather than relying
13122 on undefined behavior with wrong number of arguments.
13123 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13124 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13125 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13126 since we're not interested in debugging glyphs with old libraries.
13127 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13128 GCC 4.6.0's static checking.
13129
13130 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13131
13132 Integer overflow and signedness fixes (Bug#8873).
13133 A few related buffer overrun fixes, too.
13134
13135 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13136
13137 * dispextern.h (struct face.stipple):
13138 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13139 (x_bitmap_mask, x_allocate_bitmap_record)
13140 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13141 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13142 (x_create_bitmap_from_xpm_data):
13143 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13144 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13145 (.bitmaps_last):
13146 * xfaces.c (load_pixmap):
13147 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13148 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13149 (.bitmaps_last, struct x_output.icon_bitmap):
13150 Use ptrdiff_t, not int, for bitmap indexes.
13151 (x_allocate_bitmap_record): Check for size overflow.
13152 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13153
13154 Use ptrdiff_t, not int, for overlay counts.
13155 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13156 * editfns.c (overlays_around, get_pos_property):
13157 * textprop.c (get_char_property_and_overlay):
13158 * xdisp.c (next_overlay_change, note_mouse_highlight):
13159 * xfaces.c (face_at_buffer_position):
13160 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13161 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13162 (Fnext_overlay_change, Fprevious_overlay_change)
13163 (mouse_face_overlay_overlaps, Foverlays_in):
13164 Use ptrdiff_t, not int, for sizes.
13165 (overlays_at, overlays_in): Check for size-calculation overflow.
13166
13167 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13168
13169 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13170 (x_session_initialize): Do not assume string length fits in int.
13171
13172 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13173 This is unlikely, but can occur if DPI is outlandish.
13174
13175 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13176 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13177
13178 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13179 * xrdb.c (magic_file_p, search_magic_path):
13180 Omit last arg SUFFIX; it was always 0. All callers changed.
13181 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13182
13183 * xfont.c (xfont_match): Avoid need for strlen.
13184
13185 * xfns.c: Don't assume strlen fits in int.
13186 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13187
13188 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13189 not unsigned long, as we prefer signed integers. All callers changed.
13190 Detect integer overflow in repeat count.
13191 (message_dolog): Don't assume print length fits in 39 bytes.
13192 (display_mode_element): Don't assume strlen fits in int.
13193
13194 * termcap.c: Don't assume sizes fit in int and never overflow.
13195 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13196 (gobble_line): Check for size-calculation overflow.
13197
13198 * minibuf.c (Fread_buffer):
13199 * lread.c (intern, intern_c_string):
13200 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13201 Don't assume string length fits in int.
13202
13203 * keyboard.c (parse_tool_bar_item):
13204 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13205
13206 * font.c: Don't assume string length fits in int.
13207 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13208 Use ptrdiff_t, not int.
13209 (font_intern_prop): Don't assume string length fits in int.
13210 Don't assume integer property fits in fixnum.
13211 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13212
13213 * filelock.c: Fix some buffer overrun and integer overflow issues.
13214 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13215 Reformulate so as not to need the command string.
13216 Invoke gzip -cd rather than gunzip, as it's more portable.
13217 (lock_info_type, lock_file_1, lock_file):
13218 Don't assume pid_t and time_t fit in unsigned long.
13219 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13220 (current_lock_owner): Prefer signed type for sizes.
13221 Use memcpy, not strncpy, where memcpy is what is really wanted.
13222 Don't assume (via atoi) that time_t and pid_t fit in int.
13223 Check for time_t and/or pid_t out of range, e.g., via a network share.
13224 Don't alloca where an auto var works fine.
13225
13226 * fileio.c: Fix some integer overflow issues.
13227 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13228 Don't assume string length fits in int.
13229 (directory_file_name): Don't assume string length fits in long.
13230 (make_temp_name): Don't assume pid fits in int, or that its print
13231 length is less than 20.
13232
13233 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13234
13235 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13236
13237 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13238
13239 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13240 We prefer signed integers, even for size calculations.
13241
13242 * emacs.c: Don't assume string length fits in 'int'.
13243 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13244 (main): Don't invoke strlen when not needed.
13245
13246 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13247 (XD_DEBUG_MESSAGE): Don't waste a byte.
13248
13249 * callproc.c (getenv_internal_1, getenv_internal)
13250 (Fgetenv_internal):
13251 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13252
13253 * lread.c (invalid_syntax): Omit length argument.
13254 All uses changed. This doesn't fix a bug, but it simplifies the
13255 code away from its former Hollerith-constant appearance, and it's
13256 one less 'int' to worry about when looking at integer-overflow issues.
13257 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13258
13259 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13260 This didn't break anything, but it didn't help either.
13261 It's confusing to put a bogus integer in a place where the actual
13262 value does not matter.
13263 (LIST_END_P): Remove unused macro and its bogus comment.
13264 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13265
13266 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13267 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13268 implementation.
13269 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13270 We prefer signed types, and the value cannot exceed the EMACS_INT
13271 range anyway (because otherwise the length would not be representable).
13272 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13273 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13274 This avoids a GCC warning when WIDE_EMACS_INT.
13275
13276 * indent.c (sane_tab_width): New function.
13277 (current_column, scan_for_column, Findent_to, position_indentation)
13278 (compute_motion): Use it. This is just for clarity.
13279 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13280
13281 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13282
13283 * lisp.h (lint_assume): New macro.
13284 * composite.c (composition_gstring_put_cache):
13285 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13286
13287 * editfns.c, insdel.c:
13288 Omit unnecessary forward decls, to simplify future changes.
13289
13290 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13291
13292 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13293
13294 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13295 Use much-faster test for byte-length change.
13296 Don't assume string byte-length fits in 'int'.
13297 Check that character arg fits in 'int'.
13298 (mapcar1): Declare byte as byte, for clarity.
13299
13300 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13301
13302 * fns.c (concat): Catch string overflow earlier.
13303 Do not rely on integer wraparound.
13304
13305 * dispextern.h (struct it.overlay_strings_charpos)
13306 (struct it.selective): Now EMACS_INT, not int.
13307 * xdisp.c (forward_to_next_line_start)
13308 (back_to_previous_visible_line_start)
13309 (reseat_at_next_visible_line_start, next_element_from_buffer):
13310 Don't arbitrarily truncate the value of 'selective' to int.
13311
13312 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13313
13314 * composite.c: Don't truncate sizes to 'int'.
13315 (composition_gstring_p, composition_reseat_it)
13316 (composition_adjust_point): Use EMACS_INT, not int.
13317 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13318 not EMACS_UINT, for indexes.
13319
13320 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13321
13322 * buffer.c: Include <verify.h>.
13323 (struct sortvec.priority, struct sortstr.priority):
13324 Now EMACS_INT, not int.
13325 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13326 (struct sortstr.size, record_overlay_string)
13327 (struct sortstrlist.size, struct sortlist.used):
13328 Don't truncate size to int.
13329 (record_overlay_string): Check for size-calculation overflow.
13330 (init_buffer_once): Check at compile-time, not run-time.
13331
13332 2011-06-22 Jim Meyering <meyering@redhat.com>
13333
13334 Don't leak an XBM-image-sized buffer
13335 * image.c (xbm_load): Free the image buffer after using it.
13336
13337 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13338
13339 Port to Sun C.
13340 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13341 that Sun C diagnosed.
13342 * fns.c (secure_hash): Fix pointer signedness issue.
13343 * intervals.c (static_offset_intervals): New function.
13344 (offset_intervals): Use it.
13345
13346 2011-06-21 Leo Liu <sdl.web@gmail.com>
13347
13348 * deps.mk (fns.o):
13349 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13350 sha512.h.
13351
13352 * fns.c (secure_hash): Rename from crypto_hash_function and change
13353 the first arg to accept symbols.
13354 (Fsecure_hash): New primitive.
13355 (syms_of_fns): New symbols.
13356
13357 2011-06-20 Deniz Dogan <deniz@dogan.se>
13358
13359 * process.c (Fset_process_buffer): Clarify return value in
13360 docstring.
13361
13362 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13363
13364 * dispnew.c (add_window_display_history): Use BVAR.
13365
13366 * xdisp.c (debug_method_add): Use BVAR.
13367 (check_window_end, dump_glyph_matrix, dump_glyph)
13368 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13369
13370 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13371 Likewise.
13372
13373 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13374 check till after the cache is created in init_frame_faces.
13375
13376 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13377
13378 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13379
13380 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13381
13382 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13383 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13384 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13385
13386 Improve buffer-overflow checking (Bug#8873).
13387 * fileio.c (Finsert_file_contents):
13388 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13389 Remove the old (too-loose) buffer overflow checks.
13390 They weren't needed, since make_gap checks for buffer overflow.
13391 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13392 The old code merely checked for Emacs fixnum overflow, and relied
13393 on undefined (wraparound) behavior. The new code avoids undefined
13394 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13395
13396 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13397 Tune. Don't use wider integers than needed. Don't use alloca.
13398 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13399
13400 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13401
13402 * insdel.c, lisp.h (buffer_overflow): New function.
13403 (insert_from_buffer_1, replace_range, replace_range_2):
13404 * insdel.c (make_gap_larger):
13405 * editfns.c (Finsert_char):
13406 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13407
13408 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13409
13410 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13411
13412 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13413
13414 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13415 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13416
13417 * fileio.c: Don't assume EMACS_INT fits in off_t.
13418 (emacs_lseek): New static function.
13419 (Finsert_file_contents, Fwrite_region): Use it.
13420 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13421
13422 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13423
13424 * fns.c: Don't overflow int when computing a list length.
13425 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13426 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13427 truncation on 64-bit hosts. Check for QUIT every
13428 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13429 faster and is responsive enough.
13430 (Flength): Report an error instead of overflowing an integer.
13431 (Fsafe_length): Return a float if the value is not representable
13432 as a fixnum. This shouldn't happen except in contrived situations.
13433 (Fnthcdr, Fsort): Don't assume list length fits in int.
13434 (Fcopy_sequence): Don't assume vector length fits in int.
13435
13436 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13437 (header_size, word_size): New constants.
13438 (allocate_vectorlike): Don't check size overflow here.
13439 (allocate_vector): Check it here instead, since this is the only
13440 caller of allocate_vectorlike that could cause overflow.
13441 Check that the new vector's length is representable as a fixnum.
13442
13443 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13444 The previous code was bogus. For example, next_almost_prime (32)
13445 returned 39, which is undesirable as it is a multiple of 3; and
13446 next_almost_prime (24) returned 25, which is a multiple of 5 so
13447 why was the code bothering to check for multiples of 7?
13448
13449 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13450
13451 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13452
13453 Variadic C functions now count arguments with ptrdiff_t.
13454 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13455 Back then I didn't know that the Emacs coding style prefers signed int.
13456 Also, in the meantime I found a few more instances where arguments
13457 were being counted with int, which may truncate counts on 64-bit
13458 machines, or EMACS_INT, which may be unnecessarily wide.
13459 * lisp.h (struct Lisp_Subr.function.aMANY)
13460 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13461 Arg counts are now ptrdiff_t, not size_t.
13462 All variadic functions and their callers changed accordingly.
13463 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13464 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13465 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13466 * callint.c (Fcall_interactively): Check arg count for overflow,
13467 to avoid potential buffer overrun. Use signed char, not 'int',
13468 for 'varies' array, so that we needn't bother to check its size
13469 calculation for overflow.
13470 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13471 * eval.c (apply_lambda):
13472 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13473 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13474 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13475
13476 * callint.c (Fcall_interactively): Don't use index var as event count.
13477
13478 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13479 * mem-limits.h (SIZE): Remove; no longer used.
13480
13481 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13482
13483 Remove unnecessary casts.
13484 * xterm.c (x_term_init):
13485 * xfns.c (x_set_border_pixel):
13486 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13487 These aren't needed now that we assume ANSI C.
13488
13489 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13490 It's more likely to cause problems (due to unsigned overflow)
13491 than to cure them.
13492
13493 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13494
13495 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13496
13497 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13498
13499 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13500
13501 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13502
13503 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13504
13505 GLYPH_CODE_FACE returns EMACS_INT, not int.
13506 * dispextern.h (merge_faces):
13507 * xfaces.c (merge_faces):
13508 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13509 Don't assume EMACS_INT fits in int.
13510
13511 * character.h (CHAR_VALID_P): Remove unused parameter.
13512 * fontset.c, lisp.h, xdisp.c: All uses changed.
13513
13514 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13515
13516 * fns.c (concat): Minor tuning based on overflow analysis.
13517 This doesn't fix any bugs. Use int to hold character, instead
13518 of constantly refetching from Emacs object. Use XFASTINT, not
13519 XINT, for value known to be a character. Don't bother comparing
13520 a single byte to 0400, as it's always less.
13521
13522 * floatfns.c (Fexpt):
13523 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13524
13525 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13526 for characters.
13527
13528 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13529
13530 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13531 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13532 incorrectly succeed when S was a string, because 4294967386 was
13533 truncated before it was used.
13534
13535 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13536 Otherwise, an out-of-range integer could cause undefined behavior
13537 on a 64-bit host.
13538
13539 * composite.c: Use int, not EMACS_INT, for characters.
13540 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13541 EMACS_INT, for values that are known to be in character range.
13542 This doesn't fix any bugs but is the usual style inside Emacs and
13543 may generate better code on 32-bit machines.
13544
13545 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13546 This is for reasons similar to the recent CHAR_STRING fix.
13547 * charset.c (Fencode_char): Check that character arg is actually
13548 a character. Pass an int to ENCODE_CHAR.
13549 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13550 wider than 'int', as a compile-time check to prevent future regressions
13551 in this area.
13552
13553 * character.c (char_string): Remove unnecessary casts.
13554
13555 Make sure a 64-bit char is never passed to CHAR_STRING.
13556 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13557 by silently ignoring the top 32 bits, allowing some values
13558 that were far too large to be valid characters.
13559 * character.h: Include <verify.h>.
13560 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13561 arguments are no wider than unsigned, as a compile-time check
13562 to prevent future regressions in this area.
13563 * data.c (Faset):
13564 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13565 (Fsubst_char_in_region):
13566 * fns.c (concat):
13567 * xdisp.c (decode_mode_spec_coding):
13568 Adjust to CHAR_STRING's new requirement.
13569 * editfns.c (Finsert_char, Fsubst_char_in_region):
13570 * fns.c (concat): Check that character args are actually
13571 characters. Without this test, these functions did the wrong
13572 thing with wildly out-of-range values on 64-bit hosts.
13573
13574 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13575 These casts should not be needed on 32-bit hosts, either.
13576 * keyboard.c (read_char):
13577 * lread.c (Fload): Remove casts to unsigned.
13578
13579 * lisp.h (UNSIGNED_CMP): New macro.
13580 This fixes comparison bugs on 64-bit hosts.
13581 (ASCII_CHAR_P): Use it.
13582 * casefiddle.c (casify_object):
13583 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13584 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13585 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13586 * dispextern.h (FACE_FROM_ID):
13587 * keyboard.c (read_char): Use UNSIGNED_CMP.
13588
13589 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13590 not to EMACS_INT, to avoid GCC warning.
13591
13592 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13593
13594 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13595 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13596 isn't needed on 32-bit machines.
13597
13598 * buffer.c (Fgenerate_new_buffer_name):
13599 Use EMACS_INT for count, not int.
13600 (advance_to_char_boundary): Return EMACS_INT, not int.
13601
13602 * data.c (Qcompiled_function): Now static.
13603
13604 * window.c (window_body_lines): Now static.
13605
13606 * image.c (gif_load): Rename local to avoid shadowing.
13607
13608 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13609 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13610 * alloc.c (make_save_value): Integer argument is now of type
13611 ptrdiff_t, not int.
13612 (mark_object): Use ptrdiff_t, not int.
13613 * lisp.h (pD): New macro.
13614 * print.c (print_object): Use it.
13615
13616 * alloc.c: Use EMACS_INT, not int, to count objects.
13617 (total_conses, total_markers, total_symbols, total_vector_size)
13618 (total_free_conses, total_free_markers, total_free_symbols)
13619 (total_free_floats, total_floats, total_free_intervals)
13620 (total_intervals, total_strings, total_free_strings):
13621 Now EMACS_INT, not int. All uses changed.
13622 (Fgarbage_collect): Compute overall total using a double, so that
13623 integer overflow is less likely to be a problem. Check for overflow
13624 when converting back to an integer.
13625 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13626 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13627 These were 'int' variables that could overflow on 64-bit hosts;
13628 they were never used, so remove them instead of repairing them.
13629 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13630 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13631 Previously, this ceilinged at INT_MAX, but that doesn't work on
13632 64-bit machines.
13633 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13634
13635 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13636 (allocate_vectorlike): Check for ptrdiff_t overflow.
13637 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13638 when a (possibly-narrower) signed value would do just as well.
13639 We prefer using signed arithmetic, to avoid comparison confusion.
13640
13641 * alloc.c: Catch some string size overflows that we were missing.
13642 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13643 for convenience in STRING_BYTES_MAX.
13644 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13645 The definition here is exact; the one in lisp.h was approximate.
13646 (allocate_string_data): Check for string overflow. This catches
13647 some instances we weren't catching before. Also, it catches
13648 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13649 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13650 and ptrdiff_t and EMACS_INT are both 64 bits.
13651
13652 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13653 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13654 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13655
13656 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13657
13658 * alloc.c (Fmake_string): Check for out-of-range init.
13659
13660 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13661
13662 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13663
13664 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13665
13666 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13667 xg_get_default_scrollbar_width.
13668
13669 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13670 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13671 (style_changed_cb): Call update_theme_scrollbar_width and call
13672 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13673 all frames (Bug#8505).
13674 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13675 Call gtk_window_set_resizable if HAVE_GTK3.
13676 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13677 and height if HAVE_GTK3 (Bug#8505).
13678 (scroll_bar_width_for_theme): New variable.
13679 (update_theme_scrollbar_width): New function.
13680 (xg_get_default_scrollbar_width): Move code to
13681 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13682 (xg_initialize): Call update_theme_scrollbar_width.
13683
13684 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13685
13686 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13687
13688 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13689
13690 * frame.c (make_frame): Call other_buffer_safely instead of
13691 other_buffer.
13692
13693 * window.c (temp_output_buffer_show): Call display_buffer with
13694 second argument Vtemp_buffer_show_specifiers and reset latter
13695 immediately after the call.
13696 (Vtemp_buffer_show_specifiers): New variable.
13697 (auto_window_vscroll_p, next_screen_context_lines)
13698 (Vscroll_preserve_screen_position): Remove leading asterisks from
13699 doc-strings.
13700
13701 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13702
13703 Fix minor problems found by GCC 4.6.0 static checking.
13704 * buffer.c (Qclone_number): Remove for now, as it's unused.
13705 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13706 (record_buffer): Remove unused local.
13707 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13708 (set_frame_buffer_list): Remove; unused.
13709 * frame.h (other_visible_frames): Remove decl.
13710 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13711 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13712 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13713 if HAVE_GPM.
13714 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13715 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13716 Define only if HAVE_GPM.
13717 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13718 (update_hints_inhibit): Remove; never set. All uses removed.
13719 * widgetprv.h (emacsFrameClassRec): Remove decl.
13720 * window.c (delete_deletable_window): Now returns void, since it
13721 wasn't returning anything.
13722 (compare_window_configurations): Remove unused locals.
13723 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13724 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13725 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13726 the same widths as pointers. This follows up on the 2011-05-06 patch.
13727 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13728 * xterm.h: Likewise.
13729 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13730
13731 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13732
13733 * makefile.w32-in: Update dependencies.
13734 (LISP_H): Add lib/intprops.h.
13735
13736 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13737
13738 * image.c (gif_load): Add animation frame delay to the metadata.
13739 (syms_of_image): Use DEFSYM. New symbol `delay'.
13740
13741 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13742
13743 * window.c (delete_deletable_window): Re-add.
13744 (Fset_window_configuration): Rewrite to handle dead buffers and
13745 consequently deletable windows.
13746 (window_tree, Fwindow_tree): Remove. Supply functionality in
13747 window.el.
13748 (compare_window_configurations): Simplify code.
13749
13750 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13751
13752 * image.c (imagemagick_load_image): Fix type mismatch.
13753 (Fimagemagick_types): Likewise.
13754
13755 * window.h (replace_buffer_in_windows): Declare.
13756
13757 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13758
13759 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13760 Qclone_number. Remove external declaration of Qdelete_window.
13761 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13762 code.
13763 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13764 Run Qbuffer_list_update_hook if allowed.
13765 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13766 buffer list implementation.
13767 (other_buffer_safely): New function.
13768 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13769 calls to replace_buffer_in_windows and
13770 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13771 if allowed.
13772 (record_buffer): Inhibit quitting and rewrite using quittable
13773 functions. Run Qbuffer_list_update_hook if allowed.
13774 (Frecord_buffer, Funrecord_buffer): New functions.
13775 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13776 Move switch-to-buffer to window.el.
13777 (bury-buffer): Move to window.el.
13778 (Vbuffer_list_update_hook): New variable.
13779
13780 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13781 section.
13782
13783 * window.h (resize_frame_windows): Move up in code.
13784 (Fwindow_frame): Remove EXFUN.
13785 (replace_buffer_in_all_windows): Remove prototype.
13786 (replace_buffer_in_windows_safely): Add prototype.
13787
13788 * window.c: Declare Qdelete_window static again. Move down
13789 declaration of select_count.
13790 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13791 (Fother_window): Move to window.el.
13792 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13793 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13794 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13795 window.el.
13796 (replace_buffer_in_windows): Implement by calling
13797 Qreplace_buffer_in_windows.
13798 (replace_buffer_in_all_windows): Remove with some functionality
13799 moved into replace_buffer_in_windows_safely.
13800 (replace_buffer_in_windows_safely): New function.
13801 (select_window_norecord, select_frame_norecord): Move in front
13802 of run_window_configuration_change_hook. Remove now obsolete
13803 declarations.
13804 (Fset_window_buffer): Rewrite doc-string.
13805 Call Qrecord_window_buffer.
13806 (keys_of_window): Move binding for other-window to window.el.
13807
13808 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13809
13810 * dispextern.h (struct image): Replace data member, whose int_val
13811 and ptr_val fields were not used by anything, with a single
13812 lisp_val object.
13813
13814 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13815 (gif_clear_image, gif_load, imagemagick_load_image)
13816 (gs_clear_image, gs_load): Callers changed.
13817
13818 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13819
13820 * buffer.h: Include <time.h>, for time_t.
13821 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13822
13823 Fix minor problems found by static checking.
13824
13825 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13826
13827 Make identifiers static if they are not used in other modules.
13828 * data.c (Qcompiled_function, Qframe, Qvector):
13829 * image.c (QimageMagick, Qsvg):
13830 * minibuf.c (Qmetadata):
13831 * window.c (resize_window_check, resize_root_window): Now static.
13832 * window.h (resize_window_check, resize_root_window): Remove decls.
13833
13834 * window.c (window_deletion_count, delete_deletable_window):
13835 Remove; unused.
13836 (window_body_lines): Now static.
13837 (Fdelete_other_windows_internal): Mark vars as initialized.
13838 Make sure 'resize_failed' is initialized.
13839 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13840 (resize_window_apply): Remove unused local.
13841 * window.h (delete_deletable_window): Remove decl.
13842
13843 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13844 (imagemagick_load_image): Fix pointer signedness problem by changing
13845 last arg from unsigned char * to char *. All uses changed.
13846 Also, fix a local for similar reasons.
13847 Remove unused locals. Remove locals to avoid shadowing.
13848 (fn_rsvg_handle_free): Remove; unused.
13849 (svg_load, svg_load_image): Fix pointer signedness problem.
13850 (imagemagick_load_image): Don't use garbage pointer image_wand.
13851
13852 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13853
13854 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13855
13856 * image.c (gif_load): Fix omitted cast error introduced by
13857 2011-06-06 change.
13858
13859 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13860
13861 * window.h (resize_proportionally, orig_total_lines)
13862 (orig_top_line): Remove from window structure.
13863 (set_window_height, set_window_width, change_window_heights)
13864 (Fdelete_window): Remove prototypes.
13865 (resize_frame_windows): Remove duplicate declaration.
13866
13867 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13868
13869 * window.h (resize_frame_windows, resize_window_check)
13870 (delete_deletable_window, resize_root_window)
13871 (resize_frame_windows): Declare prototypes.
13872
13873 * window.c (resize_window_apply): Make definition be "static" to
13874 match the prototype.
13875
13876 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13877
13878 * window.c: Remove declarations of Qwindow_size_fixed,
13879 window_min_size_1, window_min_size_2, window_min_size,
13880 size_window, window_fixed_size_p, enlarge_window, delete_window.
13881 Remove static from declaration of Qdelete_window, it's
13882 temporarily needed by Fbury_buffer.
13883 (replace_window): Don't assign orig_top_line and
13884 orig_total_lines.
13885 (Fdelete_window, delete_window): Remove. Window deletion is
13886 handled by window.el.
13887 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13888 Replace Fdelete_window calls with calls to Qdelete_window.
13889 (Fdelete_other_windows): Remove. Deleting other windows is
13890 handled by window.el.
13891 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13892 handled in window.el.
13893 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13894 Window minimum sizes are handled in window.el.
13895 (shrink_windows, size_window, set_window_height)
13896 (set_window_width, change_window_heights, window_height)
13897 (window_width, CURBEG, CURSIZE, enlarge_window)
13898 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13899 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13900 handled in window.el.
13901 (make_dummy_parent): Rename to make_parent_window and give it a
13902 second argument horflag.
13903 (make_window): Don't set resize_proportionally any more.
13904 (Fsplit_window): Remove. Windows are split in window.el.
13905 (save_restore_action, save_restore_orig_size)
13906 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13907 Resize mini windows in window.el.
13908 (grow_mini_window, shrink_mini_window): Implement by calling
13909 Qresize_root_window_vertically, resize_window_check and
13910 resize_window_apply.
13911 (saved_window, Fset_window_configuration, save_window_save):
13912 Do not handle orig_top_line, orig_total_lines, and
13913 resize_proportionally.
13914 (window_min_height, window_min_width): Move to window.el.
13915 (keys_of_window): Move bindings for delete-other-windows,
13916 split-window, delete-window and enlarge-window to window.el.
13917
13918 * buffer.c: Temporarily extern Qdelete_window.
13919 (Fbury_buffer): Temporarily call Qdelete_window instead of
13920 Fdelete_window (Fbury_buffer will move to window.el soon).
13921
13922 * frame.c (set_menu_bar_lines_1): Remove code handling
13923 orig_top_line and orig_total_lines.
13924
13925 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13926 set_window_height but set heights directly.
13927 (change_frame_size_1): Use resize_frame_windows.
13928
13929 * xdisp.c (init_xdisp): Don't use set_window_height but set
13930 heights directly.
13931
13932 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13933 Use resize_frame_windows instead of change_window_heights and run
13934 run_window_configuration_change_hook.
13935
13936 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13937 instead of change_window_heights and run
13938 run_window_configuration_change_hook.
13939
13940 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13941
13942 * window.c (replace_window): Rename second argument REPLACEMENT to
13943 NEW. New third argument SETFLAG. Rewrite.
13944 (delete_window, make_dummy_parent): Call replace_window with
13945 third argument 1.
13946 (window_list_1): Move down in code.
13947 (run_window_configuration_change_hook): Move set_buffer part
13948 before select_frame_norecord part in order to unwind correctly.
13949 Rename count1 to count.
13950 (recombine_windows, delete_deletable_window, resize_root_window)
13951 (Fdelete_other_windows_internal)
13952 (Frun_window_configuration_change_hook, make_parent_window)
13953 (resize_window_check, resize_window_apply, Fresize_window_apply)
13954 (resize_frame_windows, Fsplit_window_internal)
13955 (Fdelete_window_internal, Fresize_mini_window_internal):
13956 New functions.
13957 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13958
13959 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13960
13961 * window.h (window): Add some new members to window structure -
13962 normal_lines, normal_cols, new_total, new_normal, clone_number,
13963 splits, nest, prev_buffers, next_buffers.
13964 (WINDOW_TOTAL_SIZE): Move here from window.c.
13965 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13966
13967 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13968 Remove.
13969 (make_dummy_parent): Set new members of windows structure.
13970 (make_window): Move down in code. Handle new members of window
13971 structure.
13972 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13973 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13974 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13975 (Fset_window_prev_buffers, Fwindow_next_buffers)
13976 (Fset_window_next_buffers, Fset_window_clone_number):
13977 New functions.
13978 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13979 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13980 Doc-string fixes.
13981 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13982 Argument WINDOW can be now internal window too.
13983 (Fwindow_use_time): Move up in code.
13984 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13985 Rewrite doc-string.
13986 (Fset_window_configuration, saved_window)
13987 (Fcurrent_window_configuration, save_window_save): Handle new
13988 members of window structure.
13989 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13990 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13991 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13992 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13993 Qget_mru_window, Qresize_root_window,
13994 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13995 Qauto_buffer_name; staticpro them.
13996
13997 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13998
13999 * window.c (Fwindow_total_size, Fwindow_left_column)
14000 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14001 (Fwindow_list_1): New functions.
14002 (window_box_text_cols): Replace with window_body_cols.
14003 (Fwindow_width, Fscroll_left, Fscroll_right):
14004 Use window_body_cols instead of window_box_text_cols.
14005 (delete_window, Fset_window_configuration):
14006 Call delete_all_subwindows with window as argument.
14007 (delete_all_subwindows): Take a window as argument and not a
14008 structure. Rewrite.
14009 (window_loop): Remove handling of GET_LRU_WINDOW and
14010 GET_LARGEST_WINDOW.
14011 (Fget_lru_window, Fget_largest_window): Move to window.el.
14012
14013 * window.h: Extern window_body_cols instead of
14014 window_box_text_cols. delete_all_subwindows now takes a
14015 Lisp_Object as argument.
14016
14017 * indent.c (compute_motion, Fcompute_motion):
14018 Use window_body_cols instead of window_box_text_cols.
14019
14020 * frame.c (delete_frame): Call delete_all_subwindows with root
14021 window as argument.
14022
14023 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14024
14025 * fns.c (Fputhash): Document return value.
14026
14027 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14028
14029 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14030
14031 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14032
14033 Cons<->int and similar integer overflow fixes (Bug#8794).
14034
14035 Check for overflow when converting integer to cons and back.
14036 * charset.c (Fdefine_charset_internal, Fdecode_char):
14037 Use cons_to_unsigned to catch overflow.
14038 (Fencode_char): Use INTEGER_TO_CONS.
14039 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14040 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14041 * data.c (long_to_cons, cons_to_long): Remove.
14042 (cons_to_unsigned, cons_to_signed): New functions.
14043 These signal an error for invalid or out-of-range values.
14044 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14045 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14046 * font.c (Ffont_variation_glyphs):
14047 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14048 * lisp.h: Include <intprops.h>.
14049 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14050 (cons_to_signed, cons_to_unsigned): New decls.
14051 (long_to_cons, cons_to_long): Remove decls.
14052 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14053 (Fprimitive_undo): Use CONS_TO_INTEGER.
14054 * xfns.c (Fx_window_property): Likewise.
14055 * xselect.c: Include <limits.h>.
14056 (x_own_selection, selection_data_to_lisp_data):
14057 Use INTEGER_TO_CONS.
14058 (x_handle_selection_request, x_handle_selection_clear)
14059 (x_get_foreign_selection, Fx_disown_selection_internal)
14060 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14061 (lisp_data_to_selection_data): Use cons_to_unsigned.
14062 (x_fill_property_data): Use cons_to_signed.
14063 Report values out of range.
14064
14065 Check for buffer and string overflow more precisely.
14066 * buffer.h (BUF_BYTES_MAX): New macro.
14067 * lisp.h (STRING_BYTES_MAX): New macro.
14068 * alloc.c (Fmake_string):
14069 * character.c (string_escape_byte8):
14070 * coding.c (coding_alloc_by_realloc):
14071 * doprnt.c (doprnt):
14072 * editfns.c (Fformat):
14073 * eval.c (verror):
14074 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14075 since they may not be the same number.
14076 * editfns.c (Finsert_char):
14077 * fileio.c (Finsert_file_contents):
14078 Likewise for BUF_BYTES_MAX.
14079
14080 * image.c: Use ptrdiff_t, not int, for sizes.
14081 (slurp_file): Switch from int to ptrdiff_t.
14082 All uses changed.
14083 (slurp_file): Check that file size fits in both size_t (for
14084 malloc) and ptrdiff_t (for sanity and safety).
14085
14086 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14087 if b->modtime has its maximal value.
14088
14089 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14090
14091 Don't assume time_t can fit into int.
14092 * buffer.h (struct buffer.modtime): Now time_t, not int.
14093 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14094 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14095
14096 Minor fixes for signed vs unsigned integers.
14097 * character.h (MAYBE_UNIFY_CHAR):
14098 * charset.c (maybe_unify_char):
14099 * keyboard.c (read_char, reorder_modifiers):
14100 XINT -> XFASTINT, since the integer must be nonnegative.
14101 * ftfont.c (ftfont_spec_pattern):
14102 * keymap.c (access_keymap, silly_event_symbol_error):
14103 XUINT -> XFASTINT, since the integer must be nonnegative.
14104 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14105 since it makes no difference and we prefer signed.
14106 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14107 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14108 nonnegative.
14109
14110 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14111
14112 * window.h (Fwindow_frame): Declare.
14113
14114 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14115
14116 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14117 (SPARE_MEMORY): Always define.
14118 (LARGE_REQUEST): Remove.
14119 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14120
14121 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14122
14123 * lisp.h: Move EXFUNS for Fframe_root_window,
14124 Fframe_first_window and Fset_frame_selected_window to window.h.
14125
14126 * window.h: Move EXFUNS for Fframe_root_window,
14127 Fframe_first_window and Fset_frame_selected_window here from
14128 lisp.h.
14129
14130 * frame.c (Fwindow_frame, Fframe_first_window)
14131 (Fframe_root_window, Fframe_selected_window)
14132 (Fset_frame_selected_window): Move to window.c.
14133 (Factive_minibuffer_window): Move to minibuf.c.
14134 (Fother_visible_frames_p): New function.
14135
14136 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14137
14138 * window.c (decode_window, decode_any_window): Move up in code.
14139 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14140 (inhibit_frame_unsplittable): Remove unused variable.
14141 (Fwindow_buffer): Move up and rewrite doc-string.
14142 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14143 (Fwindow_prev): New functions.
14144 (Fwindow_frame): Move here from frame.c. Accept any window as
14145 argument.
14146 (Fframe_root_window, Fframe_first_window)
14147 (Fframe_selected_window): Move here from frame.c. Accept frame
14148 or arbitrary window as argument. Update doc-strings.
14149 (Fminibuffer_window): Move up in code.
14150 (Fwindow_minibuffer_p): Move up in code and simplify.
14151 (Fset_frame_selected_window): Move here from frame.c.
14152 Marginal rewrite.
14153 (Fselected_window, select_window, Fselect_window): Move up in
14154 code. Minor doc-string fixes.
14155
14156 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14157
14158 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14159 Do not assume that spare memory exists; that assumption is valid
14160 only if SYSTEM_MALLOC.
14161 (LARGE_REQUEST): New macro, so that the issue of large requests
14162 is separated from the issue of spare memory.
14163
14164 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14165
14166 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14167 format. (Bug#8806)
14168
14169 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14170
14171 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14172 before statements.
14173
14174 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14175
14176 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14177
14178 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14179
14180 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14181 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14182
14183 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14184
14185 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14186
14187 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14188
14189 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14190 (x_clipboard_manager_save): Add return value.
14191 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14192 New error handlers.
14193 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14194 Obey Vx_select_enable_clipboard_manager. Catch errors in
14195 x_clipboard_manager_save (Bug#8779).
14196 (Vx_select_enable_clipboard_manager): New variable.
14197 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14198
14199 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14200
14201 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14202
14203 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14204
14205 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14206 in the current matrix if keep_current_p is non-zero.
14207
14208 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14209
14210 * bidi.c (bidi_level_of_next_char): Fix last change.
14211
14212 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14213
14214 Support bidi reordering of text covered by display properties.
14215
14216 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14217 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14218 (bidi_cache_search, bidi_cache_iterator_state)
14219 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14220 (bidi_level_of_next_char, bidi_move_to_visually_next):
14221 Support character positions inside a run of characters covered by a
14222 display string.
14223 (bidi_paragraph_init, bidi_resolve_explicit_1)
14224 (bidi_level_of_next_char): Call bidi_fetch_char and
14225 bidi_fetch_char_advance instead of FETCH_CHAR and
14226 FETCH_CHAR_ADVANCE.
14227 (bidi_init_it): Initialize new members.
14228 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14229 definitions.
14230 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14231 instead of using explicit *_CHAR codes.
14232 (bidi_resolve_explicit, bidi_resolve_weak):
14233 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14234 bidirectional text is supported only in multibyte buffers.
14235 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14236 it to initialize the frame_window_p member of struct bidi_it.
14237 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14238 (bidi_resolve_explicit, bidi_resolve_weak)
14239 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14240 bidi_it->nchars is non-positive.
14241 (bidi_level_of_next_char): Don't try to lookup the cache for the
14242 next/previous character if nothing is cached there yet, or if we
14243 were just reseat()'ed to a new position.
14244
14245 * xdisp.c (set_cursor_from_row): Set start and stop points
14246 according to the row's direction when priming the loop that looks
14247 for the glyph on which to display cursor.
14248 (single_display_spec_intangible_p): Function deleted.
14249 (display_prop_intangible_p): Reimplement to call
14250 handle_display_spec instead of single_display_spec_intangible_p.
14251 Accept 3 additional arguments needed by handle_display_spec.
14252 This fixes incorrect cursor motion across display property with complex
14253 values: lists, `(when COND...)' forms, etc.
14254 (single_display_spec_string_p): Support property values that are
14255 lists with the argument STRING its top-level element.
14256 (display_prop_string_p): Fix the condition for processing a
14257 property that is a list to be consistent with handle_display_spec.
14258 (handle_display_spec): New function, refactored from the
14259 last portion of handle_display_prop.
14260 (compute_display_string_pos): Accept additional argument
14261 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14262 value of a `display' property is a "replacing spec".
14263 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14264 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14265 the display property, but just return a value indicating whether
14266 the display property will replace the characters it covers.
14267 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14268 frame_window_p members of struct bidi_it.
14269 (compute_display_string_pos, compute_display_string_end):
14270 New functions.
14271 (push_it): Accept second argument POSITION, where pop_it should
14272 jump to continue iteration.
14273 (reseat_1): Initialize bidi_it.disp_pos.
14274
14275 * keyboard.c (adjust_point_for_property): Adjust the call to
14276 display_prop_intangible_p to its new signature.
14277
14278 * dispextern.h (struct bidi_it): New member frame_window_p.
14279 (bidi_init_it): Update prototypes.
14280 (display_prop_intangible_p): Update prototype.
14281 (compute_display_string_pos, compute_display_string_end):
14282 Declare prototypes.
14283 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14284 EMACS_INT.
14285
14286 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14287
14288 Malloc failure behavior now depends on size of allocation.
14289 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14290 * lisp.h: Change signatures accordingly.
14291 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14292 All callers changed. (Bug#8762)
14293
14294 * gnutls.c: Use Emacs's memory allocators.
14295 Without this change, the gnutls library would invoke malloc etc.
14296 directly, which causes problems on non-SYNC_INPUT hosts, and which
14297 runs afoul of improving memory_full behavior. (Bug#8761)
14298 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14299 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14300 xfree instead of the default malloc, realloc, free.
14301 (Fgnutls_boot): No need to check for memory allocation failure,
14302 since xmalloc does that for us.
14303
14304 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14305 * category.c (hash_get_category_set):
14306 * ccl.c (ccl_driver):
14307 * charset.c (Fdefine_charset_internal):
14308 * charset.h (struct charset.hash_index):
14309 * composite.c (get_composition_id, gstring_lookup_cache)
14310 (composition_gstring_put_cache):
14311 * composite.h (struct composition.hash_index):
14312 * dispextern.h (struct image.hash):
14313 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14314 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14315 (hashfn_equal, hashfn_user_defined, make_hash_table)
14316 (maybe_resize_hash_table, hash_lookup, hash_put)
14317 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14318 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14319 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14320 * image.c (make_image, search_image_cache, lookup_image)
14321 (xpm_put_color_table_h):
14322 * lisp.h (struct Lisp_Hash_Table):
14323 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14324 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14325 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14326 * alloc.c (allocate_vectorlike):
14327 Check for overflow in vector size calculations.
14328 * ccl.c (ccl_driver):
14329 Check for overflow when converting EMACS_INT to int.
14330 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14331 need to be updated by these changes.
14332 * fns.c (make_hash_table, maybe_resize_hash_table):
14333 Check for integer overflow with large hash tables.
14334 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14335 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14336 (SXHASH_REDUCE): New macro.
14337 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14338 Use it instead of discarding useful hash info with large hash values.
14339 (sxhash_float): New function.
14340 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14341 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14342 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14343 Rewrite to use FIXNUM_BITS, as this simplifies things.
14344 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14345 Adjust signatures to match updated version of code.
14346 (consing_since_gc): Now EMACS_INT, since a single hash table can
14347 use more than INT_MAX bytes.
14348
14349 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14350
14351 Make it possible to build with GCC-4.6+ -O2 -flto.
14352
14353 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14354
14355 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14356
14357 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14358 Call minibuffer-inactive-mode.
14359
14360 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14361
14362 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14363 Update dependencies.
14364
14365 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14366
14367 * data.c (init_data): Remove code for UTS, this system is not
14368 supported anymore.
14369
14370 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14371
14372 Don't force ./temacs to start in terminal mode.
14373
14374 * frame.c (make_initial_frame): Initialize faces in all cases, not
14375 only when CANNOT_DUMP is defined.
14376 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14377
14378 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14379
14380 * dispnew.c (add_window_display_history): Use const for the string
14381 pointer. Remove declaration, not needed.
14382
14383 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14384
14385 Use 'inline', not 'INLINE'.
14386 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14387 * alloc.c, fontset.c (INLINE): Remove.
14388 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14389 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14390 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14391 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14392 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14393
14394 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14395
14396 Make it possible to run ./temacs.
14397
14398 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14399 syms_of_callproc does the same thing. Remove test for
14400 "initialized", do it in the caller.
14401 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14402
14403 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14404
14405 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14406 (read_minibuf): Use get_minibuffer.
14407 (syms_of_minibuf): Use DEFSYM.
14408 (Qmetadata): New var.
14409 * data.c (Qbuffer): Don't make it static.
14410 (syms_of_data): Use DEFSYM.
14411
14412 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14413
14414 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14415 (CCL_CODE_MIN): New macro.
14416
14417 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14418
14419 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14420
14421 * eval.c (Qdebug): Now static.
14422 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14423 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14424 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14425
14426 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14427
14428 * image.c: Various fixes to ImageMagick code comments.
14429 (Fimagemagick_types): Doc fix.
14430
14431 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14432
14433 Minor fixes prompted by GCC 4.6.0 warnings.
14434
14435 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14436
14437 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14438 (x_clipboard_manager_save_all): Move extern decl to ...
14439 * xterm.h: ... here, so that it can be checked for consistency.
14440
14441 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14442
14443 * xselect.c (x_clipboard_manager_save_frame)
14444 (x_clipboard_manager_save_all): New functions.
14445 (Fx_clipboard_manager_save): Lisp function deleted.
14446
14447 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14448 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14449
14450 * xterm.h: Update prototype.
14451
14452 2011-05-28 William Xu <william.xwl@gmail.com>
14453
14454 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14455 exiting (Bug#8239).
14456
14457 2011-05-28 Jim Meyering <meyering@redhat.com>
14458
14459 Avoid a sign-extension bug in crypto_hash_function.
14460 * fns.c (to_uchar): Define.
14461 (crypto_hash_function): Use it to convert some newly-signed
14462 variables to unsigned, to avoid sign-extension bugs. For example,
14463 without this change, (md5 "truc") would evaluate to
14464 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14465 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14466 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14467
14468 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14469
14470 Integer overflow fixes.
14471
14472 * dbusbind.c: Serial number integer overflow fixes.
14473 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14474 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14475 to hold a serial number that is too large for a fixnum.
14476 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14477 Check for serial numbers out of range. Decode any serial number
14478 that was so large that it became a float. (Bug#8722)
14479
14480 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14481 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14482 Use XFASTINT rather than XUINT when numbers are nonnegative.
14483 (xd_append_arg, Fdbus_method_return_internal):
14484 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14485 arguments, check that Lisp number is nonnegative, rather than
14486 silently wrapping negative numbers around. (Bug#8722)
14487 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14488 (Bug#8722)
14489
14490 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14491
14492 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14493
14494 ccl: Add integer overflow checks.
14495 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14496 (IN_INT_RANGE): New macros.
14497 (ccl_driver): Use them to check for integer overflow when
14498 decoding a CCL program. Many of the new checks are whether XINT (x)
14499 fits in int; it doesn't always, on 64-bit hosts. The new version
14500 doesn't catch all possible integer overflows, but it's an
14501 improvement. (Bug#8719)
14502
14503 * alloc.c (make_event_array): Use XINT, not XUINT.
14504 There's no need for unsigned here.
14505
14506 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14507 This follows up to the 2011-05-06 change that substituted uintptr_t
14508 for EMACS_INT. This case wasn't caught back then.
14509
14510 Rework Fformat to avoid integer overflow issues.
14511 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14512 now (part of C89). Include <verify.h>.
14513 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14514 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14515 (Fformat): Avoid the prepass trying to compute sizes; it was only
14516 approximate and thus did not catch overflow reliably. Instead, walk
14517 through the format just once, formatting and computing sizes as we go,
14518 checking for integer overflow at every step, and allocating a larger
14519 buffer as needed. Keep track separately whether the format is
14520 multibyte. Keep only the most-recently calculated precision, rather
14521 than them all. Record whether each argument has been converted to
14522 string. Use EMACS_INT, not int, for byte and char and arg counts.
14523 Support field widths and precisions larger than INT_MAX. Avoid
14524 sprintf's undefined behavior with conversion specifications such as %#d
14525 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14526 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14527 formatting out-of-range floating point numbers with int
14528 formats. (Bug#8668)
14529
14530 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14531
14532 * data.c: Avoid integer truncation in expressions involving floats.
14533 * data.c: Include <intprops.h>.
14534 (arith_driver): When there's an integer overflow in an expression
14535 involving floating point, convert the integers to floating point
14536 so that the resulting value does not suffer from catastrophic
14537 integer truncation. For example, on a 64-bit host (* 4
14538 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14539 Do not rely on undefined behavior after integer overflow.
14540
14541 merge count_size_as_multibyte, parse_str_to_multibyte
14542 * character.c, character.h (count_size_as_multibyte):
14543 Rename from parse_str_to_multibyte; all uses changed.
14544 Check for integer overflow.
14545 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14546 since it's now a duplicate of the other. This is more of
14547 a character than a buffer op, so better that it's in character.c.
14548 * fns.c, print.c: Adjust to above changes.
14549
14550 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14551
14552 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14553
14554 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14555
14556 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14557 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14558 (x_clipboard_manager_save): Now static.
14559 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14560
14561 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14562 (crypto_hash_function): Now static.
14563 Fix pointer signedness problems. Avoid unnecessary initializations.
14564
14565 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14566
14567 * termhooks.h (Vselection_alist): Make it terminal-local.
14568
14569 * terminal.c (create_terminal): Initialize it.
14570
14571 * xselect.c: Support for clipboard managers.
14572 (Vselection_alist): Move to termhooks.h as terminal-local var.
14573 (LOCAL_SELECTION): New macro.
14574 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14575 (symbol_to_x_atom): Remove gratuitous arg.
14576 (x_handle_selection_request, lisp_data_to_selection_data)
14577 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14578 (x_own_selection, x_get_local_selection, x_convert_selection):
14579 New arg, specifying work frame. Use terminal-local Vselection_alist.
14580 (some_frame_on_display): Delete unused function.
14581 (Fx_own_selection_internal, Fx_get_selection_internal)
14582 (Fx_disown_selection_internal, Fx_selection_owner_p)
14583 (Fx_selection_exists_p): New optional frame arg.
14584 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14585 (x_handle_selection_clear): Don't treat other terminals with the
14586 same keyboard specially. Use the terminal-local Vselection_alist.
14587 (x_clear_frame_selections): Use Frun_hook_with_args.
14588
14589 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14590
14591 * xterm.h: Add support for those atoms.
14592
14593 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14594
14595 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14596 (converted_selections, conversion_fail_tag): New global variables.
14597 (x_selection_request_lisp_error): Free the above.
14598 (x_get_local_selection): Remove unnecessary code.
14599 (x_reply_selection_request): Args changed; handle arbitrary array
14600 of converted selections stored in converted_selections.
14601 Separate the XChangeProperty and SelectionNotify steps.
14602 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14603 (x_convert_selection): New function.
14604 (x_handle_selection_event): Simplify.
14605 (x_get_foreign_selection): Don't ignore incoming requests while
14606 waiting for an answer; this will fail when we implement
14607 SAVE_TARGETS, and seems unnecessary anyway.
14608 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14609 (Vx_sent_selection_functions): Doc fix.
14610
14611 2011-05-26 Leo Liu <sdl.web@gmail.com>
14612
14613 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14614
14615 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14616
14617 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14618
14619 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14620 for fringe update if it has periodic bitmap.
14621 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14622 and fringe_bitmap_periodic_p.
14623
14624 * fringe.c (get_fringe_bitmap_data): New function.
14625 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14626 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14627 row. Mark glyph row for fringe update if periodicity changed.
14628
14629 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14630 for fringe update unless it has periodic bitmap.
14631
14632 2011-05-25 Kenichi Handa <handa@m17n.org>
14633
14634 * xdisp.c (get_next_display_element): Set correct it->face_id for
14635 a static composition.
14636
14637 2011-05-24 Leo Liu <sdl.web@gmail.com>
14638
14639 * deps.mk (fns.o):
14640 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14641
14642 * fns.c (crypto_hash_function, Fsha1): New function.
14643 (Fmd5): Use crypto_hash_function.
14644 (syms_of_fns): Add Ssha1.
14645
14646 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14647
14648 * gnutls.c: Remove unused macros.
14649 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14650 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14651 Remove macros that are defined and never used.
14652 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14653
14654 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14655
14656 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14657 (Fx_get_selection_internal): Minor cleanup.
14658 (Fx_own_selection_internal): Rename arguments for consistency with
14659 select.el.
14660
14661 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14662
14663 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14664
14665 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14666
14667 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14668
14669 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14670
14671 * dispnew.c (scrolling_window): Don't exclude the case that the
14672 last enabled row in the desired matrix touches the bottom boundary.
14673
14674 2011-05-21 Glenn Morris <rgm@gnu.org>
14675
14676 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14677 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14678 and add some more files.
14679
14680 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14681
14682 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14683 report_file_error introduced by the change from 2011-05-07.
14684
14685 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14686
14687 * systime.h (Time): Define only if emacs is defined.
14688 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14689 where the include path doesn't have X11/X.h by default. See
14690 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14691
14692 2011-05-20 Kenichi Handa <handa@m17n.org>
14693
14694 * composite.c (find_automatic_composition): Fix previous change.
14695
14696 2011-05-20 Glenn Morris <rgm@gnu.org>
14697
14698 * lisp.mk: New file, split from Makefile.in.
14699 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14700 (shortlisp): Remove.
14701 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14702
14703 2011-05-19 Glenn Morris <rgm@gnu.org>
14704
14705 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14706 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14707 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14708 (lisp): Set the order to that of loadup.el.
14709 (shortlisp): Make it a copy of $lisp.
14710 (SOME_MACHINE_LISP): Remove.
14711 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14712 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14713
14714 2011-05-18 Kenichi Handa <handa@m17n.org>
14715
14716 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14717 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14718 (find_automatic_composition): Mostly rewrite for efficiency.
14719
14720 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14721
14722 * makefile.w32-in: Update dependencies.
14723
14724 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14725
14726 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14727 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14728
14729 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14730
14731 Fix some integer overflow issues, such as string length overflow.
14732
14733 * insdel.c (count_size_as_multibyte): Check for string overflow.
14734
14735 * character.c (lisp_string_width): Check for string overflow.
14736 Use EMACS_INT, not int, for string indexes and lengths; in
14737 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14738 the resulting string length overflows an EMACS_INT; instead,
14739 report a string overflow if no precision given. When checking for
14740 precision exhaustion, use a check that cannot possibly have
14741 integer overflow. (Bug#8675)
14742 * character.h (lisp_string_width): Adjust to new signature.
14743
14744 * alloc.c (string_overflow): New function.
14745 (Fmake_string): Use it. This doesn't change behavior, but saves
14746 a few bytes and will simplify future changes.
14747 * character.c (string_escape_byte8): Likewise.
14748 * lisp.h (string_overflow): New decl.
14749
14750 Fixups, following up to the user-interface timestamp change.
14751 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14752 for UI timestamps, instead of unsigned long.
14753 * msdos.c (mouse_get_pos): Likewise.
14754 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14755 * w32gui.h (Time): Define by including "systime.h" rather than by
14756 declaring it ourselves. (Bug#8664)
14757
14758 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14759 * image.c (clear_image_cache): Likewise.
14760
14761 * term.c (term_mouse_position): Don't assume time_t wraparound.
14762
14763 Be more systematic about user-interface timestamps.
14764 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14765 and sometimes 'EMACS_UINT', to represent these timestamps.
14766 This change causes it to use 'Time' uniformly, as that's what X uses.
14767 This makes the code easier to follow, and makes it easier to catch
14768 integer overflow bugs such as Bug#8664.
14769 * frame.c (Fmouse_position, Fmouse_pixel_position):
14770 Use Time, not unsigned long, for user-interface timestamps.
14771 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14772 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14773 * keyboard.h (last_event_timestamp): Likewise.
14774 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14775 * menu.h (xmenu_show): Likewise.
14776 * term.c (term_mouse_position): Likewise.
14777 * termhooks.h (struct input_event.timestamp): Likewise.
14778 (struct terminal.mouse_position_hook): Likewise.
14779 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14780 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14781 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14782 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14783 what it was before.
14784 * menu.h, termhooks.h: Include "systime.h", for Time.
14785
14786 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14787 Don't assume that the difference between two unsigned long values
14788 can fit into an integer. At this point, we know button_down_time
14789 <= event->timestamp, so the difference must be nonnegative, so
14790 there's no need to cast the result if double-click-time is
14791 nonnegative, as it should be; check that it's nonnegative, just in
14792 case. This bug is triggered when events are more than 2**31 ms
14793 apart (about 25 days). (Bug#8664)
14794
14795 * xselect.c (last_event_timestamp): Remove duplicate decl.
14796 (x_own_selection): Remove needless cast to unsigned long.
14797
14798 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14799 that always fit in int. Use a sentinel instead of a counter, to
14800 avoid a temp and to allay GCC's concerns about possible int overflow.
14801 * frame.h (struct frame): Use int for menu_bar_items_used
14802 instead of EMACS_INT, since it always fits in int.
14803
14804 * menu.c (grow_menu_items): Check for int overflow.
14805
14806 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14807
14808 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14809 Before, the code was not consistent. These values cannot exceed
14810 2**31 - 1 so there's no need to make them unsigned.
14811 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14812 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14813 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14814 as modifiers.
14815 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14816
14817 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14818 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14819 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14820 presumably because the widths might not match.
14821
14822 * window.c (size_window): Avoid needless test at loop start.
14823
14824 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14825
14826 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14827
14828 2011-05-12 Drew Adams <drew.adams@oracle.com>
14829
14830 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14831
14832 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14833
14834 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14835 `width' to `bar_area_x' and `bar_area_width', respectively.
14836 (x_scroll_run): Take account of fringe background extension.
14837
14838 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14839 Rename local vars `left' and `width' to `bar_area_x' and
14840 `bar_area_width', respectively.
14841 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14842 background extension.
14843
14844 2011-05-10 Jim Meyering <meyering@redhat.com>
14845
14846 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14847
14848 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14849
14850 * image.c (Finit_image_library): Return t for built-in image types,
14851 like pbm and xbm. (Bug#8640)
14852
14853 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14854
14855 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14856
14857 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14858
14859 * w32console.c (Fset_screen_color): Doc fix.
14860 (Fget_screen_color): New function.
14861 (syms_of_ntterm): Defsubr it.
14862
14863 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14864 unlink the temporary file if Fcall_process didn't create it in the
14865 first place.
14866 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14867 child process will be redirected to a file specified with `:file'.
14868 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14869 cue to call_process_cleanup not to close that handle.
14870
14871 2011-05-07 Ben Key <bkey76@gmail.com>
14872
14873 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14874 one of two shell specific rules, either bootstrap-temacs-CMD or
14875 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14876 to the previous implementation of the bootstrap-temacs rule.
14877 The bootstrap-temacs-CMD rule is similar to the previous
14878 implementation of the bootstrap-temacs rule except that it
14879 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14880 variable.
14881
14882 These changes, along with some changes to nt/configure.bat,
14883 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14884 earlier fix to add support for --cflags and --ldflags options
14885 that include quotes so that it works whether make uses cmd or
14886 sh as the shell.
14887
14888 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14889
14890 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14891 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14892 is a constant.
14893 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14894 a string. Handle both cases.
14895 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14896 (Fdbus_register_method): Use Qinvalid_function.
14897
14898 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14899
14900 * makefile.w32-in: Update dependencies.
14901 (LISP_H): Add inttypes.h and stdin.h.
14902 (PROCESS_H): Add unistd.h.
14903
14904 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14905
14906 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14907 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14908
14909 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14910
14911 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14912
14913 * term.c (vfatal): Remove stray call to va_end.
14914 It's not needed and the C Standard doesn't allow it here anyway.
14915
14916 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14917 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14918
14919 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14920 bytes.
14921
14922 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14923
14924 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14925
14926 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14927
14928 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14929
14930 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14931
14932 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14933 * charset.c (Fdefine_charset_internal): Don't initialize
14934 charset.code_space[15]. The value was garbage, on hosts with
14935 32-bit int (Bug#8600).
14936
14937 * lread.c (read_integer): Be more consistent with string-to-number.
14938 Use string_to_number to do the actual conversion; this avoids
14939 rounding errors and fixes some other screwups. Without this fix,
14940 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14941 (digit_to_number): Move earlier, for benefit of read_integer.
14942 Return -1 if the digit is out of range for the base, -2 if it is
14943 not a digit in any supported base. (Bug#8602)
14944
14945 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14946
14947 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14948 to match comment at start of function. This also removes a
14949 GCC warning about overflow in a 32+64-bit port.
14950
14951 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14952
14953 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14954 Reported by Stefan Monnier in
14955 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14956 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14957 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14958
14959 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14960 (EMACS_UINTPTR): Likewise, with uintptr_t.
14961
14962 * lisp.h: Prefer 64-bit EMACS_INT if available.
14963 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14964 on 32-bit hosts that have 64-bit int, so that they can access
14965 large files.
14966 However, temporarily disable this change unless the temporary
14967 symbol WIDE_EMACS_INT is defined.
14968
14969 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14970
14971 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14972 This removes an assumption that EMACS_INT and long are the same
14973 width as pointers. The assumption is true for Emacs porting targets
14974 now, but we want to make other targets possible.
14975 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14976 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14977 In the rest of the code, change types of integers that hold casted
14978 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14979 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14980 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14981 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14982 No need to cast type when ORing.
14983 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14984 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14985 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14986 assume EMACS_INT is the same width as char *.
14987 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14988 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14989 Remove no-longer-needed casts.
14990 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14991 (xg_tool_bar_help_callback, xg_make_tool_item):
14992 Use EMACS_INTPTR to hold an integer
14993 that will be cast to void *; this can avoid a GCC warning
14994 if EMACS_INT is not the same width as void *.
14995 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14996 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14997 (current_message_1, set_message_1):
14998 Use a local to convert to proper width without a cast.
14999 * xmenu.c (dialog_selection_callback): Likewise.
15000
15001 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15002 Also, don't assume VALBITS / RAND_BITS is less than 5,
15003 and don't rely on undefined behavior when shifting a 1 left into
15004 the sign bit.
15005 * lisp.h (get_random): Change signature to match.
15006
15007 * lread.c (hash_string): Use size_t, not int, for hash computation.
15008 Normally we prefer signed values; but hashing is special, because
15009 it's better to use unsigned division on hash table sizes so that
15010 the remainder is nonnegative. Also, size_t is the natural width
15011 for hashing into memory. The previous code used 'int', which doesn't
15012 retain enough info to hash well into very large tables.
15013 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15014
15015 * dbusbind.c: Don't possibly lose pointer info when converting.
15016 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15017 Use XPNTR rather than XHASH, so that the high-order bits of
15018 the pointer aren't lost when converting through void *.
15019
15020 * eval.c (Fautoload): Don't double-shift a pointer.
15021
15022 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15023
15024 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15025
15026 * gnutls.c (DEF_GNUTLS_FN):
15027 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15028
15029 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15030
15031 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15032 marker. (Bug#8610)
15033
15034 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15035
15036 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15037 New version that can reserve upto 2GB of heap space.
15038
15039 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15040
15041 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15042
15043 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15044
15045 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15046 `gnutls_certificate_set_x509_key_file'.
15047
15048 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15049
15050 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15051 Update dependencies.
15052
15053 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15054
15055 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15056 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15057 Remove unused parameter `fildes'.
15058 * process.c (read_process_output, send_process): Don't pass it.
15059
15060 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15061
15062 Fix previous change: the library cache is defined in w32.c.
15063 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15064 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15065
15066 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15067
15068 Implement dynamic loading of GnuTLS on Windows.
15069
15070 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15071 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15072 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15073 Declare.
15074
15075 * gnutls.c (Qgnutls_dll): Define.
15076 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15077 (gnutls_*): Declare function pointers.
15078 (init_gnutls_functions): New function to initialize function pointers.
15079 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15080 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15081 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15082 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15083 (emacs_gnutls_write, emacs_gnutls_read)
15084 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15085 (Fgnutls_available_p): New function.
15086 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15087 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15088 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15089
15090 * image.c: Include w32.h.
15091 (Vimage_type_cache): Delete.
15092 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15093 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15094 (w32_delayed_load): Move to w32.c.
15095
15096 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15097
15098 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15099 (w32_delayed_load): Move from image.c. When loading a library, record
15100 its filename in the :loaded-from property of the library id.
15101 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15102 Initialize and staticpro them.
15103 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15104
15105 * process.c: Include lisp.h before w32.h, not after.
15106 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15107 instead of gnutls_record_check_pending.
15108
15109 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15110
15111 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15112
15113 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15114 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15115 as passed in.
15116
15117 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15118
15119 * xterm.c (x_set_frame_alpha): Do not set property on anything
15120 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15121
15122 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15123
15124 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15125
15126 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15127
15128 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15129 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15130 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15131 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15132 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15133 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15134 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15135 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15136 (Qgnutls_bootprop_callbacks_verify): Make static.
15137
15138 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15139
15140 * callproc.c: Indentation fixup.
15141
15142 * sysdep.c (wait_for_termination_1): Make static.
15143 (wait_for_termination, interruptible_wait_for_termination):
15144 Move after wait_for_termination_1.
15145
15146 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15147
15148 * sysdep.c (interruptible_wait_for_termination): New function
15149 which is like wait_for_termination, but allows keyboard
15150 interruptions.
15151
15152 * callproc.c (Fcall_process): Add (:file "file") as an option for
15153 the STDOUT buffer.
15154 (Fcall_process_region): Ditto.
15155
15156 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15157
15158 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15159 rather than `XVECTOR (FOO)->size'.
15160
15161 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15162 inttypes.h, as a gnulib replacement is used if it not available in
15163 system headers.
15164
15165 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15166
15167 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15168 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15169 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15170
15171 * coding.c (coding_alloc_by_realloc): Error out if destination
15172 will grow beyond MOST_POSITIVE_FIXNUM.
15173 (decode_coding_emacs_mule): Abort if there isn't enough place in
15174 charbuf for the composition carryover bytes. Reserve an extra
15175 space for up to 2 characters produced in a loop.
15176 (decode_coding_iso_2022): Abort if there isn't enough place in
15177 charbuf for the composition carryover bytes.
15178
15179 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15180
15181 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15182 aborting when %lld or %lll format is passed.
15183 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15184 %llo or %llx format is passed. (Bug#8545)
15185
15186 * window.c (window_scroll_line_based): Use a marker instead of
15187 simple variables to record original value of point. (Bug#7952)
15188
15189 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15190 produced by %s or %c overflows available buffer space. (Bug#8545)
15191
15192 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15193
15194 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15195 (SIZE_MAX): Move defn after all includes, as they might #define it.
15196
15197 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15198
15199 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15200
15201 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15202
15203 * keyboard.c (Qdelayed_warnings_hook): Define.
15204 (command_loop_1): Run `delayed-warnings-hook'
15205 if Vdelayed_warnings_list is non-nil.
15206 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15207 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15208
15209 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15210
15211 * doprnt.c (doprnt): Don't return value smaller than the buffer
15212 size if the message was truncated. (Bug#8545).
15213
15214 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15215
15216 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15217 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15218
15219 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15220
15221 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15222
15223 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15224
15225 * makefile.w32-in: Update dependencies.
15226
15227 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15228
15229 Improve `doprnt' and its usage. (Bug#8545)
15230 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15231 `format_end'. Remove support for %l as a conversion specifier.
15232 Don't use xrealloc. Improve diagnostics when the %l size modifier
15233 is used. Update the commentary.
15234
15235 * eval.c (verror): Simplify calculation of size_t.
15236
15237 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15238 messages.
15239
15240 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15241
15242 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15243 change.
15244
15245 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15246
15247 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15248 This makes this file independent of the recent pseudovector change.
15249
15250 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15251
15252 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15253
15254 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15255 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15256 Remove unused local.
15257 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15258
15259 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15260 GCC 4.6.0 optimizes based on type-based alias analysis.
15261 For example, if b is of type struct buffer * and v of type struct
15262 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15263 != &v->size, and therefore "v->size = 1; b->size = 2; return
15264 v->size;" must therefore return 1. This assumption is incorrect
15265 for Emacs, since it type-puns struct Lisp_Vector * with many other
15266 types. To fix this problem, this patch adds a new type struct
15267 vectorlike_header that documents the constraints on layout of vectors
15268 and pseudovectors, and helps optimizing compilers not get fooled
15269 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15270 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15271 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15272 the size member.
15273 (XSETPVECTYPE): Rewrite in terms of new macro.
15274 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15275 This is a bit clearer, and further avoids the possibility of
15276 undesirable aliasing.
15277 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15278 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15279 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15280 since Lisp_Subr is a special case (no "next" field).
15281 (ASIZE): Now uses header.size rather than size.
15282 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15283 to avoid the hassle of writing XVECTOR (foo)->header.size.
15284 (struct vectorlike_header): New type.
15285 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15286 object, to help avoid aliasing.
15287 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15288 (SUBRP): Likewise, since Lisp_Subr is a special case.
15289 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15290 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15291 (struct Lisp_Hash_Table): Combine first two members into a single
15292 struct vectorlike_header member. All uses of "size" and "next" members
15293 changed to be "header.size" and "header.next".
15294 * buffer.h (struct buffer): Likewise.
15295 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15296 * frame.h (struct frame): Likewise.
15297 * process.h (struct Lisp_Process): Likewise.
15298 * termhooks.h (struct terminal): Likewise.
15299 * window.c (struct save_window_data, struct saved_window): Likewise.
15300 * window.h (struct window): Likewise.
15301 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15302 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15303 * buffer.c (init_buffer_once): Likewise.
15304 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15305 special case.
15306 * process.c (Fformat_network_address): Use local var for size,
15307 for brevity.
15308
15309 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15310
15311 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15312 * data.c (atof): Remove decl; no longer used or needed.
15313 (digit_to_number): Move to lread.c.
15314 (Fstring_to_number): Use new string_to_number function, to be
15315 consistent with how the Lisp reader treats infinities and NaNs.
15316 Do not assume that floating-point numbers represent EMACS_INT
15317 without losing information; this is not true on most 64-bit hosts.
15318 Avoid double-rounding errors, by insisting on integers when
15319 parsing non-base-10 numbers, as the documentation specifies.
15320 * lisp.h (string_to_number): New decl, replacing ...
15321 (isfloat_string): Remove.
15322 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15323 (read1): Do not accept +. and -. as integers; this
15324 appears to have been a coding error. Similarly, do not accept
15325 strings like +-1e0 as floating point numbers. Do not report
15326 overflow for integer overflows unless the base is not 10 which
15327 means we have no simple and reliable way to continue.
15328 Break out the floating-point parsing into a new
15329 function string_to_number, so that Fstring_to_number parses
15330 floating point numbers consistently with the Lisp reader.
15331 (digit_to_number): Move here from data.c. Make it static inline.
15332 (E_CHAR, EXP_INT): Remove, replacing with ...
15333 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15334 (string_to_number): New function, replacing isfloat_string.
15335 This function checks for valid syntax and produces the resulting
15336 Lisp float number too. Rework it so that string-to-number
15337 no longer mishandles examples like "1.0e+". Use strtoumax,
15338 so that overflow for non-base-10 numbers is reported only when
15339 there's no portable and simple way to convert to floating point.
15340
15341 * textprop.c (set_text_properties_1): Rewrite for clarity,
15342 and to avoid GCC warning about integer overflow.
15343
15344 * intervals.h (struct interval): Use EMACS_INT for members
15345 where EMACS_UINT might cause problems. See
15346 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15347 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15348 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15349 All uses changed.
15350 (offset_intervals): Tell GCC not to worry about length overflow
15351 when negating a negative length.
15352
15353 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15354 (overrun_check_free): Likewise.
15355
15356 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15357 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15358 word size.
15359
15360 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15361 (gnutls_make_error): Rename local to avoid shadowing.
15362 (gnutls_emacs_global_deinit): ifdef out; not used.
15363 (Fgnutls_boot): Use const for pointer to readonly storage.
15364 Comment out unused local. Fix pointer signedness problems.
15365
15366 * lread.c (openp): Don't stuff size_t into an 'int'.
15367 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15368 about possible signed overflow.
15369
15370 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15371 (GDK_KEY_g): Don't define if already defined.
15372 (xg_prepare_tooltip): Avoid pointer signedness problem.
15373 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15374
15375 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15376 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15377
15378 * xfns.c (Fx_window_property): Simplify a bit,
15379 to make a bit faster and to avoid GCC 4.6.0 warning.
15380 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15381
15382 * fns.c (internal_equal): Don't assume size_t fits in int.
15383
15384 * alloc.c (compact_small_strings): Tighten assertion a little.
15385
15386 Replace pEd with more-general pI, and fix some printf arg casts.
15387 * lisp.h (pI): New macro, generalizing old pEd macro to other
15388 conversion specifiers. For example, use "...%"pI"d..." rather
15389 than "...%"pEd"...".
15390 (pEd): Remove. All uses replaced with similar uses of pI.
15391 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15392 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15393 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15394 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15395 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15396 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15397 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15398 64-bit hosts.
15399 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15400 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15401 * print.c (safe_debug_print, print_object): Likewise.
15402 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15403 to int.
15404 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15405 avoiding the 0 flag, which is not portable.
15406 * process.c (Fmake_network_process): Use pI to avoid cast.
15407 * region-cache.c (pp_cache): Likewise.
15408 * xdisp.c (decode_mode_spec): Likewise.
15409 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15410 behavior on 64-bit hosts with printf arg.
15411 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15412 (x_stop_queuing_selection_requests): Likewise.
15413 (x_get_window_property): Don't truncate byte count to an 'int'
15414 when tracing.
15415
15416 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15417 here, since it parses constructs like leading '-' and spaces,
15418 which are not wanted; and it overflows with large numbers.
15419 Instead, simply match F[0-9]+, which is what is wanted anyway.
15420
15421 * alloc.c: Remove unportable assumptions about struct layout.
15422 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15423 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15424 (allocate_vectorlike, make_pure_vector): Use the new macros,
15425 plus offsetof, to remove unportable assumptions about struct layout.
15426 These assumptions hold on all porting targets that I know of, but
15427 they are not guaranteed, they're easy to remove, and removing them
15428 makes further changes easier.
15429
15430 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15431 This doesn't fix a bug but makes the code clearer.
15432 (string_overrun_cookie): Now const. Use initializers that
15433 don't formally overflow signed char, to avoid warnings.
15434 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15435 can cause Emacs to crash when string overrun checking is enabled.
15436 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15437 multiple of sizeof (EMACS_INT); it need not be, if
15438 alignof(EMACS_INT) < sizeof (EMACS_INT).
15439 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15440
15441 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15442
15443 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15444
15445 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15446
15447 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15448 supposed to be handshaking. (Bug#8556)
15449 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15450
15451 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15452
15453 * lisp.h (Qdebug): List symbol.
15454 * eval.c (Qdebug): Restore global linkage.
15455 * keyboard.c (debug-on-event): New variable.
15456 (handle_user_signal): Break into debugger when debug-on-event
15457 matches the current signal symbol.
15458
15459 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15460
15461 * alloc.c (check_sblock, check_string_bytes)
15462 (check_string_free_list): Convert to standard C.
15463
15464 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15465
15466 * w32.c (emacs_gnutls_push): Fix typo.
15467
15468 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15469
15470 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15471 "cast to pointer from integer of different size".
15472
15473 Improve doprnt and its use in verror. (Bug#8545)
15474 * doprnt.c (doprnt): Document the set of format control sequences
15475 supported by the function. Use SAFE_ALLOCA instead of always
15476 using `alloca'.
15477
15478 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15479 is one byte too soon. Don't use xrealloc; instead xfree and
15480 xmalloc anew.
15481
15482 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15483
15484 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15485 callbacks stage.
15486
15487 * gnutls.c: Renamed global_initialized to
15488 gnutls_global_initialized. Added internals for the
15489 :verify-hostname-error, :verify-error, and :verify-flags
15490 parameters of `gnutls-boot' and documented those parameters in the
15491 docstring. Start callback support.
15492 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15493 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15494 on error. Return error code.
15495 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15496 (emacs_gnutls_read): Likewise.
15497 (Fgnutls_boot): Return handshake error code.
15498 (emacs_gnutls_handle_error): New function.
15499 (wsaerror_to_errno): Likewise.
15500
15501 * w32.h (emacs_gnutls_pull): Add prototype.
15502 (emacs_gnutls_push): Likewise.
15503
15504 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15505 (emacs_gnutls_push): Likewise.
15506
15507 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15508
15509 * process.c (wait_reading_process_output): Check if GnuTLS
15510 buffered some data internally if no FDs are set for TLS
15511 connections.
15512
15513 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15514 (LIBS): Link to USER_LIBS.
15515 ($(BLD)/gnutls.$(0)): New target.
15516
15517 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15518
15519 * xdisp.c (handle_single_display_spec): Rename the
15520 display_replaced_before_p argument into display_replaced_p, to
15521 make it consistent with the commentary. Fix typos in the
15522 commentary.
15523
15524 * textprop.c (syms_of_textprop): Remove dead code.
15525 (copy_text_properties): Delete obsolete commentary about an
15526 interface that was deleted long ago. Fix typos in the description
15527 of arguments.
15528
15529 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15530 to changes in oldXMenu/XMenu.h from 2011-04-16.
15531 <menu_help_message, prev_menu_help_message>: Constify.
15532 (IT_menu_make_room): menu->help_text is now `const char **';
15533 adjust.
15534
15535 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15536 to changes in oldXMenu/XMenu.h from 2011-04-16.
15537 (struct XMenu): Declare `help_text' `const char **'.
15538
15539 * xfaces.c <Qunspecified>: Make extern again.
15540
15541 * syntax.c: Include sys/types.h before including regex.h, as
15542 required by POSIX.
15543
15544 * doc.c (get_doc_string): Improve the format passed to `error'.
15545
15546 * doprnt.c (doprnt): Improve commentary.
15547
15548 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15549
15550 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15551 them with etags.
15552
15553 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15554 changes in globals.h immediately force recompilation.
15555 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15556 $(CURDIR)/s/ms-w32.h.
15557 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15558
15559 * character.c (Fchar_direction): Function deleted.
15560 (syms_of_character): Don't defsubr it.
15561 <char-direction-table>: Deleted.
15562
15563 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15564
15565 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15566 * doprnt.c: Include limits.h.
15567 (SIZE_MAX): New macro.
15568 (doprnt): Return a size_t value. 2nd arg is now size_t.
15569 Many local variables are now size_t instead of int or unsigned.
15570 Improve overflow protection. Support `l' modifier for integer
15571 conversions. Support %l conversion. Don't assume an EMACS_INT
15572 argument for integer conversions and for %c.
15573
15574 * lisp.h (doprnt): Restore prototype.
15575
15576 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15577 $(SRC)/character.h.
15578
15579 * Makefile.in (base_obj): Add back doprnt.o.
15580
15581 * deps.mk (doprnt.o): Add back prerequisites.
15582 (callint.o): Depend on character.h.
15583
15584 * eval.c (internal_lisp_condition_case): Include the handler
15585 representation in the error message.
15586 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15587 when breaking from the loop.
15588
15589 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15590
15591 * callint.c (Fcall_interactively): When displaying error message
15592 about invalid control letter, pass the character's codepoint, not
15593 a pointer to its multibyte form. Improve display of the character
15594 in octal and display also its hex code.
15595
15596 * character.c (char_string): Use %x to display the (unsigned)
15597 codepoint of an invalid character, to avoid displaying a bogus
15598 negative value.
15599
15600 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15601 `error', not SYMBOL_NAME itself.
15602
15603 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15604 character arguments to `error'.
15605
15606 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15607 to `error' in error message about FINAL_CHAR argument. Make sure
15608 FINAL_CHAR is a character, and use %c when it is passed as
15609 argument to `error'.
15610
15611 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15612
15613 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15614
15615 * w32.c: Include <time.h>.
15616 (sys_localtime): New function.
15617
15618 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15619
15620 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15621
15622 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15623
15624 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15625
15626 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15627 zombies (Bug#8467).
15628
15629 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15630
15631 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15632 gl_state.e_property when gl_state.object is Qt.
15633
15634 * insdel.c (make_gap_larger): Remove limitation of buffer size
15635 to <= INT_MAX.
15636
15637 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15638
15639 * xdisp.c (lookup_glyphless_char_display)
15640 (produce_glyphless_glyph): Handle cons cell entry in
15641 glyphless-char-display.
15642 (Vglyphless_char_display): Document it.
15643
15644 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15645 glyphless-char-display.
15646
15647 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15648
15649 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15650
15651 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15652
15653 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15654 definition for no-X builds.
15655
15656 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15657
15658 Static checks with GCC 4.6.0 and non-default toolkits.
15659
15660 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15661
15662 * process.c (keyboard_bit_set): Define only if SIGIO.
15663 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15664 (send_process): Repair possible setjmp clobbering.
15665
15666 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15667
15668 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15669
15670 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15671
15672 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15673 Define only if needed.
15674
15675 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15676 by pacifying GCC about it. Maybe it's time to retire it?
15677 * xfaces.c (USG, __TIMEVAL__): Likewise.
15678
15679 * dispextern.h (struct redisplay_interface): Rename param
15680 to avoid shadowing.
15681 * termhooks.h (struct terminal): Likewise.
15682 * xterm.c (xembed_send_message): Likewise.
15683
15684 * insdel.c (make_gap_smaller): Define only if
15685 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15686
15687 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15688 it.
15689
15690 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15691 so that we aren't warned about unused symbols.
15692
15693 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15694
15695 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15696
15697 * xfns.c (x_real_positions): Mark locals as initialized.
15698
15699 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15700
15701 * xterm.c: Fix problems found by static analysis with other toolkits.
15702 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15703 (x_dispatch_event): Declare static if USE_GTK, and
15704 define if USE_GTK || USE_X_TOOLKIT.
15705 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15706 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15707 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15708 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15709
15710 * xmenu.c (menu_help_callback): Pointer type fixes.
15711 Use const pointers when pointing at readonly data. Avoid pointer
15712 signedness clashes.
15713 (FALSE): Remove unused macro.
15714 (update_frame_menubar): Remove unused decl.
15715
15716 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15717
15718 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15719 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15720 (single_menu_item): Rename local to avoid shadowing.
15721
15722 * keyboard.c (make_lispy_event): Remove unused local var.
15723
15724 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15725 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15726
15727 * bitmaps: Change bitmaps from unsigned char back to the X11
15728 compatible char. Avoid the old compiler warnings about
15729 out-of-range initializers by using, for example, '\xab' rather
15730 than 0xab.
15731
15732 * xgselect.c (xgselect_initialize): Check vs interface
15733 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15734
15735 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15736
15737 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15738 to read-only memory.
15739
15740 * fns.c (vector): Remove; this old hack is no longer needed.
15741
15742 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15743 Remove unused var.
15744 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15745
15746 * xrdb.c (x_load_resources): Omit unused local.
15747
15748 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15749 (x_window): Rename locals to avoid shadowing.
15750 (USG): Use the kludged USG macro, to pacify gcc.
15751
15752 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15753 (x_term_init): Remove local to avoid shadowing.
15754
15755 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15756
15757 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15758 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15759
15760 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15761
15762 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15763
15764 Fix regex.c, syntax.c and friends for buffers > 2GB.
15765 * syntax.h (struct gl_state_s): Declare character position members
15766 EMACS_INT.
15767
15768 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15769
15770 * textprop.c (verify_interval_modification, interval_of):
15771 Declare arguments EMACS_INT.
15772
15773 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15774 EMACS_INT.
15775
15776 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15777
15778 * indent.c (Fvertical_motion): Local variable it_start is now
15779 EMACS_INT.
15780
15781 * regex.c (re_match, re_match_2, re_match_2_internal)
15782 (bcmp_translate, regcomp, regexec, print_double_string)
15783 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15784 (re_compile_pattern, re_exec): Declare arguments and local
15785 variables `size_t' and `ssize_t' and return values `regoff_t', as
15786 appropriate.
15787 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15788 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15789 <compile_stack_type>: `size' and `avail' are now `size_t'.
15790
15791 * regex.h <regoff_t>: Use ssize_t, not int.
15792 (re_search, re_search_2, re_match, re_match_2): Arguments that
15793 specify buffer/string position and length are now ssize_t and
15794 size_t. Return type is regoff_t.
15795
15796 2011-04-16 Ben Key <bkey76@gmail.com>
15797
15798 * nsfont.m: Fixed bugs in ns_get_family and
15799 ns_descriptor_to_entity that were caused by using free to
15800 deallocate memory blocks that were allocated by xmalloc (via
15801 xstrdup). This caused Emacs to crash when compiled with
15802 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15803 --enable-checking=xmallocoverrun). xfree is now used to
15804 deallocate these memory blocks.
15805
15806 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15807
15808 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15809
15810 emacs_write: Accept and return EMACS_INT for sizes.
15811 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15812 et seq.
15813 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15814 Accept and return EMACS_INT.
15815 (emacs_gnutls_write): Return the number of bytes written on
15816 partial writes.
15817 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15818 (emacs_read, emacs_write): Remove check for negative size, as the
15819 Emacs source code has been audited now.
15820 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15821 (emacs_read, emacs_write): Use it.
15822 * process.c (send_process): Adjust to the new signatures of
15823 emacs_write and emacs_gnutls_write. Do not attempt to store
15824 a byte offset into an 'int'; it might overflow.
15825 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15826
15827 * sound.c: Don't assume sizes fit in 'int'.
15828 (struct sound_device.period_size, alsa_period_size):
15829 Return EMACS_INT, not int.
15830 (struct sound_device.write, vox_write, alsa_write):
15831 Accept EMACS_INT, not int.
15832 (wav_play, au_play): Use EMACS_INT to store sizes and to
15833 record read return values.
15834
15835 2011-04-15 Ben Key <bkey76@gmail.com>
15836
15837 * keyboard.c (Qundefined): Don't declare static since it is used
15838 in nsfns.m.
15839 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15840 static since they are used in nsfont.m.
15841
15842 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15843
15844 * process.c (Qprocessp): Don't declare static.
15845 * lisp.h (Qprocessp): Declare again.
15846
15847 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15848
15849 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15850
15851 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15852
15853 Improve C-level modularity by making more things 'static'.
15854
15855 Don't publish debugger-only interfaces to other modules.
15856 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15857 (verify_bytepos, count_markers): Move decls to the only modules
15858 that need them.
15859 * region-cache.h (pp_cache): Likewise.
15860 * window.h (check_all_windows): Likewise.
15861 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15862
15863 * sysdep.c (croak): Now static, if
15864 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15865 * syssignal.h (croak): Declare only if not static.
15866
15867 * alloc.c (refill_memory_reserve): Now static if
15868 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15869 * lisp.h (refill_memory_reserve): Declare only if not static.
15870
15871 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15872 Define only if USE_LUCID.
15873
15874 * xrdb.c (x_customization_string, x_rm_string): Now static.
15875
15876 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15877 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15878
15879 * xdisp.c (draw_row_with_mouse_face): Now static.
15880 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15881
15882 * window.h (check_all_windows): Mark externally visible.
15883
15884 * window.c (window_deletion_count): Now static.
15885
15886 * undo.c: Make symbols static if they're not exported.
15887 (last_undo_buffer, last_boundary_position, pending_boundary):
15888 Now static.
15889
15890 * textprop.c (interval_insert_behind_hooks): Now static.
15891 (interval_insert_in_front_hooks): Likewise.
15892
15893 * term.c: Make symbols static if they're not exported.
15894 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15895 (max_frame_lines, tty_set_terminal_modes):
15896 (tty_reset_terminal_modes, tty_turn_off_highlight):
15897 (get_tty_terminal): Now static.
15898 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15899 * termhooks.h (term_mouse_moveto): Do not declare if
15900 HAVE_WINDOW_SYSTEM.
15901 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15902 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15903
15904 * sysdep.c: Make symbols static if they're not exported.
15905 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15906 Now static.
15907 (sigprocmask_set, full_mask): Remove; unused.
15908 (wait_debugging): Mark as visible.
15909 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15910 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15911
15912 * syntax.c (syntax_temp): Define only if !__GNUC__.
15913
15914 * sound.c (current_sound_device, current_sound): Now static.
15915
15916 * search.c (searchbufs, searchbuf_head): Now static.
15917
15918 * scroll.c (scroll_cost): Remove; unused.
15919 * dispextern.h (scroll_cost): Remove decl.
15920
15921 * region-cache.h (pp_cache): Mark as externally visible.
15922
15923 * process.c: Make symbols static if they're not exported.
15924 (process_tick, update_tick, create_process, chan_process):
15925 (Vprocess_alist, proc_buffered_char, datagram_access):
15926 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15927 (deactivate_process): Mark defn as static, as well as decl.
15928 * lisp.h (create_process): Remove decl.
15929 * process.h (chan_process, Vprocess_alist): Remove decls.
15930
15931 * print.c: Make symbols static if they're not exported.
15932 (print_depth, new_backquote_output, being_printed, print_buffer):
15933 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15934 (print_interval, print_number_index, initial_stderr_stream):
15935 Now static.
15936 * lisp.h (Fprinc): Remove decl.
15937 (debug_output_compilation_hack): Mark as externally visible.
15938
15939 * sysdep.c (croak): Move decl from here to syssignal.h.
15940 * syssignal.h (croak): Put it here, so the API can be checked when
15941 'croak' is called from dissociate_if_controlling_tty.
15942
15943 * minibuf.c: Make symbols static if they're not exported.
15944 (minibuf_save_list, choose_minibuf_frame): Now static.
15945 * lisp.h (choose_minibuf_frame): Remove decl.
15946
15947 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15948
15949 * lread.c: Make symbols static if they're not exported.
15950 (read_objects, initial_obarray, oblookup_last_bucket_number):
15951 Now static.
15952 (make_symbol): Remove; unused.
15953 * lisp.h (initial_obarray, make_symbol): Remove decls.
15954
15955 * keyboard.c: Make symbols static if they're not exported.
15956 (single_kboard, recent_keys_index, total_keys, recent_keys):
15957 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15958 (this_single_command_key_start, echoing, last_auto_save):
15959 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15960 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15961 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15962 (Vlispy_mouse_stem, double_click_count):
15963 Now static.
15964 (force_auto_save_soon): Define only if SIGDANGER.
15965 (ignore_mouse_drag_p): Now static if
15966 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15967 (print_help): Remove; unused.
15968 (stop_character, last_timer_event): Mark as externally visible.
15969 * keyboard.h (ignore_mouse_drag_p): Declare only if
15970 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15971 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15972 * lisp.h (echoing): Remove decl.
15973 (force_auto_save_soon): Declare only if SIGDANGER.
15974 * xdisp.c (redisplay_window): Simplify code, to make it more
15975 obvious that ignore_mouse_drag_p is not accessed if !defined
15976 USE_GTK && !defined HAVE_NS.
15977
15978 * intervals.c: Make symbols static if they're not exported.
15979 (merge_properties_sticky, merge_interval_right, delete_interval):
15980 Now static.
15981 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15982
15983 * insdel.c: Make symbols static if they're not exported.
15984 However, leave prepare_to_modify_buffer alone. It's never
15985 called from outside this function, but that appears to be a bug.
15986 (combine_after_change_list, combine_after_change_buffer):
15987 (adjust_after_replace, signal_before_change): Now static.
15988 (adjust_after_replace_noundo): Remove; unused.
15989 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15990 (signal_before_change): Remove decls.
15991
15992 * indent.c (val_compute_motion, val_vmotion): Now static.
15993
15994 * image.c: Make symbols static if they're not exported.
15995 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15996 if USE_GTK.
15997 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15998 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15999
16000 * fringe.c (standard_bitmaps): Now static.
16001 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16002
16003 * frame.c: Make symbols static if they're not exported.
16004 (x_report_frame_params, make_terminal_frame): Now static.
16005 (get_frame_param): Now static, unless HAVE_NS.
16006 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16007 (x_get_resource_string): Remove; not used.
16008 * frame.h (make_terminal_frame, x_report_frame_params):
16009 (x_get_resource_string); Remove decls.
16010 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16011 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16012
16013 * font.c, fontset.c: Make symbols static if they're not exported.
16014 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16015 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16016 * font.c (font_close_object): Now static.
16017 * font.h (font_close_object): Remove.
16018 * fontset.c (FONTSET_OBJLIST): Remove.
16019 (free_realized_fontset) #if-0 the body, which does nothing.
16020 (face_suitable_for_char_p): #if-0, as it's never called.
16021 * fontset.h (face_suitable_for_char_p): Remove decl.
16022 * xfaces.c (face_at_string_position):
16023 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16024 since 0 is always ASCII.
16025
16026 * fns.c (weak_hash_tables): Now static.
16027
16028 * fileio.c: Make symbols static if they're not exported.
16029 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16030 (Vwrite_region_annotation_buffers): Now static.
16031
16032 * eval.c: Make symbols static if they're not exported.
16033 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16034 * lisp.h (backtrace_list): Remove decl.
16035
16036 * emacs.c: Make symbols static if they're not exported.
16037 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16038 (fatal_error_code, fatal_error_signal_hook, standard_args):
16039 Now static.
16040 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16041 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16042 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16043 * lisp.h (fatal_error_signal_hook): Remove decl.
16044 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16045
16046 * editfns.c: Move a (normally-unused) function to its only use.
16047 * editfns.c, lisp.h (get_operating_system_release): Remove.
16048 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16049 worth the hassle of breaking this out.
16050
16051 * xterm.c: Make symbols static if they're not exported.
16052 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16053 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16054 (x_destroy_window, x_delete_display):
16055 Now static.
16056 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16057 (x_mouse_leave): Remove; unused.
16058 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16059 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16060 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16061 Remove decls.
16062 (x_mouse_leave): Declare only if WINDOWSNT.
16063 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16064 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16065 USE_X_TOOLKIT.
16066
16067 * ftxfont.c: Make symbols static if they're not exported.
16068 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16069 HAVE_FREETYPE.
16070 * font.h (ftxfont_driver): Likewise.
16071
16072 * xfns.c: Make symbols static if they're not exported.
16073 (x_last_font_name, x_display_info_for_name):
16074 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16075 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16076 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16077 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16078 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16079 (last_show_tip_args): Now static.
16080 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16081 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16082 (x_screen_planes): Remove; unused.
16083 * dispextern.h (x_screen_planes): Remove decl.
16084
16085 * dispnew.c: Make symbols static if they're not exported.
16086 * dispextern.h (redraw_garbaged_frames, scrolling):
16087 (increment_row_positions): Remove.
16088 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16089 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16090 Now static.
16091 (redraw_garbaged_frames): Remove; unused.
16092
16093 * xfaces.c: Make symbols static if they're not exported.
16094 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16095 Remove decls.
16096 * xterm.h (defined_color): Remove decls.
16097 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16098 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16099 (menu_face_changed_default, defined_color, free_realized_face):
16100 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16101 (ascii_face_of_lisp_face): Remove; unused.
16102
16103 * xdisp.c: Make symbols static if they're not exported.
16104 * dispextern.h (scratch_glyph_row, window_box_edges):
16105 (glyph_to_pixel_coords, set_cursor_from_row):
16106 (get_next_display_element, set_iterator_to_next):
16107 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16108 (show_mouse_face): Remove decls
16109 * frame.h (message_buf_print): Likewise.
16110 * lisp.h (pop_message, set_message, check_point_in_composition):
16111 Likewise.
16112 * xterm.h (set_vertical_scroll_bar): Likewise.
16113 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16114 (message_buf_print, scratch_glyph_row, displayed_buffer):
16115 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16116 (get_next_display_element, show_mouse_face, window_box_edges):
16117 (frame_to_window_pixel_xy, check_point_in_composition):
16118 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16119 (glyph_to_pixel_coords): Remove; unused.
16120
16121 * dired.c (file_name_completion): Now static.
16122
16123 * dbusbind.c (xd_in_read_queued_messages): Now static.
16124
16125 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16126 * data.c (circular_list_error): Remove.
16127
16128 * commands.h (last_point_position, last_point_position_buffer):
16129 (last_point_position_window): Remove decls.
16130 * keyboard.c: Make these variables static.
16131
16132 * coding.h (coding, code_convert_region, encode_coding_gap):
16133 Remove decls.
16134 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16135 (iso_code_class, detect_coding, code_convert_region): Now static.
16136 (encode_coding_gap): Remove; unused.
16137
16138 * chartab.c (chartab_chars, chartab_bits): Now static.
16139
16140 * charset.h (charset_iso_8859_1): Remove decl.
16141 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16142 Now static.
16143
16144 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16145 * ccl.c (Vccl_program_table): Now static.
16146 (check_ccl_update): Remove; unused.
16147
16148 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16149 * category.h: ... from here.
16150 * category.c (check_category_table, set_category_set): Now static.
16151
16152 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16153 * lisp.h: Remove these decls.
16154
16155 * buffer.c (buffer_count): Remove unused var.
16156
16157 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16158 so that it's not optimized away.
16159 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16160 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16161 exported only to the debugger.
16162
16163 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16164 * atimer.h (run_all_atimers): Remove; not exported.
16165
16166 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16167 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16168 was inaccessible from Lisp.
16169 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16170 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16171
16172 alloc.c: Import and export fewer symbols, and remove unused items.
16173 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16174 is defined.
16175 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16176 it's not optimized away by whole-program optimization.
16177 (message_enable_multibyte, free_misc): Remove.
16178 (catchlist, handlerlist, mark_backtrace):
16179 Declare only if BYTE_MARK_STACK.
16180 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16181 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16182 (message_enable_multibyte): Remove decl.
16183 (free_misc, interval_free_list, float_block, float_block_index):
16184 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16185 (cons_free_list, last_marked_index):
16186 Now static.
16187 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16188 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16189 (mark_backtrace): Define only if BYTE_MARK_STACK.
16190 * xdisp.c (message_enable_multibyte): Now static.
16191
16192 Declare Lisp_Object Q* variables to be 'static' if not exported.
16193 This makes it easier for human readers (and static analyzers)
16194 to see whether these variables are used from other modules.
16195 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16196 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16197 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16198 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16199 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16200 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16201 * xmenu.c, xselect.c:
16202 Declare Q* vars static if they are not used in other modules.
16203 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16204 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16205 Remove decls of unexported vars.
16206 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16207
16208 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16209
16210 Make Emacs functions such as Fatom 'static' by default.
16211 This makes it easier for human readers (and static analyzers)
16212 to see whether these functions can be called from other modules.
16213 DEFUN now defines a static function. To make the function external
16214 so that it can be used in other C modules, use the new macro DEFUE.
16215 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16216 (Finit_image_library):
16217 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16218 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16219 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16220 Remove decls, since these functions are now static.
16221 (Funintern, Fget_internal_run_time): New decls, since these functions
16222 were already external.
16223
16224 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16225 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16226 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16227 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16228 * keyboard.c, keymap.c, lread.c:
16229 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16230 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16231 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16232 Mark functions with DEFUE instead of DEFUN,
16233 if they are used in other modules.
16234 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16235 decls for now-static functions.
16236 * buffer.h (Fdelete_overlay): Remove decl.
16237 * callproc.c (Fgetenv_internal): Mark as internal.
16238 * composite.c (Fremove_list_of_text_properties): Remove decl.
16239 (Fcomposition_get_gstring): New forward static decl.
16240 * composite.h (Fcomposite_get_gstring): Remove decl.
16241 * dired.c (Ffile_attributes): New forward static decl.
16242 * doc.c (Fdocumntation_property): New forward static decl.
16243 * eval.c (Ffetch_bytecode): New forward static decl.
16244 (Funintern): Remove extern decl; now in .h file where it belongs.
16245 * fileio.c (Fmake_symbolic_link): New forward static decl.
16246 * image.c (Finit_image_library): New forward static decl.
16247 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16248 * intervals.h (Fprevious_property_change):
16249 (Fremove_list_of_text_properties): Remove decls.
16250 * keyboard.c (Fthis_command_keys): Remove decl.
16251 (Fcommand_execute): New forward static decl.
16252 * keymap.c (Flookup_key): New forward static decl.
16253 (Fcopy_keymap): Now static.
16254 * keymap.h (Flookup_key): Remove decl.
16255 * process.c (Fget_process): New forward static decl.
16256 (Fprocess_datagram_address): Mark as internal.
16257 * syntax.c (Fsyntax_table_p): New forward static decl.
16258 (skip_chars): Remove duplicate decl.
16259 * textprop.c (Fprevious_property_change): New forward static decl.
16260 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16261 Now internal.
16262 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16263 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16264
16265 * editfns.c (Fformat): Remove unreachable code.
16266
16267 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16268
16269 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16270 change. (Bug#8496)
16271
16272 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16273
16274 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16275 when at ZV. (Bug#8487)
16276
16277 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16278
16279 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16280 (Bug#8437)
16281 * keyboard.c (parse_tool_bar_item): Likewise.
16282 * sound.c (sound_cleanup, alsa_close): Likewise.
16283 * termcap.c (tgetent): Likewise.
16284 * xfns.c (x_default_font_parameter): Likewise.
16285 * xsettings.c (read_and_apply_settings): Likewise.
16286
16287 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16288 (overrun_check_free): Protoize.
16289
16290 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16291
16292 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16293 since callers should never pass a negative size.
16294 Change the signature to match that of plain 'read' and 'write'; see
16295 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16296 * lisp.h: Update prototypes of emacs_write and emacs_read.
16297
16298 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16299
16300 * xdisp.c (redisplay_window): Don't try to determine the character
16301 position of the scroll margin if the window start point w->startp
16302 is outside the buffer's accessible region. (Bug#8468)
16303
16304 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16305
16306 Fix write-region and its subroutines for buffers > 2GB.
16307 * fileio.c (a_write, e_write): Modify declaration of arguments and
16308 local variables to support buffers larger than 2GB.
16309 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16310
16311 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16312 argument, local variables, and return value.
16313
16314 * lisp.h: Update prototypes of emacs_write and emacs_read.
16315
16316 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16317
16318 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16319
16320 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16321
16322 Fix more problems found by GCC 4.6.0's static checks.
16323
16324 * xdisp.c (vmessage): Use a better test for character truncation.
16325
16326 * charset.c (load_charset_map): <, not <=, for optimization,
16327 and to avoid potential problems with integer overflow.
16328 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16329 * casetab.c (set_identity, shuffle): Likewise.
16330 * editfns.c (Fformat): Likewise.
16331 * syntax.c (skip_chars): Likewise.
16332
16333 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16334 This also lets GCC 4.6.0 generate slightly better loop code.
16335
16336 * callint.c (Fcall_interactively): <, not <=, for optimization.
16337 (Fcall_interactively): Count the number of arguments produced,
16338 not the number of arguments given. This is simpler and lets GCC
16339 4.6.0 generate slightly better code.
16340
16341 * ftfont.c: Distingish more carefully between FcChar8 and char.
16342 The previous code passed unsigned char * to a functions like
16343 strlen and xstrcasecmp that expect char *, which does not
16344 conform to the C standard.
16345 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16346 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16347 char * when the C standard requires it.
16348
16349 * keyboard.c (read_char): Remove unused var.
16350
16351 * eval.c: Port to Windows vsnprintf (Bug#8435).
16352 Include <limits.h>.
16353 (SIZE_MAX): Define if the headers do not.
16354 (verror): Do not give up if vsnprintf returns a negative count.
16355 Instead, grow the buffer. This ports to Windows vsnprintf, which
16356 does not conform to C99. Problem reported by Eli Zaretskii.
16357 Also, simplify the allocation scheme, by avoiding the need for
16358 calling realloc, and removing the ALLOCATED variable.
16359
16360 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16361
16362 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16363 But keep the doprint source code for now, as we might revamp it
16364 and use it again (Bug#8435).
16365 * lisp.h (doprnt): Remove.
16366 * Makefile.in (base_obj): Remove doprnt.o.
16367 * deps.mk (doprnt.o): Remove.
16368
16369 error: Print 32- and 64-bit integers portably (Bug#8435).
16370 Without this change, on typical 64-bit hosts error ("...%d...", N)
16371 was used to print both 32- and 64-bit integers N, which relied on
16372 undefined behavior.
16373 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16374 * lisp.h (error, verror): Mark as printf-like functions.
16375 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16376 Report overflow in size calculations when allocating printf buffer.
16377 Do not truncate output string at its first null byte.
16378 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16379 Truncate the output at a character boundary, since vsnprintf does not
16380 do that.
16381 * charset.c (check_iso_charset_parameter): Convert internal
16382 character to string before calling 'error', since %c now has the
16383 printf meaning.
16384 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16385 overflow when computing char to be passed to 'error'. Do not
16386 pass Lisp_Object to 'error'; pass the integer instead.
16387 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16388 formatted with plain %d.
16389
16390 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16391
16392 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16393
16394 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16395
16396 * xterm.c (x_catch_errors): Remove duplicate declaration.
16397
16398 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16399
16400 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16401
16402 2011-04-10 Jim Meyering <meyering@redhat.com>
16403
16404 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16405 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16406 return ssize_t not "int", and use size_t as the buffer length.
16407 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16408 * gnutls.h: Update declarations.
16409 * process.c (read_process_output): Use ssize_t, to match.
16410 (send_process): Likewise.
16411
16412 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16413
16414 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16415
16416 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16417
16418 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16419 Use unsigned char, to match FcChar8 type definition.
16420
16421 * xterm.c (handle_one_xevent):
16422 * xmenu.c (create_and_show_popup_menu):
16423 * xselect.c (x_decline_selection_request)
16424 (x_reply_selection_request): Avoid type-punned deref of X events.
16425
16426 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16427
16428 Fix some uses of `int' instead of EMACS_INT.
16429 * search.c (string_match_1, fast_string_match)
16430 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16431 (scan_buffer, find_next_newline_no_quit)
16432 (find_before_next_newline, search_command, Freplace_match)
16433 (Fmatch_data): Make some `int' variables be EMACS_INT.
16434
16435 * xdisp.c (display_count_lines): 3rd argument and return value now
16436 EMACS_INT. All callers changed.
16437 (pint2hrstr): Last argument is now EMACS_INT.
16438
16439 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16440 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16441 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16442 (decode_coding_utf_16, decode_coding_emacs_mule)
16443 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16444 (decode_coding_ccl, decode_coding_charset)
16445 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16446 (decode_coding_iso_2022, decode_coding_emacs_mule)
16447 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16448 <char_offset, last_offset>: Declare EMACS_INT.
16449 (encode_coding_utf_8, encode_coding_utf_16)
16450 (encode_coding_emacs_mule, encode_invocation_designation)
16451 (encode_designation_at_bol, encode_coding_iso_2022)
16452 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16453 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16454 Declare EMACS_INT.
16455 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16456 (encode_invocation_designation): Last argument P_NCHARS is now
16457 EMACS_INT.
16458 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16459 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16460
16461 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16462 All users changed.
16463
16464 * ccl.c (Fccl_execute_on_string): Declare some variables
16465 EMACS_INT.
16466
16467 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16468
16469 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16470
16471 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16472
16473 * process.c (Fformat_network_address): Doc fix.
16474
16475 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16476
16477 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16478
16479 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16480
16481 * keyboard.c (read_char): Call Lisp function help-form-show,
16482 instead of using internal_with_output_to_temp_buffer.
16483 (Qhelp_form_show): New var.
16484 (syms_of_keyboard): Use DEFSYM macro.
16485
16486 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16487
16488 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16489
16490 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16491
16492 * process.c (Flist_processes): Remove to Lisp.
16493 (list_processes_1): Delete.
16494
16495 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16496
16497 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16498
16499 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16500
16501 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16502
16503 Fix more problems found by GCC 4.6.0's static checks.
16504
16505 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16506
16507 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16508
16509 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16510
16511 * xdisp.c (vmessage): Mark as a printf-like function.
16512
16513 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16514
16515 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16516
16517 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16518 printf-like functions.
16519 (tiff_load): Add casts to remove these marks before passing them
16520 to system-supplied API.
16521
16522 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16523
16524 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16525 This avoids several warnings with gcc -Wstrict-overflow.
16526 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16527 directly, rather than having caller test rule sign. This avoids
16528 some unnecessary tests.
16529 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16530 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16531 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16532
16533 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16534 (xfont_open): Avoid unnecessary tests.
16535
16536 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16537
16538 * composite.h, composite.c (composition_gstring_put_cache):
16539 Use EMACS_INT, not int, for length.
16540
16541 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16542 breaking out part of COMPOSITION_DECODE_RULE.
16543 (COMPOSITION_DECODE_RULE): Use it.
16544 * composite.c (get_composition_id): Remove unused local vars,
16545 by using the new macro.
16546
16547 * textprop.c (set_text_properties_1): Change while to do-while,
16548 since the condition is always true at first.
16549
16550 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16551 (interval_deletion_adjustment): Return unsigned value.
16552 All uses changed.
16553
16554 * process.c (list_processes_1, create_pty, read_process_output):
16555 (exec_sentinel): Remove vars that were set but not used.
16556 (create_pty): Remove unnecessary "volatile"s.
16557 (Fnetwork_interface_info): Avoid possibility of int overflow.
16558 (read_process_output): Do adaptive read buffering even if carryover.
16559 (read_process_output): Simplify nbytes computation if buffered.
16560
16561 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16562
16563 * syntax.c (scan_words): Remove var that was set but not used.
16564 (update_syntax_table): Use unsigned instead of int.
16565
16566 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16567 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16568 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16569
16570 * print.c (print_error_message): Avoid int overflow.
16571
16572 * font.c (font_list_entities): Redo for clarity,
16573 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16574
16575 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16576 (font_score): Avoid potential overflow in diff calculation.
16577
16578 * fns.c (substring_both): Remove var that is set but not used.
16579 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16580
16581 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16582
16583 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16584 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16585 can always succeed if overflow has undefined behavior.
16586
16587 * search.c (boyer_moore, wordify): Remove vars set but not used.
16588 (wordify): Omit three unnecessary tests.
16589
16590 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16591 All callers changed. This avoids the need for an unused var.
16592
16593 * casefiddle.c (casify_region): Remove var that is set but not used.
16594
16595 * dired.c (file_name_completion): Remove var that is set but not used.
16596
16597 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16598
16599 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16600 (Finsert_file_contents): Remove unnecessary code checking fd.
16601
16602 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16603 Check for integer overflow on size calculations.
16604
16605 * buffer.c (Fprevious_overlay_change): Remove var that is set
16606 but not used.
16607
16608 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16609 Remove vars that are set but not used.
16610 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16611 (timer_check_2): Mark vars as initialized.
16612
16613 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16614
16615 * image.c (lookup_image): Remove var that is set but not used.
16616 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16617
16618 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16619 that are set but not used.
16620
16621 * xfns.c (make_invisible_cursor): Don't return garbage
16622 if XCreateBitmapFromData fails (Bug#8410).
16623
16624 * xselect.c (x_get_local_selection, x_handle_property_notify):
16625 Remove vars that are set but not used.
16626
16627 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16628 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16629
16630 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16631 Remove var that is set but not used.
16632 (scroll_bar_windows_size): Now size_t, not int.
16633 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16634 Check for overflow.
16635
16636 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16637 (map_tty_color) [!defined MSDOS]: Likewise.
16638
16639 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16640
16641 * coding.c: Remove vars that are set but not used.
16642 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16643 All callers changed.
16644 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16645 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16646 (decode_coding_charset): Remove vars that are set but not used.
16647
16648 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16649 that is set but not used.
16650
16651 * print.c (print_object): Remove var that is set but not used.
16652
16653 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16654 The gnulib version avoids calling malloc in the usual case,
16655 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16656 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16657 * filelock.c (current_lock_owner): Likewise.
16658 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16659 * sysdep.c: Include allocator.h, careadlinkat.h.
16660 (emacs_no_realloc_allocator): New static constant.
16661 (emacs_readlink): New function.
16662 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16663 ../lib/careadlinkat.h.
16664
16665 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16666
16667 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16668 first non-nil return value).
16669
16670 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16671
16672 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16673 if not defined (Bug#8403).
16674
16675 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16676
16677 * xdisp.c (display_count_lines): Remove parameter `start',
16678 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16679 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16680 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16681 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16682 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16683 and thereabouts. All callers changed.
16684 (get_per_char_metric): Remove parameter `f', unused since
16685 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16686
16687 2011-04-02 Jim Meyering <meyering@redhat.com>
16688
16689 do not dereference NULL upon failed strdup
16690 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16691 (ns_get_family): Likewise.
16692
16693 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16694
16695 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16696
16697 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16698
16699 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16700 later (Bug#8403).
16701
16702 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16703
16704 Add lexical binding.
16705
16706 * window.c (Ftemp_output_buffer_show): New fun.
16707 (Fsave_window_excursion):
16708 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16709
16710 * lread.c (lisp_file_lexically_bound_p): New function.
16711 (Fload): Bind Qlexical_binding.
16712 (readevalloop): Remove `evalfun' arg.
16713 Bind Qinternal_interpreter_environment.
16714 (Feval_buffer): Bind Qlexical_binding.
16715 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16716 Mark as dynamic.
16717 (syms_of_lread): Declare `lexical-binding'.
16718
16719 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16720
16721 * keyboard.c (eval_dyn): New fun.
16722 (menu_item_eval_property): Use it.
16723
16724 * image.c (parse_image_spec): Use Ffunctionp.
16725
16726 * fns.c (concat, mapcar1): Accept byte-code-functions.
16727
16728 * eval.c (Fsetq): Handle lexical vars.
16729 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16730 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16731 (FletX, Flet): Obey lexical binding.
16732 (Fcommandp): Handle closures.
16733 (Feval): New `lexical' arg.
16734 (eval_sub): New function extracted from Feval. Use it almost
16735 everywhere where Feval was used. Look up vars in lexical env.
16736 Handle closures.
16737 (Ffunctionp): Move from subr.el.
16738 (Ffuncall): Handle closures.
16739 (apply_lambda): Remove `eval_flags'.
16740 (funcall_lambda): Handle closures and new byte-code-functions.
16741 (Fspecial_variable_p): New function.
16742 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16743 but without exporting it to Lisp.
16744
16745 * doc.c (Fdocumentation, store_function_docstring):
16746 * data.c (Finteractive_form): Handle closures.
16747
16748 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16749 interactive spec.
16750
16751 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16752 New byte-codes.
16753 (exec_byte_code): New function extracted from Fbyte_code to handle new
16754 calling convention for byte-code-functions. Add new byte-codes.
16755
16756 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16757
16758 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16759
16760 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16761
16762 * xdisp.c (redisplay_internal): Fix prototype.
16763
16764 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16765
16766 * xdisp.c (SCROLL_LIMIT): New macro.
16767 (try_scrolling): Use it when setting scroll_limit.
16768 Limit scrolling to 100 screen lines.
16769 (redisplay_window): Even when falling back on "recentering",
16770 position point in the window according to scroll-conservatively,
16771 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16772
16773 (try_scrolling): When point is above the window, allow searching
16774 as far as scroll_max, or one screenful, to compute vertical
16775 distance from PT to the scroll margin position. This prevents
16776 try_scrolling from unnecessarily failing when
16777 scroll-conservatively is set to a value slightly larger than the
16778 window height. Clean up the case of PT below the margin at bottom
16779 of window: scroll_max can no longer be INT_MAX. When aggressive
16780 scrolling is in use, don't let point enter the opposite scroll
16781 margin as result of the scroll.
16782 (syms_of_xdisp) <scroll-conservatively>: Document the
16783 threshold of 100 lines for never-recentering scrolling.
16784
16785 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16786
16787 * dispextern.h (move_it_by_lines):
16788 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16789 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16790 (message_log_check_duplicate): Remove parameters `prev_bol' and
16791 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16792 (redisplay_internal): Remove parameter `preserve_echo_area',
16793 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16794
16795 * indent.c (Fvertical_motion):
16796 * window.c (window_scroll_pixel_based, Frecenter):
16797 Don't pass `need_y_p' to `move_it_by_lines'.
16798
16799 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16800
16801 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16802 steal a few bits to be more compact.
16803 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16804 Remove unneeded casts.
16805
16806 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16807
16808 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16809
16810 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16811 binding" message (bug#7967).
16812
16813 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16814
16815 Fix more problems found by GCC 4.6.0's static checks.
16816
16817 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16818 Remove unused local var.
16819
16820 * editfns.c (Fmessage_box): Remove unused local var.
16821
16822 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16823 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16824 Omit unused local vars.
16825 * window.c (shrink_windows): Omit unused local var.
16826 * menu.c (digest_single_submenu): Omit unused local var.
16827 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16828 Omit unused local var.
16829
16830 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16831 Don't assume string length fits in int.
16832 (keyremap_step, read_key_sequence): Use size_t for sizes.
16833 (read_key_sequence): Don't check last_real_key_start redundantly.
16834
16835 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16836 instead of alloca (Bug#8344).
16837
16838 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16839 (Fbacktrace_frame): Don't assume nframes fits in int.
16840
16841 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16842
16843 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16844 concerns.
16845
16846 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16847
16848 * cm.c (calccost): Turn while-do into do-while, for clarity.
16849
16850 * keyboard.c (syms_of_keyboard): Use the same style as later
16851 in this function when indexing through an array. This also
16852 works around GCC bug 48267.
16853
16854 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16855
16856 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16857
16858 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16859 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16860
16861 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16862 This avoids undefined behavior on integer overflow, and is a bit
16863 more convenient anyway since it is compared to a size_t variable.
16864
16865 Variadic C functions now count arguments with size_t, not int.
16866 This avoids an unnecessary limitation on 64-bit machines, which
16867 caused (substring ...) to crash on large vectors (Bug#8344).
16868 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16869 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16870 All variadic functions and their callers changed accordingly.
16871 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16872 * data.c (arith_driver, float_arith_driver): Likewise.
16873 * editfns.c (general_insert_function): Likewise.
16874 * eval.c (struct backtrace.nargs, interactive_p)
16875 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16876 (funcall_lambda, mark_backtrace): Likewise.
16877 * fns.c (concat): Likewise.
16878 * frame.c (x_set_frame_parameters): Likewise.
16879 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16880 0 if not found, not -1. All callers changed.
16881
16882 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16883 (stack_copy_size): Now size_t, not int.
16884 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16885
16886 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16887
16888 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16889 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16890 All callers changed.
16891
16892 * lisp.h (multibyte_char_to_unibyte):
16893 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16894 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16895 * character.h (CHAR_TO_BYTE8):
16896 * cmds.c (internal_self_insert):
16897 * editfns.c (general_insert_function):
16898 * keymap.c (push_key_description):
16899 * search.c (Freplace_match):
16900 * xdisp.c (message_dolog, set_message_1): All callers changed.
16901
16902 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16903
16904 * keyboard.c (safe_run_hook_funcall): New function.
16905 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16906 don't set the hook to nil, but remove the offending function instead.
16907 (Qcommand_hook_internal): Remove, unused.
16908 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16909 Vcommand_hook_internal.
16910
16911 * eval.c (enum run_hooks_condition): Remove.
16912 (funcall_nil, funcall_not): New functions.
16913 (run_hook_with_args): Call each function through a `funcall' argument.
16914 Remove `cond' argument, now redundant.
16915 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16916 (Frun_hook_with_args_until_failure): Adjust accordingly.
16917 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16918
16919 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16920
16921 * dispextern.h (string_buffer_position): Remove declaration.
16922
16923 * print.c (strout): Remove parameter `multibyte', unused since
16924 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16925
16926 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16927 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16928 All callers changed.
16929
16930 * w32.c (_wsa_errlist): Use braces for struct initializers.
16931
16932 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16933 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16934 All callers changed.
16935 (string_buffer_position): Likewise. Also, make static (it's never
16936 used outside xdisp.c).
16937 (cursor_row_p): Remove parameter `w', unused since
16938 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16939 (decode_mode_spec): Remove parameter `precision', introduced during
16940 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16941 All callers changed.
16942
16943 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16944
16945 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16946
16947 2011-03-27 Anders Lindgren <andlind@gmail.com>
16948
16949 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16950 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16951 (ns_update_auto_hide_menu_bar): New functions.
16952 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16953 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16954 ns_constrain_all_frames.
16955 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16956 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16957
16958 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16959
16960 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16961
16962 2011-03-27 Glenn Morris <rgm@gnu.org>
16963
16964 * syssignal.h: Replace RETSIGTYPE with void.
16965 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16966 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16967 Replace SIGTYPE with void everywhere.
16968 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16969 * s/template.h (SIGTYPE): Remove commented out definition.
16970
16971 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16972
16973 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16974 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16975
16976 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16977
16978 * w32.c (read_unc_volume): Use parameter `henum', instead of
16979 global variable `wget_enum_handle'.
16980
16981 * keymap.c (describe_vector): Remove parameters `indices' and
16982 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16983 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16984
16985 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16986
16987 * keyboard.c (timer_check): Remove parameter `do_it_now',
16988 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16989 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16990 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16991
16992 * keyboard.c (read_char):
16993 * w32menu.c (w32_menu_display_help):
16994 * xmenu.c (show_help_event, menu_help_callback):
16995 Adjust calls to `show_help_echo'.
16996
16997 * gtkutil.c (xg_maybe_add_timer):
16998 * keyboard.c (readable_events):
16999 * process.c (wait_reading_process_output):
17000 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17001
17002 * insdel.c (adjust_markers_gap_motion):
17003 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17004 (gap_left, gap_right): Don't call it.
17005
17006 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17007
17008 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17009 incurred during fontification.
17010
17011 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17012
17013 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17014 (DEFVAR_PER_BUFFER): Don't pass it.
17015
17016 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17017 (scrolling_window): Don't pass it.
17018
17019 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17020
17021 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17022
17023 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17024 and `suffix'.
17025 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17026 of variables specific to SELinux and computation of `encoded_absname'.
17027
17028 * image.c (XPutPixel): Remove unused variable `height'.
17029
17030 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17031
17032 * unexw32.c (get_section_info): Remove unused variable `section'.
17033
17034 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17035 (system_process_attributes): Remove unused variable `sess'.
17036 (sys_read): Remove unused variable `err'.
17037
17038 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17039 (w32_wnd_proc): Remove unused variable `isdead'.
17040 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17041 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17042 (x_create_tip_frame): Remove unused variable `tem'.
17043
17044 * w32inevt.c (w32_console_read_socket):
17045 Remove unused variable `no_events'.
17046
17047 * w32term.c (x_draw_composite_glyph_string_foreground):
17048 Remove unused variable `width'.
17049
17050 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17051
17052 * w32term.c (x_set_glyph_string_clipping):
17053 Don't pass uninitialized region to CombineRgn.
17054
17055 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17056
17057 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17058 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17059 (Fx_close_connection): Remove unused variable `i'.
17060
17061 * w32font.c (w32font_draw): Return number of glyphs.
17062 (w32font_open_internal): Remove unused variable `i'.
17063 (w32font_driver): Add missing initializer.
17064
17065 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17066 (fill_in_menu): Remove unused variable `items_added'.
17067
17068 * w32term.c (last_mouse_press_frame): Remove static global variable.
17069 (w32_clip_to_row): Remove unused variable `f'.
17070 (x_delete_terminal): Remove unused variable `i'.
17071
17072 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17073 (NOTHING): Remove unused static global variable.
17074 (uniscribe_check_otf): Remove unused variable `table'.
17075 (uniscribe_font_driver): Add missing initializers.
17076
17077 2011-03-23 Julien Danjou <julien@danjou.info>
17078
17079 * term.c (Fsuspend_tty, Fresume_tty):
17080 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17081 * window.c (temp_output_buffer_show):
17082 * insdel.c (signal_before_change):
17083 * frame.c (Fhandle_switch_frame):
17084 * fileio.c (Fdo_auto_save):
17085 * emacs.c (Fkill_emacs):
17086 * editfns.c (save_excursion_restore):
17087 * cmds.c (internal_self_insert):
17088 * callint.c (Fcall_interactively):
17089 * buffer.c (Fkill_all_local_variables):
17090 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17091 Use Frun_hooks.
17092 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17093 unconditionally since it does the check itself.
17094
17095 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17096
17097 Fix more problems found by GCC 4.5.2's static checks.
17098
17099 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17100 the first time through the loop, since we know p0 < p1 then.
17101 This also avoids a gcc -Wstrict-overflow warning.
17102
17103 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17104 leading to a memory leak, possible in functions like
17105 load_charset_map_from_file that can allocate an unbounded number
17106 of objects (Bug#8318).
17107
17108 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17109 that could (at least in theory) be that large.
17110
17111 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17112 This is less likely to overflow, and avoids undefined behavior if
17113 overflow does occur. All callers changed. Use strtoul to scan
17114 for the unsigned long integer.
17115 (pint2hrstr): Simplify and tune code slightly.
17116 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17117
17118 * scroll.c (do_scrolling): Work around GCC bug 48228.
17119 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17120
17121 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17122 This also avoids a warning with gcc -Wstrict-overflow.
17123 (validate_x_resource_name): Simplify count usage.
17124 This also avoids a warning with gcc -Wstrict-overflow.
17125
17126 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17127 fail (Bug#8306).
17128
17129 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17130
17131 * process.c (Fmake_network_process): Use socklen_t, not int,
17132 where POSIX says socklen_t is required in portable programs.
17133 This fixes a porting bug on hosts like 64-bit HP-UX, where
17134 socklen_t is wider than int (Bug#8277).
17135 (Fmake_network_process, server_accept_connection):
17136 (wait_reading_process_output, read_process_output):
17137 Likewise.
17138
17139 * process.c: Rename or move locals to avoid shadowing.
17140 (list_processes_1, Fmake_network_process):
17141 (read_process_output_error_handler, exec_sentinel_error_handler):
17142 Rename or move locals.
17143 (Fmake_network_process): Define label "retry_connect" only if needed.
17144 (Fnetwork_interface_info): Fix pointer signedness.
17145 (process_send_signal): Add cast to avoid pointer signedness problem.
17146 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17147 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17148
17149 Make tparam.h and terminfo.c consistent.
17150 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17151 Include tparam.h instead, since it declares them.
17152 * cm.h (PC): Remove extern decl; tparam.h now does this.
17153 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17154 * terminfo.c: Include tparam.h, to check interfaces.
17155 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17156 (tparam): Adjust signature to match interface in tparam.h;
17157 this removes some undefined behavior. Check that outstring and len
17158 are zero, which they always are with Emacs.
17159 * tparam.h (PC, BC, UP): New extern decls.
17160
17161 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17162 (xftfont_open): Rename locals to avoid shadowing.
17163
17164 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17165 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17166 (OTF_TAG_SYM): Omit macro if not needed.
17167 (ftfont_list): Remove unused local.
17168 (get_adstyle_property, ftfont_pattern_entity):
17169 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17170 Rename locals to avoid shadowing.
17171
17172 * xfont.c (xfont_list_family): Mark var as initialized.
17173
17174 * xml.c (make_dom): Now static.
17175
17176 * composite.c (composition_compute_stop_pos): Rename local to
17177 avoid shadowing.
17178 (composition_reseat_it): Remove unused locals.
17179 (find_automatic_composition, composition_adjust_point): Likewise.
17180 (composition_update_it): Mark var as initialized.
17181 (find_automatic_composition): Mark vars as initialized,
17182 with a FIXME (Bug#8290).
17183
17184 character.h: Rename locals to avoid shadowing.
17185 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17186 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17187 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17188 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17189 to avoid shadowing.
17190
17191 * textprop.c (property_change_between_p): Remove; unused.
17192
17193 * intervals.c (interval_start_pos): Now static.
17194
17195 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17196
17197 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17198 Rename locals to avoid shadowing.
17199
17200 * sound.c (wav_play, au_play, Fplay_sound_internal):
17201 Fix pointer signedness.
17202 (alsa_choose_format): Remove unused local var.
17203 (wav_play): Initialize a variable to 0, to prevent undefined
17204 behavior (Bug#8278).
17205
17206 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17207
17208 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17209
17210 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17211 clobbering (Bug#8298).
17212 * sysdep.c (sys_subshell): Likewise.
17213 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17214
17215 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17216 This should get cleaned up, so that child_setup has the
17217 same signature on all platforms.
17218
17219 * callproc.c (call_process_cleanup): Now static.
17220 (relocate_fd): Rename locals to avoid shadowing.
17221
17222 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17223
17224 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17225 not to be necessary, and produces flickering.
17226
17227 2011-03-20 Glenn Morris <rgm@gnu.org>
17228
17229 * config.in: Remove file.
17230
17231 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17232
17233 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17234 are now in src/globals.h.
17235 (syms_of_minibuf): Remove spurious & from previous change.
17236
17237 2011-03-20 Leo Liu <sdl.web@gmail.com>
17238
17239 * minibuf.c (completing-read-function): New variable.
17240 (completing-read-default): Rename from completing-read.
17241 (completing-read): Call completing-read-function.
17242
17243 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17244
17245 * xfaces.c (Fx_load_color_file):
17246 Read color file from absolute filename (bug#8250).
17247
17248 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17249
17250 * makefile.w32-in: Update dependencies.
17251
17252 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17253
17254 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17255
17256 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17257
17258 Fix more problems found by GCC 4.5.2's static checks.
17259
17260 * process.c (make_serial_process_unwind, send_process_trap):
17261 (sigchld_handler): Now static.
17262
17263 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17264 That way, the code declares only the vars that it needs.
17265 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17266 * s/cygwin.h (PTY_ITERATION): Likewise.
17267 * s/darwin.h (PTY_ITERATION): Likewise.
17268 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17269
17270 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17271 * process.c (allocate_pty): Don't declare stb unless it's needed.
17272
17273 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17274 (CONSTANTLIM): Remove; unused.
17275 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17276 Define only if needed.
17277
17278 * unexelf.c (unexec): Name an expression,
17279 to avoid gcc -Wbad-function-cast warning.
17280 Use a different way to cause a compilation error if anyone uses
17281 n rather than nn, a way that does not involve shadowing.
17282 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17283
17284 * deps.mk (unexalpha.o): Remove; unused.
17285
17286 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17287 * unexec.h: New file.
17288 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17289 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17290 Depend on unexec.h.
17291 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17292 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17293 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17294 Change as necessary to match prototype in unexec.h.
17295
17296 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17297 shadowing.
17298 (back_comment, skip_chars): Mark vars as initialized.
17299
17300 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17301 Rename locals to avoid shadowing.
17302
17303 * lread.c (read1): Rewrite so as not to use empty "else".
17304 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17305
17306 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17307
17308 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17309 warning when compiling print.c.
17310
17311 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17312 instead of using an uninitialized var.
17313 (font_sort_entities): Mark var as initialized.
17314
17315 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17316
17317 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17318 pointers to constants.
17319 (font_parse_fcname): Remove unused vars.
17320 (font_delete_unmatched): Now static.
17321 (font_get_spec): Remove; unused.
17322 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17323 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17324 Rename or move locals to avoid shadowing.
17325
17326 * fns.c (require_nesting_list, require_unwind): Now static.
17327 (Ffillarray): Rename locals to avoid shadowing.
17328
17329 * floatfns.c (domain_error2): Define only if needed.
17330 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17331
17332 * alloc.c (mark_backtrace): Move decl from here ...
17333 * lisp.h: ... to here, so that it can be checked.
17334
17335 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17336 (Fdefvar): Rewrite so as not to use empty "else".
17337 (lisp_indirect_variable): Name an expression,
17338 to avoid gcc -Wbad-function-cast warning.
17339 (Fdefvar): Rename locals to avoid shadowing.
17340
17341 * callint.c (quotify_arg, quotify_args): Now static.
17342 (Fcall_interactively): Rename locals to avoid shadowing.
17343 Use const pointer when appropriate.
17344
17345 * lisp.h (get_system_name, get_operating_system_release):
17346 Move decls here, to check interfaces.
17347 * process.c (get_operating_system_release): Move decl to lisp.h.
17348 * xrdb.c (get_system_name): Likewise.
17349 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17350 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17351 some of which prompt warnings from gcc -Wbad-function-cast.
17352 (Fformat_time_string, Fencode_time, Finsert_char):
17353 (Ftranslate_region_internal, Fformat):
17354 Rename or remove local vars to avoid shadowing.
17355 (Ftranslate_region_internal): Mark var as initialized.
17356
17357 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17358 avoid shadowing.
17359
17360 * lisp.h (eassert): Check that the argument compiles, even if
17361 ENABLE_CHECKING is not defined.
17362
17363 * data.c (Findirect_variable): Name an expression, to avoid
17364 gcc -Wbad-function-cast warning.
17365 (default_value, arithcompare, arith_driver, arith_error): Now static.
17366 (store_symval_forwarding): Rename local to avoid shadowing.
17367 (Fmake_variable_buffer_local, Fmake_local_variable):
17368 Mark variables as initialized.
17369 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17370
17371 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17372 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17373 Rename locals to avoid shadowing.
17374 (mark_stack): Move local variables into the #ifdef region where
17375 they're used.
17376 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17377 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17378 needed otherwise.
17379 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17380 (GC_STRING_CHARS): Remove; not used.
17381 (Fmemory_limit): Cast sbrk's returned value to char *.
17382
17383 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17384 avoids undefined behavior in theory.
17385
17386 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17387
17388 Use functions, not macros, for up- and down-casing (Bug#8254).
17389 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17390 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17391 to use the following functions instead of these macros.
17392 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17393 EMACS_INT, since callers assume the returned value fits in int.
17394 (upcase1): Likewise, for UPCASE_TABLE.
17395 (uppercasep, lowercasep, upcase): New static inline functions.
17396 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17397 the race-condition problem in the old DOWNCASE.
17398
17399 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17400 Rename locals to avoid shadowing.
17401 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17402 (regex_compile, re_search_2, re_match_2_internal):
17403 Remove unused local vars.
17404 (FREE_VAR): Rewrite so as not to use empty "else",
17405 which gcc can warn about.
17406 (regex_compile, re_match_2_internal): Mark locals as initialized.
17407 (RETALLOC_IF): Define only if needed.
17408 (WORDCHAR_P): Likewise. This one is never needed, but is used
17409 only in a comment talking about a compiler bug, so put inside
17410 the #if 0 of that comment.
17411 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17412 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17413 Remove; unused.
17414
17415 * search.c (boyer_moore): Rename locals to avoid shadowing.
17416 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17417 (PREV_CHAR_BOUNDARY): Likewise.
17418
17419 * search.c (simple_search): Remove unused var.
17420
17421 * dired.c (compile_pattern): Move decl from here ...
17422 * lisp.h: ... to here, so that it can be checked.
17423 (struct re_registers): New forward decl.
17424
17425 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17426
17427 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17428 All uses changed.
17429 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17430 Rename locals to avoid shadowing.
17431 (Fvertical_motion): Mark locals as initialized.
17432
17433 * casefiddle.c (casify_object, casify_region): Now static.
17434 (casify_region): Mark local as initialized.
17435
17436 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17437
17438 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17439 New macros, so that the caller can use some names other than
17440 gcpro1, gcpro2, etc.
17441 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17442 of the new macros.
17443 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17444 argument, for consistency with GCPRO2_VAR, etc: it is now the
17445 prefix of the variable, not the variable itself. All uses
17446 changed.
17447 * dired.c (directory_files_internal, file_name_completion):
17448 Rename locals to avoid shadowing.
17449
17450 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17451 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17452 dired.c's scmp function, had undefined behavior.
17453 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17454 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17455 * buffer.h: ... to here, because these macros use current_buffer,
17456 and the new implementation with inline functions needs to have
17457 current_buffer in scope now, rather than later when the macros
17458 are used.
17459 (downcase, upcase1): New static inline functions.
17460 (DOWNCASE, UPCASE1): Reimplement using these functions.
17461 This avoids undefined behavior in expressions like
17462 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17463 from race conditions in accessing the global variables
17464 case_temp1 and case_temp2.
17465 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17466 * lisp.h (case_temp1, case_temp2): Remove their decls.
17467 * character.h (ASCII_CHAR_P): Move from here ...
17468 * lisp.h: ... to here, so that the inline functions mentioned
17469 above can use them.
17470
17471 * dired.c (directory_files_internal_unwind): Now static.
17472
17473 * fileio.c (file_name_as_directory, directory_file_name):
17474 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17475 Now static.
17476 (file_name_as_directory): Use const pointers when appropriate.
17477 (Fexpand_file_name): Likewise. In particular, newdir might
17478 point at constant storage, so make it a const pointer.
17479 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17480 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17481 signedness issues.
17482 (Fset_file_times, Finsert_file_contents, auto_save_error):
17483 Rename locals to avoid shadowing.
17484
17485 * minibuf.c (choose_minibuf_frame_1): Now static.
17486 (Ftry_completion, Fall_completions): Rename or remove locals
17487 to avoid shadowing.
17488
17489 * marker.c (bytepos_to_charpos): Remove; unused.
17490
17491 * lisp.h (verify_bytepos, count_markers): New decls,
17492 so that gcc does not warn that these functions aren't declared.
17493
17494 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17495 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17496 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17497 (copy_text): Remove unused local var.
17498
17499 * filelock.c (within_one_second): Now static.
17500 (lock_file_1): Rename local to avoid shadowing.
17501
17502 * buffer.c (fix_overlays_before): Mark locals as initialized.
17503 (fix_start_end_in_overlays): Likewise. This function should be
17504 simplified by using pointers-to-pointers, but that's a different
17505 matter.
17506 (switch_to_buffer_1): Now static.
17507 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17508 (report_overlay_modification): Rename locals to avoid shadowing.
17509
17510 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17511 Fix pointer signedness issue.
17512 (sys_subshell): Mark local as volatile if checking for lint,
17513 to suppress a gcc -Wclobbered warning that does not seem to be right.
17514 (MAXPATHLEN): Define only if needed.
17515
17516 * process.c (serial_open, serial_configure): Move decls from here ...
17517 * systty.h: ... to here, so that they can be checked.
17518
17519 * fns.c (get_random, seed_random): Move extern decls from here ...
17520 * lisp.h: ... to here, so that they can be checked.
17521
17522 * sysdep.c (reset_io): Now static.
17523 (wait_for_termination_signal): Remove; unused.
17524
17525 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17526 (copy_keymap_item, append_key, push_text_char_description):
17527 Now static.
17528 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17529 (DENSE_TABLE_SIZE): Remove; unused.
17530 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17531 (describe_map_tree):
17532 Rename locals to avoid shadowing.
17533
17534 * keyboard.c: Declare functions static if they are not used elsewhere.
17535 (echo_char, echo_dash, cmd_error, top_level_2):
17536 (poll_for_input, handle_async_input): Now static.
17537 (read_char, kbd_buffer_get_event, make_lispy_position):
17538 (make_lispy_event, make_lispy_movement, apply_modifiers):
17539 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17540 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17541 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17542 (read_key_sequence, read_char): Mark locals as initialized.
17543 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17544
17545 * keyboard.h (make_ctrl_char): New decl.
17546 (mark_kboards): Move decl here ...
17547 * alloc.c (mark_kboards): ... from here.
17548
17549 * lisp.h (force_auto_save_soon): New decl.
17550
17551 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17552 (DEFINE_DUMMY_FUNCTION): New macro.
17553 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17554 Use it.
17555 (main): Add casts to avoid warnings
17556 if GCC considers string literals to be constants.
17557
17558 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17559
17560 * dbusbind.c: Pointer signedness fixes.
17561 (xd_signature, xd_append_arg, xd_initialize):
17562 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17563 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17564 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17565 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17566
17567 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17568 if GCC considers string literals to be constants.
17569 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17570
17571 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17572
17573 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17574 (print_preprocess, print_object): New macro to fix last change.
17575
17576 * print.c (print_preprocess): Don't forget font objects.
17577
17578 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17579
17580 * emacs.c (USAGE3): Doc fixes.
17581
17582 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17583
17584 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17585 structure.
17586
17587 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17588
17589 * lisp.h (VWindow_system, Qfile_name_history):
17590 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17591 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17592 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17593
17594 * w32select.c: Don't #include "keyboard.h".
17595 (run_protected): Add extern declaration for waiting_for_input.
17596
17597 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17598 * w32console.c (detect_input_pending, read_input_pending)
17599 (encode_terminal_code):
17600 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17601 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17602 (w32_system_caret_y, Qfile_name_history):
17603 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17604 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17605 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17606 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17607 * w32proc.c (Qlocal, report_file_error):
17608 * w32term.c (Vwindow_system, updating_frame):
17609 * w32uniscribe.c (initialized, uniscribe_font_driver):
17610 Remove unneeded extern declarations.
17611
17612 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17613
17614 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17615
17616 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17617
17618 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17619 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17620 These macros can no longer be used for assignment.
17621
17622 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17623 Assign struct members directly, instead of using BUF_BEGV etc.
17624 (record_buffer_markers, fetch_buffer_markers): New functions for
17625 recording and fetching special buffer markers.
17626 (set_buffer_internal_1, set_buffer_temp): Use them.
17627
17628 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17629
17630 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17631
17632 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17633 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17634
17635 * xdisp.c (hscroll_window_tree):
17636 (reconsider_clip_changes): Use PT instead of BUF_PT.
17637
17638 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17639
17640 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17641 $(EMACS_ROOT)/lib/intprops.h.
17642
17643 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17644
17645 Fix more problems found by GCC 4.5.2's static checks.
17646
17647 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17648 to unsigned char * to avoid compiler diagnostic.
17649 (xg_free_frame_widgets): Make it clear that a local variable is
17650 needed only if USE_GTK_TOOLTIP.
17651 (gdk_window_get_screen): Make it clear that this macro is needed
17652 only if USE_GTK_TOOLTIP.
17653 (int_gtk_range_get_value): New function, which avoids a diagnostic
17654 from gcc -Wbad-function-cast.
17655 (xg_set_toolkit_scroll_bar_thumb): Use it.
17656 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17657 diagnostic from gcc -Wbad-function-cast.
17658 (get_utf8_string, xg_get_file_with_chooser):
17659 Rename locals to avoid shadowing.
17660 (create_dialog): Move locals to avoid shadowing.
17661
17662 * xgselect.c (xg_select): Remove unused var.
17663
17664 * image.c (four_corners_best): Mark locals as initialized.
17665 (gif_load): Initialize transparent_p to zero (Bug#8238).
17666 Mark another local as initialized.
17667 (my_png_error, my_error_exit): Mark with NO_RETURN.
17668
17669 * image.c (clear_image_cache): Now static.
17670 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17671 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17672 (x_edge_detection): Remove unnecessary cast that
17673 gcc -Wbad-function-cast diagnoses.
17674 (gif_load): Fix pointer signedness.
17675 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17676 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17677
17678 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17679
17680 Improve quality of tests for time stamp overflow.
17681 For example, without this patch (encode-time 0 0 0 1 1
17682 1152921504606846976) returns the obviously-bogus value (-948597
17683 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17684 reports time overflow. See
17685 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17686 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17687 * editfns.c: Include limits.h and intprops.h.
17688 (TIME_T_MIN, TIME_T_MAX): New macros.
17689 (time_overflow): Move earlier, to before first use.
17690 (hi_time, lo_time): New functions, for an accurate test for
17691 out-of-range times.
17692 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17693 (Fget_internal_run_time): Don't assume time_t fits in int.
17694 (make_time): Use list2 instead of Fcons twice.
17695 (Fdecode_time): More accurate test for out-of-range times.
17696 (check_tm_member): New function.
17697 (Fencode_time): Use it, to test for out-of-range times.
17698 (lisp_time_argument): Don't rely on undefined left-shift and
17699 right-shift behavior when checking for time stamp overflow.
17700
17701 * editfns.c (time_overflow): New function, refactoring common code.
17702 (Fformat_time_string, Fdecode_time, Fencode_time):
17703 (Fcurrent_time_string): Use it.
17704
17705 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17706 * dired.c (make_time): Move to ...
17707 * editfns.c (make_time): ... here.
17708 * systime.h: Note the move.
17709
17710 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17711
17712 * fringe.c (update_window_fringes): Remove unused variables.
17713
17714 * unexmacosx.c (copy_data_segment): Also copy __got section.
17715 (Bug#8223)
17716
17717 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17718
17719 * termcap.c [MSDOS]: Include "msdos.h".
17720 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17721 Constify `char *' arguments and their references according to
17722 prototypes in tparam.h.
17723
17724 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17725
17726 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17727 Adapt all references accordingly.
17728
17729 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17730
17731 2011-03-11 Tom Tromey <tromey@redhat.com>
17732
17733 * buffer.c (syms_of_buffer): Remove obsolete comment.
17734
17735 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17736
17737 * termhooks.h (encode_terminal_code): Declare prototype.
17738
17739 * msdos.c (encode_terminal_code): Don't declare prototype.
17740
17741 * term.c (encode_terminal_code): Now external again, used by
17742 w32console.c and msdos.c.
17743
17744 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17745 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17746
17747 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17748
17749 Fix some minor problems found by GCC 4.5.2's static checks.
17750
17751 * fringe.c (update_window_fringes): Mark locals as initialized
17752 (Bug#8227).
17753 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17754
17755 * alloc.c (mark_fringe_data): Move decl from here ...
17756 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17757 to check its interface.
17758 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17759
17760 * fontset.c (free_realized_fontset): Now static.
17761 (Fset_fontset_font): Rename local to avoid shadowing.
17762 (fontset_font): Mark local as initialized.
17763 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17764
17765 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17766
17767 * xselect.c (x_disown_buffer_selections): Remove; not used.
17768 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17769 (x_own_selection, Fx_disown_selection_internal): Rename locals
17770 to avoid shadowing.
17771 (x_handle_dnd_message): Remove local to avoid shadowing.
17772
17773 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17774 so that the caller can use some name other than gcpro1.
17775 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17776 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17777 (Fx_backspace_delete_keys_p):
17778 Use them to avoid shadowing, and rename vars to avoid shadowing.
17779 (x_decode_color, x_set_name, x_window): Now static.
17780 (Fx_create_frame): Add braces to silence GCC warning.
17781 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17782 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17783 Remove unused locals.
17784 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17785 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17786 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17787 macros.
17788
17789 * xterm.h (x_mouse_leave): New decl.
17790
17791 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17792 Remove unused functions.
17793 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17794 (x_calc_absolute_position): Now static.
17795 (XTread_socket): Don't define label "out" unless it's used.
17796 Don't declare local "event" unless it's used.
17797 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17798 unless they are used.
17799 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17800 (x_fatal_error_signal): Remove; not used.
17801 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17802 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17803 (x_error_catcher, x_connection_closed, x_error_handler):
17804 (x_error_quitter, xembed_send_message, x_iconify_frame):
17805 (my_log_handler): Rename locals to avoid shadowing.
17806 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17807 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17808
17809 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17810 Rename or move locals to avoid shadowing.
17811 (tty_defined_color, merge_face_heights): Now static.
17812 (free_realized_faces_for_fontset): Remove; not used.
17813 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17814 does not deduce is never used uninitialized.
17815 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17816 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17817
17818 * terminal.c (store_terminal_param): Now static.
17819
17820 * xmenu.c (menu_highlight_callback): Now static.
17821 (set_frame_menubar): Remove unused local.
17822 (xmenu_show): Rename parameter to avoid shadowing.
17823 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17824 since they might point to immutable storage.
17825 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17826 since it's unused otherwise.
17827
17828 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17829 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17830 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17831 avoids a gcc -Wuninitialized diagnostic.
17832 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17833 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17834 does not deduce are never used uninitialized.
17835
17836 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17837
17838 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17839 * window.c (window_loop, size_window):
17840 (run_window_configuration_change_hook, enlarge_window): Likewise.
17841
17842 * window.c (display_buffer): Now static.
17843 (size_window): Mark variables that gcc -Wuninitialized
17844 does not deduce are never used uninitialized.
17845 * window.h (check_all_windows): New decl, to forestall
17846 gcc -Wmissing-prototypes diagnostic.
17847 * dispextern.h (bidi_dump_cached_states): Likewise.
17848
17849 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17850 shadowing.
17851 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17852 Include <limits.h>.
17853 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17854 and to avoid gcc -Wuninitialized warning.
17855 (load_charset_map): Mark variables that gcc -Wuninitialized
17856 does not deduce are never used uninitialized.
17857 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17858
17859 * coding.c (coding_set_source, coding_set_destination):
17860 Use "else { /* comment */ }" rather than "else /* comment */;"
17861 for clarity, and to avoid gcc -Wempty-body warning.
17862 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17863 a block, when the outer 'i' will do.
17864 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17865 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17866 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17867 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17868 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17869 Rename locals to avoid shadowing.
17870 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17871 * coding.c (emacs_mule_char, encode_invocation_designation):
17872 Now static, since they're not used elsewhere.
17873 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17874 (decode_coding_object, encode_coding_object, detect_coding_system):
17875 (decode_coding_emacs_mule): Mark variables that gcc
17876 -Wuninitialized does not deduce are never used uninitialized.
17877 (detect_coding_iso_2022): Initialize a local variable that might
17878 be used uninitialized. Leave a FIXME because it's not clear that
17879 this initialization is needed. (Bug#8211)
17880 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17881 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17882 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17883 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17884 Remove unused macros.
17885
17886 * category.c (hash_get_category_set): Remove unused local var.
17887 (copy_category_table): Now static, since it's not used elsewhere.
17888 * character.c (string_count_byte8): Likewise.
17889
17890 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17891 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17892
17893 * chartab.c (copy_sub_char_table): Now static, since it's not used
17894 elsewhere.
17895 (sub_char_table_ref_and_range, char_table_ref_and_range):
17896 Rename locals to avoid shadowing.
17897 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17898
17899 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17900 (BIDI_BOB): Remove unused macro.
17901
17902 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17903 deduce are never used uninitialized.
17904 * term.c (encode_terminal_code): Likewise.
17905
17906 * term.c (encode_terminal_code): Now static. Remove unused local.
17907
17908 * tparam.h: New file.
17909 * term.c, tparam.h: Include it.
17910 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17911 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17912 Move these decls to tparam.h, and make them agree with what
17913 is actually in tparam.c. The previous trick of using incompatible
17914 decls in different modules does not conform to the C standard.
17915 All callers of tparam changed to use tparam's actual API.
17916 * tparam.c (tparam1, tparam, tgoto):
17917 Use const pointers where appropriate.
17918
17919 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17920 * cm.h (struct cm): Likewise.
17921 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17922 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17923 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17924 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17925 (turn_on_face, init_tty): Likewise.
17926 * termchar.h (struct tty_display_info): Likewise.
17927
17928 * term.c (term_mouse_position): Rename local to avoid shadowing.
17929
17930 * alloc.c (mark_ttys): Move decl from here ...
17931 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17932
17933 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17934
17935 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17936
17937 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17938
17939 * search.c (compile_pattern_1): Remove argument regp, unused since
17940 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17941 (compile_pattern): Don't pass it.
17942
17943 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17944
17945 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17946 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17947 for ! HAVE_GTK3.
17948 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17949
17950 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17951
17952 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17953 gdk_window_get_screen, gdk_window_get_geometry,
17954 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17955 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17956 (xg_get_pixbuf_from_pixmap): New function.
17957 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17958 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17959 Call xg_get_pixbuf_from_pixmap instead of
17960 gdk_pixbuf_get_from_drawable.
17961 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17962 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17963 (xg_check_special_colors): Use GtkStyleContext and its functions
17964 for HAVE_GTK3.
17965 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17966 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17967 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17968 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17969 Call gtk_widget_get_preferred_size.
17970 (xg_frame_resized): gdk_window_get_geometry only takes 5
17971 parameters.
17972 (xg_win_to_widget, xg_event_is_for_menubar):
17973 Call gdk_x11_window_lookup_for_display.
17974 (xg_set_widget_bg): New function.
17975 (delete_cb): New function.
17976 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17977 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17978 (xg_set_background_color): Call xg_set_widget_bg.
17979 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17980 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17981 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17982 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17983 if ! HAVE_GTK3.
17984 (update_frame_tool_bar): Call gtk_widget_hide.
17985 (xg_initialize): Use GDK_KEY_g.
17986
17987 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17988 if ! HAVE_GTK3
17989 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17990
17991 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17992 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17993 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17994
17995 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17996
17997 * w32xfns.c (select_palette): Check success of RealizePalette against
17998 GDI_ERROR, not zero.
17999
18000 See ChangeLog.11 for earlier changes.
18001
18002 ;; Local Variables:
18003 ;; coding: utf-8
18004 ;; End:
18005
18006 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18007
18008 This file is part of GNU Emacs.
18009
18010 GNU Emacs is free software: you can redistribute it and/or modify
18011 it under the terms of the GNU General Public License as published by
18012 the Free Software Foundation, either version 3 of the License, or
18013 (at your option) any later version.
18014
18015 GNU Emacs is distributed in the hope that it will be useful,
18016 but WITHOUT ANY WARRANTY; without even the implied warranty of
18017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18018 GNU General Public License for more details.
18019
18020 You should have received a copy of the GNU General Public License
18021 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.