Fix some profiler stuff on Windows (follow-up to 1995-03-15T21:55:37Z!kwzh@gnu.org).
[bpt/emacs.git] / src / ChangeLog
1 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2
3 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4
5 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6
7 * character.h (MAYBE_UNIFY_CHAR): Remove.
8 * charset.c, charset.h (maybe_unify_char): Now static.
9 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
10 Since this stuff is now private to charset.c, there's no need for
11 a public macro and no need to inline by hand.
12
13 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
14 Stefan Monnier <monnier@iro.umontreal.ca>
15 Juanma Barranquero <lekktu@gmail.com>
16
17 * profiler.c: New file.
18 * Makefile.in (base_obj): Add profiler.o.
19 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
20 ($(BLD)/profiler.$(O)): New target.
21 * emacs.c (main): Call syms_of_profiler.
22 * alloc.c (Qautomatic_gc): New constant.
23 (MALLOC_PROBE): New macro.
24 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
25 (total_bytes_of_live_objects): New function.
26 (Fgarbage_collect): Use it. Record itself in backtrace_list.
27 Call malloc_probe for the memory profiler.
28 (syms_of_alloc): Define Qautomatic_gc.
29 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
30 race condition.
31 (struct backtrace): Move definition...
32 * lisp.h (struct backtrace): ..here.
33 (Qautomatic_gc, profiler_memory_running): Declare vars.
34 (malloc_probe, syms_of_profiler): Declare functions.
35 * xdisp.c (Qautomatic_redisplay): New constant.
36 (redisplay_internal): Record itself in backtrace_list.
37 (syms_of_xdisp): Define Qautomatic_redisplay.
38
39 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
40
41 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
42
43 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
44
45 Prefer POSIX timers if available.
46 They avoid a race if the timer is too close to the current time.
47 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
48 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
49 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
50
51 2012-09-25 Eli Zaretskii <eliz@gnu.org>
52
53 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
54 CHAR_STRING_ADVANCE.
55 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
56 STRING_CHAR_ADVANCE.
57
58 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
59
60 Move Vlibrary_cache to emacs.c and reset before dumping.
61
62 * lisp.h (reset_image_types): Declare.
63 [WINDOWSNT] (Vlibrary_cache): Declare.
64
65 * image.c (reset_image_types): New function.
66
67 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
68 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
69 (Fdump_emacs): Reset Vlibrary_cache and image_types.
70
71 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
72 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
73
74 * w32.h (Vlibrary_cache): Do not declare.
75
76 2012-09-25 Eli Zaretskii <eliz@gnu.org>
77
78 * w32proc.c (sys_signal): Handle all signals defined by the
79 MS-Windows runtime, not just SIGCHLD. Actually install the signal
80 handlers for signals supported by Windows. Don't override
81 term_ntproc as the handler for SIGABRT.
82 (sigaction): Rewrite to call sys_signal instead of duplicating its
83 code.
84 (sys_kill): Improve commentary.
85
86 * w32.c (term_ntproc): Accept (and ignore) one argument, for
87 consistency with a signature of a signal handler. All callers
88 changed.
89 (init_ntproc): Accept an argument DUMPING. If dumping, don't
90 install term_ntproc as a signal handler for SIGABRT, as that
91 should be done by the dumped Emacs.
92
93 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
94
95 * w32select.c (term_w32select): Protect against repeated
96 invocation by setting clipboard_owner to NULL after calling
97 DestroyWindow.
98
99 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
100 and term_ntproc to their modified signatures.
101
102 * character.c (char_string, string_char): Remove calls to
103 MAYBE_UNIFY_CHAR. See the discussion starting at
104 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
105 for the details.
106
107 2012-09-25 Chong Yidong <cyd@gnu.org>
108
109 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
110
111 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
112
113 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
114 when encountering an unknown bytecode.
115
116 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
117
118 image.c, indent.c: Use bool for booleans.
119 * dispextern.h (struct image_type): Members valid_p, load, init
120 now return bool, not int. All uses changed.
121 * image.c: Omit unnecessary static decls.
122 (x_create_bitmap_mask, x_build_heuristic_mask):
123 Return void, not int, since callers don't care about the return value.
124 (x_create_bitmap_mask, define_image_type, valid_image_p)
125 (struct image_keyword, parse_image_spec, image_spec_value)
126 (check_image_size, image_background)
127 (image_background_transparent, x_clear_image_1)
128 (postprocess_image, lookup_image, x_check_image_size)
129 (x_create_x_image_and_pixmap, xbm_image_p)
130 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
131 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
132 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
133 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
134 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
135 (png_image_p, init_png_functions, png_load_body, png_load)
136 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
137 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
138 (init_gif_functions, gif_load, imagemagick_image_p)
139 (imagemagick_load_image, imagemagick_load, svg_image_p)
140 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
141 (gs_load):
142 * nsimage.m (ns_load_image):
143 * nsterm.m (ns_defined_color):
144 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
145 * xfns.c (x_defined_color):
146 * xterm.c (x_alloc_lighter_color_for_widget)
147 (x_alloc_nearest_color_1, x_alloc_nearest_color)
148 (x_alloc_lighter_color):
149 * indent.c (disptab_matches_widthtab, current_column)
150 (scan_for_column, string_display_width, indented_beyond_p)
151 (compute_motion, vmotion, Fvertical_motion):
152 Use bool for booleans.
153
154 2012-09-24 Chong Yidong <cyd@gnu.org>
155
156 * chartab.c (Fset_char_table_default): Obsolete function removed.
157
158 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
159
160 Move pid_t related decls out of lisp.h.
161 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
162 (interruptible_wait_for_termination):
163 Move these decls from lisp.h to syswait.h, since they use pid_t.
164 Needed on FreeBSD; see Herbert J. Skuhra in
165 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
166 * callproc.c: Include syswait.h.
167
168 gnutls.c, gtkutil.c: Use bool for boolean.
169 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
170 (emacs_gnutls_handle_error):
171 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
172 (xg_hide_tooltip, xg_create_frame_widgets)
173 (create_dialog, xg_uses_old_file_dialog)
174 (xg_get_file_with_chooser, xg_get_file_with_selection)
175 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
176 (xg_item_label_same_p, xg_update_menubar)
177 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
178 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
179 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
180 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
181 (update_frame_tool_bar, free_frame_tool_bar):
182 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
183 * nsmenu.m (ns_update_menubar):
184 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
185 * xfns.c (Fx_show_tip) [USE_GTK]:
186 Use bool for boolean.
187 * gtkutil.c (xg_update_frame_menubar):
188 * xmenu.c (update_frame_menubar):
189 Return void, not int, since caller ignores return value.
190 * gtkutil.c (xg_change_toolbar_position):
191 Return void, not 1.
192
193 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
194
195 * makefile.w32-in (BLOCKINPUT_H): Remove.
196 (SYSSIGNAL_H): New macro.
197 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
198 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
199 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
200 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
201 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
202 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
203 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
204 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
205 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
206 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
207 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
208 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
209 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
210 ($(BLD)/w32xfns.$(O)): Update dependencies.
211
212 2012-09-23 Eli Zaretskii <eliz@gnu.org>
213
214 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
215 fatal_error_backtrace.
216
217 * w32proc.c (sys_kill): Undo last change: don't do anything when
218 invoked to deliver SIGABRT to our own process. This is now
219 handled by emacs_raise.
220
221 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
222
223 * w32term.c (w32_read_socket): Remove leftover reference to
224 interrupt_input_pending.
225
226 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
227
228 Do not use SA_NODEFER.
229 Problem reported by Dani Moncayo in
230 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
231 * alloc.c (die):
232 * sysdep.c (emacs_abort): Do not reset signal handler.
233 * emacs.c (terminate_due_to_signal): Reset signal handler here.
234 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
235 wanted even on POSIXish hosts, and it doesn't work on Windows.
236
237 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
238
239 * xterm.c (x_term_init): Call fixup_locale before and after calling
240 gtk_init (Bug#12392).
241
242 2012-09-23 Chong Yidong <cyd@gnu.org>
243
244 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
245 Vdynamic_library_alist.
246
247 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
248 (Fgnutls_available_p): Caller changed.
249
250 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
251 (Flibxml_parse_xml_region): Likewise.
252
253 * dispextern.h (struct image_type): Remove arg from init function.
254
255 * image.c (Finit_image_library, lookup_image_type)
256 (define_image_type): Remove now-unneeded second arg.
257 (init_xpm_functions, init_png_functions, init_jpeg_functions)
258 (init_tiff_functions, init_gif_functions, init_svg_functions):
259 Arglist and w32_delayed_load calling convention changed.
260 (gs_type): Remove init_gs_functions; there is no such function.
261 (valid_image_p, make_image): Fix caller to lookup_image_type.
262
263 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
264
265 Simplify and avoid signal-handling races (Bug#12471).
266 * alloc.c (die):
267 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
268 Avoid recursive loop if there's a fatal error in the function itself.
269 * atimer.c (pending_atimers):
270 * blockinput.h: Don't include "atimer.h"; no longer needed.
271 (interrupt_input_pending): Remove. All uses removed.
272 pending_signals now counts both atimers and ordinary interrupts.
273 This is less racy than having three separate pending-signal flags.
274 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
275 (input_blocked_p):
276 Rename from their upper-case counterparts BLOCK_INPUT,
277 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
278 INPUT_BLOCKED_P, and turn into functions. All uses changed.
279 This makes it easier to access volatile variables more accurately.
280 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
281 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
282 that's more reliable if the code is buggy and sets
283 interrupt_input_blocked to a negative value. All uses changed.
284 * atimer.c (deliver_alarm_signal):
285 Remove. No need to deliver this to the parent; any thread can
286 handle this signal now. All uses replaced by underlying handler.
287 * atimer.c (turn_on_atimers):
288 * dispnew.c (handle_window_change_signal):
289 * emacs.c (handle_danger_signal):
290 * keyboard.c (kbd_buffer_get_event):
291 Don't reestablish signal handler; not needed with sigaction.
292 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
293 (UNBLOCK_INPUT_TO):
294 Rework to avoid unnecessary accesses to volatile variables.
295 (UNBLOCK_INPUT_TO): Now a function.
296 (totally_unblock_input, unblock_input): New decls.
297 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
298 (init_data): Remove. Necessary stuff now done in init_signal.
299 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
300 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
301 (fatal_error_code): Remove; no longer needed.
302 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
303 it doesn't always backtrace. All uses changed. No need to reset
304 signal to default, since sigaction and/or die does that for us now.
305 Use emacs_raise (FOO), not kill (getpid (), FOO).
306 (main): Check more-accurately whether we're dumping.
307 Move fatal-error setup to sysdep.c
308 * floatfns.c: Do not include "syssignal.h"; no longer needed.
309 * gtkutil.c (xg_get_file_name, xg_get_font):
310 Remove no-longer-needed signal-mask manipulation.
311 * keyboard.c, process.c (POLL_FOR_INPUT):
312 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
313 * keyboard.c (read_avail_input): Remove.
314 All uses replaced by gobble_input.
315 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
316 (kbd_buffer_store_event_hold, gobble_input):
317 (record_asynch_buffer_change) [USABLE_SIGIO]:
318 (store_user_signal_events):
319 No need to mess with signal mask.
320 (gobble_input): If blocking input and there are terminals, simply
321 set pending_signals to 1 and return. All hooks changed to not
322 worry about whether input is blocked.
323 (process_pending_signals): Clear pending_signals before processing
324 them, in case a signal comes in while we're processing.
325 By convention callers now test pending_signals before calling us.
326 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
327 New functions, to support changes to blockinput.h.
328 (handle_input_available_signal): Now extern.
329 (reinvoke_input_signal): Remove. All uses replaced by
330 handle_async_input.
331 (quit_count): Now volatile, since a signal handler uses it.
332 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
333 All callers changed. Block SIGINT only if not already blocked.
334 Clear sigmask reliably, even if Fsignal returns, which it can.
335 Omit unnecessary accesses to volatile var.
336 (quit_throw_to_read_char): No need to restore sigmask.
337 * keyboard.c (gobble_input, handle_user_signal):
338 * process.c (wait_reading_process_output):
339 Call signal-handling code rather than killing ourselves.
340 * lisp.h: Include <float.h>, for...
341 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
342 (pending_signals): Now volatile.
343 (syms_of_data): Now const if IEEE floating point.
344 (handle_input_available_signal) [USABLE_SIGIO]:
345 (terminate_due_to_signal, record_child_status_change): New decls.
346 * process.c (create_process): Avoid disaster if memory is exhausted
347 while we're processing a vfork, by tightening the critical section
348 around the vfork.
349 (send_process_frame, process_sent_to, handle_pipe_signal)
350 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
351 ignores SIGPIPE.
352 (send_process): No need for setjmp/longjmp any more, since the
353 SIGPIPE stuff is now gone. Instead, report an error if errno
354 is EPIPE.
355 (record_child_status_change): Now extern. PID and W are now args.
356 Return void, not bool. All callers changed.
357 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
358 Remove. All uses removed. This bug should be fixed now in a
359 different way.
360 (wait_for_termination_1): Use waitpid rather than sigsuspend,
361 and record the child status change directly. This avoids the
362 need to futz with the signal mask.
363 (process_fatal_action): Move here from emacs.c.
364 (emacs_sigaction_flags): New function, containing
365 much of what used to be in emacs_sigaction_init.
366 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
367 caught by emacs, to make races less likely.
368 (deliver_process_signal): Rename from handle_on_main_thread.
369 All uses changed.
370 (BACKTRACE_LIMIT_MAX): Now at top level.
371 (thread_backtrace_buffer, threadback_backtrace_pointers):
372 New static vars.
373 (deliver_thread_signal, deliver_fatal_thread_signal):
374 New functions, for more-accurate delivery of thread-specific signals.
375 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
376 (deliver_arith_signal): Handle in this thread, not
377 in the main thread, since it's triggered by this thread.
378 (maybe_fatal_sig): New function.
379 (init_signals): New arg DUMPING so that we can be more accurate
380 about whether we're dumping. Caller changed.
381 Treat thread-specific signals differently from process-general signals.
382 Block all signals while handling fatal error; that's safer.
383 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
384 on IEEE hosts.
385 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
386 Ignore SIGPIPE unless batch.
387 (emacs_backtrace): Output backtrace for the appropriate thread,
388 which is not necessarily the main thread.
389 * syssignal.h: Include <stdbool.h>.
390 (emacs_raise): New macro.
391 * xterm.c (x_connection_signal): Remove; no longer needed
392 now that we use sigaction.
393 (x_connection_closed): No need to mess with sigmask now.
394 (x_initialize): No need to reset SIGPIPE handler here, since
395 init_signals does this for us now.
396
397 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
398
399 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
400 background rect may be larger (Bug#12245).
401
402 2012-09-23 Chong Yidong <cyd@gnu.org>
403
404 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
405
406 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
407
408 * .gdbinit: Just stop at fatal_error_backtrace.
409 See Stefan Monnier's request in
410 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
411 Remove no-longer-used query of system type.
412
413 2012-09-22 Chong Yidong <cyd@gnu.org>
414
415 * search.c (Freplace_match): Doc fix (Bug#12325).
416
417 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
418
419 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
420 (Fline_end_position): Doc fix.
421
422 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
423
424 2012-09-22 Chong Yidong <cyd@gnu.org>
425
426 * dispextern.h (struct image_type): Add new slot, storing a type
427 initialization function.
428
429 * image.c (define_image_type): Call the image initializer function
430 if it is defined. Arguments and return value changed.
431 (valid_image_p, make_image): Callers changed.
432 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
433 (gif_type, imagemagick_type, svg_type, gs_type):
434 Add initialization functions.
435 (Finit_image_library): Call lookup_image_type.
436 (CHECK_LIB_AVAILABLE): Macro deleted.
437 (lookup_image_type): Call define_image_type here, rather than via
438 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
439 (syms_of_image): Move define_image_type calls for xbm_type and
440 pbm_type to lookup_image_type.
441
442 2012-09-22 Eli Zaretskii <eliz@gnu.org>
443
444 * keyboard.c (timer_check_2): Move calculation of 'timers' and
445 'idle_timers' from here ...
446 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
447 lists, to avoid infloops when the timer does something stupid,
448 like reinvoke itself with the same or smaller time-out.
449 (Bug#12447)
450
451 2012-09-22 Martin Rudalics <rudalics@gmx.at>
452
453 * window.c (Fsplit_window_internal): Handle only Qt value of
454 Vwindow_combination_limit separately.
455 (Qtemp_buffer_resize): New symbol.
456 (Vwindow_combination_limit): New default value.
457 Rewrite doc-string.
458
459 2012-09-22 Eli Zaretskii <eliz@gnu.org>
460
461 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
462 the new overlay string. (Bug#10159)
463
464 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
465
466 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
467 or that fprintf is async-signal-safe. POSIX doesn't require
468 either assumption.
469
470 2012-09-22 Chong Yidong <cyd@gnu.org>
471
472 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
473 (Bug#8207).
474
475 2012-09-22 Kenichi Handa <handa@gnu.org>
476
477 * composite.c (composition_reseat_it): Handle the case that a
478 grapheme cluster is not covered by a single font (Bug#12352).
479
480 2012-09-21 Chong Yidong <cyd@gnu.org>
481
482 * image.c (define_image_type): Avoid adding duplicate types to
483 image_types (Bug#12463). Suggested by Jörg Walter.
484
485 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
486
487 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
488 (print_load_command_name): Add case LC_DATA_IN_CODE.
489 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
490
491 2012-09-21 Glenn Morris <rgm@gnu.org>
492
493 * eval.c (Frun_hook_with_args_until_success)
494 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
495
496 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
497
498 * fileio.c (Ffile_selinux_context): Only call freecon when
499 lgetfilecon succeeded.
500 (Fset_file_selinux_context): Likewise. (Bug#12444)
501
502 2012-09-21 Eli Zaretskii <eliz@gnu.org>
503
504 * xdisp.c (try_window_reusing_current_matrix): Under bidi
505 reordering, locate the cursor by calling set_cursor_from_row; if
506 that fails, clear the desired glyph matrix before returning a
507 failure indication to the caller. Fixes leaving garbled display
508 when fast scrolling with a down-key. (Bug#12403)
509 (compute_stop_pos_backwards): Fix a typo that caused crashes while
510 scrolling through multibyte text.
511
512 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
513
514 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
515 calling mark_vectorlike since that's the one that marks the window.
516 (mark_discard_killed_buffers): Mark the final cdr.
517 * window.h (struct window): Move prev/next_buffers to the
518 non-standard fields.
519 * window.c (make_window): Initialize prev/next_buffers manually.
520
521 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
522
523 Omit unused arg EXPECTED from socket hooks.
524 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
525 * nsterm.m (ns_term_init):
526 * termhooks.h (struct terminal.read_socket_hook):
527 * w32inevt.c (w32_console_read_socket):
528 * w32term.c (w32_read_socket):
529 * xterm.c (XTread_socket):
530 Omit unused arg EXPECTED. All callers changed.
531 (store_user_signal_events): Return void, not int, since callers no
532 longer care about the return value. All uses changed.
533
534 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
535
536 * w32gui.h (XParseGeometry): Do not declare.
537
538 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
539
540 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
541 Ignore 'expected'. See Eli Zaretskii in
542 <http://bugs.gnu.org/12471#8> (last line).
543
544 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
545 (XParseGeometry): Now static. Substitute extremal values for
546 values that are out of range.
547
548 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
549
550 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
551
552 * nsfns.m (XParseGeometry): Remove.
553 (Fx_create_frame): Call x_set_offset to correctly interpret
554 top_pos in geometry.
555
556 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
557 (Fx_parse_geometry): If there is a space in string, call
558 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
559
560 2012-09-17 Eli Zaretskii <eliz@gnu.org>
561
562 * search.c (scan_buffer): Use character positions in calls to
563 region_cache_forward and region_cache_backward, not byte
564 positions. (Bug#12196)
565
566 * w32term.c (w32_read_socket): Set pending_signals to 1, like
567 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
568
569 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
570 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
571 emacs_blocked_malloc, now deleted.
572
573 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
574
575 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
576 The workaround was for improving performance on Solaris 2.4, but
577 is getting in the way now. Emacs will still work if someone is
578 still running Solaris 2.4 in a museum somewhere; Sun dropped
579 support for Solaris 2.4 in 2003.
580 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
581 * process.c (create_process) [HAVE_WORKING_VFORK]:
582 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
583 since Emacs no longer uses vfork on that platform.
584
585 2012-09-17 Glenn Morris <rgm@gnu.org>
586
587 * emacs.c: Use COPYRIGHT.
588
589 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
590
591 Remove configure's --without-sync-input option (Bug#12450).
592 When auditing signal-handling in preparation for cleaning it up,
593 I found that SYNC_INPUT has race conditions and would be a real
594 pain to fix. Since it's an undocumented and deprecated
595 configure-time option, now seems like a good time to remove it.
596 Also see <http://bugs.gnu.org/11080#16>.
597 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
598 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
599 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
600 (malloc_hysteresis):
601 (check_depth) [XMALLOC_OVERRUN_CHECK]:
602 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
603 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
604 (dont_register_blocks, bytes_used_when_reconsidered)
605 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
606 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
607 [!SYSTEM_MALLOC && !SYNC_INPUT]:
608 Remove. All uses removed.
609 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
610 implementation, one that depends on whether the new macro
611 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
612 is defined.
613 * atimer.c (run_timers, handle_alarm_signal):
614 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
615 (handle_async_input, process_pending_signals)
616 (handle_input_available_signal, init_keyboard):
617 * nsterm.m (ns_read_socket):
618 * process.c (wait_reading_process_output):
619 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
620 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
621 (emacs_write):
622 * xterm.c (XTread_socket):
623 Assume SYNC_INPUT.
624 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
625 * eval.c (handling_signal): Remove. All uses removed.
626 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
627 All uses replaced with the SYNC_INPUT version.
628 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
629 Remove decls.
630 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
631 Now static.
632
633 * font.c (Ffont_shape_gstring): Remove unused local.
634
635 2012-09-16 Glenn Morris <rgm@gnu.org>
636
637 * Makefile.in (clean): No longer run nextstep's clean.
638
639 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
640 (ns_frag): Remove.
641 (ns-app): Move here from ns.mk, and simplify.
642 (clean): Simplify nextstep entry.
643 * ns.mk: Remove file.
644
645 2012-09-17 Kenichi Handa <handa@gnu.org>
646
647 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
648 not covert the last few charactes.
649
650 2012-09-16 Kenichi Handa <handa@gnu.org>
651
652 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
653 here, but just check the validity of glyphs in the glyph-string.
654
655 2012-09-16 Martin Rudalics <rudalics@gmx.at>
656
657 * window.c (Fwindow_parameter, Fset_window_parameter):
658 Accept any window as argument (Bug#12452).
659
660 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
661
662 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
663 to ns_term_init to avoid memory leak.
664
665 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
666 explicit retain/release.
667 (ns_term_init): Only allow one display. Initialize outerpool and
668 ns_*_types.
669
670 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
671
672 Port _setjmp fix to POSIXish hosts as well as Microsoft.
673 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
674 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
675 the Microsoft problem in a different way, by altering ../nt/config.nt.
676
677 2012-09-15 Eli Zaretskii <eliz@gnu.org>
678
679 * w32xfns.c:
680 * w32uniscribe.c:
681 * w32term.c:
682 * w32select.c:
683 * w32reg.c:
684 * w32proc.c:
685 * w32menu.c:
686 * w32inevt.c:
687 * w32heap.c:
688 * w32font.c:
689 * w32fns.c:
690 * w32console.c:
691 * w32.c:
692 * w16select.c: Remove inclusion of setjmp.h, as it is now included
693 by lisp.h. This completes removal of setjmp.h inclusion
694 erroneously announced in the previous commit. (Bug#12446)
695
696 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
697 more accurate.
698
699 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
700 not defined as a macro. The latter happens on MS-Windows.
701 (Bug#12446)
702
703 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
704
705 Port better to POSIX hosts lacking _setjmp (Bug#12446).
706 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
707 Some instances of '#include <setjmp.h>' removed, if the
708 only reason for the instance was because "lisp.h" was included.
709 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
710 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
711 and _longjmp with the new symbols. Emacs already uses _setjmp if
712 available, so this change affects only POSIXish hosts that have
713 sigsetjmp but not _setjmp, such as some versions of Solaris and
714 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
715 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
716 (png_load_body) [HAVE_PNG]:
717 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
718 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
719 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
720 since PNG requires jmp_buf. This is the only exception to the
721 general rule that we now use sys_setjmp and sys_longjmp.
722 This exception is OK since this code does not change the signal
723 mask or longjmp out of a signal handler.
724
725 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
726
727 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
728 Include "syssignal.h", for 'main_thread'.
729
730 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
731
732 Avoid out-of-range marker position (Bug#12426).
733 * insdel.c (replace_range, replace_range_2):
734 Adjust markers before overlays, as suggested by comments.
735 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
736 Remove redundant check before calling offset_intervals.
737
738 2012-09-14 Martin Rudalics <rudalics@gmx.at>
739
740 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
741 current buffer (Bug#12387).
742
743 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
744
745 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
746
747 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
748
749 Use a more backwards-compatible timer format (Bug#12430).
750 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
751 vector element, not from the 4th, since PSECS is now at the end.
752 (Fcurrent_idle_time): Doc fix.
753
754 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
755
756 Function to mark objects and remove killed buffers at once.
757 * alloc.c (discard_killed_buffers): Rename to ...
758 (mark_discard_killed buffers) ... new name. Add marking
759 of remaining objects. Fix comment. Adjust users.
760 (mark_object): Do not touch frame buffer lists here.
761 * frame.c (delete_frame): Reset frame buffer lists here.
762
763 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
764
765 Better workaround for GNOME bug when --enable-gcc-warnings.
766 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
767 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
768 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
769
770 Simplify SIGIO usage (Bug#12408).
771 The code that dealt with SIGIO was crufty and confusing, e.g., it
772 played tricks like "#undef SIGIO" but these tricks were not used
773 consistently. Simplify mostly by not #undeffing standard symbols,
774 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
775 or not as we please) rather than "defined SIGIO" (standard symbol
776 that we probably shouldn't #undef).
777 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
778 Modules that need it can include it.
779 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
780 * dispextern.h (ignore_sigio): New decl.
781 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
782 unconditionally, since it's now a no-op if !USABLE_SIGIO.
783 * emacs.c (shut_down_emacs):
784 * keyboard.c (kbd_buffer_store_event_hold):
785 Use ignore_sigio rather than invoking 'signal' directly.
786 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
787 for FIONREAD.
788 (FIONREAD, SIGIO): Do not #undef.
789 (tty_read_avail_input): Use #error rather than a syntax error.
790 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
791 for I_PIPE, used by SETUP_SLAVE_PTY.
792 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
793 * sysdep.c (croak): Remove; no longer needed. This bit of
794 temporary code, with Fred N. Fish's comment that it's temporary,
795 has been in Emacs since at least 1992!
796 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
797 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
798 * syssignal.h (croak): Remove decl.
799 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
800 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
801 now that we're termios-only.
802 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
803 * term.c (dissociate_if_controlling_tty): Use #error rather than
804 a run-time error.
805
806 Work around GCC and GNOME bugs when --enable-gcc-warnings.
807 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
808 to work around GNOME bug 683906.
809 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
810 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
811 This works around GCC bug 54561.
812
813 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
814
815 More fixes for 'volatile' and setjmp/longjmp.
816 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
817 * image.c (struct png_load_context) [HAVE_PNG]: New type.
818 (png_load_body) [HAVE_PNG]:
819 (jpeg_load_body) [HAVE_JPEG]:
820 New function, with most of the old parent function's body.
821 (png_load) [HAVE_PNG]:
822 (jpeg_load) [HAVE_JPEG]:
823 Invoke the new function, to avoid longjmp munging our locals.
824 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
825 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
826 longjmp is passed 2, as the C standard doesn't guarantee this.
827 Instead, store the failure code into mgr->failure_code.
828
829 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
830
831 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
832 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
833 (syms_of_keyboard): Remove support for unread-command-char.
834
835 2012-09-12 Eli Zaretskii <eliz@gnu.org>
836
837 * w32proc.c (sys_kill): If PID is our process ID and the signal is
838 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
839 violation. (Bug#12426)
840
841 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
842
843 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
844
845 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
846
847 * eval.c: Add `inhibit-debugger'.
848 (Qinhibit_debugger): New symbol.
849 (call_debugger): Bind it instead of Qdebug_on_error.
850 (maybe_call_debugger): Test Vinhibit_debugger.
851 (syms_of_eval): Define inhibit-debugger.
852 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
853 (syms_of_xdisp): Remove inhibit-debug-on-message.
854
855 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
856
857 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
858 If a nonvolatile local variable is written before a _longjmp to
859 the frame containing the variable, and is read after the _longjmp,
860 the value read is indeterminate. Some local variables of type
861 'struct handler' and 'struct catchtag' are used in this way, so
862 mark each of their slots as volatile if the slot can be set before
863 _longjmp and read afterwards.
864 * lisp.h (struct handler): var and chosen_clause are now volatile.
865 (struct catchtag): val, next, and pdlcount are now volatile.
866
867 * bidi.c (bidi_push_it, bidi_pop_it):
868 * fns.c (copy_hash_table):
869 * image.c (define_image_type):
870 * keyboard.c (kbd_buffer_store_event_hold):
871 * process.c (Fprocess_send_eof):
872 * xfaces.c (x_create_gc) [HAVE_NS]:
873 * xgselect.c (xg_select):
874 Prefer assignment to memcpy when either will do.
875
876 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
877 Use pointer-to-a-pointer to simplify and avoid a NILP check each
878 time an item is removed. No need to mark this function 'inline';
879 the compiler knows better than we do.
880
881 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
882
883 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
884 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
885 to change_frame_size (Bug#12388).
886 (windowDidResize:): Pass YES to updateFrameSize.
887
888 * nsterm.h: Add delay parameter to updateFrameSize.
889
890 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
891
892 Discard killed buffers from deleted window and frame objects.
893 This reduces an amount of references to killed buffers and
894 helps GC to reclaim them faster.
895 * alloc.c (discard_killed_buffers): New function.
896 (mark_object): Use it for deleted windows and frames.
897 (mark_object): If symbol's value is set up for a killed buffer
898 or deleted frame, restore it's global binding.
899 * data.c (swap_in_global_binding): Add GC notice.
900 (swap_in_symval_forwarding): Use convenient set_blv_where.
901 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
902 * window.h: ... to here.
903
904 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
905
906 Convenient macro to check whether the buffer is live.
907 * buffer.h (BUFFER_LIVE_P): New macro.
908 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
909 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
910
911 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
912
913 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
914 composition cases (Bug#12364).
915
916 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
917 overhang of succeeding glyphs overlapping box cursor.
918
919 * w32term.c (x_draw_glyph_string): Likewise.
920
921 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
922
923 Simplify, document, and port floating-point (Bug#12381).
924 The porting part of this patch fixes bugs on non-IEEE platforms
925 with frexp, ldexp, logb.
926 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
927 Now static.
928 * floatfns.c: Simplify discussion of functions that Emacs doesn't
929 support, by removing commented-out code and briefly listing the
930 C89 functions excluded. The commented-out stuff was confusing
931 maintenance, e.g., we thought we needed cbrt but it was commented out.
932 (logb): Remove decl; no longer needed.
933 (isfinite): New macro, if not already supplied.
934 (isnan): Don't replace any existing macro.
935 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
936 are present on all C89 platforms.
937 (Ffrexp): Do not special-case zero, as frexp does the right thing
938 for that case.
939 (Flogb): Do not use logb, as it doesn't have the desired meaning
940 on hosts that use non-base-2 floating point. Instead, stick with
941 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
942 frexp, to avoid getting an unspecified result.
943
944 * xdisp.c (Qinhibit_debug_on_message): Now static.
945
946 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
947
948 * nsterm.m (ns_update_begin): Set clip path to whole view by using
949 NSBezierPath (Bug#12131).
950
951 2012-09-10 Chong Yidong <cyd@gnu.org>
952
953 * fns.c (Fdelq, Fdelete): Doc fix.
954
955 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
956
957 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
958 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
959
960 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
961
962 * lisp.h (make_lisp_ptr): New macro to replace XSET.
963 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
964 Use it.
965
966 2012-09-09 Eli Zaretskii <eliz@gnu.org>
967
968 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
969 left fringe if the window has a left margin. This avoids leaving
970 traces of the cursor because its leftmost pixel is not drawn over.
971
972 * dispnew.c (update_window_line): When the left margin area of a
973 screen line is updated, set the redraw_fringe_bitmaps_p flag of
974 that screen line. (Bug#12277)
975
976 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
977
978 Assume C89 or later for math functions (Bug#12381).
979 This simplifies the code, and makes it a bit smaller and faster,
980 and (most important) makes it easier to clean up signal handling
981 since we can stop worring about floating-point exceptions in
982 library code. That was a problem before C89, but the problem
983 went away many years ago on all practical Emacs targets.
984 * data.c, image.c, lread.c, print.c:
985 Don't include <math.h>; no longer needed.
986 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
987 might be autoconfigured, as that never happens.
988 * data.c (fmod):
989 * doprnt.c (DBL_MAX_10_EXP):
990 * print.c (DBL_DIG):
991 Remove. C89 or later always defines these.
992 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
993 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
994 (arith_error, domain_error, domain_error2):
995 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
996 no longer needed -- we simply return what C returns. All uses removed.
997 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
998 the wrapped code.
999 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1000 Remove. All uses expanded, as these macros are no longer used
1001 more than once and are now more trouble than they're worth.
1002 (Ftan): Use tan, not sin / cos.
1003 (Flogb): Assume C89 frexp.
1004 (fmod_float): Assume C89 fmod.
1005 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1006 (init_floatfns): Remove. All uses removed.
1007
1008 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1009
1010 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1011 compositeToPoint for OSX < 10.6 (Bug#12390).
1012
1013 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1014
1015 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1016 This produces more-accurate results.
1017
1018 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1019
1020 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1021 changes (Bug#12088).
1022
1023 2012-09-08 Chong Yidong <cyd@gnu.org>
1024
1025 * syntax.c (Fstring_to_syntax): Doc fix.
1026
1027 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1028
1029 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1030 in the internal border.
1031 (x_set_window_size): Remove static variables and their usage.
1032 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1033 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1034 Remove fringe/internal border adjustment (Bug#11052).
1035 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1036 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1037 (ns_fix_rect_ibw): Remove.
1038 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1039 (ns_dumpglyphs_box_or_relief): Ditto.
1040 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1041 adjustment.
1042 (ns_dumpglyphs_image): Ditto.
1043 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1044 border adjustment.
1045 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1046 their usage. Add fringe_extended_p and its use as in other terms.
1047 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1048 scroll bar was removed.
1049 (updateFrameSize): New function.
1050 (windowDidResize): Move code to updateFrameSize and call it.
1051
1052 * nsterm.h (EmacsView): Add updateFrameSize.
1053
1054 2012-09-07 Chong Yidong <cyd@gnu.org>
1055
1056 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1057
1058 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1059
1060 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1061
1062 More signal-handler cleanup (Bug#12327).
1063 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1064 Problem introduced when merging patches. Noted by Eli Zaretskii in
1065 <http://bugs.gnu.org/12327#67>.
1066 * floatfns.c: Comment fix.
1067 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1068 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1069 and anyway the declaration is harmless even if SIGDANGER is not defined.
1070 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1071 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1072 source files not surprisingly expected syssignal.h to define, or
1073 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1074 Include <sys/ioctl.h>, for FIONREAD.
1075 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1076 This eliminates a problem whereby other files mysteriously had
1077 to include "syssignal.h" before including "systty.h" if they
1078 wanted to use "#ifdef SIGIO".
1079
1080 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1081
1082 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1083
1084 * w32.c (sigemptyset): Empty the set.
1085 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1086
1087 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1088
1089 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1090
1091 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1092 (mark_object): Likewise for frame objects.
1093
1094 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1095
1096 * syssignal.h (handle_on_main_thread): Always declare,
1097 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1098 This ports to platforms without HAVE_PTHREAD.
1099
1100 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1101
1102 Signal-handler cleanup (Bug#12327).
1103 Emacs's signal handlers were written in the old 4.2BSD style with
1104 sigblock and sigmask and so forth, and this led to some
1105 inefficiencies and confusion. Rewrite these to use
1106 pthread_sigmask etc. without copying signal sets around. Also,
1107 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1108 'signal', and instead use functions that do not attempt to take
1109 over the system name space. This patch causes Emacs's text
1110 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1111 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1112 Do not include <signal.h> or "syssignal.h", as these
1113 modules do not use signals.
1114 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1115 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1116 Do not include <signal.h>, as "syssignal.h" does that for us now.
1117 * atimer.c (sigmask_atimers): New function.
1118 (block_atimers, unblock_atimers): New functions,
1119 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1120 All uses replaced.
1121 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1122 no longer needed here.
1123 * emacs.c (main): Inspect existing signal handler with sigaction,
1124 so that there's no need to block and unblock SIGHUP.
1125 * sysdep.c (struct save_signal): New member 'action', replacing
1126 old member 'handler'.
1127 (save_signal_handlers, restore_signal_handlers):
1128 Use sigaction instead of 'signal' to save and restore.
1129 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1130 New function. All users of 'signal' modified to use set_sighandler
1131 if they're writeonly, and to use sys_signal if they're read+write.
1132 (emacs_sigaction_init, forwarded_signal): New functions.
1133 (sys_signal): Remove. All uses replaced by calls to sigaction
1134 and emacs_sigaction_init, or by direct calls to 'signal'.
1135 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1136 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1137 all uses replaced by pthread_sigmask etc. calls.
1138 * syssignal.h: Include <signal.h>.
1139 (emacs_sigaction_init, forwarded_signal): New decls.
1140 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1141 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1142 (sigmask, sys_sigmask): Remove; no longer needed.
1143 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1144 (sigblock, sigunblock, sigfree):
1145 (sigsetmask) [!defined sigsetmask]:
1146 Remove. All uses replaced by pthread_sigmask.
1147 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1148 no longer need to be replaced, and its typical old uses
1149 are now done via emacs_sigaction_init and sigaction.
1150 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1151 (sys_sigdel): Remove; unused.
1152 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1153
1154 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1155
1156 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1157 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1158
1159 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1160
1161 Explicitly mark buffer_defaults and buffer_local_symbols.
1162 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1163 mark_local_symbols here.
1164 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1165 since special buffers aren't marked here any more.
1166 (allocate_buffer): Chain new buffer with all_buffers here...
1167 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1168 not here.
1169 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1170 (syms_of_buffer): Remove staticpro of the above.
1171 (init_buffer_once): Set names for buffer_defaults and
1172 buffer_local_symbols.
1173
1174 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1175
1176 Use bool for booleans in font-related modules.
1177 * font.c (font_intern_prop, font_style_to_value)
1178 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1179 (generate_otf_features, font_check_otf_features, font_check_otf)
1180 (font_match_p, font_list_entities, font_at):
1181 * fontset.c (fontset_id_valid_p, reorder_font_vector
1182 (fontset_find_font, Fset_fontset_font)
1183 (face_suitable_for_char_p) [0]:
1184 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1185 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1186 (m17n_flt_initialized, ftfont_shape_by_flt):
1187 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1188 * nsfont.m (nsfont_draw):
1189 * w32font.c (w32font_draw):
1190 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1191 Use bool for booleans.
1192 * font.h: Adjust to above API changes.
1193 (struct font, struct font_driver, struct font_driver_list):
1194 Use bool for booleans.
1195 (struct font): Remove useless member encoding_type.
1196 All users removed.
1197 * fontset.c, xftfont.c: Omit unnecessary static decls.
1198
1199 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1200
1201 * alloc.c (mark_object): Revert window marking code
1202 since it's unsafe for the Fset_window_configuration.
1203
1204 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1205
1206 Fix race conditions with signal handlers and errno (Bug#12327).
1207 Be more systematic about preserving errno whenever a signal
1208 handler returns, even if it's not in the main thread. Do this by
1209 renaming signal handlers to distinguish between signal delivery
1210 and signal handling. All uses changed.
1211 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1212 * data.c (deliver_arith_signal): Rename from arith_error.
1213 * dispnew.c (deliver_window_change_signal): Rename from
1214 window_change_signal.
1215 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1216 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1217 * keyboard.c (deliver_input_available_signal): Rename from
1218 input_available_signal.
1219 (deliver_user_signal): Rename from handle_user_signal.
1220 (deliver_interrupt_signal): Rename from interrupt_signal.
1221 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1222 (deliver_child_signal): Rename from sigchld_handler.
1223 * atimer.c (handle_alarm_signal):
1224 * data.c (handle_arith_signal):
1225 * dispnew.c (handle_window_change_signal):
1226 * emacs.c (handle_fatal_signal, handle_danger_signal):
1227 * keyboard.c (handle_input_available_signal):
1228 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1229 * process.c (handle_pipe_signal, handle_child_signal):
1230 New functions, with the actual signal-handling code taken from the
1231 original respective signal handlers, sans the sporadic attempts to
1232 preserve errno, since that's now done by handle_on_main_thread.
1233 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1234 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1235 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1236 Move to sysdep.c.
1237 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1238 Move initialization of main_thread to sysdep.c's init_signals.
1239 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1240 our usage, and simplifies the mainline code.
1241 (record_child_status_change): New static function, as a helper
1242 for handle_child_signal, and with most of the old child handler's
1243 contents.
1244 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1245 (handle_child_signal): Use the above.
1246 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1247 Moved here from emacs.c.
1248 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1249 code moved here from emacs.c's main function.
1250 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1251 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1252 This lets callers save and restore errno properly.
1253
1254 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1255
1256 Remove redundant or unused things here and there.
1257 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1258 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1259 * editfns.c (Fcompare_buffer_substrings): Likewise.
1260 * frame.h (struct terminal, struct font_driver_list):
1261 Remove redundant declarations.
1262 * window.h (Qleft, Qright): Likewise.
1263
1264 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1265
1266 Do not mark objects from deleted buffers, windows and frames.
1267 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1268 (mark_object): Likewise for windows and frames.
1269
1270 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1271
1272 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1273 buffer_defaults and buffer_local_symbols as valid objects.
1274 Return special value to denote them.
1275
1276 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1277
1278 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1279 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1280 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1281 (file_name_absolute_p, Fsubstitute_in_file_name):
1282 (check_executable, check_writable, Ffile_accessible_directory_p)
1283 (Fset_file_selinux_context, Fdefault_file_modes)
1284 (Finsert_file_contents, choose_write_coding_system)
1285 (Fwrite_region, build_annotations, a_write, e_write)
1286 (Fdo_auto_save):
1287 * filelock.c (boot_time_initialized, get_boot_time)
1288 (get_boot_time_1, lock_file_1, within_one_second):
1289 * floatfns.c (in_float):
1290 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1291 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1292 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1293 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1294 * window.c (compare_window_configurations):
1295 Use bool for booleans.
1296 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1297 (Fdefault_file_modes): Now mode_t, not int, for modes.
1298 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1299 (internal_delete_file): Now returns void, not a (boolean) int,
1300 since nobody was looking at the return value.
1301 * lisp.h, window.h: Adjust to above API changes.
1302
1303 * xdisp.c (set_message): Simplify and reindent last change.
1304
1305 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1306
1307 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1308
1309 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1310
1311 * eval.c (call_debugger): Make the function non-static so that we
1312 can call it from set_message.
1313
1314 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1315 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1316
1317 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1318
1319 Give more-useful info on a fatal error (Bug#12328).
1320 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1321 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1322 of doing the work ourselves.
1323 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1324 do most of the work.
1325 (fatal_error_backtrace): New function, taken from the guts
1326 of the old fatal_error_signal, but with a new option to output
1327 a backtrace.
1328 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1329 info about the signal than just its number.
1330 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1331 * sysdep.c: Include <execinfo.h>
1332 (emacs_backtrace): New function, taken partly from the previous
1333 code of the 'die' function.
1334 (emacs_abort): Call fatal_error_backtrace rather than abort.
1335
1336 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1337
1338 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1339 eager (load-time) macro-expansion.
1340 * lisp.mk (lisp): Add macroexp.
1341
1342 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1343
1344 Simplify redefinition of 'abort' (Bug#12316).
1345 Do not try to redefine the 'abort' function. Instead, redo
1346 the code so that it calls 'emacs_abort' rather than 'abort'.
1347 This removes the need for the NO_ABORT configure-time macro
1348 and makes it easier to change the abort code to do a backtrace.
1349 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1350 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1351 Remove; sysdep.c's emacs_abort now takes its place.
1352 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1353 'abort' changed to use 'emacs_abort'.
1354 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1355 (abort) [!defined abort]: Rename to ...
1356 (emacs_abort): ... new name.
1357 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1358 the place of the old 'abort' in emacs.c.
1359 * w32.c, w32fns.c (abort): Do not #undef.
1360 * w32.c (emacs_abort): Rename from w32_abort.
1361
1362 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1363
1364 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1365 offsets[j].dv, since the y axis of the screen coordinates points
1366 down, while the y axis of the font definition coordinates points
1367 up. This fixes display of Arabic diacritics such as KASRA and
1368 KASRATAN. (Bug#11860)
1369
1370 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1371
1372 Be more systematic about _setjmp vs setjmp.
1373 * alloc.c (test_setjmp, mark_stack):
1374 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1375 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1376 (png_load, my_error_exit, jpeg_load):
1377 * process.c (send_process_trap, send_process):
1378 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1379 The underscored versions are up to 30x faster on some hosts.
1380 Formerly, the code used setjmp+longjmp sometimes and
1381 _setjmp+_longjmp at other times, with no particular reason to
1382 prefer setjmp+longjmp.
1383
1384 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1385
1386 Fix minor problem found by static checking.
1387 * buffer.c (Fdelete_all_overlays): Return nil.
1388
1389 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1390
1391 * buffer.c (Fdelete_all_overlays): New function.
1392
1393 2012-09-03 Chong Yidong <cyd@gnu.org>
1394
1395 * gtkutil.c: Add extern decl for Qxft.
1396
1397 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1398
1399 * emacs.c, eval.c: Use bool for boolean.
1400 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1401 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1402 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1403 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1404 (main, decode_env_path, Fdaemon_initialized):
1405 * eval.c (call_debugger, Finteractive_p, interactive_p):
1406 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1407 (maybe_call_debugger, Fbacktrace):
1408 * process.c (read_process_output, exec_sentinel):
1409 Use bool for booleans.
1410 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1411 All callers changed.
1412 * eval.c (interactive_p): Omit always-true boolean argument
1413 EXCLUDE_SUBRS_P. All callers changed.
1414 * dispextern.h, lisp.h: Reflect above API changes.
1415 * firstfile.c (dummy): Use the address of 'main', whose signature
1416 won't change, instead of the address of 'initialize', whose
1417 signature just changed from int to bool.
1418 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1419 * msdos.c (fatal_error_in_progress): ... from here.
1420 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1421 of incrementing it.
1422 (redisplay_internal, unwind_redisplay): Simply clear
1423 REDISPLAYING_P when unwinding, instead of saving its previous,
1424 always-false value and then restoring it.
1425
1426 Clean up some extern decls.
1427 Mostly, this hoists extern decls out of .c files and into .h files.
1428 That way, we're more likely to catch errors if the interfaces change.
1429 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1430 declare xg_mark_data.
1431 * dispextern.h (x_frame_parm_handlers):
1432 * font.h (Qxft):
1433 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1434 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1435 (Qultra_bold, Qoblique, Qitalic):
1436 Move extern decl here from .c file.
1437 * alloc.c (xg_mark_data) [USE_GTK]:
1438 * doc.c (Qclosure):
1439 * eval.c (Qlexical_binding):
1440 * fns.c (time) [!HAVE_UNISTD_H]:
1441 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1442 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1443 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1444 * lread.c (Qinternal_interpreter_environment):
1445 * minibuf.c (Qbuffer):
1446 * process.c (QCfamily, QCfilter):
1447 * widget.c (free_frame_faces):
1448 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1449 * xfont.c (x_clear_errors):
1450 * xterm.c (x_frame_parm_handlers):
1451 Remove now-redundant extern decls.
1452 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1453 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1454 Now static.
1455 * xfaces.c: Remove unnecessary static decls.
1456 * xterm.c (updating_frame): Remove decl of nonexistent object.
1457
1458 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1459 when building globals.h, as the objects that are not built on
1460 this host are not needed to compile C files on this host.
1461
1462 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1463
1464 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1465
1466 * frame.h: Add missing prototype for x_wm_set_size_hint.
1467
1468 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1469
1470 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1471 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1472 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1473 (Fsubstitute_command_keys):
1474 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1475 (save_excursion_save, save_excursion_restore)
1476 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1477 (format_time_string, general_insert_function)
1478 (make_buffer_string, make_buffer_string_both)
1479 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1480 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1481 (copy_text, insert_1, insert_1_both, insert_from_string)
1482 (insert_from_string_before_markers, insert_from_string_1)
1483 (insert_from_buffer, insert_from_buffer_1, replace_range)
1484 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1485 (del_range_2, modify_region):
1486 * intervals.c (intervals_equal, balance_possible_root_interval)
1487 (adjust_intervals_for_insertion, merge_properties_sticky)
1488 (graft_intervals_into_buffer, lookup_char_property)
1489 (adjust_for_invis_intang, set_point_both)
1490 (get_property_and_range, compare_string_intervals)
1491 (set_intervals_multibyte_1, set_intervals_multibyte):
1492 * keyboard.c (decode_timer):
1493 Use bool for boolean.
1494 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1495 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1496
1497 2012-09-02 Chong Yidong <cyd@gnu.org>
1498
1499 * keymap.c (push_key_description): Print M-TAB as C-M-i
1500 (Bug#11758).
1501
1502 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1503
1504 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1505 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1506 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1507 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1508 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1509 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1510 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1511
1512 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1513
1514 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1515 more than one grapheme cluster passed to the shaper: compute the
1516 offset adjustment values separately for each cluster. (Bug#11860)
1517
1518 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1519 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1520 about implicit conversions from integer to pointer.
1521
1522 2012-09-01 Daniel Colascione <dancol@dancol.org>
1523
1524 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1525 system used too early.
1526
1527 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 Better seed support for (random).
1530 * emacs.c (main): Call init_random.
1531 * fns.c (Frandom): Set the seed from a string argument, if given.
1532 Remove long-obsolete Gentzel cruft.
1533 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1534 (init_random): New function.
1535
1536 2012-09-01 Daniel Colascione <dancol@dancol.org>
1537
1538 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1539 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1540 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1541 x_wm_set_size_hint, x_query_colors, x_real_positions,
1542 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1543 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1544 all of which have been moved to common code.
1545
1546 * xfaces.c: Include TERM_HEADER instead of listing all possible
1547 window-system headers.
1548
1549 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1550 to match header.
1551
1552 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1553 directly accessing frame internals.
1554
1555 * w32font.h: Include font.h. Define syms_of_w32font and
1556 globals_of_w32font.
1557
1558 * process.c: Include TERM_HEADER instead of listing all possible
1559 window-system headers.
1560
1561 * nsterm.h: Remove declarations now in frame.h.
1562 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1563
1564 * menu.c: Include TERM_HEADER instead of listing all possible
1565 window-system headers.
1566
1567 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1568 window system.
1569
1570 * keyboard.c: Include TERM_HEADER instead of listing all possible
1571 window-system headers.
1572
1573 * image.c: Include TERM_HEADER instead of listing all possible
1574 window-system headers. Declare Vlibrary_cache when compiling for
1575 Windows.
1576
1577 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1578 window system declarations.
1579
1580 * frame.h: Move common functions here: set_frame_menubar,
1581 x_set_window_size, x_sync, x_get_focus_frame,
1582 x_set_mouse_position, x_set_mouse_pixel_position,
1583 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1584 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1585 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1586 x_activate_menubar, x_real_positions, x_bitmap_icon,
1587 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1588 and x_query_colors.
1589
1590 * frame.c: Include TERM_HEADER instead of listing all possible
1591 window-system headers.
1592
1593 * font.c: Include TERM_HEADER instead of listing all possible
1594 window-system headers.
1595
1596 * emacs.c: Include TERM_HEADER.
1597
1598 * dispnew.c: Include TERM_HEADER instead of listing all possible
1599 window-system headers.
1600
1601 * ccl.h: Include character.h.
1602
1603 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1604 the current window system; include in list of objects to link into
1605 Emacs.
1606
1607 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1608
1609 Remove mark_ttys function and fix tty_display_info initialization.
1610 * lisp.h (mark_ttys): Remove prototype.
1611 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1612 to mark_ttys because all possible values of 'top_frame' slot are
1613 the frames which are reachable from Vframe_list.
1614 * term.c (mark_ttys): Remove.
1615 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1616
1617 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1618
1619 Change struct frame bitfields from unsigned char to unsigned.
1620 * frame.h (struct frame): Change type of 'display_preempted',
1621 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1622 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1623 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1624 bitfields from unsigned char to unsigned.
1625
1626 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1627
1628 Remove unused member of struct x_output and struct w32_output.
1629 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1630 * w32term.h (struct w32_output): Likewise.
1631
1632 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1633
1634 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1635 does not become zero (Bug#12234).
1636
1637 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1638
1639 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1640 for GCC 4.7.1 x86-64.
1641
1642 2012-08-30 Glenn Morris <rgm@gnu.org>
1643
1644 * lread.c (init_lread): For out-of-tree builds, only add the
1645 source directory's site-lisp dir to the load-path if it exists,
1646 consistent with in-tree builds. (Bug#12302)
1647
1648 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1649
1650 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1651 button_values to NULL. Call setStykeMask so dialogs get a close button.
1652 (windowShouldClose:): Set window_closed.
1653 (dealloc): New member, free button_values.
1654 (process_dialog:): Make member function. Remove window argument,
1655 replace window with self. Count buttons and allocate and store values
1656 in button_values.
1657 (addButton:value:row:): value is int with the name tag. Call setTag
1658 with tag. Remove return self, declare return value as void.
1659 (addString:row:): Remove return self, declare return value as void.
1660 (addSplit): Remove return self, declare return value as void.
1661 (clicked:): Remove return self, declare return value as void.
1662 Set dialog_return to button_values[seltag]. Code formatting change.
1663 (initFromContents:isQuestion:): Adjust call to process_dialog.
1664 Code formatting change.
1665 (timeout_handler:): Set timer_fired to YES.
1666 (runDialogAt:): Set timer_fired to NO.
1667 Handle click on close button as quit.
1668
1669 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1670 Add window_closed and button_values. Add void as return value for
1671 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1672 Add process_dialog as new member.
1673
1674 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1675
1676 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1677 is not one of the heaps we manage. (Bug#12242)
1678
1679 2012-08-28 Glenn Morris <rgm@gnu.org>
1680
1681 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1682
1683 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1684
1685 * window.c (Fset_window_configuration): Remove handling of
1686 auto-buffer-name window parameter. Install revision of reverted
1687 fix.
1688
1689 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1690
1691 Do not allow to set major mode for a dead buffer.
1692 * buffer.c (Fset_buffer_major_mode): Signal an error
1693 if the buffer is dead.
1694 (Fother_buffer, other_buffer_safely): Remove redundant
1695 nested declaration.
1696
1697 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1698
1699 Always use set_buffer_if_live to restore original buffer at unwind.
1700 * buffer.h (record_unwind_current_buffer): New function.
1701 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1702 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1703 * undo.c, window.c: Adjust users.
1704 * buffer.c (set_buffer_if_live): Fix comment.
1705
1706 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1707
1708 Fix usage of set_buffer_internal.
1709 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1710 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1711 * coding.c (decode_coding): Omit redundant test.
1712 * fileio.c (decide_coding_unwind): Likewise.
1713 * fns.c (secure_hash): Likewise.
1714 * insdel.c (modify_region): Likewise.
1715 * keyboard.c (command_loop_1): Likewise.
1716 * print.c (PRINTFINISH): Likewise.
1717 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1718
1719 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1720
1721 * dispnew.c: Use bool for boolean.
1722 (frame_garbaged, display_completed, delayed_size_change)
1723 (fonts_changed_p, add_window_display_history)
1724 (add_frame_display_history, verify_row_hash)
1725 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1726 (row_equal_p, realloc_glyph_pool)
1727 (allocate_matrices_for_frame_redisplay)
1728 (showing_window_margins_p)
1729 (adjust_frame_glyphs_for_frame_redisplay)
1730 (build_frame_matrix_from_leaf_window, make_current)
1731 (mirrored_line_dance, mirror_line_dance, update_frame)
1732 (update_window_tree, update_single_window)
1733 (check_current_matrix_flags, update_window, update_text_area)
1734 (update_window_line, set_window_update_flags, scrolling_window)
1735 (update_frame_1, scrolling, buffer_posn_from_coords)
1736 (do_pending_window_change, change_frame_size)
1737 (change_frame_size_1, sit_for):
1738 Use bool for boolean.
1739 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1740 and remove last int (actually boolean) argument, which was always 0.
1741 All callers changed.
1742 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1743 * dispextern.h (struct composition_it): Use bool for boolean.
1744 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1745 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1746 * dired.c (file_name_completion):
1747 Use bool for boolean. (This was missed in an earlier change.)
1748
1749 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1750
1751 * window.c (Fset_window_configuration): Revert first part of
1752 last change.
1753
1754 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1755
1756 * nsterm.h (NSPanel): New class variable dialog_return.
1757
1758 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1759 Initialize dialog_return.
1760 (windowShouldClose:): Use stop instead of stopModalWithCode.
1761 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1762 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1763 event.
1764 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1765 modal loop returns.
1766
1767 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1768
1769 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1770 * composite.c (find_composition, composition_gstring_p)
1771 (composition_reseat_it, find_automatic_composition):
1772 * data.c (let_shadows_buffer_binding_p)
1773 (let_shadows_global_binding_p, set_internal, make_blv)
1774 (Fmake_variable_buffer_local, Fmake_local_variable)
1775 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1776 (cons_to_signed, arith_driver):
1777 * dbusbind.c (xd_in_read_queued_messages):
1778 * dired.c (directory_files_internal, file_name_completion):
1779 Use bool for booleans.
1780 * dired.c (file_name_completion):
1781 * process.h (fd_callback):
1782 Omit int (actually boolean) argument. It wasn't being used.
1783 All uses changed.
1784 * composite.h, lisp.h: Reflect above API changes.
1785
1786 * cmds.c, coding.c: Use bool for booleans.
1787 * cmds.c (move_point, Fself_insert_command):
1788 * coding.h (struct composition status, struct coding_system):
1789 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1790 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1791 (emacs_mule_char, decode_coding_emacs_mule)
1792 (encode_coding_emacs_mule, detect_coding_iso_2022)
1793 (decode_coding_iso_2022, encode_invocation_designation)
1794 (encode_designation_at_bol, encode_coding_iso_2022)
1795 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1796 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1797 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1798 (encode_coding_raw_text, detect_coding_charset)
1799 (decode_coding_charset, encode_coding_charset, detect_eol)
1800 (detect_coding, get_translation_table, produce_chars)
1801 (consume_chars, reused_workbuf_in_use)
1802 (make_conversion_work_buffer, code_conversion_save)
1803 (decode_coding_object, encode_coding_object)
1804 (detect_coding_system, char_encodable_p)
1805 (Funencodable_char_position, code_convert_region)
1806 (code_convert_string, code_convert_string_norecord)
1807 (Fset_coding_system_priority):
1808 * fileio.c (Finsert_file_contents):
1809 Use bool for booleans.
1810 * coding.h, lisp.h: Reflect above API changes.
1811 * coding.c: Remove unnecessary static function decls.
1812 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1813 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1814 not a boolean 'int', since callers never look at the return value.
1815 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1816 * coding.h (decoding_buffer_size, encoding_buffer_size)
1817 (emacs_mule_string_char): Remove unused extern decls.
1818 (struct iso_2022_spec, struct coding_system):
1819 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1820 (struct emacs_mule_spec): Remove unused field 'full_support'.
1821 All initializations removed.
1822 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1823
1824 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1825
1826 Fix spare memory change (Bug#12286).
1827 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1828 (valid_lisp_object_p): Likewise.
1829
1830 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1831
1832 * window.c (Fset_window_configuration): Record any window's old
1833 buffer if it's replaced (see Bug#8789). If the new current
1834 buffer doesn't appear in the selected window, go to its old
1835 point (Bug#12208).
1836
1837 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1838
1839 Special MEM_TYPE_SPARE to denote reserved memory.
1840 * alloc.c (enum mem_type): New memory type.
1841 (refill_memory_reserve): Use new type for spare memory.
1842 This prevents live_cons_p and live_string_p from incorrect
1843 detection of uninitialized objects from spare memory as live.
1844
1845 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1846
1847 Spelling fixes.
1848 * Makefile.in (.PHONY): versioclean -> versionclean.
1849
1850 Remove unused external symbols.
1851 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1852 * window.c (Qwindow_valid_p, decode_valid_window):
1853 Now static, not extern.
1854 * data.c (Qinterval): Remove; unused.
1855 (syms_of_data): Do not define 'interval'.
1856 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1857 * window.h (decode_valid_window):
1858 Remove decls.
1859
1860 * character.c, charset.c, chartab.c: Use bool for booleans.
1861 * character.c (lisp_string_width, string_count_byte8)
1862 (string_escape_byte8):
1863 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1864 (load_charset_map_from_file, map_charset_chars)
1865 (Fdefine_charset_internal, define_charset_internal)
1866 (Fdeclare_equiv_charset, find_charsets_in_text)
1867 (Ffind_charset_region, char_charset, Fiso_charset):
1868 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1869 (sub_char_table_set, sub_char_table_set_range)
1870 (char_table_set_range, optimize_sub_char_table)
1871 (map_sub_char_table):
1872 Use bool for boolean.
1873 * character.c (str_to_unibyte): Omit last boolean argument; it was
1874 always 0. All callers changed.
1875 * character.h, charset.h: Adjust to match previous changes.
1876 * character.h (char_printable_p): Remove decl of nonexistent function.
1877 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1878 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1879 are all boolean, so make them single-bit bitfields.
1880
1881 * lisp.h (ASET): Remove attempt to detect side effects.
1882 It was meant to be temporary and it often doesn't work,
1883 because when IDX has side effects the behavior of IDX==IDX
1884 is undefined. See Stefan Monnier in
1885 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1886
1887 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1888
1889 * lisp.h (functionp): New function (extracted from Ffunctionp).
1890 (FUNCTIONP): Use it.
1891 * eval.c (Ffunctionp): Use it.
1892
1893 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1894
1895 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1896 as that's faster and simpler than static storage. Don't bother
1897 with the g_main_context_query overhead if g_main_context_pending
1898 says no events are pending.
1899 (gfds, gfds_size): Remove these static vars.
1900 (xgselect_initialize): Remove; no longer needed.
1901 All uses and decls removed.
1902
1903 * emacs.c (fatal_error_signal_hook): Remove.
1904 All uses removed. This leftover from old code was always 0.
1905
1906 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1907 * casefiddle.c (casify_object, casify_region):
1908 * casetab.c (set_case_table):
1909 * category.c, category.h (word_boundary_p):
1910 * category.h (CHAR_HAS_CATEGORY):
1911 Use bool for booleans, instead of int.
1912
1913 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1914
1915 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1916
1917 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1918
1919 On assertion failure, print backtrace if available.
1920 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1921 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1922 * Makefile.in (LIB_EXECINFO): New macro.
1923 (LIBES): Use it.
1924
1925 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1926 * bytecode.c (exec_byte_code):
1927 * callint.c (check_mark, Fcall_interactively):
1928 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1929 (getenv_internal, sync_process_alive, call_process_exited):
1930 * lisp.h (USE_SAFE_ALLOCA):
1931 Use bool for booleans, instead of int.
1932 * lisp.h, process.h: Adjust prototypes to match above changes.
1933 * callint.c (Fcall_interactively): Don't assume the mark's
1934 offset fits in 'int'.
1935
1936 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1937
1938 * buffer.c, buffer.h: Use bool for boolean.
1939 * buffer.c (reset_buffer_local_variables)
1940 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1941 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1942 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1943 (overlay_touches_p, overlay_strings, Foverlay_put)
1944 (report_overlay_modification, call_overlay_mod_hooks):
1945 (mmap_enlarge, mmap_set_vars):
1946 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1947 Use bool for booleans, instead of int.
1948 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1949 since the 1-or-0 return value is always ignored anyway.
1950 (mmap_initialized_p):
1951 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1952 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1953
1954 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1955
1956 * bidi.c: Use bool for boolean.
1957 This is a bit more readable, and makes the text segment of bidi.o
1958 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1959 Presumably it's faster too.
1960 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1961 Now bool.
1962 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1963 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1964 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1965 (bidi_explicit_dir_char, bidi_level_of_next_char)
1966 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1967 Use bool for booleans, instead of int.
1968 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1969 (bidi_unshelve_cache): Adjust decls to match code.
1970
1971 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1972
1973 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1974 argument.
1975
1976 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1977
1978 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1979 * atimer.h: Include <stdbool.h>.
1980
1981 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1982
1983 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1984 compile time tests instead of run time tests on systems that do
1985 not use them.
1986 (FRAME_MAC_P): Remove leftover from deleted code.
1987 * frame.c (syms_of_frame): Remove leftover from deleted code.
1988
1989 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1990
1991 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1992
1993 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1994
1995 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1996 Otherwise, the compiler complains about (A?B:C) where B is void
1997 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1998 (fontset_add): Return void, for FONTSET_ADD.
1999
2000 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2001
2002 * alloc.c: Use bool for booleans.
2003 (gc_in_progress, abort_on_gc)
2004 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2005 (dont_register_blocks) [GC_MALLOC_CHECK]:
2006 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2007 (check_string_bytes, make_specified_string, memory_full)
2008 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2009 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2010 (mark_stack, valid_pointer_p, make_pure_string)
2011 (Fgarbage_collect, survives_gc_p, gc_sweep):
2012 Use bool for booleans, instead of int.
2013 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2014 Remove unused local.
2015 * alloc.c (PURE_POINTER_P):
2016 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2017 * editfns.c (Fformat):
2018 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2019 (Fdo_auto_save):
2020 * fns.c (sweep_weak_table):
2021 * lisp.h (suppress_checking, push_message, survives_gc_p)
2022 (make_pure_string, gc_in_progress, abort_on_gc):
2023 * lread.c (readchar, read1):
2024 * print.c (Fprin1_to_string):
2025 * xdisp.c (push_message):
2026 Use bool for booleans affected directly or indirectly by
2027 alloc.c's changes.
2028
2029 Make recently-introduced setters macros.
2030 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2031 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2032 (set_fontset_default, set_fontset_fallback): Rename from their
2033 upper-case counterparts, and make them functions rather than macros.
2034 This is more consistent with the other recently-introduced setters.
2035 These don't need to be inline, since they're local.
2036
2037 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2038
2039 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2040 the loop (Bug#12247).
2041
2042 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2043
2044 * lisp.h (vcopy): Use memcpy rather than our own loop.
2045 This fixes a performance regression introduced by the recent
2046 addition of vcopy. This means 'vcopy' will need to be modified
2047 for a copying collector, but that's OK. Also, tighten the
2048 checking in the assertion.
2049
2050 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2051
2052 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2053 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2054 non-base glyph for the width of the base character, according to
2055 what x_draw_composite_glyph_string_foreground expects.
2056 Generate WADJUST value according to composition_gstring_width's
2057 expectations, to produce correct width of the composed character.
2058 Reverse the sign of the DU offset produced by ScriptPlace.
2059
2060 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2061
2062 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2063
2064 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2065
2066 Avoid direct writes to contents member of struct Lisp_Vector.
2067 * lisp.h (vcopy): New function to copy data into vector.
2068 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2069 * fns.c (Ffillarray): Use ASET.
2070 * keyboard.c (timer_check_2): Use AREF and ASET.
2071 (append_tool_bar_item, Frecent_keys): Use vcopy.
2072 * lread.c (read_vector): Use ASET.
2073 * msdos.c (Frecent_doskeys): Use vcopy.
2074 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2075 (Finternal_merge_in_global_face): Use ASET and vcopy.
2076 * xfont.c (xfont_list_pattern): Likewise.
2077
2078 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2079
2080 * window.c (Fwindow_point): For the selected window always return
2081 the position of its buffer's point.
2082 (Fset_window_point): For the selected window always go in its
2083 buffer to the specified position.
2084
2085 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2086
2087 Setter macros for fontsets.
2088 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2089 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2090 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2091 Adjust users.
2092
2093 2012-08-20 Glenn Morris <rgm@gnu.org>
2094
2095 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2096 Don't assume that `ln -f' works.
2097
2098 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2099
2100 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2101 and later about non-assignments with no effect. See discussion at
2102 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2103 details.
2104
2105 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2106
2107 Inline setter functions for Lisp_Objects slots of struct specbinding.
2108 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2109 Adjust users.
2110
2111 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2112
2113 * window.c (select_window): Always make selected window's buffer
2114 current.
2115
2116 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2117
2118 Use AREF and ASET for docstrings of category tables.
2119 * category.h (CATEGORY_DOCSTRING): Use AREF.
2120 (SET_CATEGORY_DOCSTRING): Use ASET.
2121 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2122
2123 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2124
2125 Inline setter functions for hash table members.
2126 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2127 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2128 (set_hash_key_and_value, set_hash_index, set_hash_next)
2129 (set_hash_hash): New functions.
2130 * charset.c, fns.c: Adjust users.
2131
2132 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2133
2134 Inline getter and setter functions for per-buffer values.
2135 * buffer.h (per_buffer_default, set_per_buffer_default)
2136 (per_buffer_value, set_per_buffer_value): New functions.
2137 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2138 * buffer.c, data.c: Adjust users.
2139
2140 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2141
2142 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2143
2144 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2145
2146 Rely on <config.h> + <unistd.h> to declare 'environ',
2147 as gnulib does this if the system doesn't.
2148 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2149 Remove declaration. MS-Windows declares it on stdlib.h which is
2150 included by conf_post.h.
2151 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2152 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2153 * vm-limit.c: Include <unistd.h>, for 'environ'.
2154
2155 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2156 (start_of_data): Remove decl; mem-limits.h provides it.
2157
2158 * xdisp.c (handle_invisible_prop): Make it a bit faster
2159 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2160
2161 2012-08-19 Chong Yidong <cyd@gnu.org>
2162
2163 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2164 ends (Bug#3874).
2165
2166 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2167
2168 * .gdbinit: Use call instead of set when calling a function in the
2169 inferior.
2170
2171 * data.c (set_internal): Don't use set_blv_found.
2172 (Fkill_local_variable): Likewise.
2173
2174 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2175
2176 * nsfont.m (ns_ascii_average_width): Ensure the string
2177 ascii_printable is initialized with a null-terminated character
2178 array. Otherwise, it can contain undesired extra characters.
2179
2180 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2181
2182 port new setting code to Sun C 5.8 2005/10/13
2183 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2184 Return void, not Lisp_Object. Otherwise, the compiler
2185 complains about (A?B:C) where B is void and C is Lisp_Object
2186 when compiling CHAR_TABLE_SET, due to the recent change to
2187 the API of sub_char_table_set_contents.
2188
2189 2012-08-18 Chong Yidong <cyd@gnu.org>
2190
2191 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2192 for the string case (Bug#3874).
2193
2194 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2195
2196 * buffer.h (BSET): Remove (Bug#12215).
2197 Replace all uses with calls to new setter functions.
2198 (bset_bidi_paragraph_direction, bset_case_canon_table)
2199 (bset_case_eqv_table, bset_directory, bset_display_count)
2200 (bset_display_time, bset_downcase_table)
2201 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2202 (bset_last_selected_window, bset_local_var_alist)
2203 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2204 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2205 (bset_width_table):
2206 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2207 (bset_auto_fill_function, bset_auto_save_file_format)
2208 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2209 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2210 (bset_cache_long_line_scans, bset_case_fold_search)
2211 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2212 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2213 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2214 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2215 (bset_header_line_format, bset_indicate_buffer_boundaries)
2216 (bset_indicate_empty_lines, bset_invisibility_spec)
2217 (bset_left_fringe_width, bset_major_mode, bset_mark)
2218 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2219 (bset_name, bset_overwrite_mode, bset_pt_marker)
2220 (bset_right_fringe_width, bset_save_length)
2221 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2222 (bset_scroll_up_aggressively, bset_selective_display)
2223 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2224 (bset_word_wrap, bset_zv_marker):
2225 * category.c (bset_category_table):
2226 * syntax.c (bset_syntax_table):
2227 New setter functions.
2228
2229 * process.h (PSET): Remove (Bug#12215).
2230 Replace all uses with calls to new setter functions.
2231 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2232 (PROCESS_INLINE): New macro.
2233 (pset_childp): New setter function.
2234 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2235 * process.c (PROCESS_INLINE):
2236 Define to EXTERN_INLINE, so that the corresponding functions
2237 are compiled into code.
2238 (pset_buffer, pset_command, pset_decode_coding_system)
2239 (pset_decoding_buf, pset_encode_coding_system)
2240 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2241 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2242 (pset_type, pset_write_queue): New setter functions.
2243
2244 * window.h (WSET): Remove (Bug#12215).
2245 Replace all uses with calls to new setter functions.
2246 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2247 (WINDOW_INLINE): New macro.
2248 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2249 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2250 (wset_total_lines, wset_vertical_scroll_bar)
2251 (wset_window_end_pos, wset_window_end_valid)
2252 (wset_window_end_vpos): New setter functions.
2253 * window.c (WINDOW_INLINE):
2254 Define to EXTERN_INLINE, so that the corresponding functions
2255 are compiled into code.
2256 (wset_combination_limit, wset_dedicated, wset_display_table)
2257 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2258 (wset_new_normal, wset_new_total, wset_next_buffers)
2259 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2260 (wset_prev_buffers, wset_right_fringe_width)
2261 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2262 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2263 (wset_window_parameters):
2264 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2265 (wset_column_number_displayed, wset_region_showing):
2266 New setter functions.
2267
2268 * termhooks.h (TSET): Remove (Bug#12215).
2269 Replace all uses with calls to new setter functions.
2270 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2271 (TERMHOOKS_INLINE): New macro.
2272 (tset_charset_list, tset_selection_alist): New setter functions.
2273 * terminal.c (TERMHOOKS_INLINE):
2274 Define to EXTERN_INLINE, so that the corresponding functions
2275 are compiled into code.
2276 (tset_param_alist): New setter function.
2277
2278 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2279
2280 * keyboard.h (KSET): Remove (Bug#12215).
2281 Replace all uses with calls to new setter functions.
2282 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2283 (KEYBOARD_INLINE): New macro.
2284 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2285 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2286 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2287 New setter functions.
2288 * keyboard.c (KEYBOARD_INLINE):
2289 Define to EXTERN_INLINE, so that the corresponding functions
2290 are compiled into code.
2291 (kset_echo_string, kset_kbd_queue)
2292 (kset_keyboard_translate_table, kset_last_prefix_arg)
2293 (kset_last_repeatable_command, kset_local_function_key_map)
2294 (kset_overriding_terminal_local_map, kset_real_last_command)
2295 (kset_system_key_syms): New setter functions.
2296
2297 * frame.h (FSET): Remove (Bug#12215).
2298 Replace all uses with calls to new setter functions.
2299 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2300 (FRAME_INLINE): New macro.
2301 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2302 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2303 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2304 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2305 (fset_param_alist, fset_root_window, fset_scroll_bars)
2306 (fset_selected_window, fset_title, fset_tool_bar_items)
2307 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2308 * frame.c (FRAME_INLINE):
2309 Define to EXTERN_INLINE, so that the corresponding functions
2310 are compiled into code.
2311 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2312
2313 A few more naming-convention fixes for getters and setters.
2314 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2315 and rename from buffer_overlays_set_before.
2316 (set_buffer_overlays_after): Move here from buffer.h, and rename
2317 from buffer_overlays_set_after.
2318 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2319 All uses changed.
2320 (set_buffer_intervals): Rename from buffer_set_intervals.
2321 * intervals.c (set_interval_object): Move here from intervals.h,
2322 and rename from interval_set_object.
2323 (set_interval_left): Move here from intervals.h, and rename from
2324 interval_set_left.
2325 (set_interval_right): Move here from intervals.h, and rename from
2326 interval_set_right.
2327 (copy_interval_parent): Move here from intervals.h, and rename from
2328 interval_copy_parent.
2329 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2330 (set_interval_plist): Rename from interval_set_plist.
2331 Return void, not Lisp_Object, since no caller uses the result.
2332 * lisp.h (string_intervals): Rename from string_get_intervals.
2333 (set_string_intervals): Rename from string_set_intervals.
2334
2335 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2336 (set_char_table_contents): Rename from char_table_set_contents.
2337 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2338 All uses changed. See the end of
2339 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2340
2341 * lisp.h (CSET): Remove (Bug#12215).
2342 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2343 (set_char_table_purpose): New functions,
2344 replacing CSET. All uses changed. For example, replace
2345 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2346 "set_char_table_parent (char_table, parent);".
2347 The old version was confusing because it used the same name
2348 'parent' for two different things.
2349
2350 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2351
2352 Functions to get and set Lisp_Object fields of buffer-local variables.
2353 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2354 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2355 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2356 * data.c, eval.c, frame.c: Adjust users.
2357
2358 2012-08-17 Chong Yidong <cyd@gnu.org>
2359
2360 * xfaces.c (merge_face_vectors): If the target font specfies a
2361 font spec, make the font's attributes take precedence over
2362 directly-specified attributes.
2363 (merge_face_ref): Recognize :font.
2364
2365 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2366
2367 Do not use memcpy for copying intervals.
2368 * intervals.c (reproduce_interval): New function.
2369 (reproduce_tree, reproduce_tree_obj): Use it.
2370 (reproduce_tree_obj): Remove prototype.
2371
2372 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2373
2374 * lisp.h (duration_to_sec_usec): Remove unused decl.
2375
2376 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2377
2378 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2379 to an allocated instance of NSString, not to the class itself.
2380
2381 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2382
2383 * makefile.w32-in (C_CTYPE_H): New macro.
2384 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2385 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2386 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2387
2388 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2389
2390 Use ASCII tests for character types.
2391 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2392 * xfns.c, xterm.c:
2393 Don't include <ctype.h>; was not needed.
2394 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2395 * sysdep.c, xfaces.c:
2396 Include <c-ctype.h> instead of <ctype.h>.
2397 * nsterm.m: Include <c-ctype.h>.
2398 * charset.c (read_hex):
2399 * doc.c (Fsnarf_documentation):
2400 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2401 (DRIVE_LETTER) [DOS_NT]:
2402 (Ffile_name_directory, Fexpand_file_name)
2403 (Fsubstitute_in_file_name):
2404 * font.c (font_parse_xlfd, font_parse_fcname):
2405 * frame.c (x_set_font_backend):
2406 * gtkutil.c (xg_get_font):
2407 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2408 * nsimage.m (hexchar):
2409 * nsterm.m (ns_xlfd_to_fontname):
2410 * sysdep.c (system_process_attributes):
2411 * xfaces.c (hash_string_case_insensitive):
2412 Use C-locale tests instead of locale-specific tests for character
2413 types, since we want the ASCII interpretation here, not the
2414 interpretation suitable for whatever happens to be the current locale.
2415
2416 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2417
2418 Consistently check windows for validity/liveness
2419 (Bug#11984, Bug#12025, Bug#12026).
2420 * lisp.h (CHECK_VALID_WINDOW): New macro.
2421 * window.c (decode_window): Rename to decode_live_window.
2422 (decode_valid_window, Fwindow_valid_p): New functions.
2423 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2424 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2425 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2426 (Fwindow_prev_sibling, Fwindow_combination_limit)
2427 (Fset_window_combination_limit, Fwindow_use_time)
2428 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2429 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2430 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2431 (Fwindow_hscroll, Fset_window_hscroll)
2432 (Fwindow_redisplay_end_trigger)
2433 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2434 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2435 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2436 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2437 (Fwindow_end, Fset_window_point, Fset_window_start)
2438 (Fpos_visible_in_window_p, Fwindow_line_height)
2439 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2440 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2441 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2442 (Fset_window_parameter, Fwindow_display_table)
2443 (Fset_window_display_table, Fdelete_other_windows_internal)
2444 (Fset_window_buffer, Fset_window_new_total)
2445 (Fset_window_new_normal, Fdelete_window_internal)
2446 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2447 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2448 (Fwindow_scroll_bars): Check whether argument window is a valid or
2449 live window. Update doc-strings.
2450 (syms_of_window): New symbol Qwindow_valid_p.
2451 * keyboard.c (Fposn_at_x_y): Check whether argument
2452 frame_or_window denotes a valid window.
2453
2454 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2455
2456 Fix previous char table change.
2457 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2458 * chartab.c (optimize_sub_char_table): Likewise.
2459
2460 2012-08-16 Chong Yidong <cyd@gnu.org>
2461
2462 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2463
2464 * xfont.c (xfont_open):
2465 * xftfont.c (xftfont_open): Set the font's max_width field.
2466
2467 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2468 min_width to space_width and average_width to the average over
2469 printable ASCII characters.
2470 (ns_char_width): Code cleanup.
2471 (ns_ascii_average_width): New utility function.
2472
2473 * font.h (struct font): Update comments.
2474
2475 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2476
2477 Simple interface to set Lisp_Object fields of character tables.
2478 * lisp.h (CSET): New macro.
2479 (char_table_set_extras, char_table_set_contents)
2480 (sub_char_table_set_contents): New function.
2481 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2482 * syntax.c: Adjust users.
2483
2484 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2485
2486 * eval.c (eval_sub): Bind lexical-binding.
2487 * lread.c (Qlexical_binding): Make non-static.
2488
2489 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2490
2491 * nsmenu.m (popupSession): Remove.
2492 (pop_down_menu): Remove endModalSession.
2493 (timeout_handler:): New method.
2494 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2495 Call runModalForWindow. Check timer_fired when it returns.
2496 If not set, cancel timer and break out of loop.
2497 Otherwise loop again, with a new timeout.
2498
2499 * nsterm.m: Include fcntl.h if present.
2500 (fd_entry, t_readfds, inNsSelect): Remove.
2501 (select_writefds, select_valid, select_timeout, selfds)
2502 (select_mutex, apploopnr): Add.
2503 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2504 Otherwise call kbd_buffer_store_event.
2505 (ns_send_appdefined): Remove release of fd_entry.
2506 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2507 Increment and decrement apploopnr.
2508 (ns_select): If no file descriptors, just do a NSTimer.
2509 Otherwise copy read/write masks and start select thread (fd_handler).
2510 Start main loop and wait for application defined event.
2511 Inform select thread to stop selecting after main loop is exited.
2512 (ns_term_init): Create selfds pipe and set non-blocking.
2513 Initialize select_mutex. Start the select thread (fd_handler).
2514 (fd_handler:): Loop forever, wait for info from the main thread
2515 to either start or stop selecting. When select returns, send
2516 and appdefined event.
2517 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2518 If not call kbd_buffer_store_event.
2519
2520 * nsterm.h (EmacsApp): fd_handler takes id argument.
2521 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2522
2523 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2524
2525 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2526
2527 * region-cache.c (move_cache_gap): Update gap_len using the actual
2528 growth of the boundaries array. Do not change cache_len.
2529 (Bug#12196)
2530
2531 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2532
2533 Generalize and cleanup font subsystem checks.
2534 * font.h (FONT_DEBUG, font_assert): Remove.
2535 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2536 Change font_assert to eassert. Use eassert where appropriate.
2537
2538 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2539
2540 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2541
2542 2012-08-15 Chong Yidong <cyd@gnu.org>
2543
2544 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2545 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2546 extract the font descriptor instead of just the font name.
2547 In that case, return a font spec instead of a string.
2548 (x_last_font_name): Move to this file from xfns.c.
2549
2550 * xfns.c (Fx_select_font): The return value can also be a font
2551 spec. Move x_last_font_name management to gtkutil.c.
2552
2553 * xfaces.c: Make font weight and style symbols non-static.
2554
2555 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2556
2557 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2558 (bug#12117).
2559
2560 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2561
2562 * alloc.c (Fgarbage_collect): Use plural form consistently.
2563
2564 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2565
2566 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2567 iteration through the command loop. Fixes a problem whereby mouse
2568 movements are ignored until the first mouse click.
2569
2570 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2571
2572 Use bool, not int, for Lisp booleans.
2573 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2574 makes Emacs a bit smaller and presumably a bit faster.
2575 * lisp.h: Include <stdbool.h>.
2576 (struct Lisp_Boolfwd, defvar_bool):
2577 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2578 * regex.c [!emacs]: Include <stdbool.h>.
2579 (false, true): Remove; <stdbool.h> does this for us now.
2580
2581 2012-08-14 Chong Yidong <cyd@gnu.org>
2582
2583 * character.c (Fcharacterp): Doc fix (Bug#12076).
2584
2585 * data.c (Findirect_variable): Doc fix (Bug#11040).
2586
2587 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2588
2589 * editfns.c (Fformat): Doc fix (Bug#12059).
2590 (Fsave_current_buffer): Doc fix (Bug#11542).
2591
2592 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2593
2594 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2595 (bug#12022).
2596
2597 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2598
2599 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2600 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2601 * minibuf.c (choose_minibuf_frame, read_minibuf):
2602 * w32fns.c (x_create_tip_frame):
2603 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2604 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2605
2606 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2607
2608 * intervals.c (offset_intervals): Remove obsolete comment.
2609
2610 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2611
2612 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2613
2614 2012-08-14 Gergely Risko <gergely@risko.hu>
2615
2616 * coding.c (decode_coding): Record buffer modification before
2617 disabling undo_list (Bug#11773).
2618
2619 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2620
2621 Revert and cleanup some recent overlay changes.
2622 * buffer.h (enum overlay_type): Remove.
2623 (buffer_get_overlays, buffer_set_overlays): Likewise.
2624 (buffer_set_overlays_before, buffer_set_overlays_after):
2625 New function. Adjust users.
2626 (unchain_both): Add eassert.
2627
2628 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2629
2630 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2631
2632 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2633
2634 * gtkutil.c (xg_mark_data): Don't assume C99.
2635
2636 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2637
2638 * gtkutil.c (xg_frame_tb_info): New struct.
2639 (TB_INFO_KEY): New define.
2640 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2641 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2642 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2643 if not present.
2644 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2645 is up to date. Otherwise store new data.
2646 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2647
2648 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2649
2650 Use KSET for write access to Lisp_Object members of struct kboard.
2651 * keyboard.h (KSET): New macro.
2652 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2653 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2654 * xterm.c: Adjust users.
2655
2656 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2657
2658 Use BSET for write access to Lisp_Object members of struct buffer.
2659 * buffer.h (BSET): New macro.
2660 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2661 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2662 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2663 * window.c, xdisp.c, xfns.c: Adjust users.
2664
2665 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2666
2667 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2668
2669 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2670
2671 * nsterm.m (not_in_argv): New function.
2672 (application:openFile, application:openTempFile:):
2673 (application:openFileWithoutUI:, application:openFiles:): Open file
2674 if not_in_argv returns non-zero (bug#12171).
2675
2676 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2677 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2678 Define for Gtk+ versions less than 3.2.
2679 (xg_get_font_name): Use those functions/macros here.
2680 Reported by Frans Oilinki <moilinki@gmail.com>.
2681
2682 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2683
2684 * unexmacosx.c (copy_data_segment): Copy initialized data in
2685 statically linked libraries from input file rather than memory.
2686
2687 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2688 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2689 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2690
2691 2012-08-10 Glenn Morris <rgm@gnu.org>
2692
2693 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2694 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2695
2696 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2697
2698 Fix last change to allow compilation with low optimization levels.
2699 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2700 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2701
2702 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2703
2704 Use common inline syntax in intervals.h.
2705 * intervals.h (INTERVALS_INLINE): New macro.
2706 Change all users from LISP_INLINE.
2707
2708 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2709
2710 Define Qnone once for all platforms.
2711 * frame.c (Qnone): Define here.
2712 (syms_of_frame): DEFSYM it.
2713 * lisp.h (Qnone): New declaration.
2714 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2715 * xfns.c: Remove duplication. Adjust users.
2716
2717 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2718
2719 Remove unused macros from intervals.h.
2720 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2721 * intervals.c: Adjust comment.
2722
2723 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2724
2725 * w32fns.c <w32_unicode_gui>: New static variable.
2726 (globals_of_w32fns): Initialize it according to os_subtype.
2727 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2728 testing os_subtype.
2729
2730 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2731 Eli Zaretskii <eliz@gnu.org>
2732
2733 Fix bug #10299 with Unicode characters sent by customized
2734 keyboards created by MSKLC.
2735 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2736 (w32_init_class): Use it to initialize the Emacs class with either
2737 ANSI or Unicode API calls.
2738 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2739 later.
2740 (w32_wnd_proc): If the character code sent by WM_CHAR or
2741 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2742 original message. Call DefWindowProcW on NT and later.
2743
2744 2012-08-10 Glenn Morris <rgm@gnu.org>
2745
2746 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2747
2748 * lisp.h (DIRECTORY_SEP): Let configure set it.
2749
2750 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2751
2752 Use TSET for write access to Lisp_Object slots of struct terminal.
2753 * termhooks.h (TSET): New macro.
2754 * coding.c, terminal.c, xselect.c: Adjust users.
2755
2756 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2757
2758 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2759 the failing expression, include them in the error message.
2760 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2761 * lisp.h (internal_condition_case_n): Update declaration.
2762
2763 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2764
2765 Inline functions to examine and change buffer overlays.
2766 * buffer.c (unchain_both): New function.
2767 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2768 (buffer_has_overlays): New function.
2769 (enum overlay_type): New enum.
2770 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2771 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2772
2773 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2774
2775 Inline functions to examine and change buffer intervals.
2776 * alloc.c (mark_interval_tree): Remove.
2777 (MARK_INTERVAL_TREE): Simplify.
2778 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2779 * intervals.c (buffer_balance_intervals): New function.
2780 (graft_intervals_into_buffer): Adjust indentation.
2781 (set_intervals_multibyte): Simplify.
2782 * buffer.h (BUF_INTERVALS): Remove.
2783 (buffer_get_intervals, buffer_set_intervals): New function.
2784 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2785 * intervals.c, textprop.c: Adjust users.
2786
2787 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2788
2789 Inline functions to examine and change string intervals.
2790 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2791 (string_get_intervals, string_set_intervals): New function.
2792 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2793 * lread.c, print.c, textprop.c: Adjust users.
2794
2795 2012-08-08 Glenn Morris <rgm@gnu.org>
2796
2797 * lisp.mk (lisp): Remove language/persian.elc.
2798
2799 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2800
2801 Cleanup intervals.
2802 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2803 (NULL_INTERVAL_P): Likewise. Adjust users.
2804 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2805 Adjust comment. Move under #if 0.
2806 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2807 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2808
2809 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2810
2811 Check total length of intervals with eassert.
2812 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2813 * intervals.c: Change all users to eassert.
2814
2815 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2816
2817 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2818 Rename fields to match removal of FGET and WGET and disuse of
2819 INTERNAL_FIELD in Lisp_Cons.
2820
2821 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2822
2823 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2824 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2825 name since all xname users are fixed long time ago. Do not
2826 use INTERNAL_FIELD.
2827 (set_symbol_name, set_symbol_function, set_symbol_plist):
2828 (set_symbol_next, set_overlay_plist): New function.
2829 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2830 (struct Lisp_Overlay): Likewise.
2831 (CVAR, MVAR, SVAR): Remove.
2832 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2833 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2834 * xterm.c: Adjust users.
2835 * .gdbinit: Change to use name field of struct Lisp_Symbol
2836 where appropriate.
2837
2838 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2839
2840 Basic functions to set Lisp_Object and pointer slots of intervals.
2841 * intervals.h (interval_set_parent, interval_set_object):
2842 (interval_set_left, interval_set_right, interval_set_plist):
2843 (interval_copy_parent): New function.
2844 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2845 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2846 Adjust indentation.
2847 (INTERVAL_SIZE): Remove. Adjust users.
2848 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2849
2850 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2851
2852 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2853 * process.h (PGET): Remove.
2854 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2855 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2856
2857 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2858
2859 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2860 * window.h (WGET): Remove.
2861 (struct window): Do not use INTERNAL_FIELD.
2862 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2863 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2864 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2865 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2866 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2867 Adjust users.
2868
2869 2012-08-07 Chong Yidong <cyd@gnu.org>
2870
2871 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2872 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2873 (Fdelete_window_internal): Signal an error if the window is not on
2874 a live frame (Bug#12025).
2875
2876 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2877
2878 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2879 * frame.h (FGET): Remove.
2880 (struct frame): Do not use INTERNAL_FIELD.
2881 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2882 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2883 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2884 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2885
2886 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2887
2888 * w32.c: Silence compiler warnings.
2889 (map_w32_filename): Remove unused variable `is_fat'.
2890 (chase_symlinks): Add parentheses around expression.
2891
2892 2012-08-06 Glenn Morris <rgm@gnu.org>
2893
2894 * sysdep.c: Respect BROKEN_GETWD.
2895
2896 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2897 Let configure handle it.
2898 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2899
2900 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2901
2902 Use GCALIGNMENT where appropriate.
2903 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2904 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2905 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2906
2907 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2908
2909 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2910 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2911
2912 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2913
2914 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2915 that should be sufficient for everyone.
2916
2917 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2918
2919 * keyboard.c (timer_check_2): Add break so timer_check returns next
2920 timeout.
2921
2922 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2923
2924 Fix Windows build errors introduced after converting to WGET and WSET.
2925 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2926 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2927
2928 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2929
2930 * nsterm.m (ns_frame_rehighlight): Use FSET.
2931
2932 * nsmenu.m (ns_update_menubar): Use FSET.
2933
2934 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2935
2936 Separate read and write access to Lisp_Object slots of Lisp_Process.
2937 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2938 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2939
2940 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2941
2942 Separate read and write access to Lisp_Object slots of struct window.
2943 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2944 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2945 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2946 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2947 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2948 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2949 Adjust users.
2950
2951 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2952
2953 Fix Windows build errors introduced after converting to FGET and FSET.
2954 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2955 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2956 (w32_judge_scroll_bars): Change to use FSET.
2957 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2958
2959 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2960
2961 Fix replacement typo.
2962 * window.c (replace_window): Set root_window instead of
2963 selected_window. This fixes a total window subsystem
2964 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2965
2966 2012-08-06 Glenn Morris <rgm@gnu.org>
2967
2968 * lisp.mk (lisp): Add language/persian.elc.
2969
2970 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2971
2972 Separate read and write access to Lisp_Object slots of struct frame.
2973 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2974 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2975 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2976 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2977 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2978
2979 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2980
2981 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2982
2983 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2984
2985 Generalize common compile-time constants.
2986 * lisp.h (header_size, bool_header_size, word_size): Now here.
2987 (struct Lisp_Vector): Add comment.
2988 (struct Lisp_Bool_Vector): Move up to define handy constants.
2989 (VECSIZE, PSEUDOVECSIZE): Simplify.
2990 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2991 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2992 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2993 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2994 * xfont.c, xmenu.c: Use word_size where appropriate.
2995
2996 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2997
2998 * search.c (Freplace_match): Treat \? in the replacement text
2999 literally (Bug#8161).
3000
3001 2012-08-05 Chong Yidong <cyd@gnu.org>
3002
3003 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3004 * frame.c (Vdelete_frame_functions):
3005 * emacs.c (Vkill_emacs_hook): Doc fix.
3006
3007 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3008
3009 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3010 --with-x-toolkit=no builds.
3011 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3012
3013 2012-08-04 Chong Yidong <cyd@gnu.org>
3014
3015 * syntax.c (Fmodify_syntax_entry): Doc fix.
3016
3017 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3018
3019 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3020 * w32.c (init_environment): Change the default values of many
3021 environment variables in dflt_envvars[] to NULL, to avoid pushing
3022 them into environment when they were not already defined.
3023 Remove the code that deletes site-lisp subdirectories from the default
3024 value of EMACSLOADPATH, as it is no longer needed.
3025 (check_windows_init_file): Now external, not static.
3026 Use Vload_path as is, without adding anything, as this function is now
3027 called when Vload_path is already set up.
3028
3029 * w32.h (check_windows_init_file): Add prototype.
3030
3031 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3032 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3033 compatibility with Posix platforms.
3034 (main): Move the call to check_windows_init_file to here from
3035 w32.c.
3036 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3037 any, in the DEFALT argument into the root of the Emacs build or
3038 installation tree, as appropriate.
3039
3040 * callproc.c (init_callproc_1): Call decode_env_path instead of
3041 doing its equivalent by hand.
3042 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3043 the code that sets Vexec_path run on MS-Windows.
3044
3045 * lread.c (init_lread): Add comments to #ifdef's.
3046
3047 * msdos.c (dos_set_window_size, IT_update_begin)
3048 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3049 instead of direct references.
3050
3051 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3052
3053 Export DEFAULT_REHASH_* to GDB.
3054 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3055 Now constants, not macros.
3056
3057 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3058
3059 Remove unnecessary casts involving pointers.
3060 These casts are no longer needed now that we assume C89 or later,
3061 since they involve casting to or from void *.
3062 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3063 (make_pure_float, make_pure_vector):
3064 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3065 * macros.c (Fstart_kbd_macro):
3066 * menu.c (find_and_return_menu_selection):
3067 * minibuf.c (read_minibuf_noninteractive):
3068 * sysdep.c (closedir):
3069 * xdisp.c (x_produce_glyphs):
3070 * xfaces.c (compare_fonts_by_sort_order):
3071 * xfns.c (x_real_positions, select_visual):
3072 * xselect.c (x_stop_queuing_selection_requests)
3073 (x_get_window_property, x_get_window_property_as_lisp_data):
3074 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3075 Remove unnecessary pointer casts.
3076 * alloc.c (record_xmalloc): New function.
3077 * lisp.h (record_xmalloc): New decl.
3078 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3079 more like a function. This is because the pointer cast is not
3080 needed. All uses changed.
3081 * print.c (print_string, print_error_message): Avoid length recalc.
3082
3083 Improve fix for macroexp crash with debugging (Bug#12118).
3084 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3085 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3086 not supposed to be invoked from the garbage collector.
3087 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3088 (gc_aset): New function, which is like ASET but can be
3089 used in the garbage collector.
3090 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3091 (set_hash_index): Use it instead of ASET.
3092
3093 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3094
3095 Support symlinks on latest versions of MS-Windows.
3096 * w32.c: Include winioctl.h and aclapi.h.
3097 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3098 (revert_to_self): Forward declarations of static functions.
3099 <static BOOL g_b_init_get_security_info>:
3100 <g_b_init_create_symbolic_link>: New static flags.
3101 (globals_of_w32): Initialize them to zero.
3102 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3103 (map_w32_filename): Improve commentary. Simplify switch.
3104 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3105 headers (most versions of MinGW w32api don't).
3106 (get_security_info, create_symbolic_link)
3107 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3108 New functions.
3109 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3110 in the argument file name.
3111 (sys_access): Call unc_volume_file_attributes only if
3112 GetFileAttributes fails with network-related error codes.
3113 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3114 have the required privileges.
3115 (get_file_security_desc_by_name): Rename from
3116 get_file_security_desc.
3117 (stat_worker): New function, with most of the guts of 'stat', and
3118 with addition of handling of symlinks and support for 'lstat'.
3119 If possible, get file's attributes and security information by
3120 handle, not by name. Produce S_IFLNK bit for symlinks, when
3121 called from 'lstat'.
3122 (stat, lstat): New functions, call 'stat_worker'.
3123 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3124 symlinks when the underlying filesystem supports them.
3125
3126 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3127
3128 Fix macroexp crash on Windows with debugging (Bug#12118).
3129 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3130 checking subscripts; problem introduced with the recent
3131 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3132 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3133 since it's used in non-static inline functions now.
3134
3135 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3136 Don't assume buffer size fits in 'int'. Remove unused local.
3137
3138 Use C99-style 'extern inline' if available.
3139 * buffer.h (BUFFER_INLINE):
3140 * category.h (CATEGORY_INLINE):
3141 * character.h (CHARACTER_INLINE):
3142 * charset.h (CHARSET_INLINE):
3143 * composite.h (COMPOSITE_INLINE):
3144 * dispextern.h (DISPEXTERN_INLINE):
3145 * lisp.h (LISP_INLINE):
3146 * systime.h (SYSTIME_INLINE):
3147 New macro, replacing 'static inline' in this header.
3148 * buffer.h, category.h, character.h, charset.h, composite.h:
3149 * dispextern.h, lisp.h, systime.h:
3150 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3151 * alloc.c (LISP_INLINE):
3152 * buffer.c (BUFFER_INLINE):
3153 * category.c (CATEGORY_INLINE):
3154 * character.c (CHARACTER_INLINE):
3155 * charset.c (CHARSET_INLINE):
3156 * composite.c (COMPOSITE_INLINE):
3157 * dispnew.c (DISPEXTERN_INLINE):
3158 * sysdep.c (SYSTIME_INLINE):
3159 Define to EXTERN_INLINE, so that the corresponding functions
3160 are compiled into code.
3161 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3162 (INLINE_HEADER_END): New macros.
3163 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3164 since it's used in non-static inline functions now.
3165 (VALMASK) [!USE_LSB_TAG]: Likewise.
3166
3167 2012-08-02 Glenn Morris <rgm@gnu.org>
3168
3169 * s/: Remove empty directory.
3170
3171 * s/ms-w32.h: Move to ../nt/inc.
3172 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3173 Update for new ms-w32.h location.
3174
3175 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3176
3177 Port to Solaris 8.
3178 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3179
3180 2012-08-02 Glenn Morris <rgm@gnu.org>
3181
3182 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3183 hard-coding the path separator.
3184
3185 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3186
3187 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3188 This how ASET and AREF are supposed to work, and makes
3189 it easier to think about future improvements. See
3190 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3191 * charset.h (set_charset_attr): New function.
3192 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3193 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3194 (aref_addr): New function. All uses of &AREF(...) changed.
3195 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3196 (set_hash_index): New functions. All lvalue-style uses of
3197 HASH_KEY etc. changed.
3198 * keyboard.c (set_prop): New function. All lvalue-style uses
3199 of PROP changed.
3200
3201 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3202
3203 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3204 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3205 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3206 * nsfns.m (ns_set_name_as_filename): Likewise.
3207 * nsmenu.m (ns_update_menubar): Likewise.
3208 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3209
3210 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3211
3212 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3213 Adapt to latest changes in field names of the corresponding Lisp
3214 objects.
3215
3216 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3217
3218 2012-08-01 Glenn Morris <rgm@gnu.org>
3219
3220 * s/msdos.h: Remove file.
3221 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3222 * Makefile.in (S_FILE): Remove.
3223 (config_h): Remove S_FILE.
3224
3225 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3226
3227 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3228 Remove; moved to nt/config.nt.
3229
3230 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3231
3232 Use INTERNAL_FIELD for conses and overlays.
3233 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3234 Remove obsolete comment.
3235 (MVAR): New macro.
3236 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3237 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3238
3239 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3240
3241 Use INTERNAL_FIELD for symbols.
3242 * lisp.h (SVAR): New macro. Adjust users.
3243 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3244 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3245
3246 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3247
3248 Use INTERNAL_FIELD for processes.
3249 * process.h (PVAR): New macro. Adjust style.
3250 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3251 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3252
3253 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3254
3255 Use INTERNAL_FIELD for windows.
3256 * window.h (WVAR): New macro.
3257 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3258 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3259 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3260 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3261 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3262 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3263
3264 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3265
3266 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3267
3268 2012-08-01 Glenn Morris <rgm@gnu.org>
3269
3270 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3271 Move to configure.ac.
3272
3273 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3274
3275 * makefile.w32-in (CONFIG_H): Update dependencies.
3276 (CONF_POST_H): New macro.
3277
3278 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3279
3280 2012-07-31 Glenn Morris <rgm@gnu.org>
3281
3282 * Makefile.in (S_FILE): No longer set by configure.
3283
3284 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3285 is available.
3286 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3287
3288 * process.h (NULL_DEVICE):
3289 * emacs.c (SEPCHAR):
3290 * editfns.c (USER_FULL_NAME): Let configure set them.
3291
3292 * s/README, s/template.h: Remove files.
3293
3294 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3295
3296 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3297 Move to configure.ac.
3298
3299 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3300
3301 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3302 resulting renaming of 'struct frame' members.
3303
3304 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3305
3306 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3307 after introduction of FVAR.
3308
3309 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3310
3311 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3312
3313 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3314 instead of compositeToPoint.
3315 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3316
3317 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3318
3319 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3320
3321 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3322 * lisp.h (INTERNAL_FIELD): New macro.
3323 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3324 (BVAR): Change to use INTERNAL_FIELD.
3325 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3326 (KVAR): Change to use INTERNAL_FIELD.
3327 * frame.h (FVAR): New macro.
3328 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3329 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3330 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3331 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3332 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3333
3334 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3335
3336 Miscellaneous fixes for non-default X toolkits.
3337 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3338 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3339 Move under #ifdef USE_LUCID.
3340 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3341 definition and usage to avoid warnings.
3342
3343 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3344
3345 * nsterm.m (openFiles): Fix previous checkin.
3346
3347 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3348
3349 * indent.c (compute_motion): Remove unused local.
3350
3351 2012-07-31 Glenn Morris <rgm@gnu.org>
3352
3353 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3354
3355 * conf_post.h [USG5_4]:
3356 Move remaining contents of s/usg5-4-common.h here.
3357 * s/usg5-4-common.h: Remove file.
3358
3359 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3360 * s/irix6-5.h: Remove file.
3361
3362 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3363 * s/darwin.h: Remove file.
3364
3365 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3366 * s/hpux10-20.h: Remove file, which is now empty.
3367
3368 2012-07-30 Glenn Morris <rgm@gnu.org>
3369
3370 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3371 * Makefile.in (config_h): Add conf_post.h.
3372 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3373
3374 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3375
3376 * nsterm.m (ns_do_open_file): New variable.
3377 (ns_term_init): Set ns_do_open_file to YES after run returns.
3378 (openFile, openTempFile, openFileWithoutUI, openFiles):
3379 Open files only if ns_do_open_file.
3380
3381 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3382
3383 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3384 This no-op macro hasn't been needed for many years.
3385 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3386
3387 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3388 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3389 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3390 gdb_make_enums_visible.
3391 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3392 (DIRECTORY_SEP): Now a constant, not a macro.
3393
3394 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3395
3396 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3397 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3398
3399 * w32term.c <w32_keyboard_codepage>: Renamed from
3400 keyboard_codepage and now external. All users changed.
3401
3402 * w32term.h: Add declaration of w32_keyboard_codepage.
3403
3404 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3405 the codepage to translate keys to Unicode. If this argument is
3406 -1, use the value returned by GetConsoleCP. All callers changed.
3407
3408 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3409
3410 Update .PHONY listings in makefiles.
3411 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3412 bootstrap-clean, distclean, maintainer-clean, versioclean,
3413 extraclean, frc.
3414
3415 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3416 This is a bit clearer. Fix some commentary typos.
3417
3418 2012-07-30 Glenn Morris <rgm@gnu.org>
3419
3420 * s/netbsd.h: Let configure include signal.h if needed.
3421 Remove file, which is now empty.
3422
3423 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3424 Let configure set them.
3425 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3426 No more need to undefine.
3427
3428 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3429
3430 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3431 non-single-byte char when adding meta modifier. (Bug#12090)
3432
3433 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3434
3435 Convert safe_call to use variable number of arguments.
3436 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3437 (safe_call2): Fix comment.
3438 * lisp.h (safe_call): Adjust prototype.
3439 * coding.c (encode_coding_object): Change to use safe_call2.
3440 * xfaces.c (merge_face_heights): Change to use safe_call1.
3441
3442 2012-07-30 Glenn Morris <rgm@gnu.org>
3443
3444 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3445 does that unconditionally. Remove file, which is now empty.
3446
3447 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3448 Remove empty files.
3449
3450 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3451
3452 Export to GDB most of lisp.h's remaining object-like macros.
3453 * lisp.h (min, max): Move earlier, because they're used earlier now.
3454 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3455 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3456 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3457 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3458 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3459 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3460 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3461 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3462 Now constants, for GDB. They need not be macros.
3463 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3464 Now constants, for GDB, as well as macros, for static initializers.
3465 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3466 Move to after the definition of struct Lisp_Char_Table,
3467 since the former now needs that type defined.
3468 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3469 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3470 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3471 New enums, for gdb_make_enums_visible.
3472 (GLYPH_MODE_LINE_FACE): Remove; unused.
3473 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3474 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3475 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3476 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3477 enum maxargs, enum MAX_ALLOCA.
3478 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3479 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3480 no longer needed, now that they are done in lisp.h.
3481
3482 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3483
3484 Cleanup string bytes checking.
3485 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3486 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3487 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3488 (check_sblock, compact_small_strings): Simplify.
3489
3490 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3491
3492 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3493 These macros are confusing and no longer need to be defined, as
3494 the enum values now suffice. All uses replaced with definiens.
3495 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3496
3497 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3498
3499 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3500 ($(BLD)/w32console.$(O)): Update dependencies.
3501
3502 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3503
3504 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3505 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3506 time. Adjust users.
3507 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3508
3509 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3510
3511 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3512 setting sitelisp (Bug#12010).
3513
3514 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3515
3516 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3517
3518 * w32heap.c (cache_system_info):
3519 * w32.c (sys_rename):
3520 * w32proc.c (find_child_console, sys_kill): All users changed.
3521
3522 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3523
3524 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3525
3526 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3527
3528 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3529
3530 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3531
3532 Cleanup statistics calculation in Fgarbage_collect.
3533 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3534 Fix zombies percentage calculation. Simplify elapsed time calculation.
3535
3536 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3537
3538 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3539 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3540 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3541 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3542 (replace_range, replace_range_2, del_range_2): Change to eassert.
3543 * marker.c (byte_char_debug_check): Adjust style.
3544
3545 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3546
3547 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3548 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3549 long-ago-commented-out code that talks about "WIN32".
3550 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3551 All uses changed.
3552
3553 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3554
3555 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3556 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3557 Simplify by using alignof.
3558 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3559 * lisp.h: Include <stdalign.h>.
3560 (GCALIGNMENT): New macro and constant.
3561 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3562 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3563 (stdalign): New macro, if not already defined.
3564
3565 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3566
3567 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3568 * w32inevt.c: Include w32inevt.h.
3569 (w32_read_console_input): New inline function, calls either
3570 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3571 w32_console_unicode_input.
3572 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3573 (w32_kbd_patch_key, key_event): Use the codepage returned by
3574 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3575 (key_event): use uChar.UnicodeChar only if
3576 w32_console_unicode_input is non-zero.
3577
3578 * w32console.c: Include w32heap.h.
3579 <w32_console_unicode_input>: New global variable.
3580 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3581 family of Windows, zero otherwise.
3582
3583 * w32inevt.h: Declare w32_console_unicode_input.
3584
3585 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3586 --without-x. (Bug#11742)
3587
3588 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3589
3590 Adjust GDB to reflect pvec_type changes (Bug#12036).
3591 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3592 2012-07-04 changes to pseudovector representation.
3593 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3594
3595 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3596
3597 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3598 bus address.
3599 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3600
3601 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3602
3603 * alloc.c (listn): Fix the order the arguments are consed onto the
3604 list.
3605
3606 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3607 enumeration constants, as PURE and HEAP are too general, and clash
3608 with other headers and sources, such as gmalloc.c and the
3609 MS-Windows system headers. All users changed.
3610
3611 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3612
3613 Revert last save_excursion_save and save_excursion_restore changes.
3614 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3615 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3616
3617 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3618
3619 Fix recently-introduced typos in Windows port.
3620 Reported by Martin Rudalics <rudalics@gmx.at>.
3621 * w32.c (init_environment): Replace comma with semicolon.
3622 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3623
3624 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3625
3626 Improve GDB symbol export (Bug#12036).
3627 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3628 arms of an 'if', not using conditional expressions; otherwise GDB
3629 complains about the types in the unevaluated arm when the argument
3630 is an integer literal.
3631 (xgetint): Simplify expression.
3632 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3633 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3634 Zaretskii in <http://bugs.gnu.org/12036#13>.
3635 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3636 needed now that we have gdb_make_enums_visible.
3637 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3638 (enum enum_USE_LSB_TAG):
3639 New enum types, packaging up enums that need to be exported to GDB.
3640
3641 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3642
3643 Utility function to make a list from specified amount of objects.
3644 * lisp.h (enum constype): New datatype.
3645 (listn): New prototype.
3646 * alloc.c (listn): New function.
3647 (Fmemory_use_count, syms_of_alloc): Use it.
3648 * buffer.c (syms_of_buffer): Likewise.
3649 * callint.c (syms_of_callint): Likewise.
3650 * charset.c (define_charset_internal): Likewise.
3651 * coding.c (syms_of_coding): Likewise.
3652 * keymap.c (syms_of_keymap): Likewise.
3653 * search.c (syms_of_search): Likewise.
3654 * syntax.c (syms_of_syntax): Likewise.
3655 * w32.c (init_environment): Likewise.
3656 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3657 * xdisp.c (syms_of_xdisp): Likewise.
3658 * xfns.c (syms_of_xfns): Likewise.
3659
3660 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3661
3662 Fast save_excursion_save and save_excursion_restore.
3663 * lisp.h (struct Lisp_Excursion): New data type.
3664 (PVEC_EXCURSION): New pseudovector type.
3665 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3666 to deal with it. Adjust comments.
3667 (init_marker, attach_marker): New prototype.
3668 (unchain_marker): Adjust prototype.
3669 * marker.c (attach_marker): Change to global.
3670 (init_marker): New function.
3671 * alloc.c (Fmake_marker, build_marker): Use it.
3672 (build_marker): More easserts.
3673 (mark_object): Handle struct Lisp_Excursion.
3674 * editfns.c (save_excursion_save, save_excursion_restore):
3675 Reimplement to use struct Lisp_Excursion. Add comments.
3676
3677 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3678
3679 Fix export of symbols to GDB (Bug#12036).
3680 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3681 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3682 emacs.c, as this is a more-suitable home. Had this been done earlier
3683 the fix for 12036 would have avoided some of the problems noted in
3684 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3685 would have been more obvious.
3686 * emacs.c: Do not include <verify.h>; no longer needed.
3687 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3688 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3689 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3690 Remove; now done in lisp.h.
3691 * lisp.h (PUBLISH_TO_GDB): New macro.
3692 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3693 (DATA_SEG_BITS): Use it.
3694 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3695 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3696 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3697 not be usable in #if. This simplifies things.
3698
3699 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3700
3701 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3702
3703 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3704
3705 Simplify export of symbols to GDB (Bug#12036).
3706 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3707 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3708 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3709 Adjust to changes in lisp.h and emacs.c, by using
3710 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3711 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3712 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3713 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3714 instead of gdb_valbits.
3715 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3716 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3717 instead of gdb_array_mark_flag.
3718 (xboolvector): Get size from $->size, not $->header.size.
3719 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3720 (xreload, hook-run, hookpost-run): Remove.
3721 * emacs.c: Include <verify.h>.
3722 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3723 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3724 Remove.
3725 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3726 (gdb_USE_LSB_TAG): New enum constants.
3727 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3728 Also define these as enum constants, so they're visible to GDB.
3729 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3730 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3731 as constants, so they're visible to GDB.
3732 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3733 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3734 Now enum constants, not macros, so they're visible to GDB.
3735 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3736 more convenient now. All uses changed.
3737 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3738 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3739
3740 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3741
3742 Explicitly free restriction data that are not needed anymore.
3743 * editfns.c (save_restriction_restore): Free restriction data.
3744
3745 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3746
3747 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3748 add argument, tune behavior, and adjust all callers.
3749
3750 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3751
3752 Use typedef for EMACS_INT, EMACS_UINT.
3753 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3754 than macros. This simplifies debugging in the usual case, since
3755 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3756 and it allows expressions involving EMACS_INT casts.
3757 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3758
3759 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3760
3761 * nsterm.m (ns_read_socket): Return early if there is a modal
3762 window (Bug#12043).
3763
3764 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3765
3766 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3767 that FOCUS-FRAME can be omitted.
3768
3769 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3770
3771 Adjust buffer text indirection counters at the end of Fkill_buffer.
3772 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3773 buffer is definitely dead. This should really fix an issue reported
3774 by Christoph Scholtes again. (Bug#12007).
3775 (init_buffer_once): Initialize indirection counters of
3776 buffer_defaults and buffer_local_symbols (for sanity and safety).
3777
3778 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3779
3780 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3781 and continuation glyphs on tooltip frames, leave them at zero.
3782 Avoids continued lines in tooltips. (Bug#11832)
3783
3784 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3785
3786 Simplify copy_overlay.
3787 * buffer.c (copy_overlay): Simplify. Use build_marker.
3788 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3789
3790 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3791
3792 * print.c (print_object): Don't crash when a frame's name is nil
3793 or invalid. (Bug#12025)
3794
3795 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3796 it signals an error when a tooltip frame is being created.
3797
3798 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3799
3800 Cleanup miscellaneous objects allocation and initialization.
3801 * alloc.c (allocate_misc): Change to static. Add argument to
3802 specify the subtype. Adjust comment and users.
3803 (build_overlay): New function.
3804 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3805 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3806 (allocate_misc): Remove prototype.
3807 (build_overlay): Add prototype.
3808
3809 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3810
3811 Swap buffer text indirection counters in Fbuffer_swap_text.
3812 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3813 This avoids crash reported by Christoph Scholtes at
3814 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3815
3816 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3817
3818 * nsmenu.m (Popdown_data): New struct.
3819 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3820 free Popdown_data.
3821 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3822 (initWithContentRect): Make imgView and contentView non-static
3823 and autorelease them. Also autorelease img and matrix (Bug#12005).
3824 (dealloc): Remove (Bug#12005).
3825
3826 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3827
3828 Adjust consing_since_gc when objects are explicitly freed.
3829 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3830 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3831 (free_cons, free_misc): Subtract object size from consing_since_gc.
3832
3833 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3834
3835 Simplify and cleanup markers positioning code.
3836 * marker.c (attach_marker): More useful eassert.
3837 (live_buffer, set_marker_internal): New function.
3838 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3839 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3840
3841 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3842
3843 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3844 as it's limited by the amount of memory, not by INT_MAX.
3845
3846 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3847
3848 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3849 in special-event-map. See the discussion at
3850 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3851 for the reasons.
3852
3853 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3854 info.dwItemData. Fixes crashes on 64-bit Windows.
3855 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3856
3857 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3858
3859 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3860 (conversationIdentifier): Return value is NSInteger.
3861 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3862
3863 2012-07-21 Chong Yidong <cyd@gnu.org>
3864
3865 * window.c (decode_any_window): Signal an error if the window is
3866 on a dead frame (Bug#11984).
3867
3868 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3869
3870 Add indirection counting to speed up Fkill_buffer.
3871 * buffer.h (struct buffer): New member.
3872 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3873 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3874 base buffer indirection counter.
3875 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3876 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3877 through buffer list if indirection counter is 0.
3878
3879 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3880
3881 Extend the value returned by Fgarbage_collect with heap statistics.
3882 * alloc.c (Qheap): New symbol.
3883 (syms_of_alloc): DEFSYM it.
3884 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3885 (Fmemory_free): Remove.
3886 (syms_of_alloc): Don't defsubr it.
3887 * buffer.c (Fcompact_buffer): Remove.
3888 (syms_of_buffer): Don't defsubr it.
3889
3890 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3891
3892 Make maybe_gc inline.
3893 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3894 * lisp.h (consing_since_gc, gc_relative_threshold)
3895 (memory_full_cons_threshold): Revert declaration.
3896 (maybe_gc): Remove prototype, define as inline.
3897 * alloc.c: Remove old commented-out code.
3898 (consing_since_gc, gc_relative_threshold)
3899 (memory_full_cons_threshold): Revert to global.
3900 (maybe_gc): Remove.
3901
3902 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3903
3904 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3905 * lisp.h (build_unibyte_string): New function.
3906 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3907 * sysdep.c, w32fns.c, xfns.c: Use it.
3908 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3909 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3910 Adjust users accordingly.
3911 * font.h (font_open_by_name): Adjust prototype.
3912
3913 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3914
3915 Cleanup calls to Fgarbage_collect.
3916 * lisp.h (maybe_gc): New prototype.
3917 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3918 Remove declarations.
3919 * alloc.c (maybe_gc): New function.
3920 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3921 Make them static.
3922 * bytecode.c (MAYBE_GC): Use maybe_gc.
3923 * eval.c (eval_sub, Ffuncall): Likewise.
3924 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3925 to avoid dependency from auto-save feature.
3926
3927 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3928
3929 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3930 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3931 'for_each_per_buffer_object_at'.
3932 All uses changed. It's better to use upper-case for macros that
3933 cannot be implemented as functions, to give the reader a clue
3934 that they're special.
3935
3936 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3937
3938 * alloc.c (Fgarbage_collect): Tweak docstring.
3939
3940 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3941
3942 Tweak the value returned from Fgarbage_collect again.
3943 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3944 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3945 Adjust documentation.
3946 (total_vector_bytes): Rename to total_vector_slots, adjust
3947 accounting.
3948 (total_free_vector_bytes): Rename to total_free_vector_slots,
3949 adjust accounting.
3950 (Qstring_bytes, Qvector_slots): New symbols.
3951 (syms_of_alloc): DEFSYM them.
3952
3953 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3954
3955 Buffer compaction primitive which may be used from Lisp.
3956 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3957 (syms_of_buffer): Register Fcompact_buffer.
3958 * alloc.c (Fgarbage_collect): Use compact_buffer.
3959 * buffer.h (compact_buffer): New prototype.
3960 (struct buffer_text): New member.
3961
3962 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3963
3964 New macro to iterate over all buffers, miscellaneous cleanups.
3965 * lisp.h (all_buffers): Remove declaration.
3966 * buffer.h (all_buffers): Add declaration, with comment.
3967 (for_each_buffer): New macro.
3968 * alloc.c (Fgarbage_collect, mark_object): Use it.
3969 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3970 (init_buffer): Likewise.
3971 * data.c (Fset_default): Likewise.
3972 * coding.c (code_conversion_restore): Remove redundant check
3973 for dead buffer.
3974 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3975
3976 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3977
3978 Fix bug that created negative-length intervals.
3979 * intervals.c (merge_interval_right, merge_interval_left):
3980 Do not zero out this interval if it is absorbed by its children,
3981 as this interval's total length doesn't change in that case. See
3982 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3983
3984 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3985
3986 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3987 when invoking (make-bool-vector N t) and N is a positive
3988 multiple of 8 -- the last 8 bits were mistakenly cleared.
3989
3990 Remove some struct layout assumptions in bool vectors.
3991 * alloc.c (bool_header_size): New constant.
3992 (header_size, word_size): Move earlier, as they're now used earlier.
3993 Use 'word_size' in a few more places, where it's appropriate.
3994 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3995 padding before the data member of a bool vector.
3996 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3997 than doing the check by hand with an abort ().
3998
3999 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4000
4001 * eval.c (Fdefvar): Don't check constants since we only set the var if
4002 it's not yet defined anyway (bug#11904).
4003
4004 * lisp.h (last_undo_boundary): Declare new var.
4005 * keyboard.c (command_loop_1): Set it.
4006 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4007 were auto-added by the command loop (bug#11774).
4008
4009 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4010
4011 * w32font.c (Qsymbol): Remove local definition.
4012 (syms_of_w32font): Don't DEFSYM it.
4013
4014 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4015
4016 Fix sweep_vectors to handle large bool vectors correctly.
4017 * alloc.c (sweep_vectors): Account total_vector_bytes for
4018 bool vectors larger than VBLOCK_BYTES_MAX.
4019
4020 2012-07-18 Chong Yidong <cyd@gnu.org>
4021
4022 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4023 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4024
4025 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4026
4027 Return more descriptive data from Fgarbage_collect.
4028 Suggested by Stefan Monnier in
4029 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4030 * alloc.c (bounded_number): New function.
4031 (total_buffers, total_vectors): New variable.
4032 (total_string_size): Rename to total_string_bytes, adjust users.
4033 (total_vector_size): Rename to total_vector_bytes, adjust users.
4034 (sweep_vectors): Account total_vectors and total_vector_bytes.
4035 (Fgarbage_collect): New return value. Adjust documentation.
4036 (gc_sweep): Account total_buffers.
4037 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4038 (VECTOR_SIZE): Remove.
4039 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4040 (Qinterval, Qmisc): New symbols.
4041 (syms_of_data): Initialize them.
4042 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4043 (Qcons, Qbuffer): New declarations.
4044
4045 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4046
4047 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4048 Round up, not down. Improve doc.
4049
4050 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4051
4052 Restore old code in allocate_string_data to avoid Faset breakage.
4053 Reported by Julien Danjou <julien@danjou.info> in
4054 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4055 * alloc.c (allocate_string_data): Restore old code with minor
4056 adjustments, fix comment to explain this subtle issue.
4057
4058 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4059
4060 Remove FILE_SYSTEM_CASE.
4061 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4062
4063 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4064 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4065 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4066 call-process-region passes it through expand-file-name.
4067
4068 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4069
4070 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4071
4072 Fix crash when creating indirect buffer (Bug#11917)
4073 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4074 Don't handle unbound variables specially if non-zero.
4075 (Fbuffer_local_variables): Pass zero.
4076 (clone_per_buffer_values): Pass non-zero.
4077
4078 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4079
4080 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4081 to make the loop interruptible.
4082
4083 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4084
4085 * gnutls.c (emacs_gnutls_handshake): Only retry if
4086 GNUTLS_E_INTERRUPTED.
4087
4088 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4089
4090 Cleanup and convert miscellaneous checks to eassert.
4091 * alloc.c (mark_interval): Fix comment, partially rephrase
4092 old comment from intervals.h (see below).
4093 * intervals.c (find_interval, adjust_intervals_for_insertion)
4094 (delete_interval, adjust_intervals_for_deletion)
4095 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4096 Convert to eassert.
4097 (adjust_intervals_for_insertion, make_new_interval):
4098 Remove obsolete and unused code.
4099 * intervals.h (struct interval): Remove obsolete comment.
4100 * textprotp.c (erase_properties): Remove unused code.
4101 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4102 (Fremove_list_of_text_properties): Convert to eassert.
4103
4104 2012-07-17 Chong Yidong <cyd@gnu.org>
4105
4106 * editfns.c (Finsert_char): Doc fix.
4107
4108 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4109
4110 Fix previous change to make Fmemory_free always accurate.
4111 * alloc.c (make_interval): Update total_free_intervals.
4112 (make_float): Likewise for total_free_floats.
4113 (free_cons, Fcons): Likewise for total_free_conses.
4114 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4115 Likewise for total_free_vector_bytes.
4116 (Fmake_symbol): Likewise for total_free_symbols.
4117 (bytes_free): Remove.
4118
4119 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4120
4121 Simple free memory accounting feature.
4122 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4123 (sweep_vectors): Accumulate size of free vectors.
4124 (Fgarbage_collect): Setup bytes_free.
4125 (Fmemory_free): New function.
4126 (syms_of_alloc): Register it.
4127
4128 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4129
4130 Cleanup overlays checking.
4131 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4132 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4133 eassert and OVERLAYP.
4134 (sort_overlays): Change to use OVERLAYP.
4135
4136 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4137
4138 * editfns.c (Finsert_char): Make it interactive, and make the
4139 second arg optional. Copy interactive spec and docstring from
4140 ucs-insert.
4141
4142 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4143
4144 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4145 Unlike the other wrapped functions, fabs has an unspecified
4146 effect on errno.
4147
4148 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4149
4150 * nsterm.m (keyDown): Interpret flags without left/right bits
4151 as the left key (Bug#11670).
4152
4153 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4154
4155 Remove empty and useless init functions.
4156 * lisp.h (init_character_once, init_fns, init_image)
4157 (init_filelock, init_sound): Remove prototype.
4158 * character.c (init_character_once): Remove.
4159 * filelock.c (init_filelock): Likewise.
4160 * fns.c (init_fns): Likewise.
4161 * image.c (init_image): Likewise.
4162 * sound.c (init_sound): Likewise.
4163 * emacs.c (main): Adjust accordingly.
4164
4165 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4166
4167 * gtkutil.h: Tiny cleanups.
4168 (use_old_gtk_file_dialog): Remove useless declaration.
4169 (xg_uses_old_file_dialog): Add suggested const attribute.
4170
4171 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4172
4173 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4174 (bidi_paragraph_init): Use it to limit search forward for a strong
4175 directional character in abnormally large paragraphs full of
4176 neutral or weak characters. (Bug#11943)
4177
4178 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4179
4180 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4181 the toolbar (Bug#9451).
4182 (xg_make_tool_item): Give the widget event box a transparent
4183 background.
4184
4185 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4186
4187 Cleanup basic allocation variables and functions.
4188 * alloc.c (ignore_warnings, init_intervals, init_float)
4189 (init_cons, init_symbol, init_marker): Remove.
4190 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4191 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4192 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4193 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4194 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4195 (staticidx, init_alloc_once, init_strings, free_ablock):
4196 Remove redundant initialization.
4197 * fns.c (init_weak_hash_tables): Remove.
4198 * lisp.h (init_weak_hash_tables): Remove prototype.
4199
4200 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4201
4202 Use zero_vector where appropriate.
4203 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4204 accordingly.
4205 * lisp.h (zero_vector): New declaration.
4206 * font.c (null_vector): Remove.
4207 (syms_of_font): Remove initialization and staticpro.
4208 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4209 * keymap.c (Faccessible_keymaps): Likewise.
4210
4211 2012-07-15 Leo Liu <sdl.web@gmail.com>
4212
4213 * fringe.c: Fix typo in comments.
4214
4215 2012-07-14 Leo Liu <sdl.web@gmail.com>
4216
4217 * fringe.c: Add a new bitmap exclamation-mark.
4218
4219 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4220
4221 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4222
4223 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4224 (HAVE_MENUS): Don't define, defined by editing config.in with
4225 msdos/sed2v2.inp.
4226 (GMALLOC_INHIBIT_VALLOC): Don't define.
4227 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4228
4229 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4230
4231 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4232
4233 2012-07-14 Glenn Morris <rgm@gnu.org>
4234
4235 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4236 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4237 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4238
4239 2012-07-13 Glenn Morris <rgm@gnu.org>
4240
4241 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4242
4243 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4244 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4245
4246 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4247
4248 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4249 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4250 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4251 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4252 where appropriate.
4253 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4254 as boolean expression.
4255 (x_set_window_size): Remove unused variable toolbar.
4256 (ns_get_color_default, ns_mod_to_lisp): Remove.
4257 (ns_mouse_position): Remove unused variables xchar and ychar.
4258 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4259 (ns_set_vertical_scroll_bar): Remove unused variable count.
4260 (ns_delete_terminal): Remove unused variable i.
4261 (ns_term_init): Remove unused variables r, g and b.
4262 (mouseDown): Remove unused variable window.
4263 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4264 (initFrameFromEmacs): Remove unused variable vbextra.
4265 (mouseEntered): Remove unused variables p and dpyinfo.
4266 (mouseExited): Remove unused variables p and r.
4267 (ns_define_frame_cursor, ns_clear_frame_area)
4268 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4269 (menuDown): Assign [sender tag] to variable and cast the variable.
4270
4271 * nsterm.h (menuDown): Add id as type to argument sender.
4272 (ns_display_info_for_name): Add Lisp_Object argument.
4273 (ns_term_init): Add Lisp_Object argument.
4274 (ns_map_event_to_object): Add void argument.
4275 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4276 prototype with arguments and only declare if __OBJC__.
4277 (nxatoms_of_nsselect): Add void argument.
4278 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4279 (ns_alloc_autorelease_pool): Add void argument.
4280 (ns_release_autorelease_pool): Add void* argument.
4281 (ns_get_defaults_value): Add const char* argument.
4282
4283 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4284 (initFromContents): Use SSDATA where appropriate.
4285 (ns_update_menubar): Add braces to ambigous if-else.
4286 (initWithTitle): Put () around assignment in if statement.
4287 (ns_menu_show): Remove unused variables window and keymap.
4288 (update_frame_tool_bar): Remove unused variable selected_p.
4289 (initWithContentRect): Remove unused variable this_cmd_name.
4290
4291 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4292 appropriate.
4293 (setXBMColor): Remove unused variable len.
4294 (setPixmapData): Put () around assignment in loop statement.
4295
4296 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4297 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4298 where appropriate.
4299 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4300 around assignment in loop statement.
4301 (nsfont_open): Remove unused variable i.
4302 (nsfont_open): Remove unused variable len.
4303 (nsfont_draw): Remove unused variable cs.
4304
4305 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4306 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4307 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4308 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4309 (Fns_font_name, Fns_perform_service)
4310 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4311 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4312 (ns_set_name): Remove unused variable view.
4313 (x_set_menu_bar_lines): Remove unused variable olines.
4314 (x_set_tool_bar_lines): Remove unused variable root_window.
4315 (Fns_list_colors): Put () around assignment in while statement.
4316 (Fns_perform_service): Remove unused variable len.
4317 (Fns_display_usable_bounds): Remove unused variable top.
4318 (syms_of_nsfns): Remove unused variable i.
4319
4320 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4321 memcpy (Bug#11907).
4322
4323 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4324
4325 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4326 and free it with DestroyExceptionInfo (Bug#11558).
4327
4328 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4329
4330 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4331 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4332 Set here, not in nt/config.nt.
4333
4334 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4335
4336 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4337 cursor overflow into the last glyph on display line when the right
4338 fringe is off. (Bug#11832)
4339
4340 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4341
4342 * xdisp.c (produce_special_glyphs): Now static.
4343 * dispextern.h (produce_special_glyphs): Remove decl.
4344
4345 2012-07-13 Glenn Morris <rgm@gnu.org>
4346
4347 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4348 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4349
4350 * s/usg5-4-common.h (USG, USG5):
4351 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4352 * s/sol2-6.h (SOLARIS2):
4353 * s/irix6-5.h (IRIX6_5):
4354 * s/hpux10-20.h (USG, USG5, HPUX):
4355 * s/gnu-linux.h (USG, GNU_LINUX):
4356 * s/freebsd.h (BSD_SYSTEM):
4357 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4358 * s/cygwin.h (CYGWIN):
4359 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4360 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4361
4362 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4363
4364 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4365
4366 2012-07-13 Glenn Morris <rgm@gnu.org>
4367
4368 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4369
4370 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4371
4372 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4373 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4374
4375 2012-07-12 Glenn Morris <rgm@gnu.org>
4376
4377 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4378
4379 * process.c (init_process_emacs): Rename from init_process.
4380 The old name is also the name of a Mach system call.
4381 * lisp.h, emacs.c: Update for this name change.
4382 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4383 longer needed.
4384
4385 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4386
4387 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4388 memmove call that removes glyphs covered by the left truncation
4389 glyph. Improve commentary.
4390 (display_line): Fix display of continuation glyphs on GUI frames
4391 when the right fringe is turned off and variable-size fonts are
4392 used in the window. Move the code that appends a stretch glyph to
4393 produce_special_glyphs, so that it could be used for truncation
4394 and continuation glyphs alike.
4395 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4396 glyph of a suitably computed width, to align the special glyphs at
4397 the window margin. Code moved from display_line. (Bug#11832)
4398
4399 2012-07-12 Glenn Morris <rgm@gnu.org>
4400
4401 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4402
4403 * s/gnu-linux.h, s/hpux10-20.h:
4404 Do not unconditionally define HAVE_XRMSETDATABASE.
4405
4406 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4407
4408 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4409
4410 Fix typos that broke OS X build.
4411 Reported by Randal L. Schwartz in
4412 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4413 * nsterm.m (ns_timeout): Add missing local decl.
4414 (ns_get_color): snprintf -> sprintf, to fix typo.
4415
4416 2012-07-12 Glenn Morris <rgm@gnu.org>
4417
4418 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4419 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4420 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4421 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4422
4423 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4424 Move PTY_OPEN to configure.
4425
4426 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4427 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4428 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4429
4430 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4431
4432 Use empty_unibyte_string where applicable.
4433 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4434 * lread.c (read1): Likewise.
4435 * xsettings.c (syms_of_xsettings): Likewise.
4436
4437 2012-07-12 Glenn Morris <rgm@gnu.org>
4438
4439 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4440 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4441 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4442 * s/hpux10-20.h (RUN_TIME_REMAP):
4443 * s/bsd-common.h (TABDLY): Move to configure.
4444
4445 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4446
4447 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4448
4449 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4450 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4451
4452 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4453
4454 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4455 * s/template.h: Move NARROWPROTO to configure.
4456
4457 2012-07-11 Glenn Morris <rgm@gnu.org>
4458
4459 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4460 unused since 2011-01-17 change to systty.h.
4461
4462 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4463 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4464 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4465
4466 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4467
4468 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4469
4470 2012-07-11 Glenn Morris <rgm@gnu.org>
4471
4472 * s/darwin.h, s/gnu-linux.h, s/template.h:
4473 Move INTERRUPT_INPUT to configure.
4474
4475 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4476
4477 Minor adjustments to interning code.
4478 * lisp.h (intern, intern_c_string): Redefine as static inline
4479 wrappers for intern_1 and intern_c_string_1, respectively.
4480 (intern_1, intern_c_string_1): Rename prototypes.
4481 * lread.c (intern_1, intern_c_string_1, oblookup):
4482 Simplify Vobarray checking.
4483 * font.c (font_intern_prop): Likewise. Adjust comment.
4484 * w32font.c (intern_font_name): Likewise.
4485
4486 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4487
4488 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4489
4490 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4491 of Fcar/Fcdr if possible.
4492 * font.c (check_otf_features): Likewise.
4493 * fontset.c (Fnew_fontset): Likewise.
4494 * gnutls.c (Fgnutls_boot): Likewise.
4495 * minibuf.c (read_minibuf): Likewise.
4496 * msdos.c (IT_set_frame_parameters): Likewise.
4497 * xmenu.c (Fx_popup_dialog): Likewise.
4498 * w32menu.c (Fx_popup_dialog): Likewise.
4499
4500 2012-07-11 Glenn Morris <rgm@gnu.org>
4501
4502 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4503 since nothing has defined it on these platforms.
4504
4505 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4506 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4507
4508 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4509 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4510 Move CLASH_DETECTION to configure.
4511
4512 * s/gnu.h: Remove file, which is now empty.
4513
4514 * s/gnu.h, s/gnu-linux.h:
4515 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4516
4517 2012-07-11 John Wiegley <johnw@newartisans.com>
4518
4519 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4520 function attribute, so we only use it if it exists in the
4521 compiler.
4522
4523 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4524
4525 Avoid call to strlen in fast_c_string_match_ignore_case.
4526 * search.c (fast_c_string_match_ignore_case): Change to use
4527 length argument. Adjust users accordingly.
4528 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4529
4530 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4531
4532 Assume mkdir, rmdir.
4533 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4534 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4535
4536 Assume rename.
4537 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4538
4539 Assume perror.
4540 * s/hpux10-20.h (HAVE_PERROR): Remove.
4541 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4542 Remove dummy definition, as this problem was obsolete long ago.
4543
4544 Assume strerror.
4545 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4546
4547 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4548
4549 Avoid calls to strlen in font processing functions.
4550 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4551 (font_open_by_name): Change to use length argument.
4552 Adjust users accordingly.
4553 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4554 Adjust prototypes.
4555 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4556 Change to return ptrdiff_t.
4557 (xfont_list_pattern, xfont_match): Use length returned by
4558 xfont_decode_coding_xlfd.
4559 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4560
4561 2012-07-11 Glenn Morris <rgm@gnu.org>
4562
4563 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4564 Move DONT_REOPEN_PTY to configure.
4565
4566 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4567 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4568
4569 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4570
4571 Remove "#define unix" that is no longer needed (Bug#11905).
4572 * s/aix4-2.h (unix): Remove; no longer needed.
4573
4574 EMACS_TIME simplification (Bug#11875).
4575 This replaces macros (which typically do not work in GDB)
4576 with functions, typedefs and enums, making the code easier to debug.
4577 The functional style also makes code easier to read and maintain.
4578 * systime.h: Include <sys/time.h> on all hosts, not just if
4579 WINDOWSNT, since 'struct timeval' is needed in general.
4580 (EMACS_TIME): Now a typedef, not a macro.
4581 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4582 not macros.
4583 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4584 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4585 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4586 (EMACS_TIME_LE): Now functions, not macros.
4587 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4588 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4589 which are not functions. All uses rewritten to use:
4590 (make_emacs_time): New function.
4591 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4592 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4593 not functions. All uses rewritten to use the following, respectively:
4594 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4595 (add_emacs_time, sub_emacs_time): New functions.
4596 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4597 * fileio.c (Fcopy_file):
4598 * xterm.c (XTflash): Get the current time closer to when it's used.
4599 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4600
4601 * bytecode.c (targets): Suppress -Woverride-init warnings.
4602
4603 Simplify by avoiding confusing use of strncpy etc.
4604 * doc.c (Fsnarf_documentation):
4605 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4606 * frame.c (Fmake_terminal_frame):
4607 * gtkutil.c (get_utf8_string):
4608 * lread.c (openp):
4609 * nsmenu.m (ns_update_menubar):
4610 * regex.c (regerror):
4611 Prefer memcpy to strncpy and strncat when either will do.
4612 * fileio.c (Fsubstitute_in_file_name):
4613 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4614 (menu_separator_name_p):
4615 * nsmenu.m (ns_update_menubar):
4616 Prefer memcmp to strncmp when either will do.
4617 * nsterm.m: Include <ftoastr.h>.
4618 (ns_get_color):
4619 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4620 Prefer snprintf to strncpy.
4621 * nsterm.m (ns_term_init):
4622 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4623 * nsterm.m (ns_term_init):
4624 Avoid the need for strncpy, by using build_string or
4625 make_unibyte_string directly. Use dtoastr, not snprintf.
4626 * process.c (Fmake_network_process): Diagnose service names that
4627 are too long, rather than silently truncating them or creating
4628 non-null-terminated names.
4629 (Fnetwork_interface_info): Likewise, for interface names.
4630 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4631 Prefer sprintf to strncat.
4632 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4633 Prefer vsnprintf to vsprintf + strncpy.
4634
4635 2012-07-10 Glenn Morris <rgm@gnu.org>
4636
4637 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4638 Clarify fallback case.
4639
4640 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4641
4642 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4643 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4644 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4645 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4646 where argument type is known to be a Lisp_Cons.
4647
4648 2012-07-10 Tom Tromey <tromey@redhat.com>
4649
4650 * bytecode.c (BYTE_CODE_THREADED): New macro.
4651 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4652 (enum byte_code_op): New type.
4653 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4654 (exec_byte_code): Use them. Use token threading when applicable.
4655
4656 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4657
4658 Optimize pure C strings initialization.
4659 * lisp.h (make_pure_string): Fix prototype.
4660 (build_pure_c_string): New function, defined as static inline. This
4661 provides a better opportunity to optimize away calls to strlen when
4662 the function is called with compile-time constant argument.
4663 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4664 argument, adjust users accordingly. Use build_pure_c_string where
4665 appropriate.
4666 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4667 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4668 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4669
4670 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4671
4672 Avoid calls to strlen in miscellaneous functions.
4673 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4674 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4675 * lread.c (openp): Likewise.
4676
4677 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4678
4679 Avoid calls to strlen in path processing functions.
4680 * fileio.c (file_name_as_directory): Add comment. Change to add
4681 srclen argument and return the length of result. Adjust users
4682 accordingly.
4683 (directory_file_name): Fix comment. Change to add srclen argument,
4684 swap 1st and 2nd arguments to obey the common convention.
4685 Adjust users accordingly.
4686 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4687
4688 2012-07-10 Glenn Morris <rgm@gnu.org>
4689
4690 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4691 Move PENDING_OUTPUT_COUNT definition to configure.
4692
4693 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4694 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4695 * s/gnu.h (DATA_START): Move definitions to configure.
4696
4697 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4698 We include usg5-4-common.h, which defines them both.
4699
4700 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4701 O_RDONLY already includes it).
4702
4703 Stop ns builds setting the EMACSLOADPATH environment variable.
4704 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4705 Now it does not set EMACSLOADPATH, just returns the load-path string.
4706 * nsterm.h: Update accordingly.
4707 * lread.c [HAVE_NS]: Include nsterm.h.
4708 (init_lread) [HAVE_NS]: Use ns_load_path.
4709 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4710
4711 2012-07-09 Glenn Morris <rgm@gnu.org>
4712
4713 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4714 since the included bsd-common.h does so.
4715
4716 Stop ns builds setting the EMACSPATH environment variable.
4717 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4718 (ns_init_paths): Do not set EMACSPATH.
4719 * nsterm.h (ns_exec_path): Add it.
4720 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4721 Use ns_exec_path.
4722
4723 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4724
4725 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4726
4727 * process.c (wait_reading_process_output): 'waitchannels' was unset
4728 when read_kbd || !NILP (wait_for_cell); fix this.
4729
4730 Add GCC-style 'const' attribute to functions that can use it.
4731 * character.h (char_resolve_modifier_mask):
4732 * keyboard.h (make_ctrl_char):
4733 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4734 (init_character_once, next_almost_prime, init_fns, init_image)
4735 (flush_pending_output, init_sound):
4736 * mem-limits.h (start_of_data):
4737 * menu.h (finish_menu_items):
4738 Add ATTRIBUTE_CONST.
4739 * emacs.c (DEFINE_DUMMY_FUNCTION):
4740 Declare the dummy function with ATTRIBUTE_CONST.
4741 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4742 Add decls with ATTRIBUTE_CONST.
4743
4744 Minor improvements to make_formatted_string.
4745 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4746 where int is good enough, as vsprintf returns an int.
4747 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4748
4749 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4750
4751 Use make_formatted_string to avoid double length calculation.
4752 * lisp.h (make_formatted_string): New prototype.
4753 * alloc.c (make_formatted_string): New function.
4754 * buffer.c (Fgenerate_new_buffer_name): Use it.
4755 * dbus.c (syms_of_dbusbind): Likewise.
4756 * editfns.c (Fcurrent_time_zone): Likewise.
4757 * filelock.c (get_boot_time): Likewise.
4758 * frame.c (make_terminal_frame, set_term_frame_name)
4759 (x_report_frame_params): Likewise.
4760 * image.c (gs_load): Likewise.
4761 * minibuf.c (get_minibuffer): Likewise.
4762 * msdos.c (dos_set_window_size): Likewise.
4763 * process.c (make_process): Likewise.
4764 * xdisp.c (ensure_echo_area_buffers): Likewise.
4765 * xsettings.c (apply_xft_settings): Likewise.
4766
4767 2012-07-09 Glenn Morris <rgm@gnu.org>
4768
4769 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4770 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4771 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4772 * nsterm.h (ns_etc_directory): Add it.
4773 * callproc.c [HAVE_NS]: Include nsterm.h.
4774 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4775
4776 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4777
4778 Move marker debugging code under MARKER_DEBUG.
4779 * marker.c (MARKER_DEBUG): Move marker debugging code under
4780 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4781 for bootstrap with --enable-checking (~3x slowdown reported
4782 by Juanma Barranquero <lekktu@gmail.com>).
4783 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4784
4785 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4786
4787 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4788 See <http://bugs.gnu.org/11825#29>.
4789
4790 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4791
4792 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4793 has no font, use the frame's font. (Bug#11813)
4794 (display_line): Add commentary about displaying truncation glyphs
4795 on GUI frames.
4796 (produce_special_glyphs): Move here from term.c.
4797
4798 * term.c (produce_special_glyphs): Move to xdisp.c.
4799
4800 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4801 section.
4802
4803 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4804
4805 * xdisp.c (display_line): Avoid warning about implicit declaration
4806 of FRAME_FONT.
4807
4808 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4809
4810 * lisp.h: Remove empty conditional.
4811
4812 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4813
4814 * lread.c (load_path_check): Now static.
4815
4816 Fix some minor --with-ns problems found by static checking.
4817 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4818 (x_set_font) [!HAVE_X_WINDOWS]:
4819 * image.c (xpm_load_image) [HAVE_NS]:
4820 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4821 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4822 Remove unused local.
4823 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4824 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4825 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4826 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4827 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4828 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4829 Fix pointer signedness problem.
4830 * xfaces.c (FRAME_X_FONT_TABLE):
4831 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4832
4833 2012-07-07 Glenn Morris <rgm@gnu.org>
4834
4835 * lread.c (load_path_check): New function, split from init_lread.
4836 (init_lread): Reorganize. Motivation:
4837 If EMACSLOADPATH is set, check/warn about that rather than the
4838 defaults, which we are not going to use. Hence we can remove
4839 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4840 Don't warn if site-lisp directories are missing.
4841 If not installed, start from a blank load-path, since
4842 PATH_LOADSEARCH refers to the eventual installation directories.
4843
4844 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4845
4846 Support truncation and continuation glyphs on GUI frames, when
4847 fringes are disabled. (Bug#11832)
4848 * xdisp.c (init_iterator): Get dimensions of truncation and
4849 continuation glyphs even if on GUI frames.
4850 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4851 or both, are absent.
4852 (start_display, move_it_in_display_line_to): Handle the case of a
4853 GUI frame without a fringe to display continuation or truncation
4854 glyphs.
4855 (insert_left_trunc_glyphs): Support GUI frames: make sure
4856 truncation glyphs overwrite enough glyphs from the current line to
4857 have sufficient space in pixels.
4858 (display_line): Support truncation and continuation glyphs on GUI
4859 frames. If some spare pixels are left on the line after inserting
4860 the truncation glyphs, fill that space with a stretch glyph of a
4861 suitably computed width.
4862
4863 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4864 produce_glyphs, to support GUI sessions.
4865
4866 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4867
4868 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4869
4870 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4871
4872 Do not require float-time's arg to fit in time_t (Bug#11825).
4873 This works better on hosts where time_t is unsigned, and where
4874 float-time is applied to the (negative) difference between two times.
4875 * editfns.c (decode_time_components): Last arg is now double *,
4876 not int *, and means to store all the result as a double, without
4877 worrying about whether the seconds part fits in time_t.
4878 All callers changed.
4879 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4880 All callers changed.
4881 (Ffloat_time): Do not fail merely because the specified time falls
4882 outside of time_t range.
4883
4884 2012-07-07 Glenn Morris <rgm@gnu.org>
4885
4886 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4887 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4888 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4889
4890 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4891
4892 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4893 Update dependencies.
4894
4895 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4896
4897 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4898
4899 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4900 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4901 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4902 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4903 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4904 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4905
4906 * xfont.c (compare_font_names): Redo to omit the need for casts.
4907
4908 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4909
4910 * xfns.c (Fx_change_window_property): Doc fix.
4911 * w32fns.c (Fx_change_window_property): Doc fix.
4912
4913 * w32fns.c (Fx_window_property): Accept the same arguments as the
4914 X Windows version. Doc fix.
4915 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4916
4917 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4918 Eli Zaretskii <eliz@gnu.org>
4919
4920 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4921 Windows-specific code from nt/config.nt moved here.
4922 Obsolete settings removed.
4923
4924 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4925
4926 * process.c: Avoid unnecessary calls to gettime.
4927 (wait_reading_process_output): Don't get the time of day
4928 when gobbling data immediately and not waiting, as there's no need
4929 for it in that case. This removes a FIXME.
4930
4931 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4932
4933 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4934 is defined (Bug#11768).
4935
4936 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4937
4938 Fix marker debugging code.
4939 * marker.c (byte_char_debug_check): Do not perform the check
4940 if buffer is not multibyte.
4941 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4942 Call byte_char_debug_check with correct arguments.
4943
4944 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4945
4946 Compile marker debugging code only if ENABLE_CHECKING is defined.
4947 * marker.c (byte_char_debug_check, count_markers):
4948 Use only if ENABLE_CHECKING is defined.
4949 (byte_debug_flag): Remove.
4950 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4951 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4952
4953 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4954
4955 Avoid code repetition in marker-related functions.
4956 * marker.c (attach_marker): New function.
4957 (Fset_marker, set_marker_restricted, set_marker_both)
4958 (set_marker_restricted_both): Use it.
4959 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4960 Consistently rename charno to charpos.
4961 (marker_position): Add eassert.
4962 (marker_byte_position): Convert to eassert.
4963
4964 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4965
4966 Simplify list operations in unchain_overlay and unchain_marker.
4967 * buffer.c (unchain_overlay): Simplify. Add comment.
4968 * marker.c (unchain_marker): Simplify. Fix comments.
4969
4970 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4971
4972 Introduce fast path for the widely used marker operation.
4973 * alloc.c (build_marker): New function.
4974 * lisp.h (build_marker): New prototype.
4975 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4976 * composite.c (autocmp_chars): Likewise.
4977 * editfns.c (buildmark): Remove.
4978 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4979 (save_restriction_save): Use build_marker.
4980 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4981 * window.c (save_window_save): Likewise.
4982
4983 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4984
4985 Do not use Fdelete_overlay in delete_all_overlays
4986 to avoid redundant calls to unchain_overlay.
4987 * buffer.c (drop_overlay): New function.
4988 (delete_all_overlays, Fdelete_overlay): Use it.
4989 * minibuf.c (get_minibuffer): Fix comment.
4990
4991 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4992
4993 Port to OpenBSD 5.1 amd64.
4994 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4995 This is needed for OpenBSD, and should be harmless on all BSD systems.
4996 Also, include <sys/sysctl.h>, as it should be available on all
4997 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4998 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4999 use p_pid member, not kp_proc.pid.
5000
5001 2012-07-06 Glenn Morris <rgm@gnu.org>
5002
5003 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5004
5005 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5006
5007 More xmalloc and related cleanup.
5008 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5009 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5010 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5011 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5012 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5013 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5014 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5015 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5016 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5017 * xterm.c:
5018 Omit needless casts involving void * pointers and allocation.
5019 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5020 as the former is more robust if P's type is changed.
5021 Prefer xzalloc to xmalloc + memset 0.
5022 Simplify malloc-or-realloc to realloc.
5023 Don't worry about xmalloc returning a null pointer.
5024 Prefer xstrdup to xmalloc + strcpy.
5025 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5026 growing it.
5027 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5028 alloca of a constant.
5029
5030 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5031
5032 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5033 hscroll is larger than the line width. Fixes long and futile
5034 looping inside extend_face_to_end_of_line (on a TTY) producing
5035 glyphs that are not needed and thrown away.
5036
5037 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5038
5039 * marker.c (set_marker_restricted_both): Simplify by using
5040 clip_to_bounds.
5041
5042 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5043
5044 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5045
5046 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5047
5048 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5049 not defined (Bug#11768).
5050 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5051 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5052 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5053 followed by gtk_box_set_homogeneous (Bug#11768).
5054 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5055 (update_theme_scrollbar_width, xg_create_scroll_bar):
5056 Use gtk_scrollbar_new (Bug#11768).
5057 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5058 (is_box_type): New function (Bug#11768).
5059 (xg_tool_item_stale_p): Call is_box_type.
5060 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5061 with default display (Bug#11768).
5062
5063 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5064
5065 * xdisp.c (window_hscroll_limited): New function.
5066 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5067 coordinates when window's hscroll is set to insanely large
5068 values. (Bug#11857)
5069
5070 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5071
5072 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5073 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5074
5075 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5076
5077 Cleanup xmalloc.
5078 * lisp.h (xzalloc): New prototype. Omit needless casts.
5079 * alloc.c (xzalloc): New function. Omit needless casts.
5080 * charset.c: Omit needless casts. Convert all calls to
5081 xmalloc with following memset to xzalloc.
5082 * dispnew.c: Likewise.
5083 * fringe.c: Likewise.
5084 * image.c: Likewise.
5085 * sound.c: Likewise.
5086 * term.c: Likewise.
5087 * w32fns.c: Likewise.
5088 * w32font.c: Likewise.
5089 * w32term.c: Likewise.
5090 * xfaces.c: Likewise.
5091 * xfns.c: Likewise.
5092 * xterm.c: Likewise.
5093 * atimer.c: Omit needless casts.
5094 * buffer.c: Likewise.
5095 * callproc.c: Likewise.
5096 * ccl.c: Likewise.
5097 * coding.c: Likewise.
5098 * composite.c: Likewise.
5099 * doc.c: Likewise.
5100 * doprnt.c: Likewise.
5101 * editfns.c: Likewise.
5102 * emacs.c: Likewise.
5103 * eval.c: Likewise.
5104 * filelock.c: Likewise.
5105 * fns.c: Likewise.
5106 * gtkutil.c: Likewise.
5107 * keyboard.c: Likewise.
5108 * lisp.h: Likewise.
5109 * lread.c: Likewise.
5110 * minibuf.c: Likewise.
5111 * msdos.c: Likewise.
5112 * print.c: Likewise.
5113 * process.c: Likewise.
5114 * region-cache.c: Likewise.
5115 * search.c: Likewise.
5116 * sysdep.c: Likewise.
5117 * termcap.c: Likewise.
5118 * terminal.c: Likewise.
5119 * tparam.c: Likewise.
5120 * w16select.c: Likewise.
5121 * w32.c: Likewise.
5122 * w32reg.c: Likewise.
5123 * w32select.c: Likewise.
5124 * w32uniscribe.c: Likewise.
5125 * widget.c: Likewise.
5126 * xdisp.c: Likewise.
5127 * xmenu.c: Likewise.
5128 * xrdb.c: Likewise.
5129 * xselect.c: Likewise.
5130
5131 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5132
5133 * fileio.c (time_error_value): Check the right error number.
5134 Problem reported by Troels Nielsen in
5135 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5136
5137 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5138
5139 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5140 This should be fixed in a better way; see Eli Zaretskii in
5141 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5142 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5143
5144 * fileio.c (time_error_value): Rename from special_mtime.
5145 The old name's problems were noted by Eli Zaretskii in
5146 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5147
5148 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5149 This variable's comment says Emacs needs at least one GDB-visible
5150 symbol of type enum pvec_type, to work around GDB problems.
5151 The symbol's value doesn't matter.
5152
5153 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5154 that causes compilation to fail on pre-C99 compilers.
5155
5156 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5157
5158 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5159 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5160
5161 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5162
5163 * buffer.c (init_buffer_once): Fix initialization of
5164 headers for buffer_defaults and buffer_local_symbols.
5165 Reported by Juanma Barranquero <lekktu@gmail.com>.
5166
5167 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5168
5169 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5170 * lisp.h (enum pvec_type): Use fewer bits.
5171 (PSEUDOVECTOR_SIZE_BITS): New constant.
5172 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5173 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5174 change in pvec_type.
5175 (PSEUDOVECTOR_TYPEP): New macro.
5176 (TYPED_PSEUDOVECTORP): Use it.
5177 * fns.c (internal_equal): Adapt code to extract pvectype.
5178 * emacs.c (gdb_pvec_type): Update type.
5179 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5180 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5181 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5182 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5183 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5184 abusing vector->header.next.nbytes.
5185 (live_vector_p): Use PVEC_TYPE.
5186 (mark_object): Adapt code to extract pvectype. Use switch.
5187
5188 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5189
5190 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5191 Tighten new eassert a bit.
5192
5193 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5194
5195 Fix compilation with --enable-gcc-warnings and -O1
5196 optimization level.
5197 * doprnt.c (doprnt): Change type of tem to int, initialize
5198 to avoid compiler warning. Add eassert.
5199 * search.c (simple_search): Initialize match_byte to avoid
5200 compiler warning. Add eassert.
5201
5202 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5203
5204 Avoid weird behavior with large horizontal scrolls.
5205 Without this change, for example, large hscroll values would
5206 mess up Emacs's display on Fedora 15 x86, presumably due to
5207 overflows in int calculations in the display code.
5208 Also, if buffers had long lines, Emacs would freeze.
5209 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5210 (set_window_hscroll): New function, containing the old guts of
5211 Fset_window_hscroll. Return the clipped value.
5212 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5213 This avoids the need to check against PTRDIFF_MAX.
5214
5215 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5216
5217 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5218
5219 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5220
5221 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5222
5223 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5224 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5225 since GCC 4.4.6 issues a bogus warning for them.
5226
5227 Fix bugs in file timestamp newness comparisons.
5228 * fileio.c (Ffile_newer_than_file_p):
5229 * lread.c (Fload): Use full timestamp resolution of files,
5230 not just the 1-second resolution, so that files that are only
5231 slightly newer still count as newer.
5232 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5233 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5234
5235 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5236
5237 * fileio.c: Improve handling of file time marker. (Bug#11852)
5238 (special_mtime): New function.
5239 (Finsert_file_contents, Fverify_visited_file_modtime):
5240 Use it to set special mtime values consistently.
5241
5242 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5243
5244 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5245 marker for non-existing file. (Bug#11852)
5246
5247 2012-07-03 Glenn Morris <rgm@gnu.org>
5248
5249 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5250 and did not make it into globals.h).
5251
5252 2012-07-03 Tom Tromey <tromey@redhat.com>
5253
5254 * window.c (Fset_window_margins, Fset_window_fringes)
5255 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5256 * textprop.c (Fprevious_property_change): No longer static.
5257 * syntax.c (Fsyntax_table_p): No longer static.
5258 * process.c (Fget_process, Fprocess_datagram_address): No longer
5259 static.
5260 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5261 * keyboard.c (Fcommand_execute): No longer static.
5262 Remove EXFUN.
5263 * insdel.c (Fcombine_after_change_execute): No longer static.
5264 * image.c (Finit_image_library): No longer static.
5265 * fileio.c (Fmake_symbolic_link): No longer static.
5266 * eval.c (Ffetch_bytecode): No longer static.
5267 * editfns.c (Fuser_full_name): No longer static.
5268 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5269 No longer static.
5270 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5271 static.
5272 * dired.c (Ffile_attributes): No longer static.
5273 * composite.c (Fcomposition_get_gstring): No longer static.
5274 * callproc.c (Fgetenv_internal): No longer static.
5275
5276 * ccl.h: Remove EXFUNs.
5277 * buffer.h: Remove EXFUNs.
5278 * dispextern.h: Remove EXFUNs.
5279 * intervals.h: Remove EXFUNs.
5280 * fontset.h: Remove EXFUN.
5281 * font.h: Remove EXFUNs.
5282 * dosfns.c (system_process_attributes): Remove EXFUN.
5283 * keymap.h: Remove EXFUNs.
5284 * lisp.h: Remove EXFUNs.
5285 * w32term.h: Remove EXFUNs.
5286 * window.h: Remove EXFUNs.
5287 * xsettings.h: Remove EXFUN.
5288 * xterm.h: Remove EXFUN.
5289
5290 2012-07-03 Glenn Morris <rgm@gnu.org>
5291
5292 * lisp.h (Frandom): Make it visible to C.
5293 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5294 buffer for invisible buffers. (Bug#1229)
5295
5296 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5297
5298 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5299 values which aren't power of 2.
5300 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5301 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5302 accordingly.
5303
5304 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5305
5306 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5307
5308 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5309
5310 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5311
5312 * alloc.c (allocate_vector_block): Remove redundant
5313 calls to mallopt if DOUG_LEA_MALLOC is defined.
5314 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5315 avoid calls to mallopt if zero_vector is returned.
5316
5317 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5318
5319 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5320 is enabled, avoid dereferencing NULL current_sblock if
5321 running undumped.
5322
5323 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5324
5325 Cleanup basic buffer management.
5326 * buffer.h (struct buffer): Change layout to use generic vector
5327 marking code. Fix some comments. Change type of 'clip_changed'
5328 to bitfield. Remove unused #ifndef old.
5329 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5330 (GET_OVERLAYS_AT): Fix indentation.
5331 (for_each_per_buffer_object_at): New macro.
5332 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5333 (Fbuffer_local_variables): Use it.
5334 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5335 * alloc.c (allocate_buffer): Adjust to match new layout of
5336 struct buffer. Fix comment.
5337 (mark_overlay): New function.
5338 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5339 Lisp area of struct buffer.
5340 (mark_object): Use it. Adjust marking of misc objects
5341 and related comments.
5342
5343 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5344
5345 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5346 wrapper that is not needed because the wrapped code is a no-op (zero
5347 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5348 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5349
5350 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5351
5352 * alloc.c (mark_buffer): Simplify. Remove prototype.
5353 (mark_object): Add comment. Reorganize marking of vector-like
5354 objects. Use CHECK_LIVE for all vector-like objects except buffers
5355 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5356 Avoid redundant calls to mark_vectorlike for bool vectors.
5357
5358 2012-06-30 Glenn Morris <rgm@gnu.org>
5359
5360 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5361
5362 * epaths.in (PATH_SITELOADSEARCH): New.
5363 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5364 This is rather than relying on --enable-locallisppath elements
5365 having "site-lisp" in their names. (Bug#10208#25, 11658)
5366
5367 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5368
5369 * w32proc.c (sys_select): Accept and ignore one more argument.
5370
5371 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5372
5373 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5374 (pselect) [!MS_DOS]: Redirect to sys_select.
5375
5376 * sysdep.c: Don't include dos.h and dosfns.h.
5377
5378 * process.c (sys_select):
5379 * msdos.c (sys_select): Accept one more argument and ignore it.
5380
5381 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5382 adapt data types and code to that.
5383
5384 * dosfns.c:
5385 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5386 which clashes with the gnulib function of the same name.
5387
5388 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5389
5390 * font.c (font_style_to_value, font_style_symbolic)
5391 (font_prop_validate_style): Add type checks for values in
5392 font_style_table.
5393
5394 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5395 argument.
5396 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5397 uses.
5398
5399 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5400
5401 * xdisp.c (try_window_id): Undo last change.
5402
5403 * w32.c (getwd): Adjust commentary about startup_dir.
5404 (init_environment): Always call sys_access, even in non-MSVC
5405 builds. Don't chdir to the directory of the Emacs executable.
5406 This undoes code from 1997 which was justified by the need to
5407 "avoid conflicts when removing and renaming directories". But its
5408 downside was that every relative file name was being interpreted
5409 relative to the directory of the Emacs executable, which can never
5410 be TRT. In particular, it broke sys_access when called with
5411 relative file names.
5412 (sys_access): Map GetLastError to errno.
5413
5414 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5415
5416 * window.h (struct window): Change type of 'fringes_outside_margins'
5417 to bitfield. Fix comment. Adjust users accordingly.
5418 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5419 Adjust comment.
5420 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5421 to ptrdiff_t.
5422
5423 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5424
5425 * gnutls.c (emacs_gnutls_handshake):
5426 Add QUIT to make the loop interruptible.
5427
5428 2012-06-29 Glenn Morris <rgm@gnu.org>
5429
5430 * charset.c (init_charset): Make lack of etc/charsets fatal.
5431
5432 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5433
5434 * editfns.c (region_limit): Fix type mismatch.
5435
5436 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5437
5438 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5439 undefined. Convert from xassert to eassert.
5440 * nsmenu.m: Convert from xassert to eassert.
5441 * nsterm.m: Likewise.
5442
5443 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5444
5445 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5446
5447 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5448
5449 Avoid integer overflow on scroll-left and scroll-right.
5450 * window.c (HSCROLL_MAX): New macro.
5451 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5452 overflow when requested scroll falls outside ptrdiff_t range.
5453
5454 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5455
5456 * window.h (struct window): Change type of 'hscroll',
5457 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5458 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5459 Adjust users accordingly.
5460 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5461 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5462 from EMACS_INT to ptrdiff_t.
5463 (make_window): Omit redundant initialization.
5464
5465 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5466
5467 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5468
5469 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5470
5471 * window.h (struct window): Change type of 'use_time' and
5472 'sequence_number' from Lisp_Object to int.
5473 * frame.c (make_frame): Adjust users accordingly.
5474 * print.c (print_object): Likewise.
5475 * window.c (select_window, Fwindow_use_time, make_parent_window)
5476 (make_window): Likewise.
5477
5478 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5479
5480 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5481 enabled with --enable-checking=[all,glyphs] configure option.
5482 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5483 adjust comments accordingly.
5484 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5485 undefined, adjust comments accordingly.
5486 * image.c: Likewise.
5487 * scroll.c: Likewise.
5488 * w32fns.c: Likewise.
5489 * w32term.c: Likewise.
5490 * xdisp.c: Likewise.
5491 * xfaces.c: Likewise.
5492 * xfns.c: Likewise.
5493 * xterm.c: Likewise.
5494
5495 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5496
5497 Generalize run-time debugging checks.
5498 * dispextern.h (XASSERTS): Remove.
5499 * fontset.c (xassert): Remove.
5500 Convert from xassert to eassert.
5501 * alloc.c: Convert from xassert to eassert.
5502 * bidi.c: Likewise.
5503 * dispnew.c: Likewise.
5504 * fns.c: Likewise.
5505 * fringe.c: Likewise.
5506 * ftfont.c: Likewise.
5507 * gtkutil.c: Likewise.
5508 * image.c: Likewise.
5509 * keyboard.c: Likewise.
5510 * menu.c: Likewise.
5511 * process.c: Likewise.
5512 * scroll.c: Likewise.
5513 * sound.c: Likewise.
5514 * term.c: Likewise.
5515 * w32console.c: Likewise.
5516 * w32fns.c: Likewise.
5517 * w32term.c: Likewise.
5518 * window.c: Likewise.
5519 * xdisp.c: Likewise.
5520 * xfaces.c: Likewise.
5521 * xfns.c: Likewise.
5522 * xselect.c: Likewise.
5523 * xterm.c: Likewise.
5524
5525 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5526
5527 * fns.c (maybe_resize_hash_table): Output message when growing the
5528 purify-hashtable.
5529
5530 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5531
5532 * alloc.c (allocate_string_data): Remove dead code.
5533 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5534 avoid GCC warning about unused macro.
5535
5536 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5537
5538 * alloc.c (allocate_string): Omit intervals initialization.
5539 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5540 as in make_pure_string and make_pure_c_string.
5541
5542 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5543
5544 * alloc.c (allocate_string): Fix last change.
5545
5546 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5547
5548 * alloc.c (allocate_string): Remove two redundant calls
5549 to memset, add explicit initialization where appropriate.
5550
5551 2012-06-27 Glenn Morris <rgm@gnu.org>
5552
5553 * lisp.mk (lisp): Remove paths.elc.
5554
5555 2012-06-27 Chong Yidong <cyd@gnu.org>
5556
5557 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5558
5559 2012-06-26 John Wiegley <johnw@newartisans.com>
5560
5561 * unexmacosx.c (copy_data_segment): Add two section names used
5562 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5563
5564 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5565 when building with Clang.
5566
5567 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5568
5569 * eval.c (Fapply): Allow calling it with a single argument.
5570
5571 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5572
5573 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5574 _stricmp and _strnicmp.
5575 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5576
5577 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5578
5579 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5580 allocated window.
5581 (allocate_process): Likewise for new process.
5582 (allocate_terminal): Change to use offsetof.
5583 (allocate_frame): Likewise.
5584 * frame.c (make_frame): Omit redundant initialization.
5585 * window.c (make_parent_window): Use memset.
5586 (make_window): Omit redundant initialization.
5587 * process.c (make_process): Omit redundant initialization.
5588 * terminal.c (create_terminal): Likewise.
5589
5590 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5591
5592 * term.c (delete_tty): Remove redundant call to memset.
5593
5594 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5595
5596 * alloc.c: Remove build_string.
5597 * lisp.h: Define build_string as static inline. This provides
5598 a better opportunity to optimize away calls to strlen when the
5599 function is called with compile-time constant argument.
5600 * image.c (imagemagick_error): Convert to build_string.
5601 * w32proc.c (sys_spawnve): Likewise.
5602 * xterm.c (x_term_init): Likewise.
5603
5604 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5605
5606 Use sprintf return value instead of invoking strlen on result.
5607 In the old days this wasn't portable, since some sprintf
5608 implementations returned char *. But they died out years ago and
5609 Emacs already assumes sprintf returns int.
5610 Similarly for float_to_string.
5611 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5612 * ccl.c (ccl_driver):
5613 * character.c (string_escape_byte8):
5614 * data.c (Fnumber_to_string):
5615 * doprnt.c (doprnt):
5616 * print.c (print_object):
5617 * xdisp.c (message_dolog):
5618 * xfns.c (syms_of_xfns):
5619 Use sprintf or float_to_string result to avoid need to call strlen.
5620 * data.c (Fnumber_to_string):
5621 Use make_unibyte_string, since the string must be ASCII.
5622 * lisp.h, print.c (float_to_string): Now returns int length.
5623 * term.c (produce_glyphless_glyph):
5624 Use sprintf result rather than recomputing it.
5625
5626 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5627 * Makefile.in (ALL_CFLAGS):
5628 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5629 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5630
5631 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5632
5633 * dispextern.h (xstrcasecmp): Define to library function
5634 strcasecmp if available.
5635 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5636
5637 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5638
5639 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5640 Avoid comma operator.
5641 * menu.c (push_submenu_start, push_submenu_end)
5642 (push_left_right_boundary, push_menu_pane): Likewise.
5643 * msdos.c (dos_rawgetc): Likewise.
5644
5645 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5646
5647 * xfns.c (xic_create_fontsetname): Remove redundant calls
5648 to memset.
5649
5650 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5651
5652 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5653 sprintf already null-terminates its output.
5654
5655 * xfns.c (x_window): Remove redundant cast.
5656
5657 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5658
5659 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5660 `const char *' to `char *' to avoid compiler warning.
5661
5662 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5663
5664 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5665 instead of truncating it to 63 (admittedly a generous limit).
5666
5667 * process.c: Fix spelling and caps in comments.
5668
5669 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5670
5671 * emacs.c (setpgrp): Remove definition, unused.
5672 * sysdep.c (setpgrp): Remove definition, not used in this file.
5673
5674 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5675
5676 * makefile.w32-in: Update dependencies.
5677
5678 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5679
5680 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5681 (SYSTIME_H): Add nt/inc/sys/time.h.
5682
5683 * systime.h [WINDOWSNT]: Include sys/time.h.
5684
5685 * s/ms-w32.h (struct timespec): Definition moved from
5686 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5687
5688 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5689
5690 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5691 * buffer.h (buffer_slot_type_mismatch):
5692 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5693 * eval.c (unwind_to_catch):
5694 * image.c (my_png_error, my_error_exit):
5695 * keyboard.c (quit_throw_to_read_char, user_error)
5696 (Fexit_recursive_edit, Fabort_recursive_edit):
5697 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5698 (wrong_type_argument, buffer_overflow, __executable_start)
5699 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5700 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5701 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5702 (fatal):
5703 (child_setup) [!DOS_NT]:
5704 * lread.c (end_of_file_error, invalid_syntax):
5705 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5706 * puresize.h (pure_write_error):
5707 * search.c (matcher_overflow):
5708 * sound.c (sound_perror, alsa_sound_perror):
5709 * sysdep.c, syssignal.h (croak):
5710 * term.c (maybe_fatal, vfatal):
5711 * textprop.c (text_read_only):
5712 * undo.c (user_error):
5713 * unexmacosx.c (unexec_error):
5714 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5715 Use _Noreturn rather than NO_RETURN.
5716 No need for separate decl merely because of _Noreturn.
5717 * sound.c (sound_warning, parse_sound):
5718 Remove unnecessary forward decls.
5719
5720 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5721
5722 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5723 * lisp.h (WAIT_READING_MAX): New macro.
5724 * dispnew.c (Fsleep_for, sit_for):
5725 * keyboard.c (kbd_buffer_get_event):
5726 * process.c (Faccept_process_output):
5727 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5728 This improves on the previous patch, which introduced a bug
5729 when time_t is unsigned and as wide as intmax_t.
5730 See <http://bugs.gnu.org/9000#51>.
5731
5732 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5733
5734 * dispnew.c (sit_for, Fsleep_for):
5735 * keyboard.c (kbd_buffer_get_event):
5736 * process.c (Faccept_process_output): Avoid compiler warnings when
5737 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5738
5739 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5740
5741 * makefile.w32-in: Update dependencies.
5742
5743 * w32.c (ltime): Add return type and declare static.
5744 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5745
5746 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5747
5748 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5749 Privately reported by Herbert J. Skuhra.
5750 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5751 All uses changed.
5752 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5753 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5754
5755 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5756
5757 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5758 last argument of make_unibyte_string.
5759
5760 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5761 language ID in the event parameters.
5762
5763 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5764 event.code, not the obscure "character set ID".
5765
5766 2012-06-23 Chong Yidong <cyd@gnu.org>
5767
5768 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5769
5770 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5771
5772 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5773 * w32.c (fdutimens): New function.
5774
5775 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5776
5777 * s/ms-w32.h (pselect): Redirect to sys_select.
5778
5779 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5780
5781 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5782 in the logic of incrementing and decrementing the value of
5783 use_relocatable_buffers.
5784
5785 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5786
5787 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5788 Privately reported by Herbert J. Skuhra.
5789 [__FreeBSD__]: Remove "*/" typo after "#include".
5790 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5791 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5792 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5793 Don't assume EMACS_TIME and struct timeval are the same type.
5794
5795 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5796
5797 Support higher-resolution time stamps (Bug#9000).
5798 The time stamps are only nanosecond-resolution at the C level,
5799 since that's the best that any real-world system supports now.
5800 But they are picosecond-resolution at the Lisp level, as that's
5801 easy, and leaves room for future OS improvements.
5802
5803 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5804 (LIBES): Use it.
5805
5806 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5807 Don't get current time unless it's needed.
5808
5809 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5810 now provides it if it's absent.
5811 (start_atimer): Port to higher-res time stamps.
5812 Check for time stamp overflow. Don't get current time more
5813 often than is needed.
5814
5815 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5816 Include systime.h, not time.h.
5817 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5818
5819 * dired.c: Include stat-time.h.
5820 (Ffile-attributes): File times now have higher resolution.
5821
5822 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5823 (struct image): Timestamp now has higher resolution.
5824
5825 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5826 has at least microseconds now. All uses removed.
5827 (update_frame, update_single_window, update_window, update_frame_1)
5828 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5829 (duration_to_sec_usec): Remove; no longer needed.
5830
5831 * editfns.c (time_overflow): Now extern.
5832 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5833 (float-time, Fformat_time_string, Fcurrent_time_string)
5834 (Fcurrent_time_zone): Accept and generate higher-resolution
5835 time stamps.
5836 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5837 (decode_time_components, lisp_seconds_argument): New functions.
5838 (make_time): Now static.
5839 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5840 Report an error if the time is invalid, rather than having the caller
5841 do that.
5842
5843 * fileio.c: Include <stat-time.h>
5844 (Fcopy_file): Copy higher-resolution time stamps.
5845 Prefer to set the time stamp via a file descriptor if that works.
5846 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5847 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5848 (Fvisited_file_modtime, Fset_visited_file_modtime):
5849 Support higher-resolution time stamps.
5850
5851 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5852
5853 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5854
5855 * image.c (prepare_image_for_display, clear_image_cache)
5856 (lookup_image): Port to higer-resolution time stamps.
5857
5858 * keyboard.c (start_polling, bind_polling_period):
5859 Check for time stamp overflow.
5860 (read_char, kbd_buffer_get_event, timer_start_idle)
5861 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5862 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5863 Port to higher-resolution time stamps. Do not assume time_t is signed.
5864 (decode_timer): New function. Timers are now vectors of length 9,
5865 not 8, to accommodate the picosecond component.
5866 (timer_check_2): Use it.
5867
5868 * nsterm.m (select_timeout, timeval_subtract): Remove.
5869 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5870 as they're a bit more accurate and handle overflow better.
5871 (ns_select): Change prototype to be compatible with pselect.
5872 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5873 * nsterm.h (ns_select): Adjust prototype.
5874
5875 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5876 us-resolution time stamps.
5877 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5878
5879 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5880
5881 * lisp.h (time_overflow): New decl.
5882 (wait_reading_process_output): First arg is now intmax_t, not int,
5883 to accommodate larger waits.
5884
5885 * process.h (struct Lisp_Process.read_output_delay):
5886 Now counts nanoseconds, not microseconds.
5887 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5888 EMACS_HAS_USECS.
5889 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5890 (wait_reading_process_output):
5891 Port to ns-resolution time stamps.
5892 (Faccept_process_output, wait_reading_process_output):
5893 Check for time stamp overflow. Do not assume time_t is signed.
5894 (select_wrapper): Remove; we now use pselect.
5895 (Fprocess_attributes): Now generates ns-resolution time stamps.
5896
5897 * sysdep.c: Include utimens.h. Don't include utime.h
5898 or worry about struct utimbuf; gnulib does that for us now.
5899 (gettimeofday): Remove; gnulib provides a substitute.
5900 (make_timeval): New function.
5901 (set_file_times): Now sets ns-resolution time stamps.
5902 New arg FD; all uses changed.
5903 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5904 (system_process_attributes):
5905 Now returns ns-resolution time stamp. All uses changed.
5906 Check for time stamp overflow.
5907
5908 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5909 provides a substitute now.
5910
5911 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5912 since it guarantees struct timespec.
5913 (EMACS_TIME): Now struct timespec, so that we can support
5914 ns-resolution time stamps.
5915 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5916 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5917 (EMACS_USECS): Remove.
5918 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5919 so multiply the arg by 1000 before storing it.
5920 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5921 New macros.
5922 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5923 Port to ns-resolution time stamps.
5924 (EMACS_TIME_NEG_P): Remove; replaced by....
5925 (EMACS_TIME_SIGN): New macro.
5926 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5927 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5928 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5929 (make_timeval, make_lisp_time, decode_time_components): New decls.
5930 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5931 that it mishandled time_t overflow. You can't compare by subtracting!
5932 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5933 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5934
5935 * term.c: Include <sys/time.h>.
5936 (timeval_to_Time): New function, for proper overflow wraparound.
5937 (term_mouse_position, term_mouse_click): Use it.
5938
5939 * undo.c (record_first_change): Support higher-resolution time stamps
5940 in the undo buffer.
5941 (Fprimitive_undo): Use them when restoring time stamps.
5942
5943 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5944 (w32_get_internal_run_time):
5945 Port to higher-resolution Emacs time stamps.
5946 (ltime): Now accepts single 64-bit integer, as that's more convenient
5947 for callers.
5948
5949 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5950
5951 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5952 for compatibility with pselect. Support ns-resolution time stamps.
5953
5954 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5955
5956 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5957 Check for time stamp overflow, and support ns-resolution time stamps.
5958
5959 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5960 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5961 (timeval_subtract): Remove; no longer needed.
5962 (XTflash, XTring_bell, x_wait_for_event):
5963 Port to ns-resolution time stamps. Don't assume time_t is signed.
5964
5965 2012-06-22 Chong Yidong <cyd@gnu.org>
5966
5967 * xdisp.c (x_consider_frame_title): Revert last change.
5968
5969 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5970
5971 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5972 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5973 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5974 staticidx goes up to 1597 out of 1600 = 0x640.)
5975
5976 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5977
5978 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5979 Otherwise, the umask might be mistakenly 0 while handling input signals.
5980
5981 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5982
5983 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5984
5985 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5986
5987 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5988 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5989 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5990 access to `contents' member of Lisp_Vector objects with AREF and ASET
5991 where appropriate.
5992
5993 2012-06-19 Chong Yidong <cyd@gnu.org>
5994
5995 * frame.c (delete_frame): When selecting a frame on a different
5996 text terminal, do not alter the terminal's top-frame.
5997
5998 * xdisp.c (format_mode_line_unwind_data): Record the target
5999 frame's selected window and its terminal's top-frame.
6000 (unwind_format_mode_line): Restore them.
6001 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6002 Callers changed.
6003 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6004 since tty frames can be explicitly named.
6005 (prepare_menu_bars): Likewise.
6006
6007 * term.c (Ftty_top_frame): New function.
6008
6009 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6010
6011 Port byte-code-meter to modern targets.
6012 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6013 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6014 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6015 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6016 (METER_1, METER_2): Simplify.
6017
6018 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6019
6020 * data.c (Fdefalias): Return `symbol' (bug#11686).
6021
6022 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6023
6024 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6025 gets killed during executing of this function (Bug#11665).
6026 Try to always return Qt when the buffer has been actually killed.
6027 (Vkill_buffer_query_functions): In doc-string say that functions
6028 run by this hook should not change the current buffer.
6029
6030 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6031
6032 Fix recently-introduced process.c problems found by static checking.
6033 * process.c (write_queue_push, write_queue_pop, send_process):
6034 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6035 (write_queue_pop): Fix pointer signedness problem.
6036 (send_process): Remove unused local.
6037
6038 2012-06-17 Chong Yidong <cyd@gnu.org>
6039
6040 * xdisp.c (redisplay_internal): No need to redisplay terminal
6041 frames that are not on top.
6042
6043 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6044
6045 * process.c (make_process): Initialize write_queue.
6046 (write_queue_push, write_queue_pop): New functions.
6047 (send_process): Use them to maintain correct ordering of process
6048 writes (Bug#10815).
6049
6050 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6051
6052 * lisp.h (eassert): Assume C89 or later.
6053 This removes the need for CHECK.
6054 (CHECK): Remove. Its comments about always evaluating its
6055 argument were confusing, as 'eassert' typically does not evaluate
6056 its argument.
6057
6058 * coding.c (produce_chars): Use ptrdiff_t, not int.
6059
6060 * xterm.c (x_draw_underwave): Check for integer overflow.
6061 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6062
6063 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6064
6065 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6066 referenced (Bug#11583).
6067
6068 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6069
6070 Implement wave-style variant of underlining.
6071 * dispextern.h (face_underline_type): New enum.
6072 (face): Add field for underline type.
6073 * nsterm.m (ns_draw_underwave): New function.
6074 (ns_draw_text_decoration): Use it.
6075 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6076 New functions.
6077 (x_draw_glyph_string): Use them.
6078 * xfaces.c (Qline, Qwave): New Lisp objects.
6079 (check_lface_attrs, merge_face_ref)
6080 (Finternal_set_lisp_face_attribute, realize_x_face):
6081 Handle wave-style underline face attributes.
6082 * xterm.c (x_draw_underwave): New function.
6083 (x_draw_glyph_string): Use it.
6084
6085 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6086
6087 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6088 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6089 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6090 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6091 ($(BLD)/w32select.$(O)): Update dependencies.
6092
6093 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6094
6095 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6096 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6097 * character.c (_fetch_multibyte_char_p): Remove.
6098 * alloc.c: Include "character.h" before "buffer.h".
6099 * bidi.c: Likewise.
6100 * buffer.c: Likewise.
6101 * bytecode.c: Likewise.
6102 * callint.c: Likewise.
6103 * callproc.c: Likewise.
6104 * casefiddle.c: Likewise.
6105 * casetab.c: Likewise.
6106 * category.c: Likewise.
6107 * cmds.c: Likewise.
6108 * coding.c: Likewise.
6109 * composite.c: Likewise.
6110 * dired.c: Likewise.
6111 * dispnew.c: Likewise.
6112 * doc.c: Likewise.
6113 * dosfns.c: Likewise.
6114 * editfns.c: Likewise.
6115 * emacs.c: Likewise.
6116 * fileio.c: Likewise.
6117 * filelock.c: Likewise.
6118 * font.c: Likewise.
6119 * fontset.c: Likewise.
6120 * fringe.c: Likewise.
6121 * indent.c: Likewise.
6122 * insdel.c: Likewise.
6123 * intervals.c: Likewise.
6124 * keyboard.c: Likewise.
6125 * keymap.c: Likewise.
6126 * lread.c: Likewise.
6127 * macros.c: Likewise.
6128 * marker.c: Likewise.
6129 * minibuf.c: Likewise.
6130 * nsfns.m: Likewise.
6131 * nsmenu.m: Likewise.
6132 * print.c: Likewise.
6133 * process.c: Likewise.
6134 * regex.c: Likewise.
6135 * region-cache.c: Likewise.
6136 * search.c: Likewise.
6137 * syntax.c: Likewise.
6138 * term.c: Likewise.
6139 * textprop.c: Likewise.
6140 * undo.c: Likewise.
6141 * unexsol.c: Likewise.
6142 * w16select.c: Likewise.
6143 * w32fns.c: Likewise.
6144 * w32menu.c: Likewise.
6145 * window.c: Likewise.
6146 * xdisp.c: Likewise.
6147 * xfns.c: Likewise.
6148 * xmenu.c: Likewise.
6149 * xml.c: Likewise.
6150 * xselect.c: Likewise.
6151
6152 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6153
6154 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6155 If all the glyphs of the glyph row came from strings, and we have no
6156 cursor positioning clues, put the cursor on the first glyph of the
6157 row.
6158 (handle_face_prop): Use chunk-relative overlay string index when
6159 indexing into it->string_overlays array. (Bug#11653)
6160 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6161 the rightmost. (Bug#11720)
6162
6163 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6164
6165 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6166 (CATEGORY_MEMBER): Enforce 1/0 value.
6167 * category.c (_temp_category_set): Remove.
6168
6169 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6170
6171 * window.c (Fdelete_other_windows_internal)
6172 (Fdelete_window_internal): Don't access frame's mouse highlight
6173 info of the initial frame. (Bug#11677)
6174
6175 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6176
6177 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6178 Assume USE_2_TAGS_FOR_INTS.
6179 (xreload): Adjust $tagmask width to match recent lisp.h change.
6180
6181 Simplify lisp.h in minor ways that should not affect code.
6182 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6183 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6184 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6185 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6186 (INTTYPEBITS): New macro, for clarity.
6187 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6188 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6189 Simplify now that USE_LSB_TAG is always defined.
6190 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6191 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6192
6193 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6194
6195 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6196
6197 2012-06-13 Glenn Morris <rgm@gnu.org>
6198
6199 * s/bsd-common.h (BSD4_3):
6200 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6201
6202 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6203
6204 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6205 instead of union.
6206 (XLI, XIL): Define.
6207 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6208 Use them.
6209 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6210 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6211 * alloc.c (widen_to_Lisp_Object): Remove.
6212 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6213 * frame.c (delete_frame): Remove outdated comment.
6214 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6215 USE_LISP_UNION_TYPE.
6216 (Fw32_unregister_hot_key): Likewise.
6217 (Fw32_toggle_lock_key): Likewise.
6218 * w32menu.c (add_menu_item): Likewise.
6219 (w32_menu_display_help): Use XIL instead of checking
6220 USE_LISP_UNION_TYPE.
6221 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6222 (init_heap): Likewise.
6223 * w32term.c (w32_read_socket): Update comment.
6224
6225 2012-06-13 Glenn Morris <rgm@gnu.org>
6226
6227 * s/usg5-4-common.h, src/s/unixware.h:
6228 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6229
6230 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6231
6232 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6233
6234 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6235 * alloc.c (make_number) [!defined make_number]:
6236 Remove, as lisp.h always defines this now.
6237 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6238 (roundup_size): Verify that it is a power of 2.
6239 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6240 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6241 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6242 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6243 USE_LSB_TAG now is always defined to be either 0 or 1.
6244 All uses changed.
6245 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6246 code works fine either way, and efficiency is not a concern here,
6247 as the union type is for debugging, not for production.
6248 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6249 Use an inline function on all platforms when using the union type,
6250 since this is simpler and 'static inline' can be used portably
6251 within Emacs now.
6252 (LISP_INITIALLY_ZERO): New macro.
6253 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6254 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6255
6256 2012-06-12 Glenn Morris <rgm@gnu.org>
6257
6258 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6259
6260 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6261
6262 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6263 Move BROKEN_SIGIO to configure.
6264
6265 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6266 Move NO_TERMIO to configure.
6267
6268 2012-06-12 Chong Yidong <cyd@gnu.org>
6269
6270 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6271 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6272 MagickExportImagePixels is undefined.
6273
6274 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6275
6276 * image.c (imagemagick_load_image): Remove unused label.
6277
6278 2012-06-11 Glenn Morris <rgm@gnu.org>
6279
6280 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6281 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6282 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6283 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6284
6285 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6286
6287 * alloc.c (make_byte_code): New function.
6288 (Fmake_byte_code): Use it. Don't purify here.
6289 * lread.c (read1): Use it as well to avoid extra allocation.
6290
6291 2012-06-11 Chong Yidong <cyd@gnu.org>
6292
6293 * image.c (imagemagick_load_image): Implement transparency.
6294
6295 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6296
6297 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6298 account for preceding backslashes. (Bug#11663)
6299
6300 2012-06-09 Chong Yidong <cyd@gnu.org>
6301
6302 * term.c: Support italics in capable terminals (Bug#9652).
6303 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6304 (turn_on_face): Output using TS_enter_italic_mode if available.
6305 Don't handle unused blinking and alt-charset cases.
6306 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6307 and tty_alt_charset_p cases.
6308 (tty_capable_p, init_tty): Support italics.
6309
6310 * termchar.h (struct tty_display_info): Add field for italics.
6311 Remove unused blink field.
6312
6313 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6314 Handle slant.
6315
6316 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6317 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6318 tty_alt_charset_p. Add tty_italic_p.
6319
6320 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6321
6322 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6323 dbus_type_is_basic if available.
6324 (xd_extract_signed, xd_extract_unsigned): Rename from
6325 extract_signed and extract_unsigned, respectively. Adapt callers.
6326
6327 2012-06-09 Chong Yidong <cyd@gnu.org>
6328
6329 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6330
6331 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6332 case (Bug#9752).
6333
6334 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6335
6336 * xdisp.c (vmessage): Treat frame message as multibyte.
6337 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6338 would generate the diagnostic "Making \302\247 buffer-local while
6339 let-bound!".
6340
6341 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6342
6343 * dispnew.c (showing_window_margins_p): Undo last change, which
6344 was done due to an inadvertent commit.
6345 (adjust_frame_glyphs_for_frame_redisplay): Do call
6346 showing_window_margins_p.
6347
6348 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6349
6350 * eval.c (Fmake_var_non_special): New primitive.
6351 (syms_of_eval): Defsubr it.
6352 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6353
6354 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6355
6356 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6357 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6358
6359 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6360
6361 * alloc.c (allocate_vectorlike): Fix last change.
6362
6363 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6364
6365 Block-based vector allocation of small vectors.
6366 * lisp.h (struct vectorlike_header): New field `nbytes',
6367 adjust comment accordingly.
6368 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6369 to denote vector blocks. Adjust users (live_vector_p,
6370 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6371 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6372 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6373 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6374 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6375 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6376 (roundup_size): New constant.
6377 (struct vector_block): New data type.
6378 (vector_blocks, vector_free_lists, zero_vector): New variables.
6379 (all_vectors): Rename to `large_vectors'.
6380 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6381 (sweep_vectors): New functions.
6382 (allocate_vectorlike): Return `zero_vector' as the only vector of
6383 0 items. Allocate new vector from block if vector size is less than
6384 or equal to VBLOCK_BYTES_MAX.
6385 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6386 (init_alloc_once): Add call to init_vectors.
6387
6388 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6389
6390 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6391
6392 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6393
6394 * doprnt.c (doprnt): Truncate multibyte char correctly.
6395 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6396 would mishandle a string argument "Xc" if X was a multibyte
6397 character of length 2: it would truncate after X's first byte
6398 rather than including all of X.
6399
6400 2012-06-06 Chong Yidong <cyd@gnu.org>
6401
6402 * buffer.c (word_wrap): Doc fix.
6403
6404 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6405
6406 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6407
6408 2012-06-03 Glenn Morris <rgm@gnu.org>
6409
6410 * xdisp.c (tool-bar-style): Doc fix.
6411
6412 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6413
6414 * Makefile.in (PAXCTL): Define.
6415 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6416 binary via PaX flags if the paxctl utility is available.
6417 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6418 Restore PaX flags to their default. (Bug#11398)
6419
6420 2012-06-03 Chong Yidong <cyd@gnu.org>
6421
6422 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6423 buffer (Bug#11226).
6424
6425 2012-06-03 Chong Yidong <cyd@gnu.org>
6426
6427 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6428 (note_mode_line_or_margin_highlight): If there is no help echo,
6429 use mode-line-default-help-echo. Handle the case where the mouse
6430 position is past the end of the mode line string.
6431
6432 * buffer.c (buffer_local_value_1): New function, split from
6433 Fbuffer_local_value; can return Qunbound.
6434 (Fbuffer_local_value): Use it.
6435 (Vmode_line_format): Docstring tweaks.
6436
6437 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6438
6439 * sysdep.c (system_process_attributes): Improve comment.
6440
6441 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6442
6443 * keyboard.c: Export real-this-command to Elisp.
6444 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6445 and DEFVAR it. Update all users.
6446
6447 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6448
6449 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6450
6451 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6452 Convert pctcpu and pctmem to Lisp float properly.
6453 Let the compiler fold better, as 100.0/0x8000 is exact.
6454
6455 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6456
6457 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6458 cons_block.
6459
6460 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6461
6462 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6463
6464 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6465
6466 For a 'struct window', replace some Lisp_Object fields to
6467 bitfields where appropriate, remove unused fields.
6468 * window.h (struct window): Remove unused 'last_mark_x' and
6469 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6470 change it's type from Lisp_Object to bitfield.
6471 Change type of 'force_start', 'optional_new_start',
6472 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6473 fields from Lisp_Object to bitfield. Adjust users accordingly.
6474
6475 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6476
6477 Pacify gcc -Wdouble-precision when using Xaw.
6478 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6479 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6480 Use 'float' consistently, rather than 'float' in most places
6481 and 'double' in a couple of places.
6482
6483 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6484
6485 * xdisp.c (handle_stop): Detect whether we have overlay strings
6486 loaded by testing it->current.overlay_string_index to be
6487 non-negative, instead of checking whether n_overlay_strings is
6488 positive. (Bug#11587)
6489
6490 2012-05-31 Chong Yidong <cyd@gnu.org>
6491
6492 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6493
6494 * doc.c (Fsubstitute_command_keys): Doc fix.
6495
6496 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6497
6498 * search.c (search_buffer): Remove calls to
6499 r_alloc_inhibit_buffer_relocation, as it is now called by
6500 maybe_unify_char, which was the cause of relocation of buffer text
6501 in bug#11519.
6502
6503 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6504
6505 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6506 for the duration of call to load_charset, to avoid problems with
6507 callers of maybe_unify_char that access buffer text through C
6508 pointers.
6509
6510 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6511 decrement the inhibition flag, instead of just setting or
6512 resetting it.
6513
6514 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6515
6516 Remove obsolete '#define static' cruft.
6517 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6518 This #undef was "temporary" in 2000; it is no longer needed
6519 now that '#define static' has gone away.
6520 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6521 (gray_bitmap_bits): Remove; no longer needed.
6522 All uses replaced with definiens.
6523 * xterm.c: Include "bitmaps/gray.xbm".
6524
6525 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6526
6527 Clean up __executable_start, monstartup when --enable-profiling.
6528 The following changes affect the code only when profiling.
6529 * dispnew.c (__executable_start): Rename from safe_bcopy.
6530 Define only on platforms that need it.
6531 * emacs.c: Include <sys/gmon.h> when profiling.
6532 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6533 (__executable_start): Remove decl, since lisp.h does it now.
6534 (safe_bcopy): Remove decl; no longer has that name.
6535 (main): Coalesce #if into single bit of code, for simplicity.
6536 Cast pointers to uintptr_t, since standard libraries want integers
6537 and not pointers.
6538 * lisp.h (__executable_start): New decl.
6539
6540 2012-05-31 Glenn Morris <rgm@gnu.org>
6541
6542 * image.c (Fimagemagick_types): Doc fix.
6543
6544 2012-05-30 Jim Meyering <meyering@redhat.com>
6545
6546 * callproc.c (Fcall_process_region): Include directory component
6547 in mkstemp error message (Bug#11586).
6548
6549 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6550
6551 * alloc.c, lisp.h (make_pure_vector): Now static.
6552
6553 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6554
6555 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6556 Move to byte-run.el.
6557 (Fautoload): Do the hash-doc more carefully.
6558 * data.c (Fdefalias): Purify definition, except for keymaps.
6559 (Qdefun): Move from eval.c.
6560 * lisp.h (Qdefun): Remove.
6561 * lread.c (read1): Tiny simplification.
6562
6563 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6564
6565 Do not create empty overlays with the evaporate property (Bug#9642).
6566 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6567 Bug#9642, but explicitly check that the buffer the overlay would
6568 be moved to is live and rearrange lines to make sure that errors
6569 will not put the overlay in an inconsistent state.
6570 (Fdelete_overlay): Cosmetics.
6571
6572 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6573
6574 * w32term.c (my_bring_window_to_top): New function.
6575 (x_raise_frame): Use handle returned by DeferWindowPos, which
6576 could be different from the original one.
6577 Call my_bring_window_to_top instead of my_set_foreground_window.
6578 (Bug#11513)
6579
6580 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6581 by calling BringWindowToTop.
6582
6583 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6584 (WM_EMACS_END): Increase by one.
6585
6586 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6587
6588 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6589 This avoids undefined behavior that might cause the eassert
6590 to not catch an out-of-range value.
6591
6592 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6593
6594 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6595 Update dependencies.
6596
6597 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6598
6599 * bidi.c (bidi_mirror_char): Fix last change.
6600
6601 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6602
6603 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6604 when referring to sectname field in printf format.
6605
6606 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6607
6608 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6609 Only r_alloc_inhibit_buffer_relocation needed to be added;
6610 the others were already declared.
6611
6612 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6613 before checking whether it's out of range. Put the check inside
6614 eassert. See
6615 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6616
6617 2012-05-27 Ken Brown <kbrown@cornell.edu>
6618
6619 * callproc.c (Fcall_process): Restore a line that was accidentally
6620 commented out in the 2011-02-13 change (bug#11547).
6621
6622 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6623
6624 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6625 defined on ralloc.c.
6626
6627 * buffer.c [REL_ALLOC]: Remove prototypes of
6628 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6629 they are now on lisp.h.
6630
6631 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6632
6633 * search.c (search_buffer): Use it to inhibit relocation of buffer
6634 text while re_search_2 is doing its job, because re_search_2 is
6635 passed C pointers to buffer text. (Bug#11519)
6636
6637 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6638 Update value to 24.
6639
6640 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6641 state after an additional call to move_it_in_display_line_to, keep
6642 the values of it->max_ascent and it->max_descent found for the
6643 entire line.
6644 (pos_visible_p): Revert the comparison against bottom_y to what it
6645 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6646 (Bug#11464)
6647
6648 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6649
6650 Fix coding-related core dumps with gcc -ftrapv.
6651 The code was computing A - B, where A and B are pointers, and B is
6652 random garbage. This can lead to core dumps on platforms that
6653 have special pointer registers, and it also leads to core dumps on
6654 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6655 A - B only when B is initialized properly.
6656 * coding.c (coding_set_source, coding_set_destination): Return void.
6657 (coding_change_source, coding_change_destinations): New functions,
6658 with the old behaviors of coding_set_source and coding_set_destination.
6659 All callers that need an offset changed to use these new functions.
6660
6661 2012-05-26 Glenn Morris <rgm@gnu.org>
6662
6663 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6664
6665 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6666
6667 Extend mouse support on W32 text-mode console.
6668 * xdisp.c (draw_row_with_mouse_face):
6669 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6670
6671 * w32console.c: Include window.h.
6672 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6673 New functions.
6674 (initialize_w32_display): Initialize mouse-highlight data.
6675
6676 * w32inevt.c: Include termchar.h and window.h.
6677 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6678 moves, call note_mouse_highlight. If help_echo changed, call
6679 gen_help_event to produce help-echo message in the echo area.
6680 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6681 highlight info.
6682
6683 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6684
6685 * lread.c (read1): Simplify slightly to avoid an overflow warning
6686 with GCC 4.7.0 on x86-64.
6687
6688 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6689
6690 * bidi.c (bidi_mirror_char): Revert last change: an int is
6691 definitely wide enough here.
6692
6693 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6694
6695 Fix integer width and related bugs (Bug#9874).
6696 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6697 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6698 (string_bytes, check_sblock, allocate_string_data):
6699 (compact_small_strings, Fmake_bool_vector, make_string)
6700 (make_unibyte_string, make_multibyte_string)
6701 (make_string_from_bytes, make_specified_string)
6702 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6703 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6704 (mark_vectorlike):
6705 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6706 (allocate_pseudovector):
6707 Use int, not EMACS_INT, where int is wide enough.
6708 (inhibit_garbage_collection, Fgarbage_collect):
6709 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6710 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6711 int might not be wide enough.
6712 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6713 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6714 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6715 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6716 (bidi_level_of_next_char, bidi_move_to_visually_next):
6717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6718 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6719 (Fkill_buffer, Fset_buffer_major_mode)
6720 (advance_to_char_boundary, Fbuffer_swap_text)
6721 (Fset_buffer_multibyte, overlays_at, overlays_in)
6722 (overlay_touches_p, struct sortvec, record_overlay_string)
6723 (overlay_strings, recenter_overlay_lists)
6724 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6725 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6726 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6727 (Foverlay_recenter, last_overlay_modification_hooks_used)
6728 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6730 (validate_region): Omit unnecessary test for b <= e,
6731 since that's guaranteed by the previous test.
6732 (adjust_overlays_for_delete): Avoid pos + length overflow.
6733 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6734 (report_overlay_modification):
6735 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6736 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6737 Omit pointer cast, which isn't needed anyway, and doesn't work
6738 after the EMACS_INT -> ptrdiff_t change.
6739 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6740 * buffer.h: Adjust decls to match defn changes elsewhere.
6741 (struct buffer_text, struct buffer):
6742 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6743 Use EMACS_INT, not int, where int might not be wide enough.
6744 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6745 not int, to avoid needless 32-bit limit on 64-bit hosts.
6746 (exec_byte_code): Use tighter memory-full test, one that checks
6747 for alloca overflow. Don't compute the address of the object just
6748 before an array, as that's not portable. Use EMACS_INT, not
6749 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6750 * callint.c (Fcall_interactively):
6751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6752 * callproc.c (call_process_kill, Fcall_process):
6753 Don't assume pid_t fits into an Emacs fixnum.
6754 (call_process_cleanup, Fcall_process, child_setup):
6755 Don't assume pid_t fits into int.
6756 (call_process_cleanup, Fcall_process, delete_temp_file)
6757 (Fcall_process_region):
6758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6759 (Fcall_process): Simplify handling of volatile integers.
6760 Use int, not EMACS_INT, where int will do.
6761 * casefiddle.c (casify_object, casify_region, operate_on_word)
6762 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6764 (casify_object): Avoid integer overflow when overallocating buffer.
6765 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6766 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6767 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6768 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6769 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6770 integers are now checked earlier. All uses replaced with XINT.
6771 (ccl_driver):
6772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6773 For CCL_MapSingle, check that content and value are in int range.
6774 (ccl_driver, Fregister_code_conversion_map):
6775 Check that Vcode_version_map_vector is a vector.
6776 (resolve_symbol_ccl_program): Check that vector header is in range.
6777 Always copy the vector, so that we can check its contents reliably
6778 now rather than having to recheck each instruction as it's being
6779 executed. Check that vector words fit in 'int'.
6780 (ccl_get_compiled_code, Fregister_ccl_program)
6781 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6782 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6783 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6784 contents are in range.
6785 (Fccl_execute_on_string): Check that status is in range.
6786 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6787 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6788 Accept and return EMACS_INT, not int, because callers can pass values
6789 out of 'int' range.
6790 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6791 (multibyte_chars_in_text, parse_str_as_multibyte)
6792 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6793 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6794 (string_escape_byte8, Fget_byte):
6795 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6796 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6797 avoid mishandling large integers.
6798 * character.h: Adjust decls to match defn changes elsewhere.
6799 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6800 (Ffind_charset_region):
6801 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6802 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6803 (load_charset_map_from_vector, Fdefine_charset_internal):
6804 Don't assume fixnum fits in int.
6805 (load_charset_map_from_vector, Fmap_charset_chars):
6806 Remove now-unnecessary CHECK_NATNUMs.
6807 (Fdefine_charset_internal): Check ranges here, more carefully.
6808 Don't rely on undefined behavior with signed left shift overflow.
6809 Don't assume unsigned int fits into fixnum, or that fixnum fits
6810 into unsigned int. Don't require max_code to be a valid fixnum;
6811 that's not true for gb10830 4-byte on a 32-bit host. Allow
6812 invalid_code to be a cons, for the same reason. Require code_offset
6813 to be a character. Avoid int overflow if max_char is close
6814 to INT_MAX.
6815 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6816 this is intended anyway and avoids some undefined behavior.
6817 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6818 INDEX_TO_CODE_POINT, as that's what it expects.
6819 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6820 * charset.h (DECODE_CHAR): Return int, not unsigned;
6821 this is what was intended anyway, and it avoids undefined behavior.
6822 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6823 integer-overflow issues.
6824 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6825 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6826 where the argument is EMACS_INT, and this behavior is not intended.
6827 * chartab.c (Fmake_char_table, Fset_char_table_range)
6828 (uniprop_get_decoder, uniprop_get_encoder):
6829 Don't assume fixnum fits in int.
6830 * cmds.c (move_point): New function, that does the gist of
6831 Fforward_char and Fbackward_char, but does so while checking
6832 for integer overflow more accurately.
6833 (Fforward_char, Fbackward_char): Use it.
6834 (Fforward_line, Fend_of_line, internal_self_insert)
6835 (internal_self_insert):
6836 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6837 Fix a FIXME, by checking for integer overflow when calculating
6838 target_clm and actual_clm.
6839 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6840 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6841 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6842 (coding_alloc_by_making_gap, alloc_destination)
6843 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6844 (encode_coding_utf_16, detect_coding_emacs_mule)
6845 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6846 (detect_coding_iso_2022, decode_coding_iso_2022)
6847 (encode_invocation_designation, encode_designation_at_bol)
6848 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6849 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6850 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6851 (encode_coding_ccl, encode_coding_raw_text)
6852 (detect_coding_charset, decode_coding_charset)
6853 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6854 (produce_composition, produce_charset, produce_annotation)
6855 (decode_coding, handle_composition_annotation)
6856 (handle_charset_annotation, consume_chars, decode_coding_gap)
6857 (decode_coding_object, encode_coding_object, detect_coding_system)
6858 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6859 (code_convert_region, code_convert_string)
6860 (Fdefine_coding_system_internal)
6861 (coding_set_source, coding_set_destination):
6862 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6863 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6864 (Fdefine_coding_system_internal):
6865 Don't assume fixnums fit in int.
6866 (decode_coding_gap, decode_coding_object, encode_coding_object)
6867 (Fread_coding_system, Fdetect_coding_region)
6868 (Funencodable_char_position, Fcheck_coding_systems_region)
6869 (get_translation, handle_composition_annotation, consume_chars):
6870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6871 (consume_chars): Rewrite to not calculate an address outside buffer.
6872 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6873 Don't access memory outside of the args array.
6874 (Fdefine_coding_system_internal): Check for charset-id overflow.
6875 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6876 result of ENCODE_CHAR.
6877 * coding.h: Adjust decls to match defn changes elsewhere.
6878 (struct coding_system):
6879 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6880 * composite.c (get_composition_id, find_composition)
6881 (run_composition_function, update_compositions)
6882 (compose_text, composition_gstring_put_cache)
6883 (composition_gstring_p, composition_gstring_width)
6884 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6885 (composition_compute_stop_pos, composition_reseat_it)
6886 (composition_update_it, struct position_record)
6887 (find_automatic_composition, composition_adjust_point)
6888 (Fcomposition_get_gstring, Ffind_composition_internal):
6889 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6890 (update_compositions):
6891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6892 * composite.h: Adjust decls to match defn changes elsewhere.
6893 (struct composition):
6894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6895 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6896 Do not attempt to compute the address of the object just before a
6897 buffer; this is not portable.
6898 (Faref, Faset):
6899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6900 (Faset): Use int, not EMACS_INT, where int is wide enough.
6901 (Fstring_to_number): Don't assume fixnums fit in int.
6902 (Frem): Don't assume arg is nonnegative.
6903 * dbusbind.c (xd_append_arg): Check for integers out of range.
6904 (Fdbus_call_method): Don't overflow the timeout int.
6905 (extract_signed, extract_unsigned): New functions.
6906 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6907 (xd_get_connection_references): Return ptrdiff_t, not int.
6908 All uses changed.
6909 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6910 (xd_read_message_1):
6911 Use int, not unsigned, where the dbus API uses int.
6912 (Fdbus_message_internal): Don't overflow mtype.
6913 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6914 * dired.c (directory_files_internal, file_name_completion, scmp)
6915 (file_name_completion_stat):
6916 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6917 (file_name_completion): Don't overflow matchcount.
6918 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6919 * dispextern.h: Adjust decls to match defn changes elsewhere.
6920 (struct text_pos, struct glyph, struct bidi_saved_info)
6921 (struct bidi_string_data, struct bidi_it, struct composition_it)
6922 (struct it):
6923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6924 (struct display_pos, struct composition_it, struct it):
6925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6926 * dispnew.c (increment_matrix_positions)
6927 (increment_row_positions, mode_line_string)
6928 (marginal_area_string):
6929 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6930 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6931 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6932 (duration_to_sec_usec): New function, to check for overflow better.
6933 (Fsleep_for, sit_for): Use it.
6934 * doc.c (get_doc_string, store_function_docstring):
6935 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6936 (get_doc_string, Fsnarf_documentation):
6937 Use int, not EMACS_INT, where int is wide enough.
6938 (get_doc_string):
6939 Use SAFE_ALLOCA, not alloca.
6940 Check for overflow when converting EMACS_INT to off_t.
6941 * doprnt.c (doprnt):
6942 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6943 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6944 Don't assume uid_t fits into fixnum.
6945 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6946 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6947 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6948 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6949 (general_insert_function)
6950 (Finsert_char, make_buffer_string, make_buffer_string_both)
6951 (update_buffer_properties, Fbuffer_substring)
6952 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6953 (Fsubst_char_in_region, check_translation)
6954 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6955 (transpose_markers, Ftranspose_regions):
6956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6957 (clip_to_bounds): Move to lisp.h as an inline function).
6958 (Fconstrain_to_field): Don't assume integers are nonnegative.
6959 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6960 (Fsubst_char_in_region, Fsave_restriction):
6961 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6962 (Femacs_pid): Don't assume pid_t fits into fixnum.
6963 (lo_time): Use int, not EMACS_INT, when int suffices.
6964 (lisp_time_argument): Check for usec out of range.
6965 (Fencode_time): Don't assume fixnum fits in int.
6966 (Fuser_login_name, Fuser_full_name): Signal an error
6967 if a uid argument is out of range, rather than relying on
6968 undefined behavior.
6969 (Fformat_time_string): Remove now-unnecessary check.
6970 lisp_time_argument checks for out-of-range usec now.
6971 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6972 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6973 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6974 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6975 (init_cmdargs, Fdump_emacs):
6976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6977 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6978 the bottom (typically) 32 bits of the fixnum.
6979 * eval.c (specpdl_size, call_debugger):
6980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6981 (when_entered_debugger, Fbacktrace_debug):
6982 Don't assume fixnum can fit in int.
6983 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6984 the object just before a buffer; this is not portable.
6985 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6986 (grow_specpdl, unbind_to):
6987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6988 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6989 (grow_specpdl): Simplify allocation by using xpalloc.
6990 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6991 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6992 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6994 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6995 (a_write, e_write):
6996 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6997 (Fcopy_file, non_regular_nbytes, read_non_regular)
6998 (Finsert_file_contents):
6999 Use int, not EMACS_INT, where int is wide enough.
7000 (READ_BUF_SIZE): Verify that it fits in int.
7001 (Finsert_file_contents): Check that counts are in proper range,
7002 rather than assuming fixnums fit into ptrdiff_t etc.
7003 Don't assume fixnums fit into int.
7004 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7005 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7006 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7007 (string_char_to_byte, string_byte_to_char)
7008 (string_make_multibyte, string_to_multibyte)
7009 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7010 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7011 (substring_both, Fdelete, internal_equal, Ffillarray)
7012 (Fclear_string, mapcar1)
7013 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7014 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7015 (larger_vector, make_hash_table, maybe_resize_hash_table)
7016 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7017 (Fmaphash, secure_hash):
7018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7019 (concat): Check for string index and length overflow.
7020 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7021 (Frequire):
7022 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7023 (larger_vector): New API (vec, incr_min, size_max) replaces old
7024 one (vec, new_size, init). This catches size overflow.
7025 INIT was removed because it was always Qnil.
7026 All callers changed.
7027 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7028 the upper bound on a hash table index size.
7029 (make_hash_table, maybe_resize_hash_table): Use it.
7030 (secure_hash): Computer start_byte and end_byte only after
7031 they're known to be in ptrdiff_t range.
7032 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7033 (Ffont_get_glyphs, Ffont_at):
7034 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7035 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7036 (Flist_fonts, Fopen_font):
7037 Don't assume fixnum can fit in int.
7038 (check_gstring): Don't assume index can fit in int.
7039 (font_match_p): Check that fixnum is a character, not a nonnegative
7040 fixnum, since the later code needs to stuff it into an int.
7041 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7042 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7043 conversion overflow issues.
7044 (Fopen_font): Check for integer out of range.
7045 (Ffont_get_glyphs): Don't assume index can fit in int.
7046 * font.h: Adjust decls to match defn changes elsewhere.
7047 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7048 integer overflow.
7049 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7050 printmax_t, where ptrdiff_t is wide enough.
7051 (Finternal_char_font):
7052 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7053 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7054 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7055 (Fset_frame_position, x_set_frame_parameters)
7056 (x_set_line_spacing, x_set_border_width)
7057 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7058 Check that fixnums are in proper range for system types.
7059 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7060 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7061 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7062 Use SAFE_ALLOCA_LISP, not alloca.
7063 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7064 intptr_t is wide enough.
7065 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7066 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7067 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7068 Check for fixnum out of range.
7069 * ftfont.c (ftfont_list): Don't assume index fits in int.
7070 Check that fixnums are in proper range for system types.
7071 (ftfont_shape_by_flt):
7072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7073 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7074 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7075 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7076 Check that fixnums are in proper range for system types.
7077 * gnutls.h: Adjust decls to match defn changes elsewhere.
7078 * gtkutil.c (xg_dialog_run):
7079 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7080 (update_frame_tool_bar):
7081 Check that fixnums are in proper range for system types.
7082 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7083 (lookup_image): Check that fixnums are in range for system types.
7084 * indent.c (last_known_column, last_known_column_point):
7085 (current_column_bol_cache):
7086 (skip_invisible, current_column, check_display_width):
7087 (check_display_width, scan_for_column, current_column_1)
7088 (Findent_to, Fcurrent_indentation, position_indentation)
7089 (indented_beyond_p, Fmove_to_column, compute_motion):
7090 (Fcompute_motion, Fvertical_motion):
7091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7092 (last_known_column_modified): Use EMACS_INT, not int.
7093 (check_display_width):
7094 (Fcompute_motion):
7095 Check that fixnums and floats are in proper range for system types.
7096 (compute_motion): Don't assume index or fixnum fits in int.
7097 (compute_motion, Fcompute_motion):
7098 Use int, not EMACS_INT, when it is wide enough.
7099 (vmotion): Omit local var start_hpos that is always 0; that way
7100 we don't need to worry about overflow in expressions involving it.
7101 * indent.h: Adjust decls to match defn changes elsewhere.
7102 (struct position):
7103 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7104 Use int, not EMACS_INT, where int is wide enough.
7105 Remove unused members ovstring_chars_done and tab_offset;
7106 all uses removed.
7107 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7108 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7109 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7110 (make_gap, copy_text, insert, insert_and_inherit)
7111 (insert_before_markers, insert_before_markers_and_inherit)
7112 (insert_1, count_combining_before, count_combining_after)
7113 (insert_1_both, insert_from_string)
7114 (insert_from_string_before_markers, insert_from_string_1)
7115 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7116 (adjust_after_replace, adjust_after_insert, replace_range)
7117 (replace_range_2, del_range, del_range_1, del_range_byte)
7118 (del_range_both, del_range_2, modify_region)
7119 (prepare_to_modify_buffer, signal_before_change)
7120 (signal_after_change, Fcombine_after_change_execute):
7121 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7122 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7123 (balance_an_interval, split_interval_right, split_interval_left)
7124 (find_interval, next_interval, update_interval)
7125 (adjust_intervals_for_insertion, delete_node, delete_interval)
7126 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7127 (static_offset_intervals, offset_intervals)
7128 (merge_interval_right, merge_interval_left, make_new_interval)
7129 (graft_intervals_into_buffer, temp_set_point_both)
7130 (temp_set_point, set_point, adjust_for_invis_intang)
7131 (set_point_both, move_if_not_intangible, get_property_and_range)
7132 (get_local_map, copy_intervals, copy_intervals_to_string)
7133 (compare_string_intervals, set_intervals_multibyte_1):
7134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7135 * intervals.h: Adjust decls to match defn changes elsewhere.
7136 (struct interval):
7137 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7138 * keyboard.c (this_command_key_count, this_single_command_key_start)
7139 (before_command_key_count, before_command_echo_length, echo_now)
7140 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7141 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7142 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7143 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7144 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7145 (last_non_minibuf_size, last_point_position, echo_truncate)
7146 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7147 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7148 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7149 (stuff_buffered_input):
7150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7151 (last_auto_save, command_loop_1, read_char):
7152 Use EMACS_INT, not int, to avoid integer overflow.
7153 (record_char): Avoid overflow in total_keys computation.
7154 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7155 * keyboard.h: Adjust decls to match defn changes elsewhere.
7156 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7157 (Fkey_description, Fdescribe_vector, Flookup_key):
7158 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7159 (click_position): New function, to check that positions are in range.
7160 (Fcurrent_active_maps):
7161 (describe_command):
7162 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7163 (Faccessible_keymaps, Fkey_description):
7164 (preferred_sequence_p):
7165 Don't assume fixnum can fit into int.
7166 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7167 Check for integer overflow in size calculations.
7168 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7169 avoid mishandling large integers.
7170 * lisp.h: Adjust decls to match defn changes elsewhere.
7171 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7172 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7173 (struct Lisp_Marker):
7174 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7175 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7176 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7177 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7178 All callers changed.
7179 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7180 Assume the arg has valid form, since it always does.
7181 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7182 unsigned integer system type.
7183 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7184 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7185 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7186 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7187 (duration_to_sec_usec): New decl.
7188 * lread.c (read_from_string_index, read_from_string_index_byte)
7189 (read_from_string_limit, readchar, unreadchar, openp)
7190 (read_internal_start, read1, oblookup):
7191 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7192 (Fload, readevalloop, Feval_buffer, Feval_region):
7193 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7194 (openp): Check for out-of-range argument to 'access'.
7195 (read1): Use int, not EMACS_INT, where int is wide enough.
7196 Don't assume fixnum fits into int.
7197 Fix off-by-one error that can read outside a buffer.
7198 (read_filtered_event): Use duration_to_sec_usec
7199 to do proper overflow checking on durations.
7200 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7201 in size calculation.
7202 (Fexecute_kbd_macro):
7203 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7204 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7205 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7206 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7207 (set_marker_both, set_marker_restricted_both, marker_position)
7208 (marker_byte_position, Fbuffer_has_markers_at):
7209 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7210 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7211 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7212 It now merely ensures that the menu is large enough, without
7213 necessarily growing it, as this avoids some integer overflow issues.
7214 All callers changed.
7215 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7217 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7218 Use SAFE_ALLOCA_LISP, not alloca.
7219 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7220 to EMACS_INT. Check that fixnums are in proper range for system types.
7221 * minibuf.c (minibuf_prompt_width, string_to_object)
7222 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7223 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7224 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7225 (get_minibuffer, read_minibuf_unwind):
7226 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7227 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7228 this simplifies overflow checking. All callers changed.
7229 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7230 (Ftest_completion):
7231 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7232 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7233 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7234 Check that fixnums are in proper range for system types.
7235 (Fx_create_frame, Fx_show_tip):
7236 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7237 * nsfont.m (ns_findfonts, nsfont_list_family):
7238 Don't assume fixnum fits in long.
7239 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7240 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7241 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7242 wide enough.
7243 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7244 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7245 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7246 (PRINTDECLARE, PRINTPREPARE):
7247 (strout, print_string):
7248 (print, print_preprocess, print_check_string_charset_prop)
7249 (print_object):
7250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7251 (PRINTDECLARE):
7252 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7255 (printchar, strout): Use xpalloc to catch size calculation overflow.
7256 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7257 (print_error_message): Use SAFE_ALLOCA, not alloca.
7258 (print_object): Use int, not EMACS_INT, where int is wide enough.
7259 (print_depth, new_backquote_output, print_number_index):
7260 Use ptrdiff_t, not int, where int might not be wide enough.
7261 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7262 (Fset_process_window_size, Fformat_network_address)
7263 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7264 (sigchld_handler):
7265 Check that fixnums are in proper range for system types.
7266 (Fsignal_process): Simplify by avoiding a goto.
7267 Check for process-ids out of pid_t range rather than relying on
7268 undefined behavior.
7269 (process_tick, update_tick): Use EMACS_INT, not int.
7270 (Fformat_network_address, read_process_output, send_process)
7271 (Fprocess_send_region, status_notify):
7272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7273 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7274 (wait_reading_process_output, read_process_output, exec_sentinel):
7275 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7276 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7277 (Faccept_process_output): Use duration_to_sec_usec to do proper
7278 overflow checking on durations.
7279 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7280 Don't assume pid_t fits in int.
7281 * process.h (struct Lisp_Process): Members tick and update_tick
7282 are now of type EMACS_INT, not int.
7283 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7284 configured --with-wide-int.
7285 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7286 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7287 * search.c (looking_at_1, string_match_1):
7288 (fast_string_match, fast_c_string_match_ignore_case)
7289 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7290 (scan_newline, find_before_next_newline, search_command)
7291 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7292 (set_search_regs, wordify):
7293 (Freplace_match):
7294 (Fmatch_data):
7295 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7296 (string_match_1, search_buffer, set_search_regs):
7297 (Fmatch_data):
7298 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7299 (wordify): Check for overflow in size calculation.
7300 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7301 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7302 Check that fixnums are in proper range for system types.
7303 * sound.c (struct sound_device)
7304 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7305 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7306 (Fplay_sound_internal):
7307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7308 * syntax.c (struct lisp_parse_state, find_start_modiff)
7309 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7310 (Fparse_partial_sexp):
7311 Don't assume fixnums can fit in int.
7312 (struct lisp_parse_state, find_start_pos, find_start_value)
7313 (find_start_value_byte, find_start_begv)
7314 (update_syntax_table, char_quoted, dec_bytepos)
7315 (find_defun_start, prev_char_comend_first, back_comment):
7316 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7317 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7319 (Finternal_describe_syntax_value): Check that match_lisp is a
7320 character, not an integer, since the code stuffs it into int.
7321 (scan_words, scan_sexps_forward):
7322 Check that fixnums are in proper range for system types.
7323 (Fforward_word):
7324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7325 (scan_sexps_forward):
7326 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7327 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7328 * syntax.h: Adjust decls to match defn changes elsewhere.
7329 (struct gl_state_s):
7330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7331 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7332 MOST_POSITIVE_FIXNUM.
7333 * sysdep.c (wait_for_termination_1, wait_for_termination)
7334 (interruptible_wait_for_termination, mkdir):
7335 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7336 (emacs_read, emacs_write):
7337 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7338 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7339 and double all fit in int.
7340 * term.c (set_tty_color_mode):
7341 Check that fixnums are in proper range for system types.
7342 * termhooks.h (struct input_event):
7343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7344 * textprop.c (validate_interval_range, interval_of)
7345 (Fadd_text_properties, set_text_properties_1)
7346 (Fremove_text_properties, Fremove_list_of_text_properties)
7347 (Ftext_property_any, Ftext_property_not_all)
7348 (copy_text_properties, text_property_list, extend_property_ranges)
7349 (verify_interval_modification):
7350 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7351 (Fnext_single_char_property_change)
7352 (Fprevious_single_char_property_change):
7353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7354 (copy_text_properties):
7355 Check for integer overflow in index calculation.
7356 * undo.c (last_boundary_position, record_point, record_insert)
7357 (record_delete, record_marker_adjustment, record_change)
7358 (record_property_change):
7359 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7360 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7361 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7362 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7363 (Fx_hide_tip, Fx_file_dialog):
7364 * w32menu.c (set_frame_menubar):
7365 Use ptrdiff_t, not int, for consistency with rest of code.
7366 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7367 (select_window, Fdelete_other_windows_internal)
7368 (window_scroll_pixel_based, window_scroll_line_based)
7369 (Frecenter, Fset_window_configuration):
7370 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7371 (Fset_window_hscroll, run_window_configuration_change_hook)
7372 (set_window_buffer, temp_output_buffer_show, scroll_command)
7373 (Fscroll_other_window, Frecenter):
7374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7375 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7376 Don't assume fixnum fits in int.
7377 (Fset_window_scroll_bars):
7378 Check that fixnums are in proper range for system types.
7379 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7380 (string_pos, c_string_pos, number_of_chars, init_iterator)
7381 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7382 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7383 (compute_display_string_end, handle_face_prop)
7384 (face_before_or_after_it_pos, handle_invisible_prop)
7385 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7386 (display_prop_intangible_p, string_buffer_position_lim)
7387 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7388 (get_overlay_strings_1, get_overlay_strings)
7389 (iterate_out_of_display_property, forward_to_next_line_start)
7390 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7391 (get_next_display_element, set_iterator_to_next)
7392 (get_visually_first_element, compute_stop_pos_backwards)
7393 (handle_stop_backwards, next_element_from_buffer)
7394 (move_it_in_display_line_to, move_it_in_display_line)
7395 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7396 (add_to_log, message_dolog, message_log_check_duplicate)
7397 (message2, message2_nolog, message3, message3_nolog
7398 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7399 (current_message_1, truncate_echo_area, truncate_message_1)
7400 (set_message, set_message_1, store_mode_line_noprop)
7401 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7402 (text_outside_line_unchanged_p, check_point_in_composition)
7403 (reconsider_clip_changes)
7404 (redisplay_internal, set_cursor_from_row, try_scrolling)
7405 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7406 (redisplay_window, find_last_unchanged_at_beg_row)
7407 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7408 (trailing_whitespace_p, find_row_edges, display_line)
7409 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7410 (display_mode_element, store_mode_line_string)
7411 (pint2str, pint2hrstr, decode_mode_spec)
7412 (display_count_lines, display_string, draw_glyphs)
7413 (x_produce_glyphs, x_insert_glyphs)
7414 (rows_from_pos_range, mouse_face_from_buffer_pos)
7415 (fast_find_string_pos, mouse_face_from_string_pos)
7416 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7417 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7418 (safe_call, init_from_display_pos, handle_fontified_prop)
7419 (handle_single_display_spec, load_overlay_strings)
7420 (with_echo_area_buffer, setup_echo_area_for_printing)
7421 (display_echo_area, echo_area_display)
7422 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7423 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7424 (redisplay_window, dump_glyph_row, display_mode_line)
7425 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7426 (handle_display_spec, display_prop_string_p):
7427 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7428 (handle_single_display_spec, build_desired_tool_bar_string)
7429 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7430 (get_specified_cursor_type):
7431 Check that fixnums are in proper range for system types.
7432 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7433 (Flookup_image_map):
7434 Don't assume fixnums fit in int.
7435 (compare_overlay_entries):
7436 Avoid mishandling comparisons due to subtraction overflow.
7437 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7438 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7439 (handle_tool_bar_click):
7440 Use int, not unsigned, since we prefer signed and the signedness
7441 doesn't matter here.
7442 (get_next_display_element, next_element_from_display_vector):
7443 Use int, not EMACS_INT, when int is wide enough.
7444 (start_hourglass): Use duration_to_sec_usec to do proper
7445 overflow checking on durations.
7446 * xfaces.c (Fbitmap_spec_p):
7447 Check that fixnums are in proper range for system types.
7448 (compare_fonts_by_sort_order):
7449 Avoid mishandling comparisons due to subtraction overflow.
7450 (Fx_family_fonts, realize_basic_faces):
7451 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7452 (Fx_family_fonts):
7453 Don't assume fixnum fits in int.
7454 Use SAFE_ALLOCA_LISP, not alloca.
7455 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7456 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7457 (face_at_buffer_position, face_for_overlay_string)
7458 (face_at_string_position):
7459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7460 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7461 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7462 (Fx_show_tip):
7463 Check that fixnums are in proper range for system types.
7464 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7465 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7467 (Fx_change_window_property): Don't assume fixnums fit in int.
7468 * xfont.c (xfont_chars_supported):
7469 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7470 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7471 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7472 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7473 * xml.c (parse_region):
7474 * xrdb.c (magic_file_p):
7475 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7476 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7477 (x_get_local_selection, x_reply_selection_request)
7478 (x_handle_selection_request, wait_for_property_change):
7479 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7480 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7481 short is wide enough.
7482 (x_send_client_event): Don't assume fixnum fits in int.
7483 * xterm.c (x_x_to_emacs_modifiers):
7484 Don't assume EMACS_INT overflows nicely into int.
7485 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7486 may come from Lisp.
7487 (handle_one_xevent): NATNUMP can eval its arg twice.
7488 (x_connection_closed):
7489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7490 * xterm.h: Adjust decls to match defn changes elsewhere.
7491 (struct scroll_bar): Use struct vectorlike_header
7492 rather than rolling our own approximation.
7493 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7494
7495 2012-05-25 Glenn Morris <rgm@gnu.org>
7496
7497 * lisp.mk (lisp): Update for more files being compiled now.
7498
7499 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7500
7501 * lread.c: Remove `read_pure' which makes no difference.
7502 (read_pure): Remove var.
7503 (unreadpure): Remove function.
7504 (readevalloop): Don't call read_list with -1 flag.
7505 (read1, read_vector): Don't test read_pure any more.
7506 (read_list): Simplify.
7507
7508 * fileio.c, character.h: Minor style tweaks.
7509
7510 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7511
7512 * window.h (clip_changed): Remove useless declaration.
7513
7514 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7515
7516 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7517 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7518
7519 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7520
7521 Remove src/m/*.
7522 This directory predates autoconf and is no longer needed nowadays.
7523 Move its few remaining bits of functionality to where they're needed.
7524 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7525 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7526 * m/template.h: Remove.
7527 * Makefile.in (M_FILE): Remove. All uses removed.
7528 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7529 * lisp.h (USE_LSB_TAG):
7530 * mem-limits.h (EXCEEDS_LISP_PTR):
7531 Use VAL_MAX, not VALBITS, in #if.
7532 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7533 (EMACS_UINT): Define unconditionally now.
7534 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7535 (BITS_PER_EMACS_INT): New constants, replacing
7536 what used to be in config.h, but not useful in #if.
7537 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7538 define them any more.
7539 (VAL_MAX): New macro.
7540 (VALMASK): Use it.
7541 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7542 BITS_PER_EMACS_INT, in #if.
7543 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7544 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7545 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7546 * s/ms-w32.h (DATA_START):
7547 Move here from removed file m/intel386.h.
7548 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7549 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7550
7551 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7552
7553 Assume C89 or later.
7554 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7555 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7556 (xrealloc):
7557 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7558 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7559 * textprop.c, tparam.c (NULL): Remove.
7560 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7561 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7562 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7563 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7564 * xterm.c (input_signal_count): Assume volatile works.
7565
7566 2012-05-21 Ken Brown <kbrown@cornell.edu>
7567
7568 * xgselect.c (xg_select): Fix first argument in call to 'select'
7569 (bug#11508).
7570
7571 2012-05-20 Ken Brown <kbrown@cornell.edu>
7572
7573 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7574 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7575
7576 2012-05-19 Ken Brown <kbrown@cornell.edu>
7577
7578 * xfns.c (x_in_use): Remove `static' qualifier.
7579 * xterm.h (x_in_use): Declare.
7580 * xgselect.c: Include xterm.h.
7581 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7582 and `display_arg' (bug#9754).
7583
7584 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7585
7586 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7587
7588 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7589 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7590
7591 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7592
7593 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7594
7595 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7596 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7597
7598 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7599 reference to image_cache->refcount.
7600 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7601
7602 2012-05-17 Juri Linkov <juri@jurta.org>
7603
7604 * search.c (Fword_search_regexp, Fword_search_backward)
7605 (Fword_search_forward, Fword_search_backward_lax)
7606 (Fword_search_forward_lax): Move functions to isearch.el
7607 (bug#10145, bug#11381).
7608
7609 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7610
7611 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7612
7613 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7614
7615 * lread.c (init_obarray): Declare Qt and Qnil as special.
7616
7617 2012-05-14 Glenn Morris <rgm@gnu.org>
7618
7619 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7620 Put "libexec" before "bin", for the sake of init_callproc_1.
7621
7622 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7623
7624 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7625
7626 * unexaix.c: Port to more-recent AIX compilers.
7627 (report_error, report_error_1, make_hdr, copy_sym)
7628 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7629 Make arguments const char *, not char *, to avoid violations of C
7630 standard and to fix some AIX warnings reported by Gilles Pion.
7631
7632 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7633
7634 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7635 already have overlays loaded.
7636 (handle_single_display_spec): Before returning without displaying
7637 fringe bitmap, synchronize the bidi iterator with the main display
7638 iterator, by calling iterate_out_of_display_property.
7639 (iterate_out_of_display_property): Detect buffer iteration by
7640 testing that it->string is a Lisp string.
7641 (get_next_display_element): When the current object is exhausted,
7642 and there's something on it->stack, call set_iterator_to_next to
7643 proceed with what's on the stack, instead of returning zero.
7644 (set_iterator_to_next): If called at the end of a Lisp string,
7645 proceed to consider_string_end without incrementing string
7646 position. Don't increment display vector index past the end of
7647 the display vector. (Bug#11417)
7648 (pos_visible_p): Don't report a position visible when move_it_to
7649 stopped at the last line of window, which happens to be scanned
7650 backwards by the bidi iteration. (Bug#11464)
7651
7652 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7653
7654 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7655 and right-margin display specs even if the spec is invalid or we
7656 are on a TTY, and thus unable to display on the fringes.
7657 That's because the text with the property will not be displayed anyway,
7658 so we need to signal to the caller that this is a "replacing"
7659 display spec. This fixes display when the spec is invalid or we
7660 are on a TTY.
7661
7662 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7663
7664 * unexaix.c (make_hdr): Fix typo in prototype.
7665 This bug broke the build on AIX. Problem reported by Gilles Pion.
7666
7667 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7668
7669 * keyboard.c (kbd_buffer_get_event): Read special events also in
7670 batch mode. (Bug#11415)
7671
7672 2012-05-12 Glenn Morris <rgm@gnu.org>
7673
7674 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7675
7676 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7677
7678 * lisp.mk (lisp): Add newcomment.elc.
7679
7680 2012-05-12 Glenn Morris <rgm@gnu.org>
7681
7682 * Makefile.in (MKDIR_P): New, set by configure.
7683 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7684
7685 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7686
7687 Remove unused function hourglass_started.
7688 * dispextern.h (hourglass_started):
7689 * w32fns.c (hourglass_started):
7690 * xdisp.c (hourglass_started): Remove.
7691
7692 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7693
7694 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7695 Update dependencies.
7696
7697 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7698
7699 * xgselect.c (xg_select): Put maxfds+1 into a var.
7700 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7701
7702 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7703
7704 2012-05-10 Dave Abrahams <dave@boostpro.com>
7705
7706 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7707 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7708
7709 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7710
7711 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7712 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7713 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7714 Initialize xd_registered_buses.
7715
7716 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7717
7718 Untag more efficiently if USE_LSB_TAG.
7719 This is based on a proposal by YAMAMOTO Mitsuharu in
7720 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7721 For an admittedly artificial (nth 8000 longlist) benchmark on
7722 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7723 Emacs's overall text size by 1%.
7724 * lisp.h (XUNTAG): New macro.
7725 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7726 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7727 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7728 * eval.c (Fautoload):
7729 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7730 * frame.h (XFRAME): Use XUNTAG.
7731
7732 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7733 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7734 Remove unportable assumptions about print widths of types like
7735 dbus_uint32_t.
7736 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7737 intptr_t when converting between pointer and integer, to avoid GCC
7738 warnings about wrong width.
7739
7740 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7741
7742 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7743 stack for each reader_thread, instead of defaulting to 8MB
7744 determined by the linker. This avoids failures in creating
7745 subprocesses on Windows 7, see the discussion in this thread:
7746 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7747
7748 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7749
7750 Fix up display of the *Minibuf-0* buffer in the mini window.
7751 * keyboard.c (read_char): Don't clear the echo area if there's no
7752 message to clear.
7753 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7754 contents of *Minibuf-0*) if there's no message displayed in its stead.
7755
7756 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7757
7758 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7759 batch mode.
7760
7761 2012-05-06 Chong Yidong <cyd@gnu.org>
7762
7763 * lisp.mk (lisp): Update.
7764
7765 2012-05-05 Jim Meyering <meyering@redhat.com>
7766
7767 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7768
7769 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7770
7771 * data.c (PUT_ERROR): New macro.
7772 (syms_of_data): Use it. Add new error type `user-error'.
7773 * undo.c (user_error): New function.
7774 (Fprimitive_undo): Use it.
7775 * print.c (print_error_message): Adjust print style for `user-error'.
7776 * keyboard.c (user_error): New function.
7777 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7778
7779 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7780
7781 Do not limit current-time-string to years 1000..9999.
7782 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7783 (Fcurrent_time_string): Support any year that is supported by the
7784 underlying localtime representation. Don't use asctime, as it
7785 has undefined behavior for years outside the range -999..9999.
7786
7787 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7788
7789 Fix race conditions involving setenv, gmtime, localtime, asctime.
7790 Without this fix, interrupts could mess up code that uses these
7791 nonreentrant functions, since setting TZ invalidates existing
7792 tm_zone or tzname values, and since most of these functions return
7793 pointers to static storage.
7794 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7795 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7796 Grow the critical sections to include not just invoking
7797 localtime/gmtime, but also accessing these functions' results
7798 including their tm_zone values if any, and any related TZ setting.
7799 (format_time_string): Last arg is now struct tm *, not struct tm **,
7800 so that the struct tm is saved in the critical section.
7801 All callers changed. Simplify allocation of initial buffer, partly
7802 motivated by the fact that memory allocation needs to be outside
7803 the critical section.
7804
7805 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7806
7807 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7808 with RESET_INTERVAL.
7809
7810 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7811 Remove duplicated buffer name initialization.
7812
7813 2012-05-02 Jim Meyering <jim@meyering.net>
7814
7815 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7816
7817 * xfns.c (x_window): Use xstrdup (Bug#11375).
7818
7819 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7820
7821 * xdisp.c (pos_visible_p): If already at a newline from the
7822 display string before the 'while' loop, don't walk back the glyphs
7823 from it3.glyph_row. Solves assertion violation when the display
7824 string begins with a newline (egg.el). (Bug#11367)
7825
7826 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7827
7828 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7829 Move to simple.el.
7830
7831 2012-05-01 Glenn Morris <rgm@gnu.org>
7832
7833 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7834 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7835 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7836 All were removed before 23.1.
7837
7838 * dispnew.c: Remove HAVE_LIBNCURSES test;
7839 it is always true on relevant platforms.
7840
7841 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7842 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7843
7844 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7845
7846 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7847
7848 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7849 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7850 Remove.
7851
7852 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7853
7854 Do not avoid creating empty evaporating overlays (Bug#9642).
7855 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7856 That is, do not delete an evaporating overlay if it becomes
7857 empty after its bounds are adjusted to fit within its buffer.
7858 This fix caused other problems, and I'm reverting it until we get
7859 to the bottom of them.
7860
7861 2012-04-27 Chong Yidong <cyd@gnu.org>
7862
7863 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7864
7865 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7866
7867 * xdisp.c (pos_visible_p): If the window start position is beyond
7868 ZV, start the display from buffer beginning. Prevents assertion
7869 violation in init_iterator when the minibuffer window is scrolled
7870 via the scroll bar.
7871
7872 * window.c (window_scroll_pixel_based): Likewise.
7873
7874 2012-04-27 Chong Yidong <cyd@gnu.org>
7875
7876 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7877
7878 2012-04-27 Glenn Morris <rgm@gnu.org>
7879
7880 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7881 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7882
7883 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7884
7885 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7886 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7887
7888 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7889
7890 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7891 display element, check also the underlying string or buffer
7892 character. (Bug#11341)
7893
7894 * w32menu.c: Include w32heap.h.
7895 (add_menu_item): If the call to AppendMenuW (via
7896 unicode_append_menu) fails, disable Unicode menus only if we are
7897 running on Windows 9X/Me.
7898
7899 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7900
7901 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7902 (xgetint): Add missing shift for LSB tags.
7903
7904 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7905
7906 * keyboard.c (read_char): Don't wipe echo area for select window
7907 events: These might get delayed via `mouse-autoselect-window'
7908 (Bug#11304).
7909
7910 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7911
7912 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7913 manipulation of :loaded-from data.
7914
7915 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7916
7917 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7918 now a cons (bug#11311).
7919
7920 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7921
7922 Do not create empty overlays with the evaporate property (Bug#9642).
7923 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7924 if it becomes empty after its bounds are adjusted to fit within
7925 its buffer. Without this fix, in a nonempty buffer (let ((o
7926 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7927 yields an empty overlay that has the evaporate property, which is
7928 not supposed to happen.
7929
7930 Fix minor GTK3 problems found by static checking.
7931 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7932 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7933 (struct _EmacsFixedClass, emacs_fixed_get_type):
7934 Move decls here from emacsgtkfixed.h, since they needn't be public.
7935 (emacs_fixed_get_type): Now static.
7936 (emacs_fixed_class_init): Omit unused local.
7937 (emacs_fixed_child_type): Remove; unused.
7938 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7939 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7940 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7941 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7942 (EMACS_FIXED_GET_CLASS): Remove; unused.
7943 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7944
7945 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7946 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7947
7948 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7949
7950 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7951 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7952 (__malloc_size_t, __malloc_ptrdiff_t):
7953 Remove. All uses removed, replaced by the definiens if needed,
7954 since we can assume C89 or better now.
7955 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7956 (protect_malloc_state, align, get_contiguous_space)
7957 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7958 (malloc_atfork_handler_child, malloc_enable_thread)
7959 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7960 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7961 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7962 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7963 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7964 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7965 Define using prototypes, not old style.
7966 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7967 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7968 (align): Don't assume that signed integer overflow wraps around.
7969 Omit unused local var.
7970 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7971 (_free_internal_nolock, memalign, mallochook, reallochook):
7972 Omit no-longer-needed casts.
7973 (valloc): Use getpagesize, not __getpagesize.
7974 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7975 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7976
7977 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7978
7979 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7980
7981 Move functions from C to Lisp. Make non-blocking method calls
7982 the default. Implement further D-Bus standard interfaces.
7983
7984 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7985 (QCdbus_request_name_allow_replacement)
7986 (QCdbus_request_name_replace_existing)
7987 (QCdbus_request_name_do_not_queue)
7988 (QCdbus_request_name_reply_primary_owner)
7989 (QCdbus_request_name_reply_in_queue)
7990 (QCdbus_request_name_reply_exists)
7991 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7992 (QCdbus_registered_serial, QCdbus_registered_method)
7993 (QCdbus_registered_signal): New Lisp objects.
7994 (XD_DEBUG_MESSAGE): Use sizeof.
7995 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7996 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7997 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7998 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7999 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8000 (xd_signature, xd_append_arg): Allow float for integer types.
8001 (xd_get_connection_references): New function.
8002 (xd_get_connection_address): Rename from xd_initialize.
8003 Return cached address.
8004 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8005 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8006 level.
8007 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8008 Return number of refcounts.
8009 (Fdbus_get_unique_name): Make stronger parameter check.
8010 (Fdbus_message_internal): New defun.
8011 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8012 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8013 (Fdbus_send_signal, Fdbus_register_service)
8014 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8015 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8016 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8017 (Vdbus_compiled_version, Vdbus_runtime_version)
8018 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8019 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8020 (Vdbus_message_type_signal): New defvars.
8021 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8022 Adapt docstring.
8023
8024 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8025
8026 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8027 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8028 Do not assume ptrdiff_t is the same width as 'int'.
8029
8030 * alloc.c: Handle unusual debugging option combinations.
8031 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8032 since the two debugging options are incompatible.
8033 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8034 is defined.
8035 (mem_init, mem_insert, mem_insert_fixup):
8036 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8037 (NEED_MEM_INSERT): Remove; no longer needed.
8038
8039 2012-04-22 Leo Liu <sdl.web@gmail.com>
8040
8041 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8042
8043 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8044
8045 * sysdep.c [__FreeBSD__]: Minor cleanups.
8046 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8047 Use Emacs indenting style more consistently. Avoid some casts.
8048 Use 'double' consistently rather than mixing 'float' and 'double'.
8049
8050 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8051
8052 * sysdep.c (list_system_processes, system_process_attributes):
8053 Add implementation for FreeBSD (Bug#5243).
8054
8055 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8056
8057 * lisp.mk (lisp): Update.
8058
8059 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8060
8061 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8062 It is never used otherwise.
8063
8064 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8065
8066 * print.c (print_preprocess): Only check print_depth if print-circle
8067 is nil.
8068 (print_object): Check for cycles even when print-circle is nil and
8069 print-gensym is t, but only check print_depth if print-circle is nil.
8070
8071 2012-04-20 Chong Yidong <cyd@gnu.org>
8072
8073 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8074 set the status to "failed" and ensure that sentinel is run.
8075
8076 2012-04-20 Glenn Morris <rgm@gnu.org>
8077
8078 * process.c (Fset_process_inherit_coding_system_flag)
8079 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8080 (Fmake_network_process, Fmake_serial_process): Doc fix.
8081
8082 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8083
8084 * xdisp.c (string_buffer_position_lim): Limit starting position to
8085 BEGV.
8086 (set_cursor_from_row): If called for a mode-line or header-line
8087 row, return zero immediately.
8088 (try_cursor_movement): If inside continuation line, don't back up
8089 farther than the first row after the header line, if any.
8090 Don't consider the header-line row as "partially visible", even if
8091 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8092
8093 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8094
8095 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8096 (bug#11238).
8097
8098 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8099 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8100
8101 configure: new option --enable-gcc-warnings (Bug#11207)
8102 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8103 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8104 (ALL_CFLAGS): Use new macros rather than old.
8105 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8106 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8107 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8108 -Wunused-result, -Wunused-variable. This should go away once
8109 the Emacs and Gnulib regex code is merged.
8110 (xmalloc, xrealloc): Now static.
8111
8112 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8113
8114 * dired.c (Fsystem_groups): Remove unused local.
8115
8116 2012-04-17 Glenn Morris <rgm@gnu.org>
8117
8118 * dired.c (Fsystem_users): Doc fix.
8119
8120 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8121
8122 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8123 (syms_of_dired): Add them.
8124
8125 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8126
8127 Fix minor alloc.c problems found by static checking.
8128 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8129 New extern decls, to avoid calling undeclared functions.
8130 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8131 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8132 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8133 (NEED_MEM_INSERT): New macro.
8134 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8135 Remove one incorrect comment and fix another.
8136
8137 Fix minor ralloc.c problems found by static checking.
8138 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8139 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8140 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8141 (r_alloc_sbrk): Now static.
8142
8143 Improve ralloc.c interface checking.
8144 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8145 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8146 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8147 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8148 [REL_ALLOC]: ... to here, to check interface.
8149 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8150 Remove decls. This fixes an "It stinks!".
8151
8152 * alloc.c (which_symbols): Fix alignment issue / type clash.
8153
8154 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8155
8156 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8157 (struct Lisp_Misc_Any): Likewise.
8158 (struct Lisp_Free): Likewise.
8159 * alloc.c (union aligned_Lisp_Symbol): Define.
8160 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8161 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8162 (union aligned_Lisp_Misc): Define.
8163 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8164 aligned_Lisp_Misc instead of union Lisp_Misc.
8165 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8166
8167 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8168
8169 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8170 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8171 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8172 * s/netbsd.h, s/sol2-6.h:
8173 Remove definition of GC_MARK_STACK, since the default now works.
8174 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8175 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8176 no longer the default.
8177 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8178
8179 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8180
8181 * lread.c (lisp_file_lexically_bound_p):
8182 Fix hang at ";-*-\n" (bug#11238).
8183
8184 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8185
8186 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8187 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8188
8189 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8190
8191 * nsterm.m (constrainFrameRect): Always constrain when there is only
8192 one screen (Bug#10962).
8193
8194 2012-04-13 Ken Brown <kbrown@cornell.edu>
8195
8196 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8197
8198 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8199
8200 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8201
8202 2012-04-11 Daniel Colascione <dancol@dancol.org>
8203
8204 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8205 against is gone. It's better to use vfork now so that when Cygwin
8206 gains a new, working vfork, we use it automatically (bug#10398).
8207
8208 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8209
8210 * window.c (save_window_save): Obey window-point-insertion-type.
8211
8212 2012-04-11 Glenn Morris <rgm@gnu.org>
8213
8214 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8215
8216 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8217
8218 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8219
8220 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8221
8222 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8223 (force_quit_count): New var.
8224 (handle_interrupt): Use it.
8225
8226 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8227
8228 * w32.c (w32_delayed_load): Record the full path of the library
8229 being loaded (bug#10424).
8230
8231 2012-04-09 Glenn Morris <rgm@gnu.org>
8232
8233 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8234 not just in the obarray, before snarfing them. (Bug#11036)
8235
8236 * Makefile.in ($(leimdir)/leim-list.el):
8237 Pass EMACS rather than BUILT_EMACS.
8238
8239 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8240
8241 * process.c (make_process):
8242 * process.h: Add integer `gnutls_handshakes_tried' member to
8243 process struct.
8244
8245 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8246 Add convenience `GNUTLS_LOG2i' macro.
8247
8248 * gnutls.c (gnutls_log_function2i): Convenience log function.
8249 (emacs_gnutls_read): Use new log functions,
8250 `gnutls_handshakes_tried' process member, and
8251 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8252 attempts per process (connection).
8253
8254 2012-04-09 Chong Yidong <cyd@gnu.org>
8255
8256 * eval.c (Fuser_variable_p, user_variable_p_eh)
8257 (lisp_indirect_variable): Functions deleted.
8258 (Fdefvar): Caller changed.
8259
8260 * callint.c (Finteractive, Fcall_interactively):
8261 * minibuf.c (Fread_variable): Callers changed.
8262
8263 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8264
8265 * xdisp.c (set_cursor_from_row): If the display string appears in
8266 the buffer at position that is closer to point than the position
8267 after the display string, display the cursor on the first glyph of
8268 the display string. Fixes cursor display when a 'display' text
8269 property immediately follows invisible text. (Bug#11094)
8270
8271 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8272
8273 composite.c: use 'double' consistently
8274 * composite.c (get_composition_id): Use 'double' consistently
8275 instead of converting 'float' to 'double' and vice versa; this is
8276 easier to understand and avoids a GCC warning.
8277
8278 2012-04-09 Glenn Morris <rgm@gnu.org>
8279
8280 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8281 preparation for dumping it with emacs. (Bug#4789)
8282 (leimdir): New variable.
8283 ($(leimdir)/leim-list.el): New rule.
8284 (emacs$(EXEEXT)): Depend on leim-list.el.
8285
8286 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8287 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8288 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8289
8290 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8291
8292 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8293 proper alignment.
8294
8295 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8296
8297 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8298 Remove unused local variable.
8299
8300 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8301
8302 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8303 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8304 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8305 objects, as mark_maybe_pointer will catch them otherwise.
8306 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8307 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8308
8309 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8310
8311 Fix typo that broke non-Windows builds.
8312 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8313
8314 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8315
8316 Support building on MS-Windows with libxml2.
8317
8318 * makefile.w32-in (OBJ2): Add xml.$(O).
8319 (GLOBAL_SOURCES): Add xml.c.
8320 ($(BLD)/xml.$(O)): New dependency list.
8321
8322 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8323 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8324 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8325 [!WINDOWSNT]: New macros.
8326 (init_libxml2_functions, libxml2_loaded_p): New functions.
8327 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8328 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8329 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8330 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8331 linked in).
8332 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8333 Call init_libxml2_functions before calling libxml2 functions.
8334 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8335
8336 * emacs.c: Don't include libxml/parser.h.
8337 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8338 xmlCleanupParser directly.
8339
8340 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8341
8342 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8343
8344 * indent.c (Fvertical_motion): If there is a display string at
8345 point, use it.vpos to compute how many lines to backtrack after
8346 move_it_to point. (Bug#11133)
8347
8348 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8349
8350 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8351 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8352 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8353 macros related to unification of CJK characters. For the details,
8354 see the discussion following the message here:
8355 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8356
8357 2012-04-04 Chong Yidong <cyd@gnu.org>
8358
8359 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8360
8361 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8362
8363 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8364 instead of alloca. (Bug#11138)
8365
8366 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8367
8368 * w32menu.c (is_simple_dialog): Properly check lisp types.
8369 (Bug#11141)
8370
8371 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8372
8373 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8374 position we get to after a call to move_it_to fails the
8375 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8376 only if we wind up in a string from display property. (Bug#11063)
8377
8378 * window.c (Fdelete_other_windows_internal): Invalidate the row
8379 and column information about mouse highlight, so that redisplay
8380 restores it after reallocating the glyph matrices. (Bug#7464)
8381
8382 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8383 string comes from a `display' text property, use the buffer
8384 position of that property as if we actually saw that position in
8385 the row's glyphs.
8386 (move_it_by_lines): Remove the assertion that
8387 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8388 violated when there's a before-string at the beginning of a line.
8389 (Bug#11063)
8390
8391 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8392
8393 * xdisp.c (append_space_for_newline): If the default face was
8394 remapped, use the remapped face for the appended newline.
8395 (extend_face_to_end_of_line): Use the remapped default face for
8396 extending the face to the end of the line.
8397 (display_line): Call extend_face_to_end_of_line when the default
8398 face was remapped. (Bug#11068)
8399
8400 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8401
8402 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8403
8404 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8405
8406 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8407
8408 2012-03-27 Glenn Morris <rgm@gnu.org>
8409
8410 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8411 Doc fixes.
8412
8413 2012-03-26 Kenichi Handa <handa@m17n.org>
8414
8415 * dispextern.h (struct glyph): Fix previous change. Change the
8416 bit length of glyphless.ch to 25 (Bug#11082).
8417
8418 2012-03-26 Chong Yidong <cyd@gnu.org>
8419
8420 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8421 (command_loop_1): Use it; inhibit selection update for
8422 handle-select-window too (Bug#8996).
8423
8424 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8425
8426 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8427
8428 2012-03-25 Kenichi Handa <handa@m17n.org>
8429
8430 * dispextern.h (struct glyph): Change the bit length of
8431 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8432
8433 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8434
8435 * s/ms-w32.h (tzname): Include time.h before redirecting to
8436 _tzname. Fixes the MSVC build. (Bug#9960)
8437
8438 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8439
8440 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8441 characters.
8442
8443 * xterm.c (XTread_socket): Only modify handling_signal if
8444 !SYNC_INPUT. (Bug#11080)
8445
8446 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8447
8448 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8449 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8450 when fetching a multibyte character consumes more bytes than
8451 CHAR_BYTES returns, due to unification of CJK characters in
8452 string_char. (Bug#11073)
8453
8454 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8455
8456 * process.c (wait_reading_process_output): Handle pty disconnect
8457 by refraining from sending oneself a SIGCHLD (bug#10933).
8458
8459 2012-03-22 Chong Yidong <cyd@gnu.org>
8460
8461 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8462
8463 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8464 Mark string as coming from a prefix property.
8465 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8466 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8467
8468 2012-03-21 Chong Yidong <cyd@gnu.org>
8469
8470 * xfaces.c (Vface_remapping_alist): Doc fix.
8471
8472 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8473
8474 * w32proc.c (Fw32_set_console_codepage)
8475 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8476 Doc fixes.
8477
8478 2012-03-20 Chong Yidong <cyd@gnu.org>
8479
8480 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8481 to reflect default non-nil value of redisplay-dont-pause.
8482
8483 2012-03-19 Kenichi Handa <handa@m17n.org>
8484
8485 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8486 it fit in a valid range (Bug#11003).
8487
8488 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8489
8490 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8491 that is not from display property, accept the row as a "cursor
8492 row" if one of the string's character has a non-nil `cursor'
8493 property. Fixes cursor positioning when there are newlines in
8494 overlay strings, e.g. in icomplete.el. (Bug#11035)
8495
8496 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8497
8498 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8499
8500 2012-03-12 Chong Yidong <cyd@gnu.org>
8501
8502 * eval.c (inhibit_lisp_code): Rename from
8503 inhibit_window_configuration_change_hook; move from window.c.
8504
8505 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8506 * window.c (run_window_configuration_change_hook)
8507 (syms_of_window): Callers changed.
8508
8509 2012-03-11 Chong Yidong <cyd@gnu.org>
8510
8511 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8512
8513 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8514
8515 2012-03-10 Chong Yidong <cyd@gnu.org>
8516
8517 * frame.c (other_visible_frames): Don't assume the selected frame
8518 is visible (Bug#10955).
8519
8520 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8521
8522 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8523
8524 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8525
8526 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8527 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8528 zero (Bug#10954).
8529
8530 2012-03-03 Glenn Morris <rgm@gnu.org>
8531
8532 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8533
8534 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8535
8536 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8537 position past the first glyph_row that ends at ZV. (Bug#10902)
8538 (redisplay_window, next_element_from_string): Fix typos in
8539 comments.
8540 (redisplay_window): Pass to move_it_vertically the margin in
8541 pixels, not in screen lines.
8542
8543 2012-03-02 Glenn Morris <rgm@gnu.org>
8544
8545 * buffer.c (buffer-list-update-hook): Doc fix.
8546
8547 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8548
8549 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8550 push_it before setting up the iterator for the first overlay
8551 string, even if we have an empty string loaded.
8552 (next_overlay_string): If there's an empty string on the iterator
8553 stack, pop the stack. (Bug#10903)
8554
8555 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8556
8557 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8558 Suggested by Stefan Monnier in
8559 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8560 * alloc.c (widen_to_Lisp_Object): New static function.
8561 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8562 and widening them to Lisp_Objects. This would work even if
8563 USE_LSB_TAG is defined and wide integers are used, which might
8564 happen in a future version of Emacs.
8565
8566 2012-02-25 Chong Yidong <cyd@gnu.org>
8567
8568 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8569 Doc fix.
8570
8571 * xselect.c (Fx_selection_exists_p): Doc fix.
8572 (x_clipboard_manager_save_all): Print an informative message
8573 before saving to clipboard manager.
8574
8575 2012-02-24 Chong Yidong <cyd@gnu.org>
8576
8577 * keyboard.c (process_special_events): Handle all X selection
8578 requests in kbd_buffer, not just the next one (Bug#8869).
8579
8580 2012-02-23 Chong Yidong <cyd@gnu.org>
8581
8582 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8583 call when setting menu-bar-lines and tool-bar-lines parameters.
8584 (unwind_create_frame_1): New helper function.
8585
8586 * window.c (inhibit_window_configuration_change_hook): New var.
8587 (run_window_configuration_change_hook): Obey it.
8588 (syms_of_window): Initialize it.
8589
8590 2012-02-22 Chong Yidong <cyd@gnu.org>
8591
8592 * xterm.c (x_draw_image_relief): Add missing type check for
8593 Vtool_bar_button_margin (Bug#10743).
8594
8595 2012-02-21 Chong Yidong <cyd@gnu.org>
8596
8597 * fileio.c (Vfile_name_handler_alist): Doc fix.
8598
8599 * buffer.c (Fget_file_buffer): Protect against invalid file
8600 handler return value.
8601
8602 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8603
8604 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8605 when computing $valmask.
8606
8607 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8608 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8609 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8610 It's useless in that case, and it can cause problems on hosts
8611 that allocate halves of EMACS_INT values separately.
8612 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8613 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8614 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8615 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8616 it avoids undefined behavior on hosts where shifting right by more
8617 than the word width has undefined behavior.
8618
8619 2012-02-19 Chong Yidong <cyd@gnu.org>
8620
8621 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8622 (Funhandled_file_name_directory, Ffile_name_as_directory)
8623 (Fdirectory_file_name, Fexpand_file_name)
8624 (Fsubstitute_in_file_name): Protect against invalid file handler
8625 return values (Bug#10845).
8626
8627 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8628
8629 * .gdbinit (pitx): Fix incorrect references to fields of the
8630 iterator stack.
8631
8632 2012-02-17 Chong Yidong <cyd@gnu.org>
8633
8634 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8635
8636 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8637
8638 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8639 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8640
8641 2012-02-15 Chong Yidong <cyd@gnu.org>
8642
8643 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8644 marked as special. Also, starting docstrings with * is obsolete.
8645
8646 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8647
8648 * gnutls.c (emacs_gnutls_write): Fix last change.
8649
8650 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8651
8652 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8653 send_process.
8654
8655 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8656
8657 * keymap.c (Fsingle_key_description): Handle char ranges.
8658
8659 2012-02-12 Chong Yidong <cyd@gnu.org>
8660
8661 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8662 as that creates a dangerous corner case.
8663
8664 * window.c (Fdelete_window_internal): Invalidate the mouse
8665 highlight (Bug#9904).
8666
8667 2012-02-12 Glenn Morris <rgm@gnu.org>
8668
8669 * xselect.c (Fx_own_selection_internal)
8670 (Fx_get_selection_internal, Fx_disown_selection_internal)
8671 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8672 * nsselect.m (Fx_own_selection_internal)
8673 (Fx_disown_selection_internal, Fx_selection_exists_p)
8674 (Fx_selection_owner_p, Fx_get_selection_internal):
8675 Sync docs and argument specs with the xselect.c versions.
8676
8677 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8678
8679 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8680
8681 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8682
8683 * w32select.c (Fx_selection_exists_p): Sync doc string and
8684 argument list with xselect.c. (Bug#10783)
8685
8686 * w16select.c (Fx_selection_exists_p): Sync doc string and
8687 argument list with xselect.c. (Bug#10783)
8688
8689 2012-02-10 Glenn Morris <rgm@gnu.org>
8690
8691 * fns.c (Fsecure_hash): Doc fix.
8692
8693 2012-02-09 Kenichi Handa <handa@m17n.org>
8694
8695 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8696
8697 2012-02-07 Chong Yidong <cyd@gnu.org>
8698
8699 * buffer.c (Fbuffer_local_variables)
8700 (buffer_lisp_local_variables): Handle unbound vars correctly;
8701 don't let Qunbound leak into Lisp.
8702
8703 2012-02-07 Glenn Morris <rgm@gnu.org>
8704
8705 * image.c (Fimagemagick_types): Doc fix.
8706
8707 * image.c (imagemagick-render-type): Change it from a lisp object
8708 to an integer. Move the doc here from the lisp manual.
8709 Treat all values not equal to 0 the same.
8710
8711 2012-02-06 Chong Yidong <cyd@gnu.org>
8712
8713 * doc.c (store_function_docstring): Avoid applying docstring of
8714 alias to base function (Bug#2603).
8715
8716 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8717
8718 * .gdbinit (pp1, pv1): Remove redundant defines.
8719 (pr): Use pp.
8720
8721 2012-02-04 Chong Yidong <cyd@gnu.org>
8722
8723 * nsterm.m: Declare a global (Bug#10694).
8724
8725 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8726
8727 * w32.c (get_emacs_configuration_options):
8728 Include --enable-checking, if specified, in the return value.
8729
8730 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8731
8732 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8733 after rounding frame sizes. (Bug#9723)
8734
8735 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8736
8737 * keyboard.c (adjust_point_for_property): Don't position point
8738 before BEGV. (Bug#10696)
8739
8740 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8741
8742 Handle overflow when computing char display width (Bug#9496).
8743 * character.c (char_width): Return EMACS_INT, not int.
8744 (char_width, c_string_width): Check for overflow when
8745 computing the width; this is possible now that individual
8746 characters can have unbounded width. Problem introduced
8747 by merge from Emacs 23 on 2012-01-19.
8748
8749 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8750
8751 * dbusbind.c (Fdbus_register_method): Mention the return value
8752 :ignore in the docstring.
8753
8754 2012-02-02 Glenn Morris <rgm@gnu.org>
8755
8756 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8757
8758 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8759 Unconditionally set to t. (Bug#10673)
8760 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8761 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8762 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8763
8764 2012-02-02 Kenichi Handa <handa@m17n.org>
8765
8766 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8767 0, do not call append_composite_glyph.
8768
8769 2012-02-02 Kenichi Handa <handa@m17n.org>
8770
8771 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8772 NULL (Bug#6988).
8773 (x_produce_glyphs): If the component of a composition is a null
8774 string, set it->pixel_width to 1 to avoid zero-width glyph.
8775
8776 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8777
8778 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8779 first 2 arguments are identical. This makes inserting large
8780 output from a subprocess an order of magnitude faster on
8781 MS-Windows, where all sbrk'ed memory is always contiguous.
8782
8783 2012-01-31 Glenn Morris <rgm@gnu.org>
8784
8785 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8786 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8787 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8788
8789 2012-01-29 Glenn Morris <rgm@gnu.org>
8790
8791 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8792
8793 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8794
8795 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8796
8797 2012-01-28 Chong Yidong <cyd@gnu.org>
8798
8799 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8800
8801 2012-01-26 Chong Yidong <cyd@gnu.org>
8802
8803 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8804
8805 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8806 repeat counts (Bug#10507).
8807
8808 2012-01-26 Glenn Morris <rgm@gnu.org>
8809
8810 * lread.c (syms_of_lread): Doc fix.
8811
8812 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8813
8814 * coding.c (encode_designation_at_bol): Change return value to
8815 EMACS_INT.
8816
8817 2012-01-25 Chong Yidong <cyd@gnu.org>
8818
8819 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8820
8821 2012-01-21 Chong Yidong <cyd@gnu.org>
8822
8823 * floatfns.c (Fcopysign): Make the second argument non-optional,
8824 since nil is not allowed anyway.
8825
8826 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8827
8828 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8829 (send_process): Likewise.
8830
8831 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8832
8833 * window.c (save_window_save, Fcurrent_window_configuration)
8834 (Vwindow_persistent_parameters): Do not use Qstate.
8835 Rewrite doc-strings.
8836
8837 2012-01-19 Kenichi Handa <handa@m17n.org>
8838
8839 * character.c (char_width): New function.
8840 (Fchar_width, c_string_width, lisp_string_width):
8841 Use char_width (Bug#9496).
8842
8843 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8844
8845 * window.c (Vwindow_persistent_parameters): New variable.
8846 (Fset_window_configuration, save_window_save): Handle persistent
8847 window parameters.
8848
8849 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8850
8851 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8852 thrashing the stack of the thread. (Bug#9087)
8853
8854 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8855
8856 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8857
8858 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8859
8860 * xdisp.c (rows_from_pos_range): Handle the case where the
8861 highlight ends on a newline. (Bug#10464)
8862 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8863 he end column for display of highlight that ends on a newline
8864 before a R2L line.
8865
8866 2012-01-11 Glenn Morris <rgm@gnu.org>
8867
8868 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8869 from load-path also when installation-directory is nil. (Bug#10208)
8870
8871 2012-01-10 Glenn Morris <rgm@gnu.org>
8872
8873 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8874
8875 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8876 Update template values to be closer to their typical values these days.
8877
8878 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8879
8880 * xdisp.c (rows_from_pos_range): Accept additional argument
8881 DISP_STRING, and accept any glyph in a row whose object is that
8882 string as eligible for mouse highlight. Fixes mouse highlight of
8883 display strings from overlays. (Bug#10464)
8884
8885 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8886
8887 emacs: fix an auto-save permissions race condition (Bug#10400)
8888 * fileio.c (auto_saving_dir_umask): New static var.
8889 (Fmake_directory_internal): Use it.
8890 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8891 creating the directory. The old code temporarily assigns
8892 too-generous permissions to the directory.
8893 (do_auto_save_eh): Clear it.
8894 (Fdo_auto_save): Catch all errors, not just file errors, so
8895 that the var is always cleared.
8896
8897 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8898
8899 * search.c (scan_buffer): Pass character positions to
8900 know_region_cache, not byte positions. (Bug#6540)
8901
8902 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8903
8904 * w32.c (sys_rename): Report EXDEV when rename of a directory
8905 fails because the target is on another logical disk. (Bug#10284)
8906
8907 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8908
8909 * xterm.c (x_embed_request_focus): New function.
8910
8911 * xterm.h: Add prototype.
8912
8913 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8914
8915 2012-01-05 Glenn Morris <rgm@gnu.org>
8916
8917 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8918
8919 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8920
8921 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8922 Load gnutls_transport_set_lowat only if GnuTLS version is below
8923 2.11.1.
8924 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8925 GnuTLS versions below 2.11.1.
8926
8927 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8928
8929 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8930 to the doc string advising against its use for altering the way
8931 windows are scrolled.
8932
8933 2011-12-28 Kenichi Handa <handa@m17n.org>
8934
8935 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8936 coding-system ASCII compatible only when it does not produce BOM
8937 on encoding (Bug#10383).
8938
8939 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8940
8941 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8942 can scroll.
8943 (create_and_show_popup_menu): Always use menu_position_func for
8944 Gtk3 (Bug#10361).
8945
8946 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8947
8948 * callint.c (Fcall_interactively): Don't truncate prompt string.
8949
8950 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8951
8952 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8953 property that ends at ZV, so that the bidi iteration could be
8954 resumed from there (after widening). (Bug#10360)
8955
8956 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8957
8958 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8959
8960 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8961
8962 * nsterm.m (x_free_frame_resources):
8963 Release f->output_data.ns->miniimage.
8964 (ns_index_color): Fix indentation. Do not retain
8965 color_table->colors[i].
8966
8967 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8968 before returning.
8969
8970 * nsfns.m (x_set_background_color): Assign return value from
8971 ns_index_color to face-background instead of NSColor*.
8972 (ns_implicitly_set_icon_type): Fix indentation.
8973 Change assignment in for loop to comparison.
8974
8975 * emacs.c (ns_pool): New variable.
8976 (main): Assign ns_pool.
8977 (Fkill_emacs): Call ns_release_autorelease_pool.
8978
8979 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8980 autorelease fdesc, release fdAttrs and tdict.
8981 (ns_get_covering_families): Release charset.
8982 (ns_findfonts): Release NSFontDescriptor created with new.
8983 (ns_uni_to_glyphs): Fix indentation.
8984 (setString): Release attrStr before assigning new value.
8985
8986 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8987
8988 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8989 and NS_IMPL_COCOA.
8990 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8991 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8992
8993 2011-12-18 David Reitter <reitter@cmu.edu>
8994
8995 * nsterm.m (ns_term_init): Subscribe for notifications
8996 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8997 to method trackingNotification in EmacsMenu.
8998
8999 * nsmenu.m (trackingMenu): New variable.
9000 (trackingNotification): New method (from Aquamacs).
9001 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9002 from Aquamacs (Bug#7030).
9003
9004 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9005
9006 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9007 (symbol_to_nsstring): Fix indentation.
9008 (ns_symbol_to_pb): New function.
9009 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9010 (Fns_rotate_cut_buffers_internal): Remove.
9011 (Fns_store_selection_internal): Rename from
9012 Fns_store_cut_buffer_internal.
9013 (ns_get_foreign_selection, Fx_own_selection_internal)
9014 (Fx_disown_selection_internal, Fx_selection_exists_p)
9015 (Fns_get_selection_internal, Fns_store_selection_internal):
9016 Use ns_symbol_to_pb and check if return value is nil.
9017 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9018 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9019 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9020 renamed to Sns_store_selection_internal.
9021 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9022 and remove this function.
9023 (ns_handle_selection_clear): Remove, never used.
9024 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9025 here.
9026
9027 2011-12-17 Ken Brown <kbrown@cornell.edu>
9028
9029 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9030 GID is unknown (Bug#10257).
9031
9032 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9033
9034 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9035 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9036 which caused a build failure on GNU/Linux IA-64. This problem was
9037 introduced by my 2011-10-07 patch.
9038
9039 2011-12-15 Juri Linkov <juri@jurta.org>
9040
9041 * image.c (imagemagick_error): New function. (Bug#10112)
9042 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9043 Use `imagemagick_error' where ImageMagick functions return
9044 `MagickFalse'.
9045 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9046 proper order.
9047
9048 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9049
9050 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9051 fill background (Bug#8992).
9052
9053 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9054
9055 * window.c (Vwindow_combination_resize)
9056 (Vwindow_combination_limit): Use t instead of non-nil in
9057 doc-strings.
9058 (Vrecenter_redisplay): Add first sentence of doc-string on
9059 separate line.
9060 (Frecenter): Fix doc-string typo.
9061
9062 2011-12-11 Kenichi Handa <handa@m17n.org>
9063
9064 * coding.c (Funencodable_char_position): Pay attention to the
9065 buffer text relocation (Bug#9389).
9066
9067 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9068
9069 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9070 gtk_init (Bug#10100).
9071
9072 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9073
9074 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9075 IT->string is nil. (Bug#10263)
9076
9077 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9078
9079 * nsterm.h (x_free_frame_resources): Declare.
9080
9081 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9082 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9083
9084 * nsterm.h (ns_get_defaults_value): Declare.
9085
9086 * nsterm.m (ns_default): Call ns_get_defaults_value.
9087
9088 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9089
9090 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9091 (Bug#10170)
9092
9093 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9094
9095 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9096 that where the value of an _OBJC_* symbol points to is in the .bss
9097 section (Bug#10240).
9098
9099 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9100
9101 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9102 after the loop to call ccl_driver at least once (Bug#8619).
9103
9104 2011-12-08 Kenichi Handa <handa@m17n.org>
9105
9106 * ftfont.c (get_adstyle_property): Fix previous change
9107 (Bug#10233).
9108
9109 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9110
9111 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9112 dirs from the default value of EMACSLOADPATH (bug#10208).
9113
9114 2011-12-07 Glenn Morris <rgm@gnu.org>
9115
9116 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9117 installation and source directories as well. (Bug#10208)
9118
9119 2011-12-06 Chong Yidong <cyd@gnu.org>
9120
9121 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9122
9123 2011-12-06 Glenn Morris <rgm@gnu.org>
9124
9125 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9126 as an error, not just -1. (Bug#10217)
9127
9128 2011-12-05 Chong Yidong <cyd@gnu.org>
9129
9130 * keyboard.c (process_special_events): New function.
9131 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9132
9133 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9134
9135 * coding.c (encode_designation_at_bol): Don't use uninitialized
9136 local variable (Bug#9318).
9137
9138 2011-12-05 Kenichi Handa <handa@m17n.org>
9139
9140 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9141 return Qnil (Bug#8046, Bug#10193).
9142
9143 2011-12-05 Kenichi Handa <handa@m17n.org>
9144
9145 * coding.c (encode_designation_at_bol): New args charbuf_end and
9146 dst. Return the number of produced bytes. Callers changed.
9147 (coding_set_source): Return how many bytes coding->source was
9148 relocated.
9149 (coding_set_destination): Return how many bytes
9150 coding->destination was relocated.
9151 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9152 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9153
9154 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9155
9156 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9157 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9158 macro (Bug#9318).
9159
9160 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9161
9162 The following changes are to fix Bug#9318.
9163
9164 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9165 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9166 (encode_coding_iso_2022, encode_coding_sjis)
9167 (encode_coding_big5, encode_coding_charset): Use the above macros.
9168
9169 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9170
9171 * lisp.h (process_quit_flag): Fix external declaration.
9172
9173 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9174
9175 Don't macro-inline non-performance-critical code.
9176 * eval.c (process_quit_flag): New function.
9177 * lisp.h (QUIT): Use it.
9178
9179 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9180
9181 * nsfns.m (get_geometry_from_preferences): New function.
9182 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9183
9184 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9185
9186 * emacs.c (Qkill_emacs): Define.
9187 (syms_of_emacs): Initialize it.
9188 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9189 Qquit_flag to `kill-emacs' instead.
9190 (quit_throw_to_read_char): Add parameter `from_signal'.
9191 All callers changed. Call Fkill_emacs if requested and safe.
9192 * lisp.h (QUIT): Call Fkill_emacs if requested.
9193
9194 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9195
9196 * widget.c (update_wm_hints): Return if wmshell is null.
9197 (widget_update_wm_size_hints): New function.
9198
9199 * widget.h (widget_update_wm_size_hints): Declare.
9200
9201 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9202 widget_update_wm_size_hints (Bug#10104).
9203
9204 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9205
9206 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9207 before a newline, prepare the bidi iterator for consuming the
9208 newline, and keep the current paragraph direction. (Bug#10183)
9209 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9210
9211 2011-12-02 Juri Linkov <juri@jurta.org>
9212
9213 * search.c (Fword_search_regexp): New Lisp function created from
9214 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9215 (Fword_search_backward, Fword_search_forward)
9216 (Fword_search_backward_lax, Fword_search_forward_lax):
9217 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9218 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9219
9220 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9221
9222 * fileio.c (Finsert_file_contents): Move after-change-function call
9223 to before the "handled:" label, since all "goto handled" appear in
9224 cases where the *-change-functions have already been properly called
9225 (bug#10117).
9226
9227 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9228
9229 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9230 waiting for input. (Bug#10169)
9231
9232 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9233
9234 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9235 verifies glyph row's hash code--we have just reallocated the
9236 glyphs, so their contents can be complete garbage. (Bug#10164)
9237
9238 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9239
9240 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9241
9242 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9243
9244 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9245 attributes are tested _before_ calling verify_row_hash, to protect
9246 against GCC re-ordering of the tests. (Bug#10164)
9247
9248 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9249
9250 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9251
9252 * xterm.c (handle_one_xevent): Only set async_visible and friends
9253 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9254 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9255 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9256
9257 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9258
9259 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9260 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9261 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9262 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9263 All uses changed to use GCPRO1 etc.
9264 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9265 Revert to old implementation (i.e., before 2011-03-11).
9266
9267 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9268
9269 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9270 of scroll runs so as to avoid assigning disabled bogus rows and
9271 unnecessary graphics copy operations.
9272
9273 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9274
9275 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9276 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9277 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9278 (malloc, free, realloc, calloc): Redirect to e_* only when
9279 compiling Emacs.
9280
9281 * lisp.h (GCTYPEBITS): Move before first use.
9282 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9283 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9284 this macro definition.
9285
9286 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9287 _MSC_VER.
9288
9289 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9290
9291 * gtkutil.c (xg_create_frame_widgets):
9292 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9293 present with Gtk+ 2.0.
9294
9295 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9296
9297 * fileio.c (Finsert_file_contents): Undo previous change; see
9298 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9299
9300 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9301
9302 Rename locals to avoid shadowing.
9303 * fileio.c (Finsert_file_contents):
9304 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9305 * process.c (wait_reading_process_output):
9306 Rename inner 'proc' to 'p' to avoid shadowing.
9307 Indent for consistency with usual Emacs style.
9308
9309 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9310
9311 * xdisp.c (redisplay_window): If cursor row is not fully visible
9312 after recentering, and scroll-conservatively is set to a large
9313 number, scroll window by a few more lines to make the cursor fully
9314 visible and out of scroll-margin. (Bug#10105)
9315 (start_display): Don't move to the next line if the display should
9316 start at a newline that is part of a display vector or an overlay
9317 string. (Bug#10119)
9318
9319 2011-11-24 Juri Linkov <juri@jurta.org>
9320
9321 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9322 after the `MagickPingImage' call. (Bug#10112)
9323
9324 2011-11-23 Chong Yidong <cyd@gnu.org>
9325
9326 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9327
9328 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9329
9330 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9331 making another buffer current. (Bug#10114)
9332
9333 2011-11-23 Glenn Morris <rgm@gnu.org>
9334
9335 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9336
9337 2011-11-23 Chong Yidong <cyd@gnu.org>
9338
9339 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9340 using it (Bug#5984).
9341
9342 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9343
9344 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9345 and header-lines, as they don't have one computed for them.
9346 (Bug#10098)
9347
9348 * .gdbinit (prow): Make displayed values more self-explaining.
9349 Add row's hash code.
9350
9351 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9352
9353 * process.c (wait_reading_process_output): Fix asynchrounous
9354 GnuTLS socket handling on some versions of the GnuTLS library.
9355 (wait_reading_process_output): Add comment and URL.
9356
9357 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9358
9359 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9360
9361 2011-11-21 Chong Yidong <cyd@gnu.org>
9362
9363 * window.c (Fnext_window, Fprevious_window): Doc fix.
9364
9365 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9366
9367 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9368
9369 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9370
9371 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9372
9373 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9374
9375 * window.c (Fset_window_combination_limit): Rename argument
9376 STATUS to LIMIT.
9377 (Vwindow_combination_limit): Remove "status" from doc-string.
9378
9379 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9380
9381 * m/ibms390.h: Remove.
9382 * m/ibms390x.h: Don't include "ibms390.h".
9383
9384 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9385
9386 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9387 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9388
9389 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9390
9391 * casetab.c (Fset_case_table):
9392 * charset.c (Fcharset_after): Fix typos.
9393
9394 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9395
9396 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9397 Otherwise, valgrind does not work on some platforms.
9398 Problem reported by Andreas Schwab in
9399 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9400 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9401 is set, removing the need for VIRT_ADDRESS_VARIES.
9402 (PURE_P): Use a more-efficient implementation that needs just one
9403 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9404 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9405 to 4 (xorl, subq, cmpq, setbe).
9406 * alloc.c (pure): Always extern now, since that's the
9407 VIRT_ADDR_VARIES behavior.
9408 (PURE_POINTER_P): Use a single comparison, not two, for
9409 consistency with the new puresize.h.
9410 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9411 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9412 Remove VIRT_ADDR_VARIES no longer needed.
9413
9414 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9415
9416 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9417 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9418 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9419 behave as if the cursor position were at the window margin.
9420
9421 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9422 and the cursor position is out of bounds, behave as if the cursor
9423 position were at the window margin. (Bug#10075)
9424
9425 2011-11-18 Chong Yidong <cyd@gnu.org>
9426
9427 * window.c (Fwindow_combination_limit): Make first argument
9428 non-optional, since it is meaningless for live windows like the
9429 selected window.
9430
9431 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9432
9433 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9434
9435 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9436
9437 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9438 (graft_intervals_into_buffer): Simplify.
9439
9440 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9441
9442 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9443 hash values of the two rows.
9444 (copy_row_except_pointers): Preserve the used[] arrays and the
9445 hash values of the two rows. (Bug#10035)
9446 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9447
9448 * xdisp.c (row_hash): New function, body extracted from
9449 compute_line_metrics.
9450 (compute_line_metrics): Call row_hash, instead of computing the
9451 hash code inline.
9452
9453 * dispnew.c (verify_row_hash): Call row_hash for computing the
9454 hash code of a row, instead of duplicating code from xdisp.c.
9455
9456 * dispextern.h (row_hash): Add prototype.
9457
9458 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9459
9460 * frame.c (delete_frame): Don't delete the terminal when the last
9461 X frame is closed if emacs is built with GTK toolkit.
9462
9463 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9464
9465 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9466
9467 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9468
9469 * window.c (Vwindow_splits): Rename to
9470 Vwindow_combination_resize. Suggested by Juri Linkov.
9471 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9472 of Vwindow_splits.
9473
9474 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9475
9476 * nsfns.m (Fns_font_name):
9477 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9478
9479 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9480
9481 * window.h (window): Rename slot "nest" to "combination_limit".
9482 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9483 (Fset_window_nest): Rename to Fset_window_combination_limit.
9484 (Vwindow_nest): Rename to Vwindow_combination_limit.
9485 (recombine_windows, make_parent_window, make_window)
9486 (Fsplit_window_internal, saved_window)
9487 (Fset_window_configuration, save_window_save): Rename all
9488 occurrences of window_nest to window_combination_limit.
9489
9490 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9491
9492 * image.c (imagemagick_load_image): Fix typo.
9493
9494 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9495
9496 * xdisp.c (display_line): Move the call to
9497 highlight_trailing_whitespace before the call to
9498 compute_line_metrics, since the latter needs to see the final
9499 faces of all the glyphs to compute ROW's hash value.
9500 Fixes assertion violations in row_equal_p. (Bug#10035)
9501
9502 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9503
9504 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9505 just return (bug#10044).
9506
9507 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9508
9509 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9510 with user-defined heap size. Bump the default size of the temacs
9511 heap to 27MB, to avoid memory warning when running temacs.
9512 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9513
9514 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9515 current_matrix and desired_matrix. (Bug#9990)
9516 (verify_row_hash) [XASSERTS]: New function.
9517 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9518 that the hash value of glyph rows is correct.
9519
9520 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9521
9522 * window.h (window): Remove splits slot.
9523 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9524 (Fdelete_other_windows_internal, make_parent_window)
9525 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9526 (Fset_window_configuration, save_window_save): Don't deal with
9527 split status of windows.
9528 (saved_window): Remove splits slot.
9529 (Vwindow_splits): Rewrite doc-string.
9530
9531 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9532
9533 * xfns.c (unwind_create_frame):
9534 * nsfns.m (unwind_create_frame):
9535 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9536 Vframe_list (Bug#9999).
9537
9538 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9539
9540 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9541
9542 2011-11-11 Kenichi Handa <handa@m17n.org>
9543
9544 * callproc.c (Fcall_process): Set the member dst_multibyte of
9545 process_coding.
9546
9547 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9548
9549 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9550 avoid a crash (bug#9496).
9551
9552 2011-11-09 Chong Yidong <cyd@gnu.org>
9553
9554 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9555 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9556
9557 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9558
9559 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9560
9561 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9562
9563 Avoid some portability problems by eschewing 'extern inline' functions.
9564 The trivial performance wins aren't worth the portability hassles; see
9565 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9566 et seq.
9567 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9568 (window_box_width, window_box_left, window_box_left_offset)
9569 (window_box_right, window_box_right_offset): Undo previous change,
9570 by removing the "extern"s.
9571 * intervals.c (adjust_intervals_for_insertion)
9572 (adjust_intervals_for_deletion): Undo previous change,
9573 making these static again.
9574 (offset_intervals, temp_set_point_both, temp_set_point)
9575 (copy_intervals_to_string): No longer inline.
9576 * xdisp.c (window_text_bottom_y, window_box_width)
9577 (window_box_height, window_box_left_offset)
9578 (window_box_right_offset, window_box_left, window_box_right)
9579 (window_box): No longer inline.
9580
9581 2011-11-08 Chong Yidong <cyd@gnu.org>
9582
9583 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9584 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9585 Signal an error if not a live window.
9586 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9587 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9588
9589 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9590
9591 * lisp.h (syms_of_abbrev): Remove declaration.
9592 Reported by CHENG Gao <chenggao@royau.me>.
9593
9594 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9595
9596 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9597 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9598 of temacs in GUI mode.
9599
9600 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9601
9602 * window.h: Declare delete_all_child_windows instead of
9603 delete_all_subwindows.
9604 * window.c (Fwindow_nest, Fset_window_nest)
9605 (Fset_window_new_total, Fset_window_new_normal)
9606 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9607 (delete_all_subwindows): Rename to delete_all_child_windows.
9608 (Fdelete_other_windows_internal, Fset_window_configuration):
9609 Call delete_all_child_windows instead of delete_all_subwindows.
9610 * frame.c (delete_frame): Call delete_all_child_windows instead
9611 of delete_all_subwindows.
9612
9613 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9614
9615 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9616 This is also needed for porting to any host where GC_MARK_STACK is
9617 not GC_MAKE_GCPROS_NOOPS.
9618 (which_symbols): Use it.
9619
9620 2011-11-07 Kenichi Handa <handa@m17n.org>
9621
9622 * coding.c (coding_set_destination): Check coding->src_pos only
9623 when coding->src_object is a buffer (bug#9910).
9624
9625 * process.c (send_process): Set the member src_multibyte of coding
9626 to 0 (bug#9911) when sending a unibyte text.
9627
9628 * callproc.c (Fcall_process): Set the member src_multibyte of
9629 process_coding to 0 (bug#9912).
9630
9631 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9632
9633 * xmenu.c (cleanup_widget_value_tree): New function.
9634 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9635 calling free_menubar_widget_value_tree directly (Bug#9830).
9636
9637 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9638
9639 Fix some portability problems with 'inline'.
9640 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9641 (window_box_width, window_box_left, window_box_left_offset)
9642 (window_box_right, window_box_right_offset): Declare extern.
9643 Otherwise, these inline functions do not conform to C99 and
9644 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9645 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9646 * intervals.c (adjust_intervals_for_insertion)
9647 (adjust_intervals_for_deletion): Now extern, because otherwise the
9648 extern inline functions 'offset_intervals' couldn't refer to it.
9649 (static_offset_intervals): Remove.
9650 (offset_intervals): Rewrite using the old contents of
9651 static_offset_intervals. The old version didn't conform to C99
9652 because an extern inline function contained a reference to an
9653 identifier with static linkage.
9654
9655 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9656
9657 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9658 GC.
9659
9660 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9661
9662 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9663 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9664 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9665 return Qleft_to_right.
9666
9667 2011-11-06 Chong Yidong <cyd@gnu.org>
9668
9669 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9670 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9671 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9672 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9673 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9674 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9675 (Fwindow_vscroll): Doc fix.
9676 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9677 argument, since it makes no sense to pass a live window and for
9678 consistency with window-child.
9679
9680 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9681
9682 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9683 support MSVC.
9684
9685 2011-11-05 Jason Rumney <jasonr@gnu.org>
9686
9687 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9688 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9689 fonts (Bug#6029).
9690 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9691 bitwise arithmetic preventing use of unicode-sip and non-truetype
9692 opentype fonts.
9693
9694 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9695
9696 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9697 "emacs"-only part.
9698
9699 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9700 initialization code to keep similarity to xfns.c after changes
9701 from 2011-11-05.
9702
9703 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9704
9705 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9706 (unwind_create_frame): New function (Bug#9943).
9707 (Fx_create_frame): Restructure code to be more similar to the one in
9708 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9709 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9710 Move terminal->reference_count++ just before making the frame official
9711 (Bug#9943).
9712
9713 * nsterm.m (x_free_frame_resources): New function.
9714 (x_destroy_window): Move code to x_free_frame_resources.
9715
9716 * xfns.c (unwind_create_frame): Fix comment.
9717 (Fx_create_frame, x_create_tip_frame):
9718 Move terminal->reference_count++ just before making the frame
9719 official. Move initialization of image_cache_refcount and
9720 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9721
9722 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9723
9724 Support MSVC build with newer versions of Visual Studio.
9725 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9726 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9727 nt/gmake.defs.
9728
9729 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9730 which are not supported by MSVC.
9731 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9732 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9733 bitfields.
9734 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9735 types in bitfields.
9736 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9737
9738 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9739
9740 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9741
9742 Support MSVC build with newer versions of Visual Studio.
9743 * w32.c: Don't include w32api.h for MSVC.
9744 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9745
9746 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9747 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9748 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9749 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9750 e_* cousins.
9751 (alloca) [_MSC_VER]: Define to _alloca.
9752
9753 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9754
9755 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9756
9757 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9758
9759 * xdisp.c (note_mouse_highlight): If either of
9760 previous/next-single-property-change returns nil, treat that as
9761 the beginning or the end of the buffer. (Bug#9955)
9762
9763 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9764
9765 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9766 label is not null (Bug#9951).
9767 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9768 may be NULL.
9769
9770 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9771
9772 * window.c (Fwindow_body_size): Mention in the doc string that the
9773 return value is in frame's canonical units. (Bug#9949)
9774
9775 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9776
9777 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9778
9779 * w32fns.c (unwind_create_frame): If needed, free the glyph
9780 matrices of the partially constructed frame. (Bug#9943)
9781 * xfns.c (unwind_create_frame): Likewise.
9782
9783 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9784
9785 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9786 Don't stop backward scan on the continuation glyph, even though
9787 its CHARPOS is positive.
9788 (mouse_face_from_buffer_pos, note_mouse_highlight):
9789 Rename cover_string to disp_string.
9790
9791 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9792
9793 * window.c (temp_output_buffer_show): Don't use
9794 Vtemp_buffer_show_specifiers.
9795 (Vtemp_buffer_show_specifiers): Remove unused variable.
9796
9797 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9798
9799 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9800 past the beginning of the current glyph matrix.
9801
9802 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9803
9804 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9805 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9806 HAVE_GTK3 (Bug#9869).
9807
9808 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9809 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9810
9811 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9812
9813 * xterm.c: Declare x_handle_net_wm_state to return int.
9814 (handle_one_xevent): Check if we are iconified but don't have
9815 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9816 (get_current_wm_state): Return non-zero if not hidden,
9817 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9818 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9819 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9820 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9821
9822 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9823
9824 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9825 so that this new function doesn't get optimized away by a
9826 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9827
9828 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9829
9830 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9831
9832 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9833
9834 Fix the `xbytecode' command.
9835 * .gdbinit (xprintbytestr): New command.
9836 (xwhichsymbols): Rename from `which'; all callers changed.
9837 (xbytecode): Print the byte-code string as well.
9838
9839 2011-10-29 Kim Storm <storm@cua.dk>
9840
9841 * alloc.c (which_symbols): New function.
9842
9843 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9844
9845 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9846 line. (Bug#9903)
9847
9848 2011-10-29 Glenn Morris <rgm@gnu.org>
9849
9850 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9851 Not clear what it was for, and it causes various bugs. (Bug#9839)
9852
9853 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9854
9855 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9856 possible random value that matches one of those tested as
9857 condition to clear the mouse face.
9858
9859 2011-10-28 Chong Yidong <cyd@gnu.org>
9860
9861 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9862
9863 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9864
9865 * window.c (make_window): Initialize phys_cursor_on_p.
9866
9867 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9868
9869 * lisp.h (struct Lisp_Symbol): Update comments.
9870
9871 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9872
9873 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9874
9875 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9876
9877 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9878 <oslsachem@gmail.com> for helping to debug this.
9879
9880 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9881 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9882 (g_b_init_get_glyph_outline_w): New static variables.
9883 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9884 (GetGlyphOutlineW_Proc): New typedefs.
9885 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9886 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9887 New functions.
9888 (w32font_open_internal, compute_metrics):
9889 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9890 instead of calling the "wide" APIs directly.
9891
9892 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9893
9894 * w32.h (syms_of_w32font): Add prototype.
9895
9896 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9897
9898 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9899 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9900 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9901 (Fmove_to_window_line): Doc fix.
9902
9903 2011-10-27 Chong Yidong <cyd@gnu.org>
9904
9905 * process.c (make_process): Set gnutls_state to NULL.
9906
9907 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9908 non-NULL, regardless of GNUTLS_INITSTAGE.
9909 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9910 an error. Set process slots as soon as we allocate them.
9911
9912 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9913
9914 2011-10-27 Chong Yidong <cyd@gnu.org>
9915
9916 * gnutls.c (emacs_gnutls_deinit): New function.
9917 Deallocate credentials structures as well as calling gnutls_deinit.
9918 (Fgnutls_deinit, Fgnutls_boot): Use it.
9919
9920 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9921 (deactivate_process): Call emacs_gnutls_deinit.
9922
9923 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9924
9925 * image.c (x_create_x_image_and_pixmap):
9926 * w32.c (sys_rename, w32_delayed_load):
9927 * w32font.c (fill_in_logfont):
9928 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9929
9930 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9931
9932 * w32fns.c (w32_default_color_map): New function,
9933 extracted from Fw32_default_color_map.
9934 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9935
9936 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9937
9938 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9939
9940 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9941
9942 * keyboard.c (test_undefined): New function (bug#9751).
9943 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9944
9945 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9946
9947 * sysdep.c (init_sys_modes): Fix the check for the controlling
9948 terminal (Bug#6649).
9949
9950 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9951
9952 * dispextern.h (struct bidi_it): New member next_en_type.
9953
9954 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9955 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9956 current character, check also for next_en_type being WEAK_EN.
9957 (bidi_resolve_weak): Don't enter the expensive loop if the current
9958 position is before next_en_pos. Record the bidi type of the first
9959 non-ET, non-BN character we find, in addition to its position.
9960 (bidi_level_of_next_char): Invalidate next_en_type when
9961 next_en_pos is over-stepped.
9962
9963 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9964
9965 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9966 * editfns.c: Rewrite current-time-zone so that it invokes
9967 the equivalent of (format-time-string "%Z") to get the time zone name.
9968 This fixes a bug when the time zone name contains characters that
9969 need converting from the system time locale to Emacs internal format.
9970 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9971 that patch fixed format-time-string to do the conversion, but
9972 I forgot to fix current-time-zone.
9973 (format_time_string): New function, containing most of
9974 what Fformat_time_string used to contain.
9975 (Fformat_time_string): Rewrite in terms of format_time_string.
9976 This doesn't change this function's behavior.
9977 (current-time-zone): Rewrite to use format_time_string.
9978 This fixes the bug reported by Michael Schierl in
9979 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9980 Jason Rumney's 2007-06-07 change worked around this bug, but
9981 didn't fix it.
9982 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9983
9984 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9985
9986 * xdisp.c (start_display): If the character at POS is displayed
9987 via a display vector, reset IT->current.dpvec_index to zero.
9988 (try_window_reusing_current_matrix): If a line ends in a display
9989 vector or the next line starts in a display vector, continue
9990 redrawing the window even though the character position of
9991 start_row was reached.
9992 (Bug#9771, part 2)
9993
9994 2011-10-18 Chong Yidong <cyd@gnu.org>
9995
9996 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9997 with nobreak-char-display too.
9998
9999 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10000
10001 Fix part 3 of bug#9771.
10002 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10003 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10004 non-neutral characters if the current character is a paragraph
10005 separator (a.k.a. Newline). This avoids running the same
10006 expensive loop twice, once when we consume the preceding newline
10007 and the other time when the line actually needs to be displayed.
10008 Avoid the loop when we see neutrals on the base embedding level
10009 following a character whose directionality is the same as the
10010 paragraph's. This avoids running the expensive loop when a line
10011 ends in a long sequence of neutrals, like control characters.
10012 Add assertion against STRONG_AL type. Slightly rearrange code
10013 that determines the type of a neutral given the first non-neutral
10014 that follows it.
10015 (bidi_level_of_next_char): Set next_en_pos to zero when
10016 invalidating its info.
10017
10018 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10019
10020 * xdisp.c (push_display_prop): Determine whether to record string
10021 or buffer position by IT->string, not by IT->method. Allow
10022 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10023 (move_it_vertically_backward): Don't look for character position
10024 immediately after the newline when in a continuation line.
10025 (Bug#9771, part 1)
10026
10027 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10028
10029 * window.c (coordinates_in_window): Rewrite and delabelize
10030 vertical border check. (Bug#5357) (Bug#9618)
10031
10032 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10033
10034 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10035 errors in XSetWindowBorder (bug#9310).
10036
10037 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10038
10039 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10040 avoid crash when xmalloc overrun checking is enabled.
10041
10042 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10043
10044 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10045 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10046 cursor motion with <left> and <right> arrow keys.
10047
10048 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10049 some callers set that themselves.
10050
10051 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10052
10053 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10054 display string and the previous row comes from the same string and
10055 is empty. (Bug#9739) (Bug#9738)
10056
10057 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10058
10059 * doc.c (get_doc_string): Encode file name (bug#9735).
10060
10061 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10062
10063 * bidi.c (bidi_level_of_next_char):
10064 * xdisp.c (get_visually_first_element): Remove old incorrect
10065 comments regarding the Unicode Line Separator character.
10066
10067 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10068
10069 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10070
10071 * alloc.c (Fgc_status): Do not access beyond zombies array
10072 boundary if nzombies > MAX_ZOMBIES.
10073 * alloc.c (dump_zombies): Add missing format specifier.
10074
10075 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10076
10077 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10078 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10079
10080 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10081 Some packages use them to denote characters with modifiers.
10082
10083 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10084
10085 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10086 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10087 matching a pp-number. Rename parameter var to var1.
10088
10089 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10090
10091 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10092
10093 2011-10-08 Glenn Morris <rgm@gnu.org>
10094
10095 * callint.c (Fcall_interactively): Give a more explicit error for the
10096 'c' case with a non-character input. (Bug#8479)
10097
10098 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10099
10100 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10101 lines.
10102 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10103 lines that are hscrolled on the left.
10104
10105 * dispnew.c (buffer_posn_from_coords): Account for a possible
10106 presence of header-line. (Bug#4426)
10107
10108 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10109
10110 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10111 Don't advertise functionality which we discourage or doesn't work.
10112
10113 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10114
10115 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10116 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10117 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10118 this makes Emacs dump core during garbage collection on rare
10119 occasions. sizeof is obviously inferior to offsetof here, so
10120 stick with offsetof.
10121 (GC_POINTER_ALIGNMENT): New macro.
10122 (mark_memory): Omit 3rd (offset) arg; caller changed.
10123 Don't assume EMACS_INT alignment is the same as pointer alignment.
10124
10125 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10126
10127 * keyboard.c (read_key_sequence_remapped): New var.
10128 (read_key_sequence): Compute remapping in the right buffer.
10129 (command_loop_1): Use read_key_sequence's remapping directly.
10130
10131 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10132
10133 * dired.c (file_name_completion): Don't expand file name.
10134 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10135 before checking file name handler.
10136
10137 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10138 they've been requested explicitly (bug#9591).
10139
10140 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10141
10142 * keymap.c (Fsingle_key_description): Use make_specified_string
10143 instead of build_string to build string from push_key_description.
10144 (Bug#5193)
10145
10146 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10147
10148 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10149 This fixes a Y2038 bug on 64-bit hosts.
10150 * buffer.c (reset_buffer):
10151 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10152 (Fclear_buffer_auto_save_failure):
10153 Use 0, not -1, to represent an unset failure time, since time_t
10154 might not be signed.
10155
10156 Remove dependency on glibc malloc internals.
10157 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10158 Move back here from lisp.h, but with their new implementations.
10159 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10160 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10161 * charset.c (charset_table_init): New static var.
10162 (syms_of_charset): Use it instead of xmalloc. This removes a
10163 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10164 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10165 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10166 Move back to alloc.c.
10167 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10168 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10169
10170 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10171
10172 * nsterm.m (windowDidResize): Call x_set_window_size only when
10173 ns_in_resize is true. Otherwise set pixelwidth/height and
10174 call change_frame_size (Bug#9628).
10175
10176 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10177
10178 Port --enable-checking=all to Fedora 14 x86-64.
10179 * charset.c (syms_of_charset): Also account for glibc malloc's
10180 internal overhead when calculating the initial malloc maximum.
10181
10182 Port --enable-checking=all to Fedora 14 x86.
10183 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10184 Move to lisp.h.
10185 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10186 (overrun_check_realloc, overrun_check_free):
10187 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10188 That way, xmalloc returns a properly-aligned pointer even if
10189 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10190 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10191 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10192 into account when calculating the initial malloc maximum.
10193 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10194 Move here from alloc.c, so that charset.c can use it too.
10195 Properly align; the old code wasn't right for common 32-bit hosts
10196 when configured with --enable-checking=all.
10197 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10198 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10199
10200 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10201
10202 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10203 use EDOM.
10204
10205 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10206
10207 * xdisp.c (compute_display_string_end): If there's no display
10208 string at CHARPOS, return -1.
10209
10210 * bidi.c (bidi_fetch_char): When compute_display_string_end
10211 returns a negative value, treat the character as a normal
10212 character not covered by a display string. (Bug#9624)
10213
10214 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10215
10216 * lread.c (Fread_from_string): Fix typo in docstring.
10217
10218 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10219
10220 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10221 newline, reseat the iterator instead of bidi-iterating there one
10222 character at a time. (Bug#9610)
10223 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10224 TO_CHARPOS if the bidi iterator is at base embedding level.
10225
10226 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10227
10228 * lread.c (readevalloop): Use correct code for NBSP.
10229 (read1): Likewise. (Bug#9608)
10230
10231 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10232
10233 * dbusbind.c (Fdbus_register_signal): When service is not
10234 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10235
10236 2011-09-25 Glenn Morris <rgm@gnu.org>
10237
10238 * buffer.c (truncate-lines): Doc fix.
10239
10240 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10241
10242 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10243 (Fset_window_next_buffers): Doc fix.
10244
10245 2011-09-24 Glenn Morris <rgm@gnu.org>
10246
10247 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10248
10249 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10250
10251 Fix minor problems found by static checking.
10252 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10253 * indent.c (Fvertical_motion): Fix == vs = typo.
10254
10255 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10256
10257 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10258 Default value is now t. Doc fix.
10259
10260 * indent.c (Fvertical_motion): Compute and apply the overshoot
10261 logic when moving up, not only when moving down. Fix the
10262 confusing name and values of the it_overshoot_expected variable;
10263 logic changes accordingly. (Bug#9254) (Bug#9549)
10264
10265 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10266 CHARPOS is covered by a display string which includes newlines.
10267 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10268 is covered by a display string with embedded newlines.
10269
10270 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10271
10272 * dbusbind.c (Fdbus_register_signal): Add match rule to
10273 Vdbus_registered_objects_table. (Bug#9581)
10274 (Fdbus_register_method, Vdbus_registered_objects_table):
10275 Fix docstring.
10276
10277 2011-09-24 Jim Meyering <meyering@redhat.com>
10278
10279 do not ignore write error for any output size
10280 The previous change was incomplete.
10281 While it makes emacs --batch detect the vast majority of stdout
10282 write failures, errors were still ignored whenever the output size is
10283 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10284 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10285 && echo FAIL: ignored write error
10286 FAIL: ignored write error
10287 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10288 && echo FAIL: ignored write error
10289 FAIL: ignored write error
10290 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10291
10292 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10293
10294 * emacs.c (Fkill_emacs): In noninteractive mode exit
10295 non-successfully if a write error occurred on stdout. (Bug#9574)
10296
10297 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10298
10299 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10300 the xassert test.
10301
10302 * dispextern.h (struct it): Update the comment documenting what
10303 can it->OBJECT be.
10304
10305 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10306
10307 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10308 a display string, extend search for cursor position to end of row.
10309 (find_row_edges): If the row ends in a newline from a display
10310 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10311 Handle the case of a display string with multiple newlines.
10312 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10313 non-empty line. Fixes confusing cursor motion with arrow keys at
10314 the beginning of a line that starts with whitespace.
10315
10316 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10317
10318 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10319 (bug#9493).
10320
10321 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10322
10323 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10324 boolean (Bug#9154).
10325
10326 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10327
10328 * xdisp.c (display_line): Record maximum and minimum buffer
10329 positions even if no glyphs were produced (e.g., by a zero-width
10330 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10331 buffer positions that will be removed from the glyph row because
10332 they don't fit.
10333 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10334 column is beyond frame width: don't subtract 1 "pixel" when
10335 computing width of the stretch.
10336 (reseat_at_next_visible_line_start): Undo the change made on
10337 2011-09-17 that saved paragraph information and restored it after
10338 the call to `reseat'. (Bug#9545)
10339
10340 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10341
10342 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10343 and turn window cursor on if cleared (Bug#9415).
10344
10345 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10346
10347 * search.c (boyer_moore): Take unibyte characters from pattern
10348 literally. (Bug#9458)
10349
10350 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10351
10352 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10353
10354 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10355
10356 Fix minor problem found by static checking.
10357 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10358 initialized, to pacify gcc -Wuninitialized.
10359
10360 * fileio.c: Report proper errno when syscall falls.
10361 (Finsert_file_contents): Save and restore errno,
10362 so that report_file_error outputs the correct diagnostic.
10363 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10364
10365 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10366
10367 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10368
10369 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10370
10371 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10372 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10373
10374 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10375
10376 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10377 about the current paragraph and restore it after the call to reseat.
10378
10379 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10380 (bidi_find_paragraph_start): Search back for paragraph beginning
10381 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10382 (bidi_move_to_visually_next): Only trigger paragraph-related
10383 computations when the last character is a newline or at EOB, not
10384 just any NEUTRAL_B. (Bug#9470)
10385
10386 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10387 truncated lines if point is covered by a display string. (Bug#9524)
10388
10389 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10390
10391 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10392 (cons_to_x_long): New function.
10393 (lisp_data_to_selection_data): Use it. Correct the test for
10394 short-versus-long data; it was negated. Break out of vector
10395 loop, for efficiency, when a long datum is discovered.
10396
10397 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10398
10399 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10400
10401 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10402
10403 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10404 GCC PR/17406) by declaring this function with external scope.
10405
10406 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10407
10408 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10409 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10410
10411 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10412
10413 * editfns.c (Fformat): Correctly handle text properties on "%%".
10414
10415 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10416
10417 * xterm.c (x_draw_composite_glyph_string_foreground):
10418 * w32term.c (x_draw_composite_glyph_string_foreground):
10419 * term.c (encode_terminal_code):
10420 * composite.c (composition_update_it, get_composition_id):
10421 * xdisp.c (get_next_display_element)
10422 (fill_composite_glyph_string): Add comments about special meaning
10423 of TAB characters in a composition.
10424
10425 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10426
10427 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10428 This occurs when processing a multibyte format.
10429 Problem reported by Wolfgang Jenker.
10430
10431 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10432
10433 * xdisp.c (try_cursor_movement): Only check for exact match if
10434 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10435
10436 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10437
10438 Remove unused external symbols.
10439 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10440 * xdisp.c (calc_pixel_width_or_height): Now static.
10441 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10442 * indent.c (check_display_width):
10443 * w32term.c: Fix comment to match code.
10444 * xterm.c, xterm.h (x_catching_errors): Remove.
10445
10446 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10447
10448 * xselect.c: Use signed conversions more consistently (Bug#9498).
10449 (selection_data_to_lisp_data): Assume incoming selection data are
10450 signed integers, not unsigned. This is to be consistent with
10451 outgoing selection data, which was modified to use signed integers
10452 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10453 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10454 expects long, not unsigned long.
10455
10456 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10457
10458 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10459 computation of loop end. Reported by Johan Bockgård
10460 <bojohan@gnu.org>.
10461
10462 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10463
10464 * frame.c (Fother_visible_frames_p): Function deleted.
10465
10466 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10467
10468 * indent.c (compute_motion): Process display vector front to back
10469 rather than the other way around. (Bug#2496)
10470
10471 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10472
10473 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10474
10475 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10476
10477 * minibuf.c (Fread_from_minibuffer): Doc fix.
10478
10479 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10480
10481 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10482 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10483
10484 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10485
10486 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10487 value for non-existent files.
10488
10489 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10490
10491 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10492 set its "size" to -1. This will set the modtime_size field of
10493 the corresponding buffer to -1, which is what
10494 verify-visited-file-modtime expects for files that do not exist.
10495 (Bug#9139)
10496
10497 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10498
10499 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10500 here ...
10501 * lisp.h: ... from here. push_key_description is no longer
10502 defined in keyboard.c, so its declaration should not be in
10503 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10504 logically belongs with push_key_description.
10505
10506 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10507
10508 * buffer.h: Include <sys/types.h> instead of <time.h>.
10509 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10510 Problem reported by Herbert J. Skuhra.
10511
10512 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10513
10514 * xml.c (parse_region): Make the parsing work for
10515 non-comment-starting XML files again (bug#9144).
10516
10517 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10518
10519 * image.c (gif_load): Fix calculation of bottom and right corner.
10520 (Bug#9468)
10521
10522 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10523
10524 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10525 redisplay in small windows.
10526
10527 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10528
10529 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10530
10531 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10532
10533 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10534 Operate on live windows only.
10535
10536 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10537
10538 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10539
10540 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10541
10542 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10543 only under bidi iteration.
10544
10545 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10546
10547 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10548
10549 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10550
10551 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10552 Without this fix, the command to link temacs failed due to an
10553 undefined symbol __builtin_isnan. This is because
10554 /usr/include/iso/math_c99.h #defines isnan(x) to
10555 __builtin_isnan(x), but the bundled gcc, which identifies itself
10556 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10557 a __builtin_isnan.
10558 * floatfns.c (isnan): #undef, and then #define to a clone of
10559 what's in data.c.
10560 (Fisnan): Always define, since it's always available now.
10561 (syms_of_floatfns): Always define isnan at the Lisp level.
10562
10563 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10564
10565 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10566
10567 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10568
10569 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10570 The previous code assumed that file offsets (off_t values) fit in
10571 EMACS_INT variables, which is not true on typical 32-bit hosts.
10572 The code messed up by falsely reporting buffer overflow in cases
10573 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10574 when "big" contains more than 2**29 bytes, even though this
10575 inserts just one byte and does not overflow the buffer.
10576 (Finsert_file_contents): Store file offsets as off_t
10577 values, not as EMACS_INT values. Check for overflow when
10578 converting between EMACS_INT and off_t. When checking for
10579 buffer overflow or for overlap, take the offsets into account.
10580 Don't use EMACS_INT for small values where int suffices.
10581 When checking for overlap, fix a typo: ZV was used where
10582 ZV_BYTE was intended.
10583 (Fwrite_region): Don't assume off_t fits into 'long'.
10584 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10585
10586 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10587
10588 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10589
10590 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10591
10592 sprintf-related integer and memory overflow issues (Bug#9412).
10593
10594 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10595 (esprintf, exprintf, evxprintf): New functions.
10596 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10597 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10598 (modify_event_symbol): Do not assume that the length of
10599 name_alist_or_stem is safe to alloca and fits in int.
10600 (Fexecute_extended_command): Likewise for function name and binding.
10601 (Frecursion_depth): Wrap around reliably on integer overflow.
10602 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10603 since some callers pass EMACS_INT values.
10604 (Fsingle_key_description): Don't crash if symbol name contains more
10605 than MAX_ALLOCA bytes.
10606 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10607 (get_minibuffer): Arg is now EMACS_INT, not int.
10608 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10609 (esprintf, exprintf, evxprintf): New decls.
10610 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10611
10612 * dbusbind.c (signature_cat): New function.
10613 (xd_signature, Fdbus_register_signal):
10614 Do not overrun buffer; instead, report string overflow.
10615
10616 * dispnew.c (add_window_display_history): Don't overrun buffer.
10617 Truncate instead; this is OK since it's just a log.
10618
10619 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10620 even if the time zone offset is outlandishly large.
10621 Don't mishandle offset == INT_MIN.
10622
10623 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10624 when creating daemon; the previous buffer-overflow check was incorrect.
10625
10626 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10627 which has the guts of the old verror function.
10628
10629 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10630 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10631
10632 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10633 (font_unparse_xlfd): Don't blindly alloca long strings.
10634 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10635 fits in int, when using sprintf. Use single snprintf to count
10636 length of string rather than counting it via multiple sprintfs;
10637 that's simpler and more reliable.
10638 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10639 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10640 sprintf, in case result does not fit in int.
10641
10642 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10643 (fontset_from_font): Print it.
10644
10645 * frame.c (tty_frame_count): Now printmax_t, not int.
10646 (make_terminal_frame, set_term_frame_name): Print it.
10647 (x_report_frame_params): In X, window IDs are unsigned long,
10648 not signed long, so print them as unsigned.
10649 (validate_x_resource_name): Check for implausibly long names,
10650 and don't assume name length fits in 'int'.
10651 (x_get_resource_string): Don't blindly alloca invocation name;
10652 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10653 not fit in int.
10654
10655 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10656 (xg_check_special_colors, xg_set_geometry):
10657 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10658
10659 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10660 Use esprintf, not sprintf, in case result does not fit in int.
10661
10662 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10663 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10664 it as a large positive number.
10665 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10666 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10667
10668 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10669 in case result does not fit in int.
10670
10671 * print.c (float_to_string): Detect width overflow more reliably.
10672 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10673 buffer overrun. Don't assume list length fits in 'int'. Treat
10674 print length of 0 as 0, not as infinity; to be consistent with other
10675 uses of print length in this function. Don't overflow print length
10676 index. Don't assume hash table size fits in 'long', or that
10677 vectorlike size fits in 'unsigned long'.
10678
10679 * process.c (make_process): Use printmax_t, not int, to format
10680 process-name gensyms.
10681
10682 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10683
10684 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10685 to avoid potential buffer overrun.
10686
10687 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10688 if X resource line is longer than 512 bytes.
10689
10690 * xfns.c (x_window): Make sprintf buffer a bit bigger
10691 to avoid potential buffer overrun.
10692
10693 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10694
10695 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10696
10697 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10698
10699 Integer overflow fixes for scrolling, etc.
10700 Without these, Emacs silently mishandles large integers sometimes.
10701 For example, "C-u 4294967297 M-x recenter" was treated as if
10702 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10703
10704 * xdisp.c (try_window_id): Check Emacs fixnum range before
10705 converting to 'int'.
10706
10707 * window.c (window_scroll_line_based, Frecenter):
10708 Check that an Emacs fixnum is in range before assigning it to 'int'.
10709 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10710 values converted from Emacs fixnums.
10711 (Frecenter): Don't wrap around a line count if it is out of 'int'
10712 range; instead, treat it as an extreme value.
10713 (Fset_window_configuration, compare_window_configurations):
10714 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10715
10716 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10717 that can exceed INT_MAX. Check that EMACS_INT value is in range
10718 before assigning it to the (possibly-narrower) index.
10719 (match_limit): Don't assume that a fixnum can fit in 'int'.
10720
10721 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10722 exceed INT_MAX.
10723
10724 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10725 (Fvertical_motion): Don't wrap around LINES values that don't fit
10726 in 'int'. Instead, treat them as extreme values. This is good
10727 enough for windows, which can't have more than INT_MAX lines anyway.
10728
10729 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10730
10731 * Require libxml/parser.h to avoid compilation warning.
10732
10733 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10734
10735 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10736 since this reportedly can destroy thread storage.
10737
10738 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10739
10740 * syntax.c (find_defun_start): Update all cache variables if
10741 exiting early (Bug#9401).
10742
10743 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10744
10745 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10746
10747 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10748 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10749 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10750
10751 * term.c (tty_append_glyph): New function.
10752 (produce_stretch_glyph): Static function and its prototype deleted.
10753
10754 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10755 Add prototypes.
10756
10757 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10758
10759 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10760 when checking :margin (Bug#9390).
10761 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10762 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10763 so that the name doesn't mislead. All uses changed.
10764
10765 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10766
10767 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10768 set_tty_hooks.
10769
10770 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10771
10772 * xdisp.c (move_it_to): Don't bail out early when reaching
10773 position beyond to_charpos, if we are scanning backwards.
10774 (move_it_vertically_backward): When DY == 0, make sure we get to
10775 the first character in the line after the newline.
10776
10777 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10778
10779 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10780 (ccl_driver): Do not generate an out-of-range pointer.
10781 (Fccl_execute_on_string): Remove unnecessary check for
10782 integer overflow, noted by Stefan Monnier in
10783 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10784 Remove a FIXME that didn't need fixing.
10785 Simplify the newly-introduced buffer reallocation code.
10786
10787 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10788
10789 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10790
10791 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10792
10793 Integer and memory overflow issues (Bug#9196).
10794
10795 * doc.c (get_doc_string): Rework so that
10796 get_doc_string_buffer_size is the actual buffer size, rather than
10797 being 1 less than the actual buffer size; this makes xpalloc more
10798 convenient.
10799
10800 * image.c (x_allocate_bitmap_record, cache_image):
10801 * xselect.c (Fx_register_dnd_atom):
10802 Simplify previous changes by using xpalloc.
10803
10804 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10805 since either will do and ptrdiff_t is convenient with xpalloc.
10806
10807 * charset.c (charset_table_size)
10808 (struct charset_sort_data.priority): Now ptrdiff_t.
10809 (charset_compare): Don't overflow if priorities differ greatly.
10810 (Fsort_charsets): Don't assume list length fits in int.
10811 Check for size-calculation overflow when allocating sort data.
10812 (syms_of_charset): Allocate an initial charset table that is
10813 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10814
10815 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10816
10817 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10818 The actual value is always <= INT_MAX, and leaving it unsigned made
10819 overflow checking harder.
10820
10821 * dispextern.h (struct glyph_matrix.rows_allocated)
10822 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10823 with xpalloc. The values are still always <= INT_MAX.
10824
10825 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10826
10827 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10828 (SAFE_NALLOCA): New macro.
10829
10830 * region-cache.c (struct boundary.pos, find_cache_boundary)
10831 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10832 (set_cache_region, invalidate_region_cache)
10833 (revalidate_region_cache, know_region_cache, region_cache_forward)
10834 (region_cache_backward, pp_cache):
10835 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10836 so that ptrdiff_t * can be passed to xpalloc.
10837 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10838 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10839 (pp_cache): Don't assume cache_len fits in int.
10840 * region-cache.h: Adjust extern decls to match.
10841
10842 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10843 EMACS_INT, since either will do, for xpalloc.
10844
10845 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10846 (xnmalloc, xnrealloc, xpalloc): New functions.
10847
10848 * bidi.c (bidi_shelve_header_size): New constant.
10849 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10850 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10851
10852 * bidi.c (bidi_cache_shrink):
10853 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10854 (overlay_strings):
10855 Don't update size of array until after memory allocation succeeds,
10856 because xmalloc/xrealloc may not return.
10857 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10858 now that we have proper integer overflow checking.
10859 (record_overlay_string, overlay_strings): Catch overflows when
10860 calculating size of overlay_str_buf.
10861
10862 * callproc.c (Fcall_process): Check for size overflow when
10863 calculating size of args2.
10864 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10865 Normally we prefer signed values, but sticking with ptrdiff_t would
10866 require adding more-complicated checks.
10867
10868 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10869 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10870 Redo buffer-overflow calculations to avoid integer overflow.
10871 Add a FIXME comment where memory seems to be over-allocated.
10872
10873 * character.c (Fstring): Check for size-calculation overflow.
10874
10875 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10876 unnecessary integer overflow. Check for size overflow.
10877 (encode_coding_object): Don't update size until xmalloc succeeds.
10878
10879 * composite.c (get_composition_id): Check for overflow in glyph
10880 length calculations.
10881
10882 Integer and memory overflow fixes for display code.
10883 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10884 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10885 (scrolling_window): Check for overflow in size calculations.
10886 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10887 Don't assume glyph table len fits in int.
10888 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10889 (row_table_size): Now ptrdiff_t, not int.
10890 (scrolling_window): Avoid overflow in size calculations.
10891 Don't update size until allocation succeeds.
10892 * fns.c (concat): Check for overflow in size calculations.
10893 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10894 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10895 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10896
10897 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10898 (get_doc_string): Check for size calculation overflow.
10899 Don't update size until allocation succeeds.
10900 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10901 EMACS_INT, where ptrdiff_t will do.
10902 (Fsubstitute_command_keys): Check for string overflow.
10903
10904 * editfns.c (set_time_zone_rule): Don't assume environment length
10905 fits in int.
10906 (message_length): Now ptrdiff_t, not int.
10907 (Fmessage_box): Don't update size until allocation succeeds.
10908 Don't assume message length fits in int.
10909 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10910
10911 * emacs.c (main): Do not reallocate argv, since there is a null at
10912 the end that can be overwritten, and this way there's no need to
10913 worry about size-calculation overflow.
10914 (sort_args): Check for size-calculation overflow.
10915
10916 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10917 alloc succeeds.
10918 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10919
10920 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10921 (x_set_scroll_bar_width, x_figure_window_size):
10922 Check for integer overflow.
10923 (x_set_alpha): Do not assume XINT fits in int.
10924
10925 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10926 This is for the members text_lines, text_cols, total_lines, total_cols,
10927 where the system imposes an 'int' limit.
10928
10929 * fringe.c (Fdefine_fringe_bitmap):
10930 Don't update size until alloc works.
10931
10932 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10933 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10934
10935 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10936 Check for size-calculation overflow.
10937 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10938 do, as we prefer signed integers.
10939 (id_to_widget.max_size, id_to_widget.used)
10940 (xg_store_widget_in_map, xg_remove_widget_from_map)
10941 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10942 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10943 Use and return ptrdiff_t, not int.
10944 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10945 * gtkutil.h: Change prototypes to match the above.
10946
10947 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10948 are duplicate now that they've been promoted to lisp.h.
10949 (x_allocate_bitmap_record, x_alloc_image_color)
10950 (make_image_cache, cache_image, xpm_load):
10951 Don't update size until alloc is done.
10952 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10953 (x_detect_edges):
10954 Check for size calculation overflow.
10955 (ct_colors_allocated_max): New constant.
10956 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10957 overflow.
10958
10959 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10960 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10961 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10962 Use ptrdiff_t, not int, to count maps.
10963 (read_char_minibuf_menu_prompt): Check for overflow in size
10964 calculations. Don't update size until allocation succeeds.
10965 Redo calculations to avoid overflow.
10966 * keyboard.h: Change prototypes to match the above.
10967
10968 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10969 to count maps.
10970 (current_minor_maps): Check for size calculation overflow.
10971 * keymap.h: Change prototypes to match the above.
10972
10973 * lread.c (read1, init_obarray): Don't update size until alloc done.
10974
10975 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10976 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10977
10978 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10979 Now ptrdiff_t, not int.
10980 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10981 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10982
10983 * process.c (Fnetwork_interface_list): Check for overflow
10984 in size calculation.
10985
10986 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10987
10988 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10989 overflow. Don't bother calling xmalloc when xrealloc will do.
10990
10991 * search.c (Freplace_match): Check for size calculation overflow.
10992 (Fset_match_data): Don't assume list lengths fit in 'int'.
10993
10994 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10995 for command line length. Do not attempt to address one before the
10996 beginning of an array, as that's not portable.
10997
10998 * term.c (max_frame_lines): Remove; unused.
10999 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11000 not int.
11001 (encode_terminal_code, calculate_costs): Check for size
11002 calculation overflow.
11003 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11004 table lengths and related sizes. Don't update size until alloc
11005 done. Redo calculations to avoid overflow.
11006 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11007
11008 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11009 subtracting pointers.
11010 (gobble_line): Check for overflow more carefully. Don't update size
11011 until alloc done.
11012
11013 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11014 Don't update size until alloc done.
11015 Redo size calculations to avoid overflow.
11016 Check for size calculation overflow.
11017 (main) [DEBUG]: Fix typo in invoking tparam1.
11018
11019 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11020 Use ptrdiff_t, not int, for sizes.
11021 (store_mode_line_noprop_char): Don't update size until alloc done.
11022
11023 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11024 Use ptrdiff_t, not int, for sizes.
11025 (Finternal_make_lisp_face, cache_face):
11026 Check for size calculation overflow.
11027 (cache_face): Treat size calculation overflows as if they were
11028 memory exhaustion (the usual treatment), rather than aborting.
11029
11030 * xfns.c (x_encode_text, x_set_name_internal)
11031 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11032 sizes, since they can exceed INT_MAX in size. Check for size
11033 calculation overflow.
11034
11035 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11036 (xg_select): Check for size calculation overflow.
11037 Don't update size until alloc done.
11038
11039 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11040 as sprintf is limited to int lengths.
11041
11042 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11043 (X_LONG_MIN): New macros.
11044 Use them to make the following changes clearer.
11045 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11046 This change doesn't affect the value now, but it may help remind
11047 future maintainers not to raise the value too much later.
11048 (SELECTION_QUANTUM): Remove, replacing with ...
11049 (selection_quantum): ... new function, which avoids overflow.
11050 All uses changed.
11051 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11052 assumption that selection length fits in 'int'.
11053 (x_reply_selection_request, x_handle_selection_request)
11054 (x_get_window_property, receive_incremental_selection)
11055 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11056 (lisp_data_to_selection_data, clean_local_selection_data):
11057 Use ptrdiff_t, not int, to record length of selection.
11058 (x_reply_selection_request, x_get_window_property)
11059 (receive_incremental_selection, x_property_data_to_lisp):
11060 Redo calculations to avoid overflow.
11061 (x_reply_selection_request): When sending hint, ceiling it at
11062 X_LONG_MAX rather than relying on wraparound overflow to send
11063 something.
11064 (x_get_window_property, receive_incremental_selection)
11065 (lisp_data_to_selection_data, x_property_data_to_lisp):
11066 Check for size-calculation overflow.
11067 (x_get_window_property, receive_incremental_selection)
11068 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11069 Don't store size until memory allocation succeeds.
11070 (x_get_window_property): Plug memory leak on memory exhaustion.
11071 Don't double-block input; malloc is safe here. Don't assume 2**34
11072 - 4 fits in unsigned long. Add an xassert to check
11073 XGetWindowProperty overflow. Be more careful about overflow
11074 calculations, and distinguish size from memory overflow better.
11075 (receive_incremental_selection): When tracing, don't assume
11076 unsigned int is less than INT_MAX.
11077 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11078 harmful) conversions of unsigned short to int.
11079 (lisp_data_to_selection_data): Don't assume that integers
11080 in the range -65535 through -1 fit in an X unsigned short.
11081 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11082 result parameters unless successful. Rely on cons_to_unsigned
11083 to report problems with elements; the old code wasn't right anyway.
11084 (x_check_property_data): Check for int overflow; we cannot use
11085 a wider type due to X limits.
11086 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11087
11088 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11089
11090 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11091 (x_term_init): Check for size calculation overflow.
11092 (x_color_cells): Don't store size until memory allocation succeeds.
11093 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11094 Don't assume alloca size is less than MAX_ALLOCA.
11095 (x_term_init): Don't assume length fits in int (sprintf is limited
11096 to int size).
11097
11098 Use ptrdiff_t for composition IDs.
11099 * character.c (lisp_string_width):
11100 * composite.c (composition_table_size, n_compositions)
11101 (get_composition_id, composition_gstring_from_id):
11102 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11103 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11104 * window.c (Frecenter):
11105 Use ptrdiff_t, not int, for composition IDs.
11106 * composite.c (get_composition_id): Check for integer overflow.
11107 * composite.h: Adjust prototypes to match the above changes.
11108
11109 Use ptrdiff_t for hash table indexes.
11110 * category.c (hash_get_category_set):
11111 * ccl.c (ccl_driver):
11112 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11113 * coding.c (coding_system_charset_list, detect_coding_system):
11114 * coding.h (struct coding_system.id):
11115 * composite.c (get_composition_id, gstring_lookup_cache):
11116 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11117 * image.c (xpm_get_color_table_h):
11118 * lisp.h (hash_lookup, hash_put):
11119 * minibuf.c (Ftest_completion):
11120 Use ptrdiff_t for hash table indexes, not int (which is too
11121 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11122 32-bit --with-wide-int hosts).
11123
11124 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11125 Add a FIXME comment about memory leaks.
11126 (syms_of_charset): Don't assume xmalloc returns.
11127
11128 Don't assume that stated character widths fit in int.
11129 * character.c (Fchar_width, c_string_width, lisp_string_width):
11130 * character.h (CHAR_WIDTH):
11131 * indent.c (MULTIBYTE_BYTES_WIDTH):
11132 Use sanitize_char_width to avoid undefined and/or bad behavior
11133 with outlandish widths.
11134 * character.h (sanitize_tab_width): Rename from sanitize_width,
11135 now that we have two such functions. All uses changed.
11136 (sanitize_char_width): New inline function.
11137
11138 Don't assume that tab-width fits in int.
11139 * character.h (sanitize_width): New inline function.
11140 (SANE_TAB_WIDTH): New macro.
11141 (ASCII_CHAR_WIDTH): Use it.
11142 * indent.c (sane_tab_width): Remove. All uses replaced by
11143 SANE_TAB_WIDTH (current_buffer).
11144 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11145
11146 * fileio.c: Integer overflow issues with file modes.
11147 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11148
11149 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11150 Remove unreachable code.
11151 (read_hex, load_charset_map_from_file): Check for integer overflow.
11152
11153 * xterm.c: Don't go over XClientMessageEvent limit.
11154 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11155 (x_send_scroll_bar_event): Likewise. Check that the size does not
11156 exceed limits imposed by XClientMessageEvent, as well as the usual
11157 ptrdiff_t and size_t limits.
11158
11159 * keyboard.c: Overflow, signedness and related fixes.
11160 (make_lispy_movement): Use same integer type in forward decl
11161 that is used in the definition.
11162 (read_key_sequence, keyremap_step):
11163 Change bufsize argument back to int, undoing my 2011-03-30 change.
11164 We prefer signed types, and int is wide enough here.
11165 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11166 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11167 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11168 length, not size_t. Use ptrdiff_t for index, not int.
11169 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11170 possibility of integer overflow.
11171
11172 Overflow, signedness and related fixes for images.
11173
11174 * dispextern.h (struct it.stack[0].u.image.image_id)
11175 (struct_it.image_id, struct image.id, struct image_cache.size)
11176 (struct image_cache.used, struct image_cache.ref_count):
11177 * gtkutil.c (update_frame_tool_bar):
11178 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11179 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11180 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11181 * nsmenu.m (update_frame_tool_bar):
11182 * xdisp.c (calc_pixel_width_or_height):
11183 * xfns.c (image_cache_refcount):
11184 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11185 on typical 64-bit hosts.
11186
11187 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11188 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11189 Omit unnecessary casts to int.
11190 (parse_image_spec): Check that integers fall into 'int' range
11191 when the callers expect that.
11192 (image_ascent): Redo ascent calculation to avoid int overflow.
11193 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11194 (lookup_image): Remove unnecessary tests.
11195 (xbm_image_p): Locals are now of int, not EMACS_INT,
11196 since parse_image_check makes sure they fit into int.
11197 (png_load, gif_load, svg_load_image):
11198 Prefer int to unsigned where either will do.
11199 (tiff_handler): New function, combining the cores of the
11200 old tiff_error_handler and tiff_warning_handler.
11201 This function is rewritten to use vsnprintf and thereby avoid
11202 stack buffer overflows. It uses only the features of vsnprintf
11203 that are common to both POSIX and native Microsoft.
11204 (tiff_error_handler, tiff_warning_handler): Use it.
11205 (tiff_load, gif_load, imagemagick_load_image):
11206 Don't assume :index value fits in 'int'.
11207 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11208 (imagemagick_load_image): Check that crop parameters fit into
11209 the integer types that MagickCropImage accepts. Don't assume
11210 Vimagemagick_render_type has a nonnegative value. Don't assume
11211 size_t fits in 'long'.
11212 (gs_load): Use printmax_t to print the widest integers possible.
11213 Check for integer overflow when computing image height and width.
11214
11215 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11216
11217 * xdisp.c (redisplay_window): Don't force window start if point
11218 will be invisible in the resulting window. (Bug#9324)
11219
11220 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11221
11222 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11223 the display spec is of the form `(space ...)'.
11224 (handle_display_spec): Return the value returned by
11225 handle_single_display_spec, not just 1 or zero.
11226 (handle_single_display_spec): If the display spec is of the form
11227 `(space ...)', and specifies display in the text area, return 2
11228 rather than 1.
11229 (try_cursor_movement): Check for the need to scroll more
11230 accurately, and prefer exact match for point under bidi.
11231 Don't advance `row' beyond the last row of the window.
11232
11233 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11234 into disp_prop; all users changed.
11235
11236 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11237 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11238 for the text covered by the display property.
11239
11240 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11241
11242 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11243 Change return value to nil.
11244 (Frecord_buffer): Delete unused function.
11245
11246 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11247
11248 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11249 buffers, return left-to-right.
11250 (set_cursor_from_row): Consider candidate row a win if its glyph
11251 represents a newline and point is on that newline. Fixes cursor
11252 positioning on the newline at EOL of R2L text within L2R
11253 paragraph, and vice versa.
11254 (try_cursor_movement): Check continued rows, in addition to
11255 continuation rows. Fixes unwarranted scroll when point enters a
11256 continued line of R2L text within an L2R paragraph, or vice versa.
11257 (cursor_row_p): Consider the case of point being equal to
11258 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11259 from the end of a short line to the beginning of a continued line
11260 of R2L text within L2R paragraph.
11261 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11262 composed characters.
11263
11264 * bidi.c (bidi_check_type): Use xassert.
11265 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11266 members.
11267
11268 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11269
11270 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11271 a character.
11272
11273 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11274
11275 * nsfont.m (ns_otf_to_script): Fix typo.
11276
11277 2011-08-22 Kenichi Handa <handa@m17n.org>
11278
11279 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11280 extra slot even if the purpose is char-code-property-table.
11281
11282 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11283
11284 * xdisp.c (redisplay_window): When computing centering_position,
11285 account for the height of the header line. (Bug#8874)
11286
11287 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11288 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11289 candidate is selected by the mouse, and that candidate has a
11290 composed character under the mouse.
11291
11292 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11293 coordinates reported by pos-visible-in-window-p for a composed
11294 character in column zero.
11295
11296 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11297
11298 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11299
11300 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11301
11302 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11303 consider it a hit if to_charpos is anywhere in the range of the
11304 composed buffer positions.
11305
11306 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11307
11308 * image.c (gif_load): Don't assume that each subimage has the same
11309 dimensions as the base image. Handle disposal method that is
11310 "undefined" by the gif spec (Bug#9335).
11311
11312 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11313
11314 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11315 (Fcondition_case): Document `debug' symbol in error handler.
11316
11317 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11318
11319 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11320 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11321 from an Org mode buffer to a Speedbar frame.
11322
11323 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11324 a composition, take its buffer position from IT->cmp_it.charpos.
11325 Fixes cursor positioning at the beginning of a line that begins
11326 with a composed character.
11327
11328 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11329
11330 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11331 character bidirectional type, use STRONG_L instead. Fixes crashes
11332 in a buffer produced by `describe-categories'.
11333
11334 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11335 members before the level stack, so they would be saved and
11336 restored when copying iterator state. Fixes incorrect reordering
11337 around TABs covered by display properties.
11338
11339 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11340
11341 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11342
11343 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11344
11345 * eval.c (internal_condition_case, internal_condition_case_1)
11346 (internal_condition_case_2, internal_condition_case_n):
11347 Remove unnecessary aborts (Bug#9081).
11348
11349 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11350
11351 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11352 has no `load' handler, try opening the file locally. (Bug#9311)
11353
11354 2011-08-16 Ken Brown <kbrown@cornell.edu>
11355
11356 * gmalloc.c: Expand comment.
11357
11358 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11359
11360 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11361 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11362
11363 2011-08-16 Ken Brown <kbrown@cornell.edu>
11364
11365 Fix memory allocation problems in Cygwin build (Bug#9273).
11366
11367 * unexcw.c ( __malloc_initialized): Declare external variable.
11368 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11369
11370 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11371 New variables.
11372 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11373 dumped emacs.
11374 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11375 in the static heap.
11376 [CYGWIN] (special_realloc): New function.
11377 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11378 requests to realloc storage in the static heap.
11379
11380 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11381
11382 * bidi.c (bidi_initialize): Remove unused local.
11383
11384 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11385
11386 * bidimirror.h:
11387 * biditype.h: Remove file.
11388 * makefile.w32-in ($(BLD)/bidi.$(O)):
11389 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11390
11391 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11392
11393 * chartab.c: Improve commentary for the uniprop_table API.
11394
11395 * bidi.c (bidi_paragraph_init): Support zero value of
11396 bidi_ignore_explicit_marks_for_paragraph_level.
11397 (bidi_initialize): Use uniprop_table instead of including
11398 biditype.h and bidimirror.h.
11399
11400 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11401 coordinates of the iterator when restoring from ppos_it.
11402 (Bug#9296)
11403
11404 2011-08-14 Kenichi Handa <handa@m17n.org>
11405
11406 * process.c (create_process): Call setup_process_coding_systems
11407 after the pid of the process is set to -1 (Bug#8162).
11408
11409 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11410
11411 * xdisp.c (move_it_in_display_line_to): Don't invoke
11412 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11413 ppos_it. Fixes vertical cursor motion when line beginning is
11414 covered by an image. (Bug#9296)
11415
11416 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11417
11418 * nsterm.h (ns_run_ascript): Declare.
11419 (NSAPP_DATA2_RUNASSCRIPT): Define.
11420
11421 * nsfns.m (as_script, as_result, as_status): New static variables.
11422 (ns_run_ascript): New function.
11423 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11424 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11425 the event loop. Get status from as_status (Bug#7276).
11426
11427 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11428 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11429 the event loop (Bug#7276).
11430
11431 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11432
11433 * gnutls.c (QCgnutls_bootprop_priority)
11434 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11435 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11436 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11437 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11438 (QCgnutls_bootprop_verify_hostname_error)
11439 (QCgnutls_bootprop_callbacks_verify): Rename from
11440 Qgnutls_bootprop_..., all uses changed.
11441
11442 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11443 uses changed.
11444
11445 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11446
11447 * xfaces.c (Qframe_set_background_mode): Now static.
11448 * dispextern.h (Qframe_set_background_mode): Remove decl.
11449
11450 * process.c (Fnetwork_interface_info): Declare local only if needed.
11451
11452 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11453
11454 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11455 (Fnetwork_interface_list): Allocate in increments of bytes instead
11456 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11457 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11458 sockaddr.
11459 (struct ifflag_def): notrailers is smart on OSX.
11460 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11461 Get hardware address with getifaddrs if available.
11462
11463 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11464
11465 * xdisp.c (iterate_out_of_display_property): xassert that
11466 IT->position is set to within IT->object's boundaries. Break from
11467 the loop as soon as EOB is reached; avoids infloops in redisplay
11468 when IT->position is set up wrongly due to some bug.
11469 Set IT->current to match the bidi iterator unconditionally.
11470 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11471 entry. Force push_it to save on the stack the current
11472 buffer/string position, to be restored by pop_it. Fix flags in
11473 the iterator structure wrt the object coming from a display
11474 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11475 properties. (Bug#9284)
11476
11477 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11478
11479 * fontset.c (fontset_get_font_group): Add proper type checks.
11480 (Bug#9172)
11481
11482 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11483
11484 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11485 and LC_VERSION_MIN_MACOSX.
11486 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11487 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11488
11489 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11490
11491 * xdisp.c (forward_to_next_line_start): Allow to use the
11492 no-display-properties-and-no-overlays under bidi display.
11493 Set disp_pos in the bidi iterator to avoid searches for display
11494 properties and overlays.
11495
11496 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11497
11498 * editfns.c (Fset_time_zone_rule): Document relationship with the
11499 setenv function.
11500
11501 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11502 the font entity extracted from the cache (Bug#8109).
11503
11504 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11505
11506 * composite.c (autocmp_chars): Don't reset point. That is done by
11507 restore_point_unwind (Bug#5984).
11508
11509 2011-08-07 Juri Linkov <juri@jurta.org>
11510
11511 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11512 to show the arg `TIME' instead of `TIMEVAL'.
11513
11514 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11515
11516 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11517 display property strides EOL and includes a newline, as in
11518 longlines-mode. (Bug#9254)
11519 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11520 word-wrap under bidirectional display. (Bug#9224)
11521
11522 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11523 is non-zero, even if the data buffer is NULL. Fixes a crash in
11524 vertical-motion with longlines-mode. (Bug#9254)
11525
11526 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11527
11528 * bidi.c <bidi_cache_total_alloc>: Now static.
11529 (bidi_initialize): Initialize bidi_cache_total_alloc.
11530
11531 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11532 cache. (Bug#9221)
11533
11534 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11535 amount allocated this far in `bidi_cache_total_alloc'.
11536 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11537 non-zero, only free the data buffer without restoring the cache
11538 contents. All callers changed.
11539
11540 * dispextern.h (bidi_unshelve_cache): Update prototype.
11541
11542 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11543 (move_it_in_display_line, move_it_to)
11544 (move_it_vertically_backward, move_it_by_lines): Replace the call
11545 to xfree to an equivalent call to bidi_unshelve_cache.
11546 (move_it_in_display_line_to): Fix logic of returning
11547 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11548
11549 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11550
11551 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11552 came from a string character with a `cursor' property. (Bug#9229)
11553
11554 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11555
11556 * Makefile.in (LIB_PTHREAD): New variable.
11557 (LIBES): Add LIB_PTHREAD (Bug#9216).
11558
11559 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11560 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11561
11562 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11563
11564 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11565
11566 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11567
11568 * xterm.c (x_find_topmost_parent): New function.
11569 (x_set_frame_alpha): Find topmost parent window with
11570 x_find_topmost_parent and set the property there also (bug#9181).
11571 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11572
11573 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11574
11575 * callproc.c (Fcall_process): Avoid vfork clobbering
11576 the local vars buffer, coding_systems, current_dir.
11577
11578 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11579
11580 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11581
11582 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11583
11584 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11585 so that it is not optimized away.
11586
11587 * xdisp.c (compute_display_string_pos): Remove unused local.
11588
11589 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11590
11591 Fix slow cursor motion and scrolling in large buffers with
11592 selective display, like Org Mode buffers. (Bug#9218)
11593
11594 * dispextern.h (struct bidi_it): New member disp_prop_p.
11595
11596 * xdisp.c: Remove one-slot cache of display string positions.
11597 (compute_display_string_pos): Accept an additional argument
11598 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11599 for a display string or property. If found, set DISP_PROP_P
11600 non-zero.
11601
11602 * bidi.c (bidi_fetch_char): Accept an additional argument
11603 DISP_PROP_P, and pass it to compute_display_string_pos.
11604 Only handle text covered by a display string if DISP_PROP_P is returned
11605 non-zero. All callers of bidi_fetch_char changed.
11606
11607 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11608
11609 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11610
11611 2010-12-03 Don March <don@ohspite.net>
11612
11613 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11614 last character M-[char] is translated to ESC [char] (bug#7541).
11615
11616 2011-08-02 Kenichi Handa <handa@m17n.org>
11617
11618 * lisp.h (uniprop_table): Extern it.
11619
11620 * chartab.c (uniprop_table): Make it non-static.
11621
11622 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11623
11624 * xdisp.c (forward_to_next_line_start): Accept additional argument
11625 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11626 on the newline.
11627 (reseat_at_next_visible_line_start): Use the bidi iterator state
11628 returned by forward_to_next_line_start to restore the state of
11629 it->bidi_it after backing up to previous newline. (Bug#9212)
11630
11631 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11632
11633 * regex.c (re_comp): Protoize.
11634 (re_exec): Fix return type.
11635 (regexec): Fix type of `ret'. (Bug#9203)
11636
11637 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11638
11639 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11640 This is needed if max-image-size is a floating-point number.
11641
11642 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11643
11644 * print.c (print_object): Print empty symbol as ##.
11645
11646 * lread.c (read1): Read ## as empty symbol.
11647
11648 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11649
11650 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11651 setting frame foreground color (Bug#9175).
11652 (x_set_background_color): Likewise.
11653
11654 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11655 contents (Bug#9176).
11656 (EmacsTooltip -init): Remove bezels and add shadows to
11657 tooltip windows.
11658
11659 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11660 or scroll bar (Bug#8470).
11661
11662 * nsfont.m (nsfont_open): Remove assignment to voffset and
11663 unnecessary vars hshink, expand, hd, full_height, min_height.
11664 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11665
11666 * nsterm.h (nsfont_info): Remove voffset field.
11667
11668 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11669
11670 Implement strike-through and overline on NextStep (Bug#8863).
11671
11672 * nsfont.m (nsfont_open): Use underline position provided by font,
11673 instead of hard-coded value of 2.
11674 (nsfont_draw): Call ns_draw_text_decoration instead.
11675
11676 * nsterm.h: Add declaration for ns_draw_text_decoration.
11677
11678 * nsterm.m (ns_draw_text_decoration): New function for drawing
11679 underline, overline, and strike-through.
11680 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11681 ns_draw_text_decoration. Change treatment of cursor drawing to
11682 accommodate underlining, etc.
11683
11684 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11685
11686 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11687 default.
11688
11689 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11690
11691 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11692 Without this fix, if a signal arrives just after memory fills up,
11693 'malloc' might be invoked reentrantly.
11694
11695 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11696 In other words, assume that every image size is allowed, on non-X
11697 hosts. This assumption is probably wrong, but it lets Emacs compile.
11698
11699 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11700
11701 * regex.c (re_iswctype): Convert return values to boolean.
11702
11703 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11704
11705 * xdisp.c (compute_display_string_pos): Don't use cached display
11706 string position if the buffer had its restriction changed.
11707 (Bug#9184)
11708
11709 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11710
11711 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11712
11713 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 Integer signedness and overflow and related fixes. (Bug#9079)
11716
11717 * bidi.c: Integer size and overflow fixes.
11718 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11719 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11720 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11721 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11722 (bidi_find_other_level_edge):
11723 Use ptrdiff_t instead of EMACS_INT where either will do.
11724 This works better on 32-bit hosts configured --with-wide-int.
11725 (bidi_cache_ensure_space): Check for size-calculation overflow.
11726 Use % rather than repeated addition, for better worst-case speed.
11727 Don't set bidi_cache_size until after xrealloc returns, because it
11728 might not return.
11729 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11730 (bidi_cache_ensure_space): Also check that the bidi cache size
11731 does not exceed that of the largest Lisp string or buffer. See Eli
11732 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11733
11734 * alloc.c (__malloc_size_t): Remove.
11735 All uses replaced by size_t. See Andreas Schwab's note
11736 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11737
11738 * image.c: Improve checking for integer overflow.
11739 (check_image_size): Assume that f is nonnull, since
11740 it is always nonnull in practice. This is one less thing to
11741 worry about when checking for integer overflow later.
11742 (x_check_image_size): New function, which checks for integer
11743 overflow issues inside X.
11744 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11745 This removes the need for a memory_full check.
11746 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11747 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11748 (xbm_read_bitmap_data): Change locals back to 'int', since
11749 their values must fit in 'int'.
11750 (xpm_load_image, png_load, tiff_load):
11751 Invoke x_create_x_image_and_pixmap earlier,
11752 to avoid much needless work if the image is too large.
11753 (tiff_load): Treat overly large images as if
11754 x_create_x_image_and_pixmap failed, not as malloc failures.
11755 (gs_load): Use x_check_image_size.
11756
11757 * gtkutil.c: Omit integer casts.
11758 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11759 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11760
11761 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11762
11763 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11764 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11765 would wrongly return t on a 64-bit host.
11766
11767 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11768 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11769 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11770 and therefore cause GCC to emit a bogus diagnostic in some cases.
11771
11772 * image.c: Integer signedness and overflow and related fixes.
11773 This is not an exhaustive set of fixes, but it's time to
11774 record what I've got.
11775 (lookup_pixel_color, check_image_size): Remove redundant decls.
11776 (check_image_size): Don't assume that arbitrary EMACS_INT values
11777 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11778 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11779 (tiff_load, imagemagick_load_image):
11780 Check for overflow in size calculations.
11781 (x_create_x_image_and_pixmap): Remove unnecessary test for
11782 xmalloc returning NULL; that can't happen.
11783 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11784 (xpm_color_bucket): Use better integer hashing function.
11785 (xpm_cache_color): Don't possibly over-allocate memory.
11786 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11787 (gif_memory_source):
11788 Use ptrdiff_t, not int or size_t, to record sizes.
11789 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11790 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11791 either works, as we prefer signed integers.
11792 (tiff_read_from_memory, tiff_write_from_memory):
11793 Return tsize_t, not size_t, since that's what the TIFF API wants.
11794 (tiff_read_from_memory): Don't fail simply because the read would
11795 go past EOF; instead, return a short read.
11796 (tiff_load): Omit no-longer-needed casts.
11797 (Fimagemagick_types): Don't assume size fits into 'int'.
11798
11799 Improve hashing quality when configured --with-wide-int.
11800 * fns.c (hash_string): New function, taken from sxhash_string.
11801 Do not discard information about ASCII character case; this
11802 discarding is no longer needed.
11803 (sxhash-string): Use it. Change sig to match it. Caller changed.
11804 * lisp.h: Declare it.
11805 * lread.c (hash_string): Remove, since we now use fns.c's version.
11806 The fns.c version returns a wider integer if --with-wide-int is
11807 specified, so this should help the quality of the hashing a bit.
11808
11809 * emacs.c: Integer overflow minor fix.
11810 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11811 Define only if GNU_LINUX.
11812 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11813
11814 * dispnew.c: Integer signedness and overflow fixes.
11815 Remove unnecessary forward decls, that were a maintenance hassle.
11816 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11817 All uses changed.
11818 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11819 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11820 (prepare_desired_row, line_draw_cost):
11821 Use int, not unsigned, where either works.
11822 (save_current_matrix, restore_current_matrix):
11823 Use ptrdiff_t, not size_t, where either works.
11824 (init_display): Check for overflow more accurately, and without
11825 relying on undefined behavior.
11826
11827 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11828 Remove, replacing with the new symbols in lisp.h. All uses changed.
11829 * fileio.c (make_temp_name):
11830 * filelock.c (lock_file_1, lock_file):
11831 * xdisp.c (message_dolog):
11832 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11833 Use pMd etc. instead.
11834 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11835 replacing the pWIDE etc. symbols removed from editfns.c.
11836
11837 * keyboard.h (num_input_events): Now uintmax_t.
11838 This is (very slightly) less likely to mess up due to wraparound.
11839 All uses changed.
11840
11841 * buffer.c: Integer signedness fixes.
11842 (alloc_buffer_text, enlarge_buffer_text):
11843 Use ptrdiff_t rather than size_t when either will do, as we prefer
11844 signed integers.
11845
11846 * alloc.c: Integer signedness and overflow fixes.
11847 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11848 (__malloc_size_t): Default to size_t, not to int.
11849 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11850 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11851 Prefer ptrdiff_t to size_t when either would do, as we prefer
11852 signed integers.
11853 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11854 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11855 Now const. Initialize with values that are in range even if char
11856 is signed.
11857 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11858 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11859 These functions do the right thing with sizes > 2**32.
11860 (check_depth): Now ptrdiff_t, not int.
11861 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11862 Adjust to new way of storing sizes. Check for size overflow bugs
11863 in rest of code.
11864 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11865 slightly wrong anyway, as it missed one instance of
11866 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11867 (refill_memory_reserve): Omit needless cast to size_t.
11868 (mark_object_loop_halt): Mark as externally visible.
11869
11870 * xselect.c: Integer signedness and overflow fixes.
11871 (Fx_register_dnd_atom, x_handle_dnd_message):
11872 Use ptrdiff_t, not size_t, since we prefer signed.
11873 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11874 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11875 x_dnd_atoms_size and x_dnd_atoms_length.
11876
11877 * doprnt.c: Prefer signed to unsigned when either works.
11878 * eval.c (verror):
11879 * doprnt.c (doprnt):
11880 * lisp.h (doprnt):
11881 * xdisp.c (vmessage):
11882 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11883 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11884 prefer signed arithmetic to avoid comparison confusion.
11885 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11886 but is a bit tricky.
11887
11888 Assume freestanding C89 headers, string.h, stdlib.h.
11889 * data.c, doprnt.c, floatfns.c, print.c:
11890 Include float.h unconditionally.
11891 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11892 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11893 * regex.c: Likewise for stddef.h, string.h.
11894 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11895 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11896 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11897 (STDC_HEADERS): Remove obsolete defines.
11898 * sysdep.c: Include limits.h unconditionally.
11899
11900 Assume support for memcmp, memcpy, memmove, memset.
11901 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11902 * regex.c (memcmp, memcpy):
11903 Remove; we assume C89 now.
11904
11905 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11906 (__malloc_safe_bcopy): Remove; no longer needed.
11907
11908 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11909 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11910 well either way, and we prefer signed to unsigned.
11911
11912 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11913
11914 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11915 closes the connection while we're reading (bug#9182).
11916
11917 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11918
11919 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11920 are specified (Bug#9168).
11921
11922 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11923
11924 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11925 Found by GCC static checking and --with-wide-int on a 32-bit host.
11926
11927 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11928
11929 * xdisp.c (compute_display_string_pos): Fix logic of caching
11930 previous display string position. Initialize cached_prev_pos to
11931 -1. Fixes slow-down at the beginning of a buffer.
11932
11933 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11934
11935 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11936 for attrs[LFACE_FONTSET_INDEX].
11937
11938 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11939
11940 * xml.c (parse_region): Remove unused local
11941 that was recently introduced.
11942
11943 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11944
11945 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11946 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11947
11948 * xdisp.c (move_it_in_display_line_to): Record the best matching
11949 position for TO_CHARPOS while scanning the line, and restore it on
11950 exit if none of the characters scanned was an exact match.
11951 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11952 when exact match is impossible due to invisible text, and the
11953 lines are truncated.
11954
11955 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11956
11957 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11958 for OSX >= 10.7.
11959
11960 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11961
11962 Fix a significant slow-down of cursor motion with C-n, C-p,
11963 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11964 auto-repeat under bidi redisplay in fontified buffers.
11965 * xdisp.c (compute_stop_pos_backwards): New function.
11966 (next_element_from_buffer): Call compute_stop_pos_backwards to
11967 find a suitable prev_stop when we find ourselves before
11968 base_level_stop.
11969 (reseat): Don't look for prev_stop, as that could mean a very long
11970 run.
11971 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11972 <cached_disp_overlay_modiff>: Cache for last found display string
11973 position.
11974 (compute_display_string_pos): Return the cached position if asked
11975 about the same buffer in the same area of character positions, and
11976 the buffer wasn't changed since the time the display string
11977 position was cached.
11978
11979 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11980
11981 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11982 is an integer, which is important for empty lines. (Bug#9149)
11983
11984 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11985
11986 * frame.c (Fmodify_frame_parameters): In tty case, update the
11987 default face if necessary (Bug#4238).
11988
11989 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11990
11991 * editfns.c (Fstring_to_char): No need to explain what a character
11992 is in the docstring (Bug#6576).
11993
11994 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11995
11996 * xml.c (parse_region): Make sure we always return a tree.
11997
11998 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11999
12000 * xml.c (parse_region): If a document contains only comments,
12001 return that, too.
12002
12003 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12004
12005 * xml.c (make_dom): Return comments, too.
12006
12007 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12008
12009 Port to OpenBSD.
12010 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12011 and the surrounding thread.
12012 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12013 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12014 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12015 timer goes off.
12016 * s/openbsd.h (BROKEN_SIGIO): Define.
12017 * unexelf.c (unexec) [__OpenBSD__]:
12018 Don't update the .mdebug section of the Alpha COFF symbol table.
12019
12020 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12021
12022 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12023 (bug#8460).
12024
12025 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12026
12027 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12028 This fixes some race conditions on the permissions of any newly
12029 created file.
12030
12031 * alloc.c (valid_pointer_p): Use pipe, not open.
12032 This fixes some permissions issues when debugging.
12033
12034 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12035 If fchown fails to set both uid and gid, try to set just gid,
12036 as that is sometimes allowed. Adjust the file's mode to eliminate
12037 setuid or setgid bits that are inappropriate if fchown fails.
12038
12039 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12040
12041 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12042 to compare Lisp_Objects.
12043 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12044 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12045 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12046
12047 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12048
12049 * lread.c (read_integer): Unread even EOF character.
12050 (read1): Likewise. Properly record start position of symbol.
12051
12052 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12053 symbol character follows.
12054
12055 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12056
12057 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12058 This works around a problem with the previous change to Fcopy_file.
12059 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12060 and without this change, GCC might complain about discarding
12061 fchown's return value.
12062
12063 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12064
12065 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12066
12067 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12068
12069 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12070
12071 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12072
12073 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12074 it's used from the C level.
12075
12076 * process.c: Use the same condition for POLL_FOR_INPUT in both
12077 keyboard.c and process.c (bug#1858).
12078
12079 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12080
12081 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12082 (Fgnutls_boot): Use it.
12083
12084 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12085
12086 * doc.c (Fsubstitute_command_keys): Revert last change.
12087
12088 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12089
12090 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12091 quotes the next character, and doesn't affect other longer
12092 sequences (bug#8935).
12093
12094 * lread.c (syms_of_lread): Clarify that is isn't only
12095 `eval-buffer' and `eval-defun' that's affected by
12096 `lexical-binding' (bug#8460).
12097
12098 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12099
12100 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12101 bidi redisplay when a line includes both an image and is truncated.
12102
12103 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12104
12105 Fix minor problems found by static checking.
12106 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12107 (elsz): Now a signed constant, not a size_t var. We prefer signed
12108 types to unsigned, to avoid integer comparison confusion. Without
12109 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12110 "cannot optimize loop, the loop counter may overflow", a symptom
12111 of the confusion.
12112 * indent.c (Fvertical_motion): Mark locals as initialized.
12113 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12114
12115 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12116
12117 * search.c (Fre_search_backward): Mention `case-fold-search' in
12118 all the re_search_* functions (bug#8138).
12119
12120 * keyboard.c (Fopen_dribble_file): Document when the file is
12121 closed (bug#8056).
12122
12123 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12124
12125 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12126 bidi_cache_idx.
12127
12128 Support bidi reordering of display and overlay strings.
12129 * xdisp.c (compute_display_string_pos)
12130 (compute_display_string_end): Accept additional argument STRING.
12131 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12132 (reseat_to_string): Initialize bidi_it->string.s and
12133 bidi_it->string.schars.
12134 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12135 NULL (avoids a crash in bidi_paragraph_init).
12136 Initialize itb.string.lstring.
12137 (init_iterator): Call bidi_init_it only of a valid
12138 buffer position was specified. Initialize paragraph_embedding to
12139 L2R.
12140 (reseat_to_string): Initialize the bidi iterator.
12141 (display_string): If we need to ignore text properties of
12142 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12143 original value of -1 will not work with bidi.)
12144 (compute_display_string_pos): First arg is now struct
12145 `text_pos *'; all callers changed. Support display properties on
12146 Lisp strings.
12147 (compute_display_string_end): Support display properties on Lisp
12148 strings.
12149 (init_iterator, reseat_1, reseat_to_string): Initialize the
12150 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12151 when iterating on a string not from display properties).
12152 (compute_display_string_pos, compute_display_string_end):
12153 Fix calculation of the object to scan. Fixes an error when using
12154 arrow keys.
12155 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12156 base_level_stop; instead, set base_level_stop to BEGV.
12157 Fixes crashes in vertical-motion.
12158 (next_element_from_buffer): Improve commentary for when
12159 the iterator is before prev_stop.
12160 (init_iterator): Initialize bidi_p from the default value of
12161 bidi-display-reordering, not from buffer-local value. Use the
12162 buffer-local value only if initializing for buffer iteration.
12163 (handle_invisible_prop): Support invisible properties on strings
12164 that are being bidi-reordered.
12165 (set_iterator_to_next): Support bidi reordering of C strings and
12166 Lisp strings.
12167 (next_element_from_string): Support bidi reordering of Lisp
12168 strings.
12169 (handle_stop_backwards): Support Lisp strings as well.
12170 (display_string): Support display of R2L glyph rows.
12171 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12172 (init_iterator): Don't initialize it->bidi_p for strings
12173 here.
12174 (reseat_to_string): Initialize it->bidi_p for strings here.
12175 (next_element_from_string, next_element_from_c_string)
12176 (next_element_from_buffer): Add xassert's for correspondence
12177 between IT's object being iterated and it->bidi_it.string
12178 structure.
12179 (face_before_or_after_it_pos): Support bidi iteration.
12180 (next_element_from_c_string): Handle the case of the first string
12181 character that is not the first one in the visual order.
12182 (get_visually_first_element): New function, refactored from common
12183 parts of next_element_from_buffer, next_element_from_string, and
12184 next_element_from_c_string.
12185 (tool_bar_lines_needed, redisplay_tool_bar)
12186 (display_menu_bar): Force left-to-right direction. Add a FIXME
12187 comment for making that be controlled by a user option.
12188 (push_it, pop_it): Save and restore the state of the
12189 bidi iterator. Save and restore the bidi_p flag.
12190 (pop_it): Iterate out of display property for string iteration as
12191 well.
12192 (iterate_out_of_display_property): Support iteration over strings.
12193 (handle_single_display_spec): Set up it->bidi_it for iteration
12194 over a display string, and call bidi_init_it.
12195 (handle_single_display_spec, next_overlay_string)
12196 (get_overlay_strings_1, push_display_prop): Set up the bidi
12197 iterator for displaying display or overlay strings.
12198 (forward_to_next_line_start): Don't use the shortcut if
12199 bidi-iterating.
12200 (back_to_previous_visible_line_start): If handle_display_prop
12201 pushed the iterator stack, restore the internal state of the bidi
12202 iterator by calling bidi_pop_it same number of times.
12203 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12204 and we are bidi-iterating, don't decrement the iterator position;
12205 instead, set the first_elt flag in the bidi iterator, to produce
12206 the same effect.
12207 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12208 (push_display_prop): xassert that we are iterating a buffer.
12209 (push_it, pop_it): Save and restore paragraph_embedding member.
12210 (handle_single_display_spec, next_overlay_string)
12211 (get_overlay_strings_1, reseat_1, reseat_to_string)
12212 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12213 correctly. Don't assume unibyte strings are not bidi-reordered.
12214 (compute_display_string_pos)
12215 (compute_display_string_end): Fix handling the case of C string.
12216 (push_it, pop_it): Save and restore from_disp_prop_p.
12217 (handle_single_display_spec, push_display_prop): Set the
12218 from_disp_prop_p flag.
12219 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12220 (pop_it): Call iterate_out_of_display_property only if we are
12221 popping after iteration over a string that came from a display
12222 property. Fix a typo in popping stretch info. Add an assertion
12223 for verifying that the iterator position is in sync with the bidi
12224 iterator.
12225 (handle_single_display_spec, get_overlay_strings_1)
12226 (push_display_prop): Fix initialization of paragraph direction for
12227 string when that of the parent object is not yet determined.
12228 (reseat_1): Call bidi_init_it to resync the bidi
12229 iterator with IT's position. (Bug#7616)
12230 (find_row_edges): If ROW->start.pos gives position
12231 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12232 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12233 Reset the from_disp_prop_p flag.
12234 (SAVE_IT, RESTORE_IT): New macros.
12235 (pos_visible_p, face_before_or_after_it_pos)
12236 (back_to_previous_visible_line_start)
12237 (move_it_in_display_line_to, move_it_in_display_line)
12238 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12239 (try_scrolling, redisplay_window, display_line): Use them when
12240 saving a temporary copy of the iterator and restoring it back.
12241 (back_to_previous_visible_line_start, reseat_1)
12242 (init_iterator): Empty the bidi cache "stack".
12243 (move_it_in_display_line_to): If iterator ended up at
12244 EOL, but we never saw any buffer positions smaller than
12245 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12246 motion in bidi-reordered lines.
12247 (move_it_in_display_line_to): Record prev_method and prev_pos
12248 immediately before the call to set_iterator_to_next. Fixes cursor
12249 motion in bidi-reordered lines with stretch glyphs and strings
12250 displayed in margins. (Bug#8133) (Bug#8867)
12251 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12252 TO_CHARPOS.
12253 (pos_visible_p): Support positions in bidi-reordered lines.
12254 Save and restore bidi cache.
12255
12256 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12257 (bidi_paragraph_info): Delete unused struct.
12258 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12259 (bidi_cache_start): New variable.
12260 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12261 to zero.
12262 (bidi_cache_fetch_state, bidi_cache_search)
12263 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12264 (bidi_cache_find, bidi_peek_at_next_level)
12265 (bidi_level_of_next_char, bidi_find_other_level_edge)
12266 (bidi_move_to_visually_next): Compare cache index with
12267 bidi_cache_start rather than with zero.
12268 (bidi_fetch_char): Accept new argument STRING; all callers
12269 changed. Support iteration over a string. Support strings with
12270 display properties. Support unibyte strings. Fix the type of
12271 `len' according to what STRING_CHAR_AND_LENGTH expects.
12272 (bidi_paragraph_init, bidi_resolve_explicit_1)
12273 (bidi_resolve_explicit, bidi_resolve_weak)
12274 (bidi_level_of_next_char, bidi_move_to_visually_next):
12275 Support iteration over a string.
12276 (bidi_set_sor_type, bidi_resolve_explicit_1)
12277 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12278 can now be zero (for strings); special values 0 and -1 were
12279 changed to -1 and -2, respectively.
12280 (bidi_char_at_pos): New function.
12281 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12282 Call it instead of FETCH_MULTIBYTE_CHAR.
12283 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12284 initialized to valid values.
12285 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12286 values.
12287 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12288 the test for valid cached positions. Fix the logic for looking up
12289 the sentinel state in the cache. GCPRO the Lisp string we are
12290 iterating.
12291 (bidi_push_it, bidi_pop_it): New functions.
12292 (bidi_initialize): Initialize the bidi cache start stack pointer.
12293 (bidi_cache_ensure_space): New function, refactored from part of
12294 bidi_cache_iterator_state. Don't assume the required size is just
12295 one BIDI_CACHE_CHUNK away.
12296 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12297 (bidi_count_bytes, bidi_char_at_pos): New functions.
12298 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12299 always valid if bidi_cache_idx is valid.
12300 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12301 is valid if it's going to be used.
12302 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12303 (bidi_cache_fetch_state, bidi_cache_search)
12304 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12305 (bidi_cache_iterator_state, bidi_cache_find)
12306 (bidi_find_other_level_edge, bidi_cache_start_stack):
12307 All variables related to cache indices are now EMACS_INT.
12308
12309 * dispextern.h (struct bidi_string_data): New structure.
12310 (struct bidi_it): New member `string'. Make flag members be 1-bit
12311 fields, and put them last in the struct.
12312 (compute_display_string_pos, compute_display_string_end):
12313 Update prototypes.
12314 (bidi_push_it, bidi_pop_it): Add prototypes.
12315 (struct iterator_stack_entry): New members bidi_p,
12316 paragraph_embedding, and from_disp_prop_p.
12317 (struct it): Member bidi_p is now a bit field 1 bit wide.
12318 (bidi_shelve_cache, bidi_unshelve_cache):
12319 Declare prototypes.
12320
12321 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12322 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12323 and vector-like objects.
12324
12325 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12326 cache around display iteration.
12327
12328 * window.c (Fwindow_end, window_scroll_pixel_based)
12329 (displayed_window_lines, Frecenter): Save and restore the bidi
12330 cache around display iteration.
12331
12332 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12333
12334 * editfns.c (Fdelete_region): Clarify the use of the named
12335 parameters (bug#6788).
12336
12337 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12338
12339 * indent.c (Fvertical_motion): Set and restore w->pointm when
12340 saving and restoring the window's buffer (Bug#9006).
12341
12342 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12343
12344 * editfns.c (Fstring_to_char): Clarify just what is returned
12345 (bug#6576). Text by Eli Zaretskii.
12346
12347 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12348
12349 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12350
12351 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12352
12353 * buffer.c (mmap_find): Fix a typo.
12354
12355 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12356
12357 Fix execution of x selection hooks.
12358 * xselect.c (Qx_lost_selection_functions)
12359 (Qx_sent_selection_functions): New vars.
12360 (syms_of_xselect): DEFSYM them.
12361 (x_handle_selection_request): Pass Qx_sent_selection_functions
12362 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12363 (x_handle_selection_clear,x_clear_frame_selections):
12364 Pass Qx_lost_selection_functions rather than
12365 Vx_lost_selection_functions to Frun_hook_with_args.
12366
12367 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12368
12369 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12370 The old code sometimes used this field without initializing it.
12371
12372 * alloc.c (gc_sweep): Don't read past end of array.
12373 In theory, the old code could also have corrupted Emacs internals,
12374 though it'd be very unlikely.
12375
12376 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12377
12378 * character.c (Fcharacterp): Don't advertise optional ignored
12379 argument. (Bug#4026)
12380
12381 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12382
12383 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12384 key" (bug#4257).
12385
12386 * window.c (Fset_window_start): Doc fix (bug#4199).
12387 (Fset_window_hscroll): Ditto.
12388
12389 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12390
12391 Fix minor new problems caught by GCC 4.6.1.
12392 * term.c (init_tty): Remove unused local.
12393 * xsettings.c (store_monospaced_changed): Define this function only
12394 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12395 not used otherwise.
12396
12397 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12398
12399 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12400
12401 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12402
12403 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12404 are the mini-buffer and the echo area (bug#3320).
12405
12406 * term.c (init_tty): Remove support for supdup, c10 and perq
12407 terminals, which are no longer supported (bug#1482).
12408
12409 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12410
12411 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12412
12413 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12414
12415 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12416 for non-popups (Bug#3642).
12417
12418 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12419
12420 * alloc.c (reset_malloc_hooks): Protoize.
12421 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12422 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12423 * cm.c (losecursor): Likewise.
12424 * data.c (fmod): Likewise.
12425 * dispnew.c (swap_glyphs_in_rows): Likewise.
12426 * emacs.c (memory_warning_signal): Likewise.
12427 * floatfns.c (float_error): Likewise.
12428 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12429 (otf_open, font_otf_capability, generate_otf_features)
12430 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12431 Likewise.
12432 * image.c (pbm_read_file): Likewise.
12433 * indent.c (string_display_width): Likewise.
12434 * intervals.c (check_for_interval, search_for_interval)
12435 (inc_interval_count, count_intervals, root_interval)
12436 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12437 * lread.c (defalias): Likewise.
12438 * ralloc.c (r_alloc_check): Likewise.
12439 * regex.c (set_image_of_range_1, set_image_of_range)
12440 (regex_grow_registers): Likewise.
12441 * sysdep.c (strerror): Likewise.
12442 * termcap.c (valid_filename_p, tprint, main): Likewise.
12443 * tparam.c (main): Likewise.
12444 * unexhp9k800.c (run_time_remap, save_data_space)
12445 (update_file_ptrs, read_header, write_header, calculate_checksum)
12446 (copy_file, copy_rest, display_header): Likewise.
12447 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12448 Likewise.
12449 * xdisp.c (check_it): Likewise.
12450 * xfaces.c (register_color, unregister_color, unregister_colors):
12451 Likewise.
12452 * xfns.c (print_fontset_result): Likewise.
12453 * xrdb.c (member, fatal, main): Likewise.
12454
12455 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12456
12457 Fix minor problems found by static checking (Bug#9031).
12458 * chartab.c (char_table_set_range, map_sub_char_table):
12459 Remove unused locals.
12460 (uniprop_table): Now static.
12461 * composite.c (_work_char): Remove unused static var.
12462
12463 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12464
12465 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12466
12467 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12468
12469 * gtkutil.c (qttip_cb): Remove code without function.
12470
12471 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12472
12473 * w32.c (pthread_sigmask): New stub.
12474
12475 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12476
12477 Use pthread_sigmask, not sigprocmask (Bug#9010).
12478 sigprocmask is portable only for single-threaded applications, and
12479 Emacs can be multi-threaded when it uses GTK.
12480 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12481 (LIBES): Use it.
12482 * callproc.c (Fcall_process):
12483 * process.c (create_process):
12484 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12485 Use pthread_sigmask, not sigprocmask.
12486
12487 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12488
12489 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12490 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12491 wrong (Bug#8591).
12492
12493 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12494
12495 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12496 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12497 (xg_hide_tooltip): Fix comment.
12498
12499 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12500 in registerServicesMenuSendTypes.
12501 (validRequestorForSendType): Don't check ns_return_types.
12502
12503 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12504 ns_return_type.
12505
12506 2011-07-08 Jason Rumney <jasonr@gnu.org>
12507
12508 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12509 SH_SHOW for hidden windows (Bug#5482).
12510
12511 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12512 frame struct members of non-existent frames (Bug#6284).
12513
12514 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12515
12516 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12517 variable firstTime not needed on OSX >= 10.6.
12518 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12519 >= 10.5. Use setKnobProportion, setDoubleValue.
12520
12521 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12522 (MAC_OS_X_VERSION_10_5): Define if not defined.
12523 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12524 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12525 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12526
12527 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12528 cString and lossyCString on OSX >= 10.4.
12529
12530 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12531 sizeToFit on OSX >= 10.2.
12532
12533 * nsimage.m (allocInitFromFile): Don't use deprecated method
12534 bestRepresentationForDevice on OSX >= 10.6.
12535
12536 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12537 to avoid warning.
12538
12539 * emacs.c: Declare unexec_init_emacs_zone.
12540
12541 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12542
12543 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12544
12545 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12546 on svcsMenu (Bug#8842).
12547
12548 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12549 ns_return_types.
12550 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12551
12552 * nsterm.m (QUTF8_STRING): Declare.
12553 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12554 (validRequestorForSendType): Return type is (id).
12555 Change indexOfObjectIdenticalTo to indexOfObject.
12556 Check if we have local selection before returning self (Bug#8842).
12557 (writeSelectionToPasteboard): Put local selection into paste board
12558 if we have a local selection (Bug#8842).
12559 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12560
12561 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12562 (ns_get_local_selection): Declare.
12563
12564 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12565
12566 * keymap.c (describe_map_tree): Don't insert a double newline at
12567 the end of the buffer (bug#1169) and return whether we inserted
12568 something.
12569
12570 * callint.c (Fcall_interactively): Change "reading args" to
12571 "providing args" to try to clarify what it does (bug#1010).
12572
12573 2011-07-07 Kenichi Handa <handa@m17n.org>
12574
12575 * composite.c (composition_compute_stop_pos): Ignore a static
12576 composition starting before CHARPOS (Bug#8915).
12577
12578 * xdisp.c (handle_composition_prop): Likewise.
12579
12580 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12581
12582 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12583 (Bug#9015)
12584
12585 2011-07-07 Kenichi Handa <handa@m17n.org>
12586
12587 * character.h (unicode_category_t): New enum type.
12588
12589 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12590 (Qchar_code_property_table): New variable.
12591 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12592 (UNIPROP_COMPRESSED_FORM_P): New macros.
12593 (char_table_ascii): Uncompress the compressed values.
12594 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12595 Uncompress the compressed values.
12596 (sub_char_table_ref_and_range): Likewise.
12597 (char_table_ref_and_range): Uncompress the compressed values.
12598 (sub_char_table_set): New arg is_uniprop. Callers changed.
12599 Uncompress the compressed values.
12600 (sub_char_table_set_range): Args changed. Callers changed.
12601 (char_table_set_range): Adjuted for the above change.
12602 (map_sub_char_table): Delete args default_val and parent. Add arg
12603 top. Give decoded values to a Lisp function.
12604 (map_char_table): Adjust for the above change. Give decoded
12605 values to a Lisp function. Gcpro more variables.
12606 (uniprop_table_uncompress)
12607 (uniprop_decode_value_run_length): New functions.
12608 (uniprop_decoder, uniprop_decoder_count): New variables.
12609 (uniprop_get_decoder, uniprop_encode_value_character)
12610 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12611 New functions.
12612 (uniprop_encoder, uniprop_encoder_count): New variables.
12613 (uniprop_get_encoder, uniprop_table)
12614 (Funicode_property_table_internal, Fget_unicode_property_internal)
12615 (Fput_unicode_property_internal): New functions.
12616 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12617 Sunicode_property_table_internal, Sget_unicode_property_internal,
12618 and Sput_unicode_property_internal. Defvar_lisp
12619 char-code-property-alist.
12620
12621 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12622 Vunicode_category_table.
12623
12624 * font.c (font_range): Adjust for the change of
12625 Vunicode_category_table.
12626
12627 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12628
12629 * m/iris4d.h: Remove file, move contents ...
12630 * s/irix6-5.h: ... here.
12631
12632 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12633
12634 Remove unportable assumption about struct layout (Bug#8884).
12635 * alloc.c (mark_buffer):
12636 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12637 (clone_per_buffer_values): Don't assume that
12638 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12639 This isn't true in general, and it's particularly not true
12640 if Emacs is configured with --with-wide-int.
12641 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12642 New macros, used in the buffer.c change.
12643
12644 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12645
12646 * xsettings.c: Use both GConf and GSettings if both are available.
12647 (store_config_changed_event): Add comment.
12648 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12649 (store_tool_bar_style_changed): New functions.
12650 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12651 (struct xsettings): Move font inside HAVE_XFT.
12652 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12653 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12654 Move inside HAVE_XFT.
12655 (something_changed_gsettingsCB): Rename from something_changedCB.
12656 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12657 also.
12658 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12659 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12660 (something_changed_gconfCB): Rename from something_changedCB.
12661 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12662 (parse_settings): Move check for font inside HAVE_XFT.
12663 (read_settings, apply_xft_settings): Add comment.
12664 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12665 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12666 call store_font_name_changed.
12667 (xft_settings_event): Add comment.
12668 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12669 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12670 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12671 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12672 (xsettings_initialize): Call init_gsettings last.
12673 (xsettings_get_system_font, xsettings_get_system_normal_font):
12674 Add comment.
12675
12676 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12677
12678 Random fixes. E.g., (random) never returned negative values.
12679 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12680 subseconds part to the entropy, as that's a bit more random.
12681 Prefer signed to unsigned, since the signedness doesn't matter and
12682 in general we prefer signed. When given a limit, use a
12683 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12684 latter isn't right if USE_2_TAGS_FOR_INTS.
12685 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12686 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12687
12688 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12689
12690 * textprop.c (text_property_stickiness):
12691 Obey Vtext_property_default_nonsticky.
12692 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12693 * w32fns.c (syms_of_w32fns):
12694 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12695
12696 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12697
12698 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12699 This is more efficient than Ffile_directory_p and avoids a minor race.
12700
12701 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12702
12703 * buffer.c (Foverlay_put): Say what the return value is
12704 (bug#7835).
12705
12706 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12707 is a directory before asking whether to use the file name
12708 (bug#7564).
12709 (barf_or_query_if_file_exists): Make the "File is a directory"
12710 error be more correct.
12711
12712 * fns.c (Frequire): Remove the mention of the .gz files, since
12713 that's installation-specific, but keep the mention of
12714 `get-load-suffixes'.
12715
12716 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12717
12718 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12719 Report string overflow if the output is too long.
12720
12721 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12722
12723 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12724 (syms_of_gnutls): Remove duplicate DEFSYM for
12725 Qgnutls_bootprop_verify_hostname_error, an error for
12726 Qgnutls_bootprop_verify_error (which is no longer used).
12727
12728 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12729 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12730 Also (re)move comments that are misplaced or no longer relevant.
12731
12732 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12733
12734 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12735
12736 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12737
12738 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12739 and background color parameters if they have been changed.
12740
12741 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12742
12743 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12744
12745 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12746
12747 * xsettings.c (SYSTEM_FONT): Define only when used.
12748 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12749
12750 * keymap.c (access_keymap_1): Now static.
12751
12752 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12753
12754 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12755 leave any prefix arg for the up event (Bug#1586).
12756
12757 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12758
12759 * lread.c (syms_of_lread): Mention single symbols defined by
12760 `defvar' or `defconst' (bug#7154).
12761
12762 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12763 (Frequire): Mention get-load-suffixes.
12764
12765 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12766
12767 * window.h (window): Remove clone_number slot.
12768 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12769 Remove.
12770 (make_parent_window, make_window, saved_window)
12771 (Fset_window_configuration, save_window_save): Don't deal with
12772 clone numbers.
12773 * buffer.c (Qclone_number): Remove declaration.
12774 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12775
12776 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12777
12778 Add multiple inheritance to keymaps.
12779 * keymap.c (Fmake_composed_keymap): New function.
12780 (Fset_keymap_parent): Simplify.
12781 (fix_submap_inheritance): Remove.
12782 (access_keymap_1): New function extracted from access_keymap to handle
12783 embedded parents and handle lists of maps.
12784 (access_keymap): Use it.
12785 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12786 (Fcopy_keymap): Handle embedded parents.
12787 (Fcommand_remapping, define_as_prefix): Simplify.
12788 (Fkey_binding): Simplify.
12789 (syms_of_keymap): Move minibuffer-local-completion-map,
12790 minibuffer-local-filename-completion-map,
12791 minibuffer-local-must-match-map, and
12792 minibuffer-local-filename-must-match-map to Elisp.
12793 (syms_of_keymap): Defsubr make-composed-keymap.
12794 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12795 (parse_menu_item): Trivial simplification.
12796
12797 2011-07-01 Glenn Morris <rgm@gnu.org>
12798
12799 * Makefile.in (SETTINGS_LIBS): Fix typo.
12800
12801 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12802
12803 * coding.c (Fencode_coding_string): Record the last coding system
12804 used, as the function doc string says (bug#8738).
12805
12806 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12807
12808 * xsettings.c (store_monospaced_changed): Take new font as arg and
12809 check for change against current_mono_font.
12810 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12811 (emacs_settings_constructor, emacs_settings_get_property)
12812 (emacs_settings_set_property, emacs_settings_class_init)
12813 (emacs_settings_init, gsettings_obj): Remove.
12814 (something_changedCB): New function for HAVE_GSETTINGS.
12815 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12816 with value as argument.
12817 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12818 g_settings_new (Bug#8967). Do not create gsettings_obj.
12819 Remove calls to g_settings_bind. Connect something_changedCB to
12820 "changed".
12821
12822 * xgselect.c: Add defined (HAVE_GSETTINGS).
12823 (xgselect_initialize): Ditto.
12824
12825 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12826 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12827 xg_select.
12828
12829 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12830
12831 * eval.c (struct backtrace): Simplify and port the data structure.
12832 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12833 signed bit field, as this assumption is not portable and it makes
12834 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12835 "char debug_on_exit : 1" as this is not portable either; instead,
12836 use the portable "unsigned int debug_on_exit : 1". Remove unused
12837 member evalargs. Remove obsolete comments about cc bombing out.
12838
12839 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12840
12841 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12842 Let HAVE_GSETTINGS override HAVE_GCONF.
12843 (store_monospaced_changed): New function.
12844 (EMACS_SETTINGS): A new type derived from GObject to handle
12845 GSettings notifications.
12846 (emacs_settings_constructor, emacs_settings_get_property)
12847 (emacs_settings_set_property, emacs_settings_class_init):
12848 New functions.
12849 (gsettings_client, gsettings_obj): New variables.
12850 (GSETTINGS_SCHEMA): New define.
12851 (something_changedCB): Call store_monospaced_changed.
12852 (init_gsettings): New function.
12853 (xsettings_initialize): Call init_gsettings.
12854 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12855 to NULL.
12856
12857 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12858 GCONF_CFLAGS/LIBS.
12859
12860 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12861
12862 * window.c (resize_root_window, grow_mini_window)
12863 (shrink_mini_window): Rename Qresize_root_window to
12864 Qwindow_resize_root_window and Qresize_root_window_vertically to
12865 Qwindow_resize_root_window_vertically.
12866
12867 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12868
12869 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12870
12871 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12872
12873 * makefile.w32-in: Redesign dependencies so they reflect more
12874 clearly which files are directly included by each source file,
12875 and not through other includes.
12876
12877 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12878
12879 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12880 (sort_overlays, overlay_strings): When an overlay's clone number
12881 matches the window's clone number process the overlay even if
12882 the overlay's window property doesn't match the current window.
12883
12884 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12885 (Fwindow_hchild): Rename to Fwindow_left_child.
12886 (Fwindow_next): Rename to Fwindow_next_sibling.
12887 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12888 (resize_window_check): Rename to window_resize_check.
12889 (resize_window_apply): Rename to window_resize_apply.
12890 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12891 (Fdelete_other_windows_internal, resize_frame_windows)
12892 (Fsplit_window_internal, Fdelete_window_internal)
12893 (grow_mini_window, shrink_mini_window)
12894 (Fresize_mini_window_internal): Fix callers accordingly.
12895
12896 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12897
12898 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12899 (emacs_fixed_set_min_size): Remove.
12900 (emacs_fixed_new): Take frame as argument.
12901
12902 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12903 (_EmacsFixedPrivate): Remove minwidth/height.
12904 Add struct frame *f.
12905 (emacs_fixed_init): Initialize priv->f.
12906 (get_parent_class, emacs_fixed_set_min_size): Remove.
12907 (emacs_fixed_new): Set priv->f to argument.
12908 (emacs_fixed_get_preferred_width)
12909 (emacs_fixed_get_preferred_height): Use min_width/height from
12910 frames size_hint to set minimum and natural (Bug#8919).
12911 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12912 and use min_width/height from frames size_hint to set
12913 min_width/height (Bug#8919).
12914
12915 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12916 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12917 Fix indentation.
12918
12919 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12920
12921 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12922 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12923 called at ZV.
12924
12925 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12926
12927 * process.c (wait_reading_process_output): Bypass select if
12928 waiting for a cell while ignoring keyboard input, and input is
12929 pending. Suggested by Jan Djärv (Bug#8869).
12930
12931 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12932
12933 Use gnulib's dup2 module instead of rolling our own.
12934 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12935
12936 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12937
12938 * dispnew.c (scrolling_window): Before scrolling, turn off a
12939 mouse-highlight in the window being scrolled.
12940
12941 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12942
12943 Move DEFSYM to lisp.h and use everywhere.
12944
12945 * character.h (DEFSYM): Move declaration...
12946 * lisp.h (DEFSYM): ...here.
12947
12948 * gnutls.c:
12949 * minibuf.c:
12950 * w32menu.c:
12951 * w32proc.c:
12952 * w32select.c: Don't include character.h.
12953
12954 * alloc.c (syms_of_alloc):
12955 * buffer.c (syms_of_buffer):
12956 * bytecode.c (syms_of_bytecode):
12957 * callint.c (syms_of_callint):
12958 * casefiddle.c (syms_of_casefiddle):
12959 * casetab.c (init_casetab_once):
12960 * category.c (init_category_once, syms_of_category):
12961 * ccl.c (syms_of_ccl):
12962 * cmds.c (syms_of_cmds):
12963 * composite.c (syms_of_composite):
12964 * dbusbind.c (syms_of_dbusbind):
12965 * dired.c (syms_of_dired):
12966 * dispnew.c (syms_of_display):
12967 * doc.c (syms_of_doc):
12968 * editfns.c (syms_of_editfns):
12969 * emacs.c (syms_of_emacs):
12970 * eval.c (syms_of_eval):
12971 * fileio.c (syms_of_fileio):
12972 * fns.c (syms_of_fns):
12973 * frame.c (syms_of_frame):
12974 * fringe.c (syms_of_fringe):
12975 * insdel.c (syms_of_insdel):
12976 * keymap.c (syms_of_keymap):
12977 * lread.c (init_obarray, syms_of_lread):
12978 * macros.c (syms_of_macros):
12979 * msdos.c (syms_of_msdos):
12980 * print.c (syms_of_print):
12981 * process.c (syms_of_process):
12982 * search.c (syms_of_search):
12983 * sound.c (syms_of_sound):
12984 * syntax.c (init_syntax_once, syms_of_syntax):
12985 * terminal.c (syms_of_terminal):
12986 * textprop.c (syms_of_textprop):
12987 * undo.c (syms_of_undo):
12988 * w32.c (globals_of_w32):
12989 * window.c (syms_of_window):
12990 * xdisp.c (syms_of_xdisp):
12991 * xfaces.c (syms_of_xfaces):
12992 * xfns.c (syms_of_xfns):
12993 * xmenu.c (syms_of_xmenu):
12994 * xsettings.c (syms_of_xsettings):
12995 * xterm.c (syms_of_xterm): Use DEFSYM.
12996
12997 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12998
12999 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13000
13001 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13002
13003 Integer and buffer overflow fixes (Bug#8873).
13004
13005 * print.c (printchar, strout): Check for string overflow.
13006 (PRINTPREPARE, printchar, strout):
13007 Don't set size unless allocation succeeds.
13008
13009 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13010 for sizes. Check for string overflow more accurately.
13011 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13012
13013 * macros.c: Integer and buffer overflow fixes.
13014 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13015 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13016 Use ptrdiff_t, not int, for sizes.
13017 Don't increment bufsize until after realloc succeeds.
13018 Check for size-calculation overflow.
13019 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13020
13021 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13022
13023 * lread.c: Integer overflow fixes.
13024 (read_integer): Radix is now EMACS_INT, not int,
13025 to improve quality of diagnostics for out-of-range radices.
13026 Calculate buffer size correctly for out-of-range radices.
13027 (read1): Check for integer overflow in radices, and in
13028 read-circle numbers.
13029 (read_escape): Avoid int overflow.
13030 (Fload, openp, read_buffer_size, read1)
13031 (substitute_object_recurse, read_vector, read_list, map_obarray):
13032 Use ptrdiff_t, not int, for sizes.
13033 (read1): Use EMACS_INT, not int, for sizes.
13034 Check for size overflow.
13035
13036 * image.c (cache_image): Check for size arithmetic overflow.
13037
13038 * lread.c: Integer overflow issues.
13039 (saved_doc_string_size, saved_doc_string_length)
13040 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13041 Now ptrdiff_t, not int.
13042 (read1): Don't assume doc string length fits in int. Check for
13043 out-of-range doc string lengths.
13044 (read_list): Don't assume file position fits in int.
13045 (read_escape): Check for hex character overflow.
13046
13047 2011-06-22 Leo Liu <sdl.web@gmail.com>
13048
13049 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13050 Move to minibuffer.el.
13051
13052 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13053
13054 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13055 The following patches are for when GLYPH_DEBUG && !XASSERT.
13056 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13057 * dispnew.c (flush_stdout):
13058 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13059 Mark as externally visible.
13060 * dispnew.c (check_window_matrix_pointers): Now static.
13061 * dispnew.c (window_to_frame_vpos):
13062 * xfns.c (unwind_create_frame):
13063 * xterm.c (x_check_font): Remove unused local.
13064 * scroll.c (CHECK_BOUNDS):
13065 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13066 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13067 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13068 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13069 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13070 Now static.
13071 (debug_method_add): Use va_list and vsprintf rather than relying
13072 on undefined behavior with wrong number of arguments.
13073 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13074 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13075 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13076 since we're not interested in debugging glyphs with old libraries.
13077 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13078 GCC 4.6.0's static checking.
13079
13080 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13081
13082 Integer overflow and signedness fixes (Bug#8873).
13083 A few related buffer overrun fixes, too.
13084
13085 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13086
13087 * dispextern.h (struct face.stipple):
13088 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13089 (x_bitmap_mask, x_allocate_bitmap_record)
13090 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13091 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13092 (x_create_bitmap_from_xpm_data):
13093 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13094 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13095 (.bitmaps_last):
13096 * xfaces.c (load_pixmap):
13097 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13098 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13099 (.bitmaps_last, struct x_output.icon_bitmap):
13100 Use ptrdiff_t, not int, for bitmap indexes.
13101 (x_allocate_bitmap_record): Check for size overflow.
13102 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13103
13104 Use ptrdiff_t, not int, for overlay counts.
13105 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13106 * editfns.c (overlays_around, get_pos_property):
13107 * textprop.c (get_char_property_and_overlay):
13108 * xdisp.c (next_overlay_change, note_mouse_highlight):
13109 * xfaces.c (face_at_buffer_position):
13110 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13111 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13112 (Fnext_overlay_change, Fprevious_overlay_change)
13113 (mouse_face_overlay_overlaps, Foverlays_in):
13114 Use ptrdiff_t, not int, for sizes.
13115 (overlays_at, overlays_in): Check for size-calculation overflow.
13116
13117 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13118
13119 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13120 (x_session_initialize): Do not assume string length fits in int.
13121
13122 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13123 This is unlikely, but can occur if DPI is outlandish.
13124
13125 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13126 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13127
13128 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13129 * xrdb.c (magic_file_p, search_magic_path):
13130 Omit last arg SUFFIX; it was always 0. All callers changed.
13131 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13132
13133 * xfont.c (xfont_match): Avoid need for strlen.
13134
13135 * xfns.c: Don't assume strlen fits in int.
13136 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13137
13138 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13139 not unsigned long, as we prefer signed integers. All callers changed.
13140 Detect integer overflow in repeat count.
13141 (message_dolog): Don't assume print length fits in 39 bytes.
13142 (display_mode_element): Don't assume strlen fits in int.
13143
13144 * termcap.c: Don't assume sizes fit in int and never overflow.
13145 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13146 (gobble_line): Check for size-calculation overflow.
13147
13148 * minibuf.c (Fread_buffer):
13149 * lread.c (intern, intern_c_string):
13150 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13151 Don't assume string length fits in int.
13152
13153 * keyboard.c (parse_tool_bar_item):
13154 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13155
13156 * font.c: Don't assume string length fits in int.
13157 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13158 Use ptrdiff_t, not int.
13159 (font_intern_prop): Don't assume string length fits in int.
13160 Don't assume integer property fits in fixnum.
13161 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13162
13163 * filelock.c: Fix some buffer overrun and integer overflow issues.
13164 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13165 Reformulate so as not to need the command string.
13166 Invoke gzip -cd rather than gunzip, as it's more portable.
13167 (lock_info_type, lock_file_1, lock_file):
13168 Don't assume pid_t and time_t fit in unsigned long.
13169 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13170 (current_lock_owner): Prefer signed type for sizes.
13171 Use memcpy, not strncpy, where memcpy is what is really wanted.
13172 Don't assume (via atoi) that time_t and pid_t fit in int.
13173 Check for time_t and/or pid_t out of range, e.g., via a network share.
13174 Don't alloca where an auto var works fine.
13175
13176 * fileio.c: Fix some integer overflow issues.
13177 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13178 Don't assume string length fits in int.
13179 (directory_file_name): Don't assume string length fits in long.
13180 (make_temp_name): Don't assume pid fits in int, or that its print
13181 length is less than 20.
13182
13183 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13184
13185 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13186
13187 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13188
13189 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13190 We prefer signed integers, even for size calculations.
13191
13192 * emacs.c: Don't assume string length fits in 'int'.
13193 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13194 (main): Don't invoke strlen when not needed.
13195
13196 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13197 (XD_DEBUG_MESSAGE): Don't waste a byte.
13198
13199 * callproc.c (getenv_internal_1, getenv_internal)
13200 (Fgetenv_internal):
13201 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13202
13203 * lread.c (invalid_syntax): Omit length argument.
13204 All uses changed. This doesn't fix a bug, but it simplifies the
13205 code away from its former Hollerith-constant appearance, and it's
13206 one less 'int' to worry about when looking at integer-overflow issues.
13207 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13208
13209 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13210 This didn't break anything, but it didn't help either.
13211 It's confusing to put a bogus integer in a place where the actual
13212 value does not matter.
13213 (LIST_END_P): Remove unused macro and its bogus comment.
13214 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13215
13216 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13217 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13218 implementation.
13219 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13220 We prefer signed types, and the value cannot exceed the EMACS_INT
13221 range anyway (because otherwise the length would not be representable).
13222 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13223 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13224 This avoids a GCC warning when WIDE_EMACS_INT.
13225
13226 * indent.c (sane_tab_width): New function.
13227 (current_column, scan_for_column, Findent_to, position_indentation)
13228 (compute_motion): Use it. This is just for clarity.
13229 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13230
13231 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13232
13233 * lisp.h (lint_assume): New macro.
13234 * composite.c (composition_gstring_put_cache):
13235 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13236
13237 * editfns.c, insdel.c:
13238 Omit unnecessary forward decls, to simplify future changes.
13239
13240 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13241
13242 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13243
13244 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13245 Use much-faster test for byte-length change.
13246 Don't assume string byte-length fits in 'int'.
13247 Check that character arg fits in 'int'.
13248 (mapcar1): Declare byte as byte, for clarity.
13249
13250 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13251
13252 * fns.c (concat): Catch string overflow earlier.
13253 Do not rely on integer wraparound.
13254
13255 * dispextern.h (struct it.overlay_strings_charpos)
13256 (struct it.selective): Now EMACS_INT, not int.
13257 * xdisp.c (forward_to_next_line_start)
13258 (back_to_previous_visible_line_start)
13259 (reseat_at_next_visible_line_start, next_element_from_buffer):
13260 Don't arbitrarily truncate the value of 'selective' to int.
13261
13262 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13263
13264 * composite.c: Don't truncate sizes to 'int'.
13265 (composition_gstring_p, composition_reseat_it)
13266 (composition_adjust_point): Use EMACS_INT, not int.
13267 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13268 not EMACS_UINT, for indexes.
13269
13270 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13271
13272 * buffer.c: Include <verify.h>.
13273 (struct sortvec.priority, struct sortstr.priority):
13274 Now EMACS_INT, not int.
13275 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13276 (struct sortstr.size, record_overlay_string)
13277 (struct sortstrlist.size, struct sortlist.used):
13278 Don't truncate size to int.
13279 (record_overlay_string): Check for size-calculation overflow.
13280 (init_buffer_once): Check at compile-time, not run-time.
13281
13282 2011-06-22 Jim Meyering <meyering@redhat.com>
13283
13284 Don't leak an XBM-image-sized buffer
13285 * image.c (xbm_load): Free the image buffer after using it.
13286
13287 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13288
13289 Port to Sun C.
13290 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13291 that Sun C diagnosed.
13292 * fns.c (secure_hash): Fix pointer signedness issue.
13293 * intervals.c (static_offset_intervals): New function.
13294 (offset_intervals): Use it.
13295
13296 2011-06-21 Leo Liu <sdl.web@gmail.com>
13297
13298 * deps.mk (fns.o):
13299 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13300 sha512.h.
13301
13302 * fns.c (secure_hash): Rename from crypto_hash_function and change
13303 the first arg to accept symbols.
13304 (Fsecure_hash): New primitive.
13305 (syms_of_fns): New symbols.
13306
13307 2011-06-20 Deniz Dogan <deniz@dogan.se>
13308
13309 * process.c (Fset_process_buffer): Clarify return value in
13310 docstring.
13311
13312 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13313
13314 * dispnew.c (add_window_display_history): Use BVAR.
13315
13316 * xdisp.c (debug_method_add): Use BVAR.
13317 (check_window_end, dump_glyph_matrix, dump_glyph)
13318 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13319
13320 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13321 Likewise.
13322
13323 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13324 check till after the cache is created in init_frame_faces.
13325
13326 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13327
13328 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13329
13330 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13331
13332 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13333 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13334 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13335
13336 Improve buffer-overflow checking (Bug#8873).
13337 * fileio.c (Finsert_file_contents):
13338 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13339 Remove the old (too-loose) buffer overflow checks.
13340 They weren't needed, since make_gap checks for buffer overflow.
13341 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13342 The old code merely checked for Emacs fixnum overflow, and relied
13343 on undefined (wraparound) behavior. The new code avoids undefined
13344 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13345
13346 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13347 Tune. Don't use wider integers than needed. Don't use alloca.
13348 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13349
13350 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13351
13352 * insdel.c, lisp.h (buffer_overflow): New function.
13353 (insert_from_buffer_1, replace_range, replace_range_2):
13354 * insdel.c (make_gap_larger):
13355 * editfns.c (Finsert_char):
13356 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13357
13358 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13359
13360 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13361
13362 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13363
13364 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13365 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13366
13367 * fileio.c: Don't assume EMACS_INT fits in off_t.
13368 (emacs_lseek): New static function.
13369 (Finsert_file_contents, Fwrite_region): Use it.
13370 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13371
13372 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13373
13374 * fns.c: Don't overflow int when computing a list length.
13375 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13376 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13377 truncation on 64-bit hosts. Check for QUIT every
13378 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13379 faster and is responsive enough.
13380 (Flength): Report an error instead of overflowing an integer.
13381 (Fsafe_length): Return a float if the value is not representable
13382 as a fixnum. This shouldn't happen except in contrived situations.
13383 (Fnthcdr, Fsort): Don't assume list length fits in int.
13384 (Fcopy_sequence): Don't assume vector length fits in int.
13385
13386 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13387 (header_size, word_size): New constants.
13388 (allocate_vectorlike): Don't check size overflow here.
13389 (allocate_vector): Check it here instead, since this is the only
13390 caller of allocate_vectorlike that could cause overflow.
13391 Check that the new vector's length is representable as a fixnum.
13392
13393 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13394 The previous code was bogus. For example, next_almost_prime (32)
13395 returned 39, which is undesirable as it is a multiple of 3; and
13396 next_almost_prime (24) returned 25, which is a multiple of 5 so
13397 why was the code bothering to check for multiples of 7?
13398
13399 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13400
13401 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13402
13403 Variadic C functions now count arguments with ptrdiff_t.
13404 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13405 Back then I didn't know that the Emacs coding style prefers signed int.
13406 Also, in the meantime I found a few more instances where arguments
13407 were being counted with int, which may truncate counts on 64-bit
13408 machines, or EMACS_INT, which may be unnecessarily wide.
13409 * lisp.h (struct Lisp_Subr.function.aMANY)
13410 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13411 Arg counts are now ptrdiff_t, not size_t.
13412 All variadic functions and their callers changed accordingly.
13413 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13414 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13415 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13416 * callint.c (Fcall_interactively): Check arg count for overflow,
13417 to avoid potential buffer overrun. Use signed char, not 'int',
13418 for 'varies' array, so that we needn't bother to check its size
13419 calculation for overflow.
13420 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13421 * eval.c (apply_lambda):
13422 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13423 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13424 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13425
13426 * callint.c (Fcall_interactively): Don't use index var as event count.
13427
13428 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13429 * mem-limits.h (SIZE): Remove; no longer used.
13430
13431 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13432
13433 Remove unnecessary casts.
13434 * xterm.c (x_term_init):
13435 * xfns.c (x_set_border_pixel):
13436 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13437 These aren't needed now that we assume ANSI C.
13438
13439 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13440 It's more likely to cause problems (due to unsigned overflow)
13441 than to cure them.
13442
13443 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13444
13445 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13446
13447 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13448
13449 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13450
13451 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13452
13453 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13454
13455 GLYPH_CODE_FACE returns EMACS_INT, not int.
13456 * dispextern.h (merge_faces):
13457 * xfaces.c (merge_faces):
13458 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13459 Don't assume EMACS_INT fits in int.
13460
13461 * character.h (CHAR_VALID_P): Remove unused parameter.
13462 * fontset.c, lisp.h, xdisp.c: All uses changed.
13463
13464 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13465
13466 * fns.c (concat): Minor tuning based on overflow analysis.
13467 This doesn't fix any bugs. Use int to hold character, instead
13468 of constantly refetching from Emacs object. Use XFASTINT, not
13469 XINT, for value known to be a character. Don't bother comparing
13470 a single byte to 0400, as it's always less.
13471
13472 * floatfns.c (Fexpt):
13473 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13474
13475 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13476 for characters.
13477
13478 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13479
13480 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13481 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13482 incorrectly succeed when S was a string, because 4294967386 was
13483 truncated before it was used.
13484
13485 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13486 Otherwise, an out-of-range integer could cause undefined behavior
13487 on a 64-bit host.
13488
13489 * composite.c: Use int, not EMACS_INT, for characters.
13490 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13491 EMACS_INT, for values that are known to be in character range.
13492 This doesn't fix any bugs but is the usual style inside Emacs and
13493 may generate better code on 32-bit machines.
13494
13495 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13496 This is for reasons similar to the recent CHAR_STRING fix.
13497 * charset.c (Fencode_char): Check that character arg is actually
13498 a character. Pass an int to ENCODE_CHAR.
13499 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13500 wider than 'int', as a compile-time check to prevent future regressions
13501 in this area.
13502
13503 * character.c (char_string): Remove unnecessary casts.
13504
13505 Make sure a 64-bit char is never passed to CHAR_STRING.
13506 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13507 by silently ignoring the top 32 bits, allowing some values
13508 that were far too large to be valid characters.
13509 * character.h: Include <verify.h>.
13510 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13511 arguments are no wider than unsigned, as a compile-time check
13512 to prevent future regressions in this area.
13513 * data.c (Faset):
13514 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13515 (Fsubst_char_in_region):
13516 * fns.c (concat):
13517 * xdisp.c (decode_mode_spec_coding):
13518 Adjust to CHAR_STRING's new requirement.
13519 * editfns.c (Finsert_char, Fsubst_char_in_region):
13520 * fns.c (concat): Check that character args are actually
13521 characters. Without this test, these functions did the wrong
13522 thing with wildly out-of-range values on 64-bit hosts.
13523
13524 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13525 These casts should not be needed on 32-bit hosts, either.
13526 * keyboard.c (read_char):
13527 * lread.c (Fload): Remove casts to unsigned.
13528
13529 * lisp.h (UNSIGNED_CMP): New macro.
13530 This fixes comparison bugs on 64-bit hosts.
13531 (ASCII_CHAR_P): Use it.
13532 * casefiddle.c (casify_object):
13533 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13534 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13535 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13536 * dispextern.h (FACE_FROM_ID):
13537 * keyboard.c (read_char): Use UNSIGNED_CMP.
13538
13539 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13540 not to EMACS_INT, to avoid GCC warning.
13541
13542 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13543
13544 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13545 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13546 isn't needed on 32-bit machines.
13547
13548 * buffer.c (Fgenerate_new_buffer_name):
13549 Use EMACS_INT for count, not int.
13550 (advance_to_char_boundary): Return EMACS_INT, not int.
13551
13552 * data.c (Qcompiled_function): Now static.
13553
13554 * window.c (window_body_lines): Now static.
13555
13556 * image.c (gif_load): Rename local to avoid shadowing.
13557
13558 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13559 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13560 * alloc.c (make_save_value): Integer argument is now of type
13561 ptrdiff_t, not int.
13562 (mark_object): Use ptrdiff_t, not int.
13563 * lisp.h (pD): New macro.
13564 * print.c (print_object): Use it.
13565
13566 * alloc.c: Use EMACS_INT, not int, to count objects.
13567 (total_conses, total_markers, total_symbols, total_vector_size)
13568 (total_free_conses, total_free_markers, total_free_symbols)
13569 (total_free_floats, total_floats, total_free_intervals)
13570 (total_intervals, total_strings, total_free_strings):
13571 Now EMACS_INT, not int. All uses changed.
13572 (Fgarbage_collect): Compute overall total using a double, so that
13573 integer overflow is less likely to be a problem. Check for overflow
13574 when converting back to an integer.
13575 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13576 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13577 These were 'int' variables that could overflow on 64-bit hosts;
13578 they were never used, so remove them instead of repairing them.
13579 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13580 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13581 Previously, this ceilinged at INT_MAX, but that doesn't work on
13582 64-bit machines.
13583 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13584
13585 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13586 (allocate_vectorlike): Check for ptrdiff_t overflow.
13587 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13588 when a (possibly-narrower) signed value would do just as well.
13589 We prefer using signed arithmetic, to avoid comparison confusion.
13590
13591 * alloc.c: Catch some string size overflows that we were missing.
13592 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13593 for convenience in STRING_BYTES_MAX.
13594 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13595 The definition here is exact; the one in lisp.h was approximate.
13596 (allocate_string_data): Check for string overflow. This catches
13597 some instances we weren't catching before. Also, it catches
13598 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13599 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13600 and ptrdiff_t and EMACS_INT are both 64 bits.
13601
13602 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13603 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13604 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13605
13606 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13607
13608 * alloc.c (Fmake_string): Check for out-of-range init.
13609
13610 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13611
13612 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13613
13614 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13615
13616 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13617 xg_get_default_scrollbar_width.
13618
13619 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13620 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13621 (style_changed_cb): Call update_theme_scrollbar_width and call
13622 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13623 all frames (Bug#8505).
13624 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13625 Call gtk_window_set_resizable if HAVE_GTK3.
13626 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13627 and height if HAVE_GTK3 (Bug#8505).
13628 (scroll_bar_width_for_theme): New variable.
13629 (update_theme_scrollbar_width): New function.
13630 (xg_get_default_scrollbar_width): Move code to
13631 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13632 (xg_initialize): Call update_theme_scrollbar_width.
13633
13634 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13635
13636 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13637
13638 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13639
13640 * frame.c (make_frame): Call other_buffer_safely instead of
13641 other_buffer.
13642
13643 * window.c (temp_output_buffer_show): Call display_buffer with
13644 second argument Vtemp_buffer_show_specifiers and reset latter
13645 immediately after the call.
13646 (Vtemp_buffer_show_specifiers): New variable.
13647 (auto_window_vscroll_p, next_screen_context_lines)
13648 (Vscroll_preserve_screen_position): Remove leading asterisks from
13649 doc-strings.
13650
13651 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13652
13653 Fix minor problems found by GCC 4.6.0 static checking.
13654 * buffer.c (Qclone_number): Remove for now, as it's unused.
13655 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13656 (record_buffer): Remove unused local.
13657 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13658 (set_frame_buffer_list): Remove; unused.
13659 * frame.h (other_visible_frames): Remove decl.
13660 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13661 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13662 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13663 if HAVE_GPM.
13664 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13665 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13666 Define only if HAVE_GPM.
13667 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13668 (update_hints_inhibit): Remove; never set. All uses removed.
13669 * widgetprv.h (emacsFrameClassRec): Remove decl.
13670 * window.c (delete_deletable_window): Now returns void, since it
13671 wasn't returning anything.
13672 (compare_window_configurations): Remove unused locals.
13673 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13674 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13675 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13676 the same widths as pointers. This follows up on the 2011-05-06 patch.
13677 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13678 * xterm.h: Likewise.
13679 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13680
13681 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13682
13683 * makefile.w32-in: Update dependencies.
13684 (LISP_H): Add lib/intprops.h.
13685
13686 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13687
13688 * image.c (gif_load): Add animation frame delay to the metadata.
13689 (syms_of_image): Use DEFSYM. New symbol `delay'.
13690
13691 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13692
13693 * window.c (delete_deletable_window): Re-add.
13694 (Fset_window_configuration): Rewrite to handle dead buffers and
13695 consequently deletable windows.
13696 (window_tree, Fwindow_tree): Remove. Supply functionality in
13697 window.el.
13698 (compare_window_configurations): Simplify code.
13699
13700 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13701
13702 * image.c (imagemagick_load_image): Fix type mismatch.
13703 (Fimagemagick_types): Likewise.
13704
13705 * window.h (replace_buffer_in_windows): Declare.
13706
13707 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13708
13709 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13710 Qclone_number. Remove external declaration of Qdelete_window.
13711 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13712 code.
13713 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13714 Run Qbuffer_list_update_hook if allowed.
13715 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13716 buffer list implementation.
13717 (other_buffer_safely): New function.
13718 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13719 calls to replace_buffer_in_windows and
13720 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13721 if allowed.
13722 (record_buffer): Inhibit quitting and rewrite using quittable
13723 functions. Run Qbuffer_list_update_hook if allowed.
13724 (Frecord_buffer, Funrecord_buffer): New functions.
13725 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13726 Move switch-to-buffer to window.el.
13727 (bury-buffer): Move to window.el.
13728 (Vbuffer_list_update_hook): New variable.
13729
13730 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13731 section.
13732
13733 * window.h (resize_frame_windows): Move up in code.
13734 (Fwindow_frame): Remove EXFUN.
13735 (replace_buffer_in_all_windows): Remove prototype.
13736 (replace_buffer_in_windows_safely): Add prototype.
13737
13738 * window.c: Declare Qdelete_window static again. Move down
13739 declaration of select_count.
13740 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13741 (Fother_window): Move to window.el.
13742 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13743 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13744 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13745 window.el.
13746 (replace_buffer_in_windows): Implement by calling
13747 Qreplace_buffer_in_windows.
13748 (replace_buffer_in_all_windows): Remove with some functionality
13749 moved into replace_buffer_in_windows_safely.
13750 (replace_buffer_in_windows_safely): New function.
13751 (select_window_norecord, select_frame_norecord): Move in front
13752 of run_window_configuration_change_hook. Remove now obsolete
13753 declarations.
13754 (Fset_window_buffer): Rewrite doc-string.
13755 Call Qrecord_window_buffer.
13756 (keys_of_window): Move binding for other-window to window.el.
13757
13758 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13759
13760 * dispextern.h (struct image): Replace data member, whose int_val
13761 and ptr_val fields were not used by anything, with a single
13762 lisp_val object.
13763
13764 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13765 (gif_clear_image, gif_load, imagemagick_load_image)
13766 (gs_clear_image, gs_load): Callers changed.
13767
13768 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13769
13770 * buffer.h: Include <time.h>, for time_t.
13771 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13772
13773 Fix minor problems found by static checking.
13774
13775 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13776
13777 Make identifiers static if they are not used in other modules.
13778 * data.c (Qcompiled_function, Qframe, Qvector):
13779 * image.c (QimageMagick, Qsvg):
13780 * minibuf.c (Qmetadata):
13781 * window.c (resize_window_check, resize_root_window): Now static.
13782 * window.h (resize_window_check, resize_root_window): Remove decls.
13783
13784 * window.c (window_deletion_count, delete_deletable_window):
13785 Remove; unused.
13786 (window_body_lines): Now static.
13787 (Fdelete_other_windows_internal): Mark vars as initialized.
13788 Make sure 'resize_failed' is initialized.
13789 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13790 (resize_window_apply): Remove unused local.
13791 * window.h (delete_deletable_window): Remove decl.
13792
13793 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13794 (imagemagick_load_image): Fix pointer signedness problem by changing
13795 last arg from unsigned char * to char *. All uses changed.
13796 Also, fix a local for similar reasons.
13797 Remove unused locals. Remove locals to avoid shadowing.
13798 (fn_rsvg_handle_free): Remove; unused.
13799 (svg_load, svg_load_image): Fix pointer signedness problem.
13800 (imagemagick_load_image): Don't use garbage pointer image_wand.
13801
13802 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13803
13804 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13805
13806 * image.c (gif_load): Fix omitted cast error introduced by
13807 2011-06-06 change.
13808
13809 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13810
13811 * window.h (resize_proportionally, orig_total_lines)
13812 (orig_top_line): Remove from window structure.
13813 (set_window_height, set_window_width, change_window_heights)
13814 (Fdelete_window): Remove prototypes.
13815 (resize_frame_windows): Remove duplicate declaration.
13816
13817 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13818
13819 * window.h (resize_frame_windows, resize_window_check)
13820 (delete_deletable_window, resize_root_window)
13821 (resize_frame_windows): Declare prototypes.
13822
13823 * window.c (resize_window_apply): Make definition be "static" to
13824 match the prototype.
13825
13826 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13827
13828 * window.c: Remove declarations of Qwindow_size_fixed,
13829 window_min_size_1, window_min_size_2, window_min_size,
13830 size_window, window_fixed_size_p, enlarge_window, delete_window.
13831 Remove static from declaration of Qdelete_window, it's
13832 temporarily needed by Fbury_buffer.
13833 (replace_window): Don't assign orig_top_line and
13834 orig_total_lines.
13835 (Fdelete_window, delete_window): Remove. Window deletion is
13836 handled by window.el.
13837 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13838 Replace Fdelete_window calls with calls to Qdelete_window.
13839 (Fdelete_other_windows): Remove. Deleting other windows is
13840 handled by window.el.
13841 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13842 handled in window.el.
13843 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13844 Window minimum sizes are handled in window.el.
13845 (shrink_windows, size_window, set_window_height)
13846 (set_window_width, change_window_heights, window_height)
13847 (window_width, CURBEG, CURSIZE, enlarge_window)
13848 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13849 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13850 handled in window.el.
13851 (make_dummy_parent): Rename to make_parent_window and give it a
13852 second argument horflag.
13853 (make_window): Don't set resize_proportionally any more.
13854 (Fsplit_window): Remove. Windows are split in window.el.
13855 (save_restore_action, save_restore_orig_size)
13856 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13857 Resize mini windows in window.el.
13858 (grow_mini_window, shrink_mini_window): Implement by calling
13859 Qresize_root_window_vertically, resize_window_check and
13860 resize_window_apply.
13861 (saved_window, Fset_window_configuration, save_window_save):
13862 Do not handle orig_top_line, orig_total_lines, and
13863 resize_proportionally.
13864 (window_min_height, window_min_width): Move to window.el.
13865 (keys_of_window): Move bindings for delete-other-windows,
13866 split-window, delete-window and enlarge-window to window.el.
13867
13868 * buffer.c: Temporarily extern Qdelete_window.
13869 (Fbury_buffer): Temporarily call Qdelete_window instead of
13870 Fdelete_window (Fbury_buffer will move to window.el soon).
13871
13872 * frame.c (set_menu_bar_lines_1): Remove code handling
13873 orig_top_line and orig_total_lines.
13874
13875 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13876 set_window_height but set heights directly.
13877 (change_frame_size_1): Use resize_frame_windows.
13878
13879 * xdisp.c (init_xdisp): Don't use set_window_height but set
13880 heights directly.
13881
13882 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13883 Use resize_frame_windows instead of change_window_heights and run
13884 run_window_configuration_change_hook.
13885
13886 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13887 instead of change_window_heights and run
13888 run_window_configuration_change_hook.
13889
13890 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13891
13892 * window.c (replace_window): Rename second argument REPLACEMENT to
13893 NEW. New third argument SETFLAG. Rewrite.
13894 (delete_window, make_dummy_parent): Call replace_window with
13895 third argument 1.
13896 (window_list_1): Move down in code.
13897 (run_window_configuration_change_hook): Move set_buffer part
13898 before select_frame_norecord part in order to unwind correctly.
13899 Rename count1 to count.
13900 (recombine_windows, delete_deletable_window, resize_root_window)
13901 (Fdelete_other_windows_internal)
13902 (Frun_window_configuration_change_hook, make_parent_window)
13903 (resize_window_check, resize_window_apply, Fresize_window_apply)
13904 (resize_frame_windows, Fsplit_window_internal)
13905 (Fdelete_window_internal, Fresize_mini_window_internal):
13906 New functions.
13907 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13908
13909 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13910
13911 * window.h (window): Add some new members to window structure -
13912 normal_lines, normal_cols, new_total, new_normal, clone_number,
13913 splits, nest, prev_buffers, next_buffers.
13914 (WINDOW_TOTAL_SIZE): Move here from window.c.
13915 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13916
13917 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13918 Remove.
13919 (make_dummy_parent): Set new members of windows structure.
13920 (make_window): Move down in code. Handle new members of window
13921 structure.
13922 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13923 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13924 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13925 (Fset_window_prev_buffers, Fwindow_next_buffers)
13926 (Fset_window_next_buffers, Fset_window_clone_number):
13927 New functions.
13928 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13929 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13930 Doc-string fixes.
13931 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13932 Argument WINDOW can be now internal window too.
13933 (Fwindow_use_time): Move up in code.
13934 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13935 Rewrite doc-string.
13936 (Fset_window_configuration, saved_window)
13937 (Fcurrent_window_configuration, save_window_save): Handle new
13938 members of window structure.
13939 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13940 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13941 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13942 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13943 Qget_mru_window, Qresize_root_window,
13944 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13945 Qauto_buffer_name; staticpro them.
13946
13947 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13948
13949 * window.c (Fwindow_total_size, Fwindow_left_column)
13950 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13951 (Fwindow_list_1): New functions.
13952 (window_box_text_cols): Replace with window_body_cols.
13953 (Fwindow_width, Fscroll_left, Fscroll_right):
13954 Use window_body_cols instead of window_box_text_cols.
13955 (delete_window, Fset_window_configuration):
13956 Call delete_all_subwindows with window as argument.
13957 (delete_all_subwindows): Take a window as argument and not a
13958 structure. Rewrite.
13959 (window_loop): Remove handling of GET_LRU_WINDOW and
13960 GET_LARGEST_WINDOW.
13961 (Fget_lru_window, Fget_largest_window): Move to window.el.
13962
13963 * window.h: Extern window_body_cols instead of
13964 window_box_text_cols. delete_all_subwindows now takes a
13965 Lisp_Object as argument.
13966
13967 * indent.c (compute_motion, Fcompute_motion):
13968 Use window_body_cols instead of window_box_text_cols.
13969
13970 * frame.c (delete_frame): Call delete_all_subwindows with root
13971 window as argument.
13972
13973 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13974
13975 * fns.c (Fputhash): Document return value.
13976
13977 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13978
13979 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13980
13981 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13982
13983 Cons<->int and similar integer overflow fixes (Bug#8794).
13984
13985 Check for overflow when converting integer to cons and back.
13986 * charset.c (Fdefine_charset_internal, Fdecode_char):
13987 Use cons_to_unsigned to catch overflow.
13988 (Fencode_char): Use INTEGER_TO_CONS.
13989 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13990 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13991 * data.c (long_to_cons, cons_to_long): Remove.
13992 (cons_to_unsigned, cons_to_signed): New functions.
13993 These signal an error for invalid or out-of-range values.
13994 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13995 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13996 * font.c (Ffont_variation_glyphs):
13997 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13998 * lisp.h: Include <intprops.h>.
13999 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14000 (cons_to_signed, cons_to_unsigned): New decls.
14001 (long_to_cons, cons_to_long): Remove decls.
14002 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14003 (Fprimitive_undo): Use CONS_TO_INTEGER.
14004 * xfns.c (Fx_window_property): Likewise.
14005 * xselect.c: Include <limits.h>.
14006 (x_own_selection, selection_data_to_lisp_data):
14007 Use INTEGER_TO_CONS.
14008 (x_handle_selection_request, x_handle_selection_clear)
14009 (x_get_foreign_selection, Fx_disown_selection_internal)
14010 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14011 (lisp_data_to_selection_data): Use cons_to_unsigned.
14012 (x_fill_property_data): Use cons_to_signed.
14013 Report values out of range.
14014
14015 Check for buffer and string overflow more precisely.
14016 * buffer.h (BUF_BYTES_MAX): New macro.
14017 * lisp.h (STRING_BYTES_MAX): New macro.
14018 * alloc.c (Fmake_string):
14019 * character.c (string_escape_byte8):
14020 * coding.c (coding_alloc_by_realloc):
14021 * doprnt.c (doprnt):
14022 * editfns.c (Fformat):
14023 * eval.c (verror):
14024 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14025 since they may not be the same number.
14026 * editfns.c (Finsert_char):
14027 * fileio.c (Finsert_file_contents):
14028 Likewise for BUF_BYTES_MAX.
14029
14030 * image.c: Use ptrdiff_t, not int, for sizes.
14031 (slurp_file): Switch from int to ptrdiff_t.
14032 All uses changed.
14033 (slurp_file): Check that file size fits in both size_t (for
14034 malloc) and ptrdiff_t (for sanity and safety).
14035
14036 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14037 if b->modtime has its maximal value.
14038
14039 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14040
14041 Don't assume time_t can fit into int.
14042 * buffer.h (struct buffer.modtime): Now time_t, not int.
14043 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14044 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14045
14046 Minor fixes for signed vs unsigned integers.
14047 * character.h (MAYBE_UNIFY_CHAR):
14048 * charset.c (maybe_unify_char):
14049 * keyboard.c (read_char, reorder_modifiers):
14050 XINT -> XFASTINT, since the integer must be nonnegative.
14051 * ftfont.c (ftfont_spec_pattern):
14052 * keymap.c (access_keymap, silly_event_symbol_error):
14053 XUINT -> XFASTINT, since the integer must be nonnegative.
14054 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14055 since it makes no difference and we prefer signed.
14056 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14057 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14058 nonnegative.
14059
14060 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14061
14062 * window.h (Fwindow_frame): Declare.
14063
14064 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14065
14066 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14067 (SPARE_MEMORY): Always define.
14068 (LARGE_REQUEST): Remove.
14069 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14070
14071 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14072
14073 * lisp.h: Move EXFUNS for Fframe_root_window,
14074 Fframe_first_window and Fset_frame_selected_window to window.h.
14075
14076 * window.h: Move EXFUNS for Fframe_root_window,
14077 Fframe_first_window and Fset_frame_selected_window here from
14078 lisp.h.
14079
14080 * frame.c (Fwindow_frame, Fframe_first_window)
14081 (Fframe_root_window, Fframe_selected_window)
14082 (Fset_frame_selected_window): Move to window.c.
14083 (Factive_minibuffer_window): Move to minibuf.c.
14084 (Fother_visible_frames_p): New function.
14085
14086 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14087
14088 * window.c (decode_window, decode_any_window): Move up in code.
14089 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14090 (inhibit_frame_unsplittable): Remove unused variable.
14091 (Fwindow_buffer): Move up and rewrite doc-string.
14092 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14093 (Fwindow_prev): New functions.
14094 (Fwindow_frame): Move here from frame.c. Accept any window as
14095 argument.
14096 (Fframe_root_window, Fframe_first_window)
14097 (Fframe_selected_window): Move here from frame.c. Accept frame
14098 or arbitrary window as argument. Update doc-strings.
14099 (Fminibuffer_window): Move up in code.
14100 (Fwindow_minibuffer_p): Move up in code and simplify.
14101 (Fset_frame_selected_window): Move here from frame.c.
14102 Marginal rewrite.
14103 (Fselected_window, select_window, Fselect_window): Move up in
14104 code. Minor doc-string fixes.
14105
14106 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14107
14108 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14109 Do not assume that spare memory exists; that assumption is valid
14110 only if SYSTEM_MALLOC.
14111 (LARGE_REQUEST): New macro, so that the issue of large requests
14112 is separated from the issue of spare memory.
14113
14114 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14115
14116 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14117 format. (Bug#8806)
14118
14119 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14120
14121 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14122 before statements.
14123
14124 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14125
14126 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14127
14128 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14129
14130 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14131 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14132
14133 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14134
14135 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14136
14137 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14138
14139 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14140 (x_clipboard_manager_save): Add return value.
14141 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14142 New error handlers.
14143 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14144 Obey Vx_select_enable_clipboard_manager. Catch errors in
14145 x_clipboard_manager_save (Bug#8779).
14146 (Vx_select_enable_clipboard_manager): New variable.
14147 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14148
14149 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14150
14151 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14152
14153 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14154
14155 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14156 in the current matrix if keep_current_p is non-zero.
14157
14158 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14159
14160 * bidi.c (bidi_level_of_next_char): Fix last change.
14161
14162 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14163
14164 Support bidi reordering of text covered by display properties.
14165
14166 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14167 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14168 (bidi_cache_search, bidi_cache_iterator_state)
14169 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14170 (bidi_level_of_next_char, bidi_move_to_visually_next):
14171 Support character positions inside a run of characters covered by a
14172 display string.
14173 (bidi_paragraph_init, bidi_resolve_explicit_1)
14174 (bidi_level_of_next_char): Call bidi_fetch_char and
14175 bidi_fetch_char_advance instead of FETCH_CHAR and
14176 FETCH_CHAR_ADVANCE.
14177 (bidi_init_it): Initialize new members.
14178 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14179 definitions.
14180 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14181 instead of using explicit *_CHAR codes.
14182 (bidi_resolve_explicit, bidi_resolve_weak):
14183 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14184 bidirectional text is supported only in multibyte buffers.
14185 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14186 it to initialize the frame_window_p member of struct bidi_it.
14187 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14188 (bidi_resolve_explicit, bidi_resolve_weak)
14189 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14190 bidi_it->nchars is non-positive.
14191 (bidi_level_of_next_char): Don't try to lookup the cache for the
14192 next/previous character if nothing is cached there yet, or if we
14193 were just reseat()'ed to a new position.
14194
14195 * xdisp.c (set_cursor_from_row): Set start and stop points
14196 according to the row's direction when priming the loop that looks
14197 for the glyph on which to display cursor.
14198 (single_display_spec_intangible_p): Function deleted.
14199 (display_prop_intangible_p): Reimplement to call
14200 handle_display_spec instead of single_display_spec_intangible_p.
14201 Accept 3 additional arguments needed by handle_display_spec.
14202 This fixes incorrect cursor motion across display property with complex
14203 values: lists, `(when COND...)' forms, etc.
14204 (single_display_spec_string_p): Support property values that are
14205 lists with the argument STRING its top-level element.
14206 (display_prop_string_p): Fix the condition for processing a
14207 property that is a list to be consistent with handle_display_spec.
14208 (handle_display_spec): New function, refactored from the
14209 last portion of handle_display_prop.
14210 (compute_display_string_pos): Accept additional argument
14211 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14212 value of a `display' property is a "replacing spec".
14213 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14214 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14215 the display property, but just return a value indicating whether
14216 the display property will replace the characters it covers.
14217 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14218 frame_window_p members of struct bidi_it.
14219 (compute_display_string_pos, compute_display_string_end):
14220 New functions.
14221 (push_it): Accept second argument POSITION, where pop_it should
14222 jump to continue iteration.
14223 (reseat_1): Initialize bidi_it.disp_pos.
14224
14225 * keyboard.c (adjust_point_for_property): Adjust the call to
14226 display_prop_intangible_p to its new signature.
14227
14228 * dispextern.h (struct bidi_it): New member frame_window_p.
14229 (bidi_init_it): Update prototypes.
14230 (display_prop_intangible_p): Update prototype.
14231 (compute_display_string_pos, compute_display_string_end):
14232 Declare prototypes.
14233 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14234 EMACS_INT.
14235
14236 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14237
14238 Malloc failure behavior now depends on size of allocation.
14239 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14240 * lisp.h: Change signatures accordingly.
14241 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14242 All callers changed. (Bug#8762)
14243
14244 * gnutls.c: Use Emacs's memory allocators.
14245 Without this change, the gnutls library would invoke malloc etc.
14246 directly, which causes problems on non-SYNC_INPUT hosts, and which
14247 runs afoul of improving memory_full behavior. (Bug#8761)
14248 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14249 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14250 xfree instead of the default malloc, realloc, free.
14251 (Fgnutls_boot): No need to check for memory allocation failure,
14252 since xmalloc does that for us.
14253
14254 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14255 * category.c (hash_get_category_set):
14256 * ccl.c (ccl_driver):
14257 * charset.c (Fdefine_charset_internal):
14258 * charset.h (struct charset.hash_index):
14259 * composite.c (get_composition_id, gstring_lookup_cache)
14260 (composition_gstring_put_cache):
14261 * composite.h (struct composition.hash_index):
14262 * dispextern.h (struct image.hash):
14263 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14264 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14265 (hashfn_equal, hashfn_user_defined, make_hash_table)
14266 (maybe_resize_hash_table, hash_lookup, hash_put)
14267 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14268 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14269 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14270 * image.c (make_image, search_image_cache, lookup_image)
14271 (xpm_put_color_table_h):
14272 * lisp.h (struct Lisp_Hash_Table):
14273 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14274 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14275 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14276 * alloc.c (allocate_vectorlike):
14277 Check for overflow in vector size calculations.
14278 * ccl.c (ccl_driver):
14279 Check for overflow when converting EMACS_INT to int.
14280 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14281 need to be updated by these changes.
14282 * fns.c (make_hash_table, maybe_resize_hash_table):
14283 Check for integer overflow with large hash tables.
14284 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14285 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14286 (SXHASH_REDUCE): New macro.
14287 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14288 Use it instead of discarding useful hash info with large hash values.
14289 (sxhash_float): New function.
14290 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14291 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14292 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14293 Rewrite to use FIXNUM_BITS, as this simplifies things.
14294 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14295 Adjust signatures to match updated version of code.
14296 (consing_since_gc): Now EMACS_INT, since a single hash table can
14297 use more than INT_MAX bytes.
14298
14299 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14300
14301 Make it possible to build with GCC-4.6+ -O2 -flto.
14302
14303 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14304
14305 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14306
14307 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14308 Call minibuffer-inactive-mode.
14309
14310 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14311
14312 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14313 Update dependencies.
14314
14315 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14316
14317 * data.c (init_data): Remove code for UTS, this system is not
14318 supported anymore.
14319
14320 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14321
14322 Don't force ./temacs to start in terminal mode.
14323
14324 * frame.c (make_initial_frame): Initialize faces in all cases, not
14325 only when CANNOT_DUMP is defined.
14326 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14327
14328 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14329
14330 * dispnew.c (add_window_display_history): Use const for the string
14331 pointer. Remove declaration, not needed.
14332
14333 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14334
14335 Use 'inline', not 'INLINE'.
14336 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14337 * alloc.c, fontset.c (INLINE): Remove.
14338 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14339 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14340 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14341 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14342 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14343
14344 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14345
14346 Make it possible to run ./temacs.
14347
14348 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14349 syms_of_callproc does the same thing. Remove test for
14350 "initialized", do it in the caller.
14351 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14352
14353 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14354
14355 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14356 (read_minibuf): Use get_minibuffer.
14357 (syms_of_minibuf): Use DEFSYM.
14358 (Qmetadata): New var.
14359 * data.c (Qbuffer): Don't make it static.
14360 (syms_of_data): Use DEFSYM.
14361
14362 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14363
14364 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14365 (CCL_CODE_MIN): New macro.
14366
14367 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14368
14369 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14370
14371 * eval.c (Qdebug): Now static.
14372 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14373 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14374 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14375
14376 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14377
14378 * image.c: Various fixes to ImageMagick code comments.
14379 (Fimagemagick_types): Doc fix.
14380
14381 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14382
14383 Minor fixes prompted by GCC 4.6.0 warnings.
14384
14385 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14386
14387 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14388 (x_clipboard_manager_save_all): Move extern decl to ...
14389 * xterm.h: ... here, so that it can be checked for consistency.
14390
14391 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14392
14393 * xselect.c (x_clipboard_manager_save_frame)
14394 (x_clipboard_manager_save_all): New functions.
14395 (Fx_clipboard_manager_save): Lisp function deleted.
14396
14397 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14398 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14399
14400 * xterm.h: Update prototype.
14401
14402 2011-05-28 William Xu <william.xwl@gmail.com>
14403
14404 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14405 exiting (Bug#8239).
14406
14407 2011-05-28 Jim Meyering <meyering@redhat.com>
14408
14409 Avoid a sign-extension bug in crypto_hash_function.
14410 * fns.c (to_uchar): Define.
14411 (crypto_hash_function): Use it to convert some newly-signed
14412 variables to unsigned, to avoid sign-extension bugs. For example,
14413 without this change, (md5 "truc") would evaluate to
14414 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14415 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14416 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14417
14418 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14419
14420 Integer overflow fixes.
14421
14422 * dbusbind.c: Serial number integer overflow fixes.
14423 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14424 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14425 to hold a serial number that is too large for a fixnum.
14426 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14427 Check for serial numbers out of range. Decode any serial number
14428 that was so large that it became a float. (Bug#8722)
14429
14430 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14431 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14432 Use XFASTINT rather than XUINT when numbers are nonnegative.
14433 (xd_append_arg, Fdbus_method_return_internal):
14434 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14435 arguments, check that Lisp number is nonnegative, rather than
14436 silently wrapping negative numbers around. (Bug#8722)
14437 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14438 (Bug#8722)
14439
14440 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14441
14442 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14443
14444 ccl: Add integer overflow checks.
14445 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14446 (IN_INT_RANGE): New macros.
14447 (ccl_driver): Use them to check for integer overflow when
14448 decoding a CCL program. Many of the new checks are whether XINT (x)
14449 fits in int; it doesn't always, on 64-bit hosts. The new version
14450 doesn't catch all possible integer overflows, but it's an
14451 improvement. (Bug#8719)
14452
14453 * alloc.c (make_event_array): Use XINT, not XUINT.
14454 There's no need for unsigned here.
14455
14456 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14457 This follows up to the 2011-05-06 change that substituted uintptr_t
14458 for EMACS_INT. This case wasn't caught back then.
14459
14460 Rework Fformat to avoid integer overflow issues.
14461 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14462 now (part of C89). Include <verify.h>.
14463 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14464 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14465 (Fformat): Avoid the prepass trying to compute sizes; it was only
14466 approximate and thus did not catch overflow reliably. Instead, walk
14467 through the format just once, formatting and computing sizes as we go,
14468 checking for integer overflow at every step, and allocating a larger
14469 buffer as needed. Keep track separately whether the format is
14470 multibyte. Keep only the most-recently calculated precision, rather
14471 than them all. Record whether each argument has been converted to
14472 string. Use EMACS_INT, not int, for byte and char and arg counts.
14473 Support field widths and precisions larger than INT_MAX. Avoid
14474 sprintf's undefined behavior with conversion specifications such as %#d
14475 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14476 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14477 formatting out-of-range floating point numbers with int
14478 formats. (Bug#8668)
14479
14480 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14481
14482 * data.c: Avoid integer truncation in expressions involving floats.
14483 * data.c: Include <intprops.h>.
14484 (arith_driver): When there's an integer overflow in an expression
14485 involving floating point, convert the integers to floating point
14486 so that the resulting value does not suffer from catastrophic
14487 integer truncation. For example, on a 64-bit host (* 4
14488 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14489 Do not rely on undefined behavior after integer overflow.
14490
14491 merge count_size_as_multibyte, parse_str_to_multibyte
14492 * character.c, character.h (count_size_as_multibyte):
14493 Rename from parse_str_to_multibyte; all uses changed.
14494 Check for integer overflow.
14495 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14496 since it's now a duplicate of the other. This is more of
14497 a character than a buffer op, so better that it's in character.c.
14498 * fns.c, print.c: Adjust to above changes.
14499
14500 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14501
14502 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14503
14504 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14505
14506 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14507 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14508 (x_clipboard_manager_save): Now static.
14509 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14510
14511 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14512 (crypto_hash_function): Now static.
14513 Fix pointer signedness problems. Avoid unnecessary initializations.
14514
14515 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14516
14517 * termhooks.h (Vselection_alist): Make it terminal-local.
14518
14519 * terminal.c (create_terminal): Initialize it.
14520
14521 * xselect.c: Support for clipboard managers.
14522 (Vselection_alist): Move to termhooks.h as terminal-local var.
14523 (LOCAL_SELECTION): New macro.
14524 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14525 (symbol_to_x_atom): Remove gratuitous arg.
14526 (x_handle_selection_request, lisp_data_to_selection_data)
14527 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14528 (x_own_selection, x_get_local_selection, x_convert_selection):
14529 New arg, specifying work frame. Use terminal-local Vselection_alist.
14530 (some_frame_on_display): Delete unused function.
14531 (Fx_own_selection_internal, Fx_get_selection_internal)
14532 (Fx_disown_selection_internal, Fx_selection_owner_p)
14533 (Fx_selection_exists_p): New optional frame arg.
14534 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14535 (x_handle_selection_clear): Don't treat other terminals with the
14536 same keyboard specially. Use the terminal-local Vselection_alist.
14537 (x_clear_frame_selections): Use Frun_hook_with_args.
14538
14539 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14540
14541 * xterm.h: Add support for those atoms.
14542
14543 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14544
14545 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14546 (converted_selections, conversion_fail_tag): New global variables.
14547 (x_selection_request_lisp_error): Free the above.
14548 (x_get_local_selection): Remove unnecessary code.
14549 (x_reply_selection_request): Args changed; handle arbitrary array
14550 of converted selections stored in converted_selections.
14551 Separate the XChangeProperty and SelectionNotify steps.
14552 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14553 (x_convert_selection): New function.
14554 (x_handle_selection_event): Simplify.
14555 (x_get_foreign_selection): Don't ignore incoming requests while
14556 waiting for an answer; this will fail when we implement
14557 SAVE_TARGETS, and seems unnecessary anyway.
14558 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14559 (Vx_sent_selection_functions): Doc fix.
14560
14561 2011-05-26 Leo Liu <sdl.web@gmail.com>
14562
14563 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14564
14565 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14566
14567 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14568
14569 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14570 for fringe update if it has periodic bitmap.
14571 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14572 and fringe_bitmap_periodic_p.
14573
14574 * fringe.c (get_fringe_bitmap_data): New function.
14575 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14576 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14577 row. Mark glyph row for fringe update if periodicity changed.
14578
14579 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14580 for fringe update unless it has periodic bitmap.
14581
14582 2011-05-25 Kenichi Handa <handa@m17n.org>
14583
14584 * xdisp.c (get_next_display_element): Set correct it->face_id for
14585 a static composition.
14586
14587 2011-05-24 Leo Liu <sdl.web@gmail.com>
14588
14589 * deps.mk (fns.o):
14590 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14591
14592 * fns.c (crypto_hash_function, Fsha1): New function.
14593 (Fmd5): Use crypto_hash_function.
14594 (syms_of_fns): Add Ssha1.
14595
14596 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14597
14598 * gnutls.c: Remove unused macros.
14599 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14600 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14601 Remove macros that are defined and never used.
14602 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14603
14604 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14605
14606 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14607 (Fx_get_selection_internal): Minor cleanup.
14608 (Fx_own_selection_internal): Rename arguments for consistency with
14609 select.el.
14610
14611 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14612
14613 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14614
14615 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14616
14617 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14618
14619 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14620
14621 * dispnew.c (scrolling_window): Don't exclude the case that the
14622 last enabled row in the desired matrix touches the bottom boundary.
14623
14624 2011-05-21 Glenn Morris <rgm@gnu.org>
14625
14626 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14627 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14628 and add some more files.
14629
14630 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14631
14632 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14633 report_file_error introduced by the change from 2011-05-07.
14634
14635 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14636
14637 * systime.h (Time): Define only if emacs is defined.
14638 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14639 where the include path doesn't have X11/X.h by default. See
14640 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14641
14642 2011-05-20 Kenichi Handa <handa@m17n.org>
14643
14644 * composite.c (find_automatic_composition): Fix previous change.
14645
14646 2011-05-20 Glenn Morris <rgm@gnu.org>
14647
14648 * lisp.mk: New file, split from Makefile.in.
14649 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14650 (shortlisp): Remove.
14651 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14652
14653 2011-05-19 Glenn Morris <rgm@gnu.org>
14654
14655 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14656 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14657 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14658 (lisp): Set the order to that of loadup.el.
14659 (shortlisp): Make it a copy of $lisp.
14660 (SOME_MACHINE_LISP): Remove.
14661 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14662 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14663
14664 2011-05-18 Kenichi Handa <handa@m17n.org>
14665
14666 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14667 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14668 (find_automatic_composition): Mostly rewrite for efficiency.
14669
14670 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14671
14672 * makefile.w32-in: Update dependencies.
14673
14674 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14675
14676 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14677 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14678
14679 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14680
14681 Fix some integer overflow issues, such as string length overflow.
14682
14683 * insdel.c (count_size_as_multibyte): Check for string overflow.
14684
14685 * character.c (lisp_string_width): Check for string overflow.
14686 Use EMACS_INT, not int, for string indexes and lengths; in
14687 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14688 the resulting string length overflows an EMACS_INT; instead,
14689 report a string overflow if no precision given. When checking for
14690 precision exhaustion, use a check that cannot possibly have
14691 integer overflow. (Bug#8675)
14692 * character.h (lisp_string_width): Adjust to new signature.
14693
14694 * alloc.c (string_overflow): New function.
14695 (Fmake_string): Use it. This doesn't change behavior, but saves
14696 a few bytes and will simplify future changes.
14697 * character.c (string_escape_byte8): Likewise.
14698 * lisp.h (string_overflow): New decl.
14699
14700 Fixups, following up to the user-interface timestamp change.
14701 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14702 for UI timestamps, instead of unsigned long.
14703 * msdos.c (mouse_get_pos): Likewise.
14704 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14705 * w32gui.h (Time): Define by including "systime.h" rather than by
14706 declaring it ourselves. (Bug#8664)
14707
14708 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14709 * image.c (clear_image_cache): Likewise.
14710
14711 * term.c (term_mouse_position): Don't assume time_t wraparound.
14712
14713 Be more systematic about user-interface timestamps.
14714 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14715 and sometimes 'EMACS_UINT', to represent these timestamps.
14716 This change causes it to use 'Time' uniformly, as that's what X uses.
14717 This makes the code easier to follow, and makes it easier to catch
14718 integer overflow bugs such as Bug#8664.
14719 * frame.c (Fmouse_position, Fmouse_pixel_position):
14720 Use Time, not unsigned long, for user-interface timestamps.
14721 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14722 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14723 * keyboard.h (last_event_timestamp): Likewise.
14724 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14725 * menu.h (xmenu_show): Likewise.
14726 * term.c (term_mouse_position): Likewise.
14727 * termhooks.h (struct input_event.timestamp): Likewise.
14728 (struct terminal.mouse_position_hook): Likewise.
14729 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14730 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14731 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14732 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14733 what it was before.
14734 * menu.h, termhooks.h: Include "systime.h", for Time.
14735
14736 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14737 Don't assume that the difference between two unsigned long values
14738 can fit into an integer. At this point, we know button_down_time
14739 <= event->timestamp, so the difference must be nonnegative, so
14740 there's no need to cast the result if double-click-time is
14741 nonnegative, as it should be; check that it's nonnegative, just in
14742 case. This bug is triggered when events are more than 2**31 ms
14743 apart (about 25 days). (Bug#8664)
14744
14745 * xselect.c (last_event_timestamp): Remove duplicate decl.
14746 (x_own_selection): Remove needless cast to unsigned long.
14747
14748 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14749 that always fit in int. Use a sentinel instead of a counter, to
14750 avoid a temp and to allay GCC's concerns about possible int overflow.
14751 * frame.h (struct frame): Use int for menu_bar_items_used
14752 instead of EMACS_INT, since it always fits in int.
14753
14754 * menu.c (grow_menu_items): Check for int overflow.
14755
14756 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14757
14758 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14759 Before, the code was not consistent. These values cannot exceed
14760 2**31 - 1 so there's no need to make them unsigned.
14761 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14762 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14763 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14764 as modifiers.
14765 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14766
14767 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14768 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14769 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14770 presumably because the widths might not match.
14771
14772 * window.c (size_window): Avoid needless test at loop start.
14773
14774 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14775
14776 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14777
14778 2011-05-12 Drew Adams <drew.adams@oracle.com>
14779
14780 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14781
14782 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14783
14784 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14785 `width' to `bar_area_x' and `bar_area_width', respectively.
14786 (x_scroll_run): Take account of fringe background extension.
14787
14788 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14789 Rename local vars `left' and `width' to `bar_area_x' and
14790 `bar_area_width', respectively.
14791 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14792 background extension.
14793
14794 2011-05-10 Jim Meyering <meyering@redhat.com>
14795
14796 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14797
14798 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14799
14800 * image.c (Finit_image_library): Return t for built-in image types,
14801 like pbm and xbm. (Bug#8640)
14802
14803 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14804
14805 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14806
14807 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14808
14809 * w32console.c (Fset_screen_color): Doc fix.
14810 (Fget_screen_color): New function.
14811 (syms_of_ntterm): Defsubr it.
14812
14813 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14814 unlink the temporary file if Fcall_process didn't create it in the
14815 first place.
14816 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14817 child process will be redirected to a file specified with `:file'.
14818 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14819 cue to call_process_cleanup not to close that handle.
14820
14821 2011-05-07 Ben Key <bkey76@gmail.com>
14822
14823 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14824 one of two shell specific rules, either bootstrap-temacs-CMD or
14825 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14826 to the previous implementation of the bootstrap-temacs rule.
14827 The bootstrap-temacs-CMD rule is similar to the previous
14828 implementation of the bootstrap-temacs rule except that it
14829 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14830 variable.
14831
14832 These changes, along with some changes to nt/configure.bat,
14833 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14834 earlier fix to add support for --cflags and --ldflags options
14835 that include quotes so that it works whether make uses cmd or
14836 sh as the shell.
14837
14838 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14839
14840 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14841 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14842 is a constant.
14843 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14844 a string. Handle both cases.
14845 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14846 (Fdbus_register_method): Use Qinvalid_function.
14847
14848 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14849
14850 * makefile.w32-in: Update dependencies.
14851 (LISP_H): Add inttypes.h and stdin.h.
14852 (PROCESS_H): Add unistd.h.
14853
14854 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14855
14856 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14857 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14858
14859 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14860
14861 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14862
14863 * term.c (vfatal): Remove stray call to va_end.
14864 It's not needed and the C Standard doesn't allow it here anyway.
14865
14866 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14867 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14868
14869 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14870 bytes.
14871
14872 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14873
14874 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14875
14876 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14877
14878 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14879
14880 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14881
14882 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14883 * charset.c (Fdefine_charset_internal): Don't initialize
14884 charset.code_space[15]. The value was garbage, on hosts with
14885 32-bit int (Bug#8600).
14886
14887 * lread.c (read_integer): Be more consistent with string-to-number.
14888 Use string_to_number to do the actual conversion; this avoids
14889 rounding errors and fixes some other screwups. Without this fix,
14890 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14891 (digit_to_number): Move earlier, for benefit of read_integer.
14892 Return -1 if the digit is out of range for the base, -2 if it is
14893 not a digit in any supported base. (Bug#8602)
14894
14895 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14896
14897 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14898 to match comment at start of function. This also removes a
14899 GCC warning about overflow in a 32+64-bit port.
14900
14901 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14902
14903 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14904 Reported by Stefan Monnier in
14905 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14906 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14907 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14908
14909 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14910 (EMACS_UINTPTR): Likewise, with uintptr_t.
14911
14912 * lisp.h: Prefer 64-bit EMACS_INT if available.
14913 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14914 on 32-bit hosts that have 64-bit int, so that they can access
14915 large files.
14916 However, temporarily disable this change unless the temporary
14917 symbol WIDE_EMACS_INT is defined.
14918
14919 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14920
14921 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14922 This removes an assumption that EMACS_INT and long are the same
14923 width as pointers. The assumption is true for Emacs porting targets
14924 now, but we want to make other targets possible.
14925 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14926 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14927 In the rest of the code, change types of integers that hold casted
14928 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14929 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14930 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14931 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14932 No need to cast type when ORing.
14933 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14934 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14935 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14936 assume EMACS_INT is the same width as char *.
14937 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14938 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14939 Remove no-longer-needed casts.
14940 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14941 (xg_tool_bar_help_callback, xg_make_tool_item):
14942 Use EMACS_INTPTR to hold an integer
14943 that will be cast to void *; this can avoid a GCC warning
14944 if EMACS_INT is not the same width as void *.
14945 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14946 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14947 (current_message_1, set_message_1):
14948 Use a local to convert to proper width without a cast.
14949 * xmenu.c (dialog_selection_callback): Likewise.
14950
14951 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14952 Also, don't assume VALBITS / RAND_BITS is less than 5,
14953 and don't rely on undefined behavior when shifting a 1 left into
14954 the sign bit.
14955 * lisp.h (get_random): Change signature to match.
14956
14957 * lread.c (hash_string): Use size_t, not int, for hash computation.
14958 Normally we prefer signed values; but hashing is special, because
14959 it's better to use unsigned division on hash table sizes so that
14960 the remainder is nonnegative. Also, size_t is the natural width
14961 for hashing into memory. The previous code used 'int', which doesn't
14962 retain enough info to hash well into very large tables.
14963 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14964
14965 * dbusbind.c: Don't possibly lose pointer info when converting.
14966 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14967 Use XPNTR rather than XHASH, so that the high-order bits of
14968 the pointer aren't lost when converting through void *.
14969
14970 * eval.c (Fautoload): Don't double-shift a pointer.
14971
14972 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14973
14974 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14975
14976 * gnutls.c (DEF_GNUTLS_FN):
14977 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14978
14979 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14980
14981 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14982 marker. (Bug#8610)
14983
14984 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14985
14986 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14987 New version that can reserve upto 2GB of heap space.
14988
14989 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14990
14991 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14992
14993 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14994
14995 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14996 `gnutls_certificate_set_x509_key_file'.
14997
14998 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14999
15000 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15001 Update dependencies.
15002
15003 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15004
15005 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15006 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15007 Remove unused parameter `fildes'.
15008 * process.c (read_process_output, send_process): Don't pass it.
15009
15010 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15011
15012 Fix previous change: the library cache is defined in w32.c.
15013 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15014 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15015
15016 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15017
15018 Implement dynamic loading of GnuTLS on Windows.
15019
15020 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15021 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15022 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15023 Declare.
15024
15025 * gnutls.c (Qgnutls_dll): Define.
15026 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15027 (gnutls_*): Declare function pointers.
15028 (init_gnutls_functions): New function to initialize function pointers.
15029 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15030 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15031 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15032 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15033 (emacs_gnutls_write, emacs_gnutls_read)
15034 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15035 (Fgnutls_available_p): New function.
15036 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15037 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15038 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15039
15040 * image.c: Include w32.h.
15041 (Vimage_type_cache): Delete.
15042 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15043 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15044 (w32_delayed_load): Move to w32.c.
15045
15046 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15047
15048 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15049 (w32_delayed_load): Move from image.c. When loading a library, record
15050 its filename in the :loaded-from property of the library id.
15051 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15052 Initialize and staticpro them.
15053 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15054
15055 * process.c: Include lisp.h before w32.h, not after.
15056 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15057 instead of gnutls_record_check_pending.
15058
15059 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15060
15061 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15062
15063 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15064 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15065 as passed in.
15066
15067 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15068
15069 * xterm.c (x_set_frame_alpha): Do not set property on anything
15070 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15071
15072 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15073
15074 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15075
15076 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15077
15078 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15079 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15080 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15081 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15082 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15083 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15084 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15085 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15086 (Qgnutls_bootprop_callbacks_verify): Make static.
15087
15088 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15089
15090 * callproc.c: Indentation fixup.
15091
15092 * sysdep.c (wait_for_termination_1): Make static.
15093 (wait_for_termination, interruptible_wait_for_termination):
15094 Move after wait_for_termination_1.
15095
15096 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15097
15098 * sysdep.c (interruptible_wait_for_termination): New function
15099 which is like wait_for_termination, but allows keyboard
15100 interruptions.
15101
15102 * callproc.c (Fcall_process): Add (:file "file") as an option for
15103 the STDOUT buffer.
15104 (Fcall_process_region): Ditto.
15105
15106 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15107
15108 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15109 rather than `XVECTOR (FOO)->size'.
15110
15111 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15112 inttypes.h, as a gnulib replacement is used if it not available in
15113 system headers.
15114
15115 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15116
15117 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15118 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15119 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15120
15121 * coding.c (coding_alloc_by_realloc): Error out if destination
15122 will grow beyond MOST_POSITIVE_FIXNUM.
15123 (decode_coding_emacs_mule): Abort if there isn't enough place in
15124 charbuf for the composition carryover bytes. Reserve an extra
15125 space for up to 2 characters produced in a loop.
15126 (decode_coding_iso_2022): Abort if there isn't enough place in
15127 charbuf for the composition carryover bytes.
15128
15129 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15130
15131 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15132 aborting when %lld or %lll format is passed.
15133 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15134 %llo or %llx format is passed. (Bug#8545)
15135
15136 * window.c (window_scroll_line_based): Use a marker instead of
15137 simple variables to record original value of point. (Bug#7952)
15138
15139 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15140 produced by %s or %c overflows available buffer space. (Bug#8545)
15141
15142 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15143
15144 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15145 (SIZE_MAX): Move defn after all includes, as they might #define it.
15146
15147 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15148
15149 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15150
15151 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15152
15153 * keyboard.c (Qdelayed_warnings_hook): Define.
15154 (command_loop_1): Run `delayed-warnings-hook'
15155 if Vdelayed_warnings_list is non-nil.
15156 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15157 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15158
15159 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15160
15161 * doprnt.c (doprnt): Don't return value smaller than the buffer
15162 size if the message was truncated. (Bug#8545).
15163
15164 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15165
15166 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15167 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15168
15169 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15170
15171 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15172
15173 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15174
15175 * makefile.w32-in: Update dependencies.
15176
15177 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15178
15179 Improve `doprnt' and its usage. (Bug#8545)
15180 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15181 `format_end'. Remove support for %l as a conversion specifier.
15182 Don't use xrealloc. Improve diagnostics when the %l size modifier
15183 is used. Update the commentary.
15184
15185 * eval.c (verror): Simplify calculation of size_t.
15186
15187 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15188 messages.
15189
15190 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15191
15192 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15193 change.
15194
15195 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15196
15197 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15198 This makes this file independent of the recent pseudovector change.
15199
15200 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15201
15202 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15203
15204 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15205 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15206 Remove unused local.
15207 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15208
15209 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15210 GCC 4.6.0 optimizes based on type-based alias analysis.
15211 For example, if b is of type struct buffer * and v of type struct
15212 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15213 != &v->size, and therefore "v->size = 1; b->size = 2; return
15214 v->size;" must therefore return 1. This assumption is incorrect
15215 for Emacs, since it type-puns struct Lisp_Vector * with many other
15216 types. To fix this problem, this patch adds a new type struct
15217 vectorlike_header that documents the constraints on layout of vectors
15218 and pseudovectors, and helps optimizing compilers not get fooled
15219 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15220 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15221 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15222 the size member.
15223 (XSETPVECTYPE): Rewrite in terms of new macro.
15224 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15225 This is a bit clearer, and further avoids the possibility of
15226 undesirable aliasing.
15227 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15228 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15229 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15230 since Lisp_Subr is a special case (no "next" field).
15231 (ASIZE): Now uses header.size rather than size.
15232 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15233 to avoid the hassle of writing XVECTOR (foo)->header.size.
15234 (struct vectorlike_header): New type.
15235 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15236 object, to help avoid aliasing.
15237 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15238 (SUBRP): Likewise, since Lisp_Subr is a special case.
15239 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15240 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15241 (struct Lisp_Hash_Table): Combine first two members into a single
15242 struct vectorlike_header member. All uses of "size" and "next" members
15243 changed to be "header.size" and "header.next".
15244 * buffer.h (struct buffer): Likewise.
15245 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15246 * frame.h (struct frame): Likewise.
15247 * process.h (struct Lisp_Process): Likewise.
15248 * termhooks.h (struct terminal): Likewise.
15249 * window.c (struct save_window_data, struct saved_window): Likewise.
15250 * window.h (struct window): Likewise.
15251 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15252 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15253 * buffer.c (init_buffer_once): Likewise.
15254 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15255 special case.
15256 * process.c (Fformat_network_address): Use local var for size,
15257 for brevity.
15258
15259 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15260
15261 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15262 * data.c (atof): Remove decl; no longer used or needed.
15263 (digit_to_number): Move to lread.c.
15264 (Fstring_to_number): Use new string_to_number function, to be
15265 consistent with how the Lisp reader treats infinities and NaNs.
15266 Do not assume that floating-point numbers represent EMACS_INT
15267 without losing information; this is not true on most 64-bit hosts.
15268 Avoid double-rounding errors, by insisting on integers when
15269 parsing non-base-10 numbers, as the documentation specifies.
15270 * lisp.h (string_to_number): New decl, replacing ...
15271 (isfloat_string): Remove.
15272 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15273 (read1): Do not accept +. and -. as integers; this
15274 appears to have been a coding error. Similarly, do not accept
15275 strings like +-1e0 as floating point numbers. Do not report
15276 overflow for integer overflows unless the base is not 10 which
15277 means we have no simple and reliable way to continue.
15278 Break out the floating-point parsing into a new
15279 function string_to_number, so that Fstring_to_number parses
15280 floating point numbers consistently with the Lisp reader.
15281 (digit_to_number): Move here from data.c. Make it static inline.
15282 (E_CHAR, EXP_INT): Remove, replacing with ...
15283 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15284 (string_to_number): New function, replacing isfloat_string.
15285 This function checks for valid syntax and produces the resulting
15286 Lisp float number too. Rework it so that string-to-number
15287 no longer mishandles examples like "1.0e+". Use strtoumax,
15288 so that overflow for non-base-10 numbers is reported only when
15289 there's no portable and simple way to convert to floating point.
15290
15291 * textprop.c (set_text_properties_1): Rewrite for clarity,
15292 and to avoid GCC warning about integer overflow.
15293
15294 * intervals.h (struct interval): Use EMACS_INT for members
15295 where EMACS_UINT might cause problems. See
15296 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15297 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15298 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15299 All uses changed.
15300 (offset_intervals): Tell GCC not to worry about length overflow
15301 when negating a negative length.
15302
15303 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15304 (overrun_check_free): Likewise.
15305
15306 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15307 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15308 word size.
15309
15310 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15311 (gnutls_make_error): Rename local to avoid shadowing.
15312 (gnutls_emacs_global_deinit): ifdef out; not used.
15313 (Fgnutls_boot): Use const for pointer to readonly storage.
15314 Comment out unused local. Fix pointer signedness problems.
15315
15316 * lread.c (openp): Don't stuff size_t into an 'int'.
15317 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15318 about possible signed overflow.
15319
15320 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15321 (GDK_KEY_g): Don't define if already defined.
15322 (xg_prepare_tooltip): Avoid pointer signedness problem.
15323 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15324
15325 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15326 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15327
15328 * xfns.c (Fx_window_property): Simplify a bit,
15329 to make a bit faster and to avoid GCC 4.6.0 warning.
15330 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15331
15332 * fns.c (internal_equal): Don't assume size_t fits in int.
15333
15334 * alloc.c (compact_small_strings): Tighten assertion a little.
15335
15336 Replace pEd with more-general pI, and fix some printf arg casts.
15337 * lisp.h (pI): New macro, generalizing old pEd macro to other
15338 conversion specifiers. For example, use "...%"pI"d..." rather
15339 than "...%"pEd"...".
15340 (pEd): Remove. All uses replaced with similar uses of pI.
15341 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15342 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15343 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15344 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15345 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15346 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15347 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15348 64-bit hosts.
15349 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15350 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15351 * print.c (safe_debug_print, print_object): Likewise.
15352 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15353 to int.
15354 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15355 avoiding the 0 flag, which is not portable.
15356 * process.c (Fmake_network_process): Use pI to avoid cast.
15357 * region-cache.c (pp_cache): Likewise.
15358 * xdisp.c (decode_mode_spec): Likewise.
15359 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15360 behavior on 64-bit hosts with printf arg.
15361 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15362 (x_stop_queuing_selection_requests): Likewise.
15363 (x_get_window_property): Don't truncate byte count to an 'int'
15364 when tracing.
15365
15366 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15367 here, since it parses constructs like leading '-' and spaces,
15368 which are not wanted; and it overflows with large numbers.
15369 Instead, simply match F[0-9]+, which is what is wanted anyway.
15370
15371 * alloc.c: Remove unportable assumptions about struct layout.
15372 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15373 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15374 (allocate_vectorlike, make_pure_vector): Use the new macros,
15375 plus offsetof, to remove unportable assumptions about struct layout.
15376 These assumptions hold on all porting targets that I know of, but
15377 they are not guaranteed, they're easy to remove, and removing them
15378 makes further changes easier.
15379
15380 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15381 This doesn't fix a bug but makes the code clearer.
15382 (string_overrun_cookie): Now const. Use initializers that
15383 don't formally overflow signed char, to avoid warnings.
15384 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15385 can cause Emacs to crash when string overrun checking is enabled.
15386 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15387 multiple of sizeof (EMACS_INT); it need not be, if
15388 alignof(EMACS_INT) < sizeof (EMACS_INT).
15389 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15390
15391 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15392
15393 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15394
15395 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15396
15397 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15398 supposed to be handshaking. (Bug#8556)
15399 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15400
15401 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15402
15403 * lisp.h (Qdebug): List symbol.
15404 * eval.c (Qdebug): Restore global linkage.
15405 * keyboard.c (debug-on-event): New variable.
15406 (handle_user_signal): Break into debugger when debug-on-event
15407 matches the current signal symbol.
15408
15409 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15410
15411 * alloc.c (check_sblock, check_string_bytes)
15412 (check_string_free_list): Convert to standard C.
15413
15414 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15415
15416 * w32.c (emacs_gnutls_push): Fix typo.
15417
15418 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15419
15420 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15421 "cast to pointer from integer of different size".
15422
15423 Improve doprnt and its use in verror. (Bug#8545)
15424 * doprnt.c (doprnt): Document the set of format control sequences
15425 supported by the function. Use SAFE_ALLOCA instead of always
15426 using `alloca'.
15427
15428 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15429 is one byte too soon. Don't use xrealloc; instead xfree and
15430 xmalloc anew.
15431
15432 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15433
15434 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15435 callbacks stage.
15436
15437 * gnutls.c: Renamed global_initialized to
15438 gnutls_global_initialized. Added internals for the
15439 :verify-hostname-error, :verify-error, and :verify-flags
15440 parameters of `gnutls-boot' and documented those parameters in the
15441 docstring. Start callback support.
15442 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15443 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15444 on error. Return error code.
15445 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15446 (emacs_gnutls_read): Likewise.
15447 (Fgnutls_boot): Return handshake error code.
15448 (emacs_gnutls_handle_error): New function.
15449 (wsaerror_to_errno): Likewise.
15450
15451 * w32.h (emacs_gnutls_pull): Add prototype.
15452 (emacs_gnutls_push): Likewise.
15453
15454 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15455 (emacs_gnutls_push): Likewise.
15456
15457 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15458
15459 * process.c (wait_reading_process_output): Check if GnuTLS
15460 buffered some data internally if no FDs are set for TLS
15461 connections.
15462
15463 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15464 (LIBS): Link to USER_LIBS.
15465 ($(BLD)/gnutls.$(0)): New target.
15466
15467 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15468
15469 * xdisp.c (handle_single_display_spec): Rename the
15470 display_replaced_before_p argument into display_replaced_p, to
15471 make it consistent with the commentary. Fix typos in the
15472 commentary.
15473
15474 * textprop.c (syms_of_textprop): Remove dead code.
15475 (copy_text_properties): Delete obsolete commentary about an
15476 interface that was deleted long ago. Fix typos in the description
15477 of arguments.
15478
15479 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15480 to changes in oldXMenu/XMenu.h from 2011-04-16.
15481 <menu_help_message, prev_menu_help_message>: Constify.
15482 (IT_menu_make_room): menu->help_text is now `const char **';
15483 adjust.
15484
15485 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15486 to changes in oldXMenu/XMenu.h from 2011-04-16.
15487 (struct XMenu): Declare `help_text' `const char **'.
15488
15489 * xfaces.c <Qunspecified>: Make extern again.
15490
15491 * syntax.c: Include sys/types.h before including regex.h, as
15492 required by POSIX.
15493
15494 * doc.c (get_doc_string): Improve the format passed to `error'.
15495
15496 * doprnt.c (doprnt): Improve commentary.
15497
15498 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15499
15500 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15501 them with etags.
15502
15503 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15504 changes in globals.h immediately force recompilation.
15505 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15506 $(CURDIR)/s/ms-w32.h.
15507 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15508
15509 * character.c (Fchar_direction): Function deleted.
15510 (syms_of_character): Don't defsubr it.
15511 <char-direction-table>: Deleted.
15512
15513 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15514
15515 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15516 * doprnt.c: Include limits.h.
15517 (SIZE_MAX): New macro.
15518 (doprnt): Return a size_t value. 2nd arg is now size_t.
15519 Many local variables are now size_t instead of int or unsigned.
15520 Improve overflow protection. Support `l' modifier for integer
15521 conversions. Support %l conversion. Don't assume an EMACS_INT
15522 argument for integer conversions and for %c.
15523
15524 * lisp.h (doprnt): Restore prototype.
15525
15526 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15527 $(SRC)/character.h.
15528
15529 * Makefile.in (base_obj): Add back doprnt.o.
15530
15531 * deps.mk (doprnt.o): Add back prerequisites.
15532 (callint.o): Depend on character.h.
15533
15534 * eval.c (internal_lisp_condition_case): Include the handler
15535 representation in the error message.
15536 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15537 when breaking from the loop.
15538
15539 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15540
15541 * callint.c (Fcall_interactively): When displaying error message
15542 about invalid control letter, pass the character's codepoint, not
15543 a pointer to its multibyte form. Improve display of the character
15544 in octal and display also its hex code.
15545
15546 * character.c (char_string): Use %x to display the (unsigned)
15547 codepoint of an invalid character, to avoid displaying a bogus
15548 negative value.
15549
15550 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15551 `error', not SYMBOL_NAME itself.
15552
15553 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15554 character arguments to `error'.
15555
15556 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15557 to `error' in error message about FINAL_CHAR argument. Make sure
15558 FINAL_CHAR is a character, and use %c when it is passed as
15559 argument to `error'.
15560
15561 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15562
15563 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15564
15565 * w32.c: Include <time.h>.
15566 (sys_localtime): New function.
15567
15568 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15569
15570 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15571
15572 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15573
15574 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15575
15576 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15577 zombies (Bug#8467).
15578
15579 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15580
15581 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15582 gl_state.e_property when gl_state.object is Qt.
15583
15584 * insdel.c (make_gap_larger): Remove limitation of buffer size
15585 to <= INT_MAX.
15586
15587 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15588
15589 * xdisp.c (lookup_glyphless_char_display)
15590 (produce_glyphless_glyph): Handle cons cell entry in
15591 glyphless-char-display.
15592 (Vglyphless_char_display): Document it.
15593
15594 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15595 glyphless-char-display.
15596
15597 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15598
15599 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15600
15601 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15602
15603 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15604 definition for no-X builds.
15605
15606 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15607
15608 Static checks with GCC 4.6.0 and non-default toolkits.
15609
15610 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15611
15612 * process.c (keyboard_bit_set): Define only if SIGIO.
15613 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15614 (send_process): Repair possible setjmp clobbering.
15615
15616 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15617
15618 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15619
15620 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15621
15622 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15623 Define only if needed.
15624
15625 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15626 by pacifying GCC about it. Maybe it's time to retire it?
15627 * xfaces.c (USG, __TIMEVAL__): Likewise.
15628
15629 * dispextern.h (struct redisplay_interface): Rename param
15630 to avoid shadowing.
15631 * termhooks.h (struct terminal): Likewise.
15632 * xterm.c (xembed_send_message): Likewise.
15633
15634 * insdel.c (make_gap_smaller): Define only if
15635 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15636
15637 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15638 it.
15639
15640 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15641 so that we aren't warned about unused symbols.
15642
15643 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15644
15645 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15646
15647 * xfns.c (x_real_positions): Mark locals as initialized.
15648
15649 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15650
15651 * xterm.c: Fix problems found by static analysis with other toolkits.
15652 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15653 (x_dispatch_event): Declare static if USE_GTK, and
15654 define if USE_GTK || USE_X_TOOLKIT.
15655 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15656 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15657 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15658 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15659
15660 * xmenu.c (menu_help_callback): Pointer type fixes.
15661 Use const pointers when pointing at readonly data. Avoid pointer
15662 signedness clashes.
15663 (FALSE): Remove unused macro.
15664 (update_frame_menubar): Remove unused decl.
15665
15666 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15667
15668 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15669 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15670 (single_menu_item): Rename local to avoid shadowing.
15671
15672 * keyboard.c (make_lispy_event): Remove unused local var.
15673
15674 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15675 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15676
15677 * bitmaps: Change bitmaps from unsigned char back to the X11
15678 compatible char. Avoid the old compiler warnings about
15679 out-of-range initializers by using, for example, '\xab' rather
15680 than 0xab.
15681
15682 * xgselect.c (xgselect_initialize): Check vs interface
15683 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15684
15685 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15686
15687 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15688 to read-only memory.
15689
15690 * fns.c (vector): Remove; this old hack is no longer needed.
15691
15692 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15693 Remove unused var.
15694 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15695
15696 * xrdb.c (x_load_resources): Omit unused local.
15697
15698 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15699 (x_window): Rename locals to avoid shadowing.
15700 (USG): Use the kludged USG macro, to pacify gcc.
15701
15702 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15703 (x_term_init): Remove local to avoid shadowing.
15704
15705 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15706
15707 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15708 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15709
15710 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15711
15712 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15713
15714 Fix regex.c, syntax.c and friends for buffers > 2GB.
15715 * syntax.h (struct gl_state_s): Declare character position members
15716 EMACS_INT.
15717
15718 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15719
15720 * textprop.c (verify_interval_modification, interval_of):
15721 Declare arguments EMACS_INT.
15722
15723 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15724 EMACS_INT.
15725
15726 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15727
15728 * indent.c (Fvertical_motion): Local variable it_start is now
15729 EMACS_INT.
15730
15731 * regex.c (re_match, re_match_2, re_match_2_internal)
15732 (bcmp_translate, regcomp, regexec, print_double_string)
15733 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15734 (re_compile_pattern, re_exec): Declare arguments and local
15735 variables `size_t' and `ssize_t' and return values `regoff_t', as
15736 appropriate.
15737 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15738 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15739 <compile_stack_type>: `size' and `avail' are now `size_t'.
15740
15741 * regex.h <regoff_t>: Use ssize_t, not int.
15742 (re_search, re_search_2, re_match, re_match_2): Arguments that
15743 specify buffer/string position and length are now ssize_t and
15744 size_t. Return type is regoff_t.
15745
15746 2011-04-16 Ben Key <bkey76@gmail.com>
15747
15748 * nsfont.m: Fixed bugs in ns_get_family and
15749 ns_descriptor_to_entity that were caused by using free to
15750 deallocate memory blocks that were allocated by xmalloc (via
15751 xstrdup). This caused Emacs to crash when compiled with
15752 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15753 --enable-checking=xmallocoverrun). xfree is now used to
15754 deallocate these memory blocks.
15755
15756 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15757
15758 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15759
15760 emacs_write: Accept and return EMACS_INT for sizes.
15761 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15762 et seq.
15763 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15764 Accept and return EMACS_INT.
15765 (emacs_gnutls_write): Return the number of bytes written on
15766 partial writes.
15767 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15768 (emacs_read, emacs_write): Remove check for negative size, as the
15769 Emacs source code has been audited now.
15770 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15771 (emacs_read, emacs_write): Use it.
15772 * process.c (send_process): Adjust to the new signatures of
15773 emacs_write and emacs_gnutls_write. Do not attempt to store
15774 a byte offset into an 'int'; it might overflow.
15775 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15776
15777 * sound.c: Don't assume sizes fit in 'int'.
15778 (struct sound_device.period_size, alsa_period_size):
15779 Return EMACS_INT, not int.
15780 (struct sound_device.write, vox_write, alsa_write):
15781 Accept EMACS_INT, not int.
15782 (wav_play, au_play): Use EMACS_INT to store sizes and to
15783 record read return values.
15784
15785 2011-04-15 Ben Key <bkey76@gmail.com>
15786
15787 * keyboard.c (Qundefined): Don't declare static since it is used
15788 in nsfns.m.
15789 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15790 static since they are used in nsfont.m.
15791
15792 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15793
15794 * process.c (Qprocessp): Don't declare static.
15795 * lisp.h (Qprocessp): Declare again.
15796
15797 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15798
15799 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15800
15801 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15802
15803 Improve C-level modularity by making more things 'static'.
15804
15805 Don't publish debugger-only interfaces to other modules.
15806 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15807 (verify_bytepos, count_markers): Move decls to the only modules
15808 that need them.
15809 * region-cache.h (pp_cache): Likewise.
15810 * window.h (check_all_windows): Likewise.
15811 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15812
15813 * sysdep.c (croak): Now static, if
15814 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15815 * syssignal.h (croak): Declare only if not static.
15816
15817 * alloc.c (refill_memory_reserve): Now static if
15818 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15819 * lisp.h (refill_memory_reserve): Declare only if not static.
15820
15821 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15822 Define only if USE_LUCID.
15823
15824 * xrdb.c (x_customization_string, x_rm_string): Now static.
15825
15826 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15827 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15828
15829 * xdisp.c (draw_row_with_mouse_face): Now static.
15830 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15831
15832 * window.h (check_all_windows): Mark externally visible.
15833
15834 * window.c (window_deletion_count): Now static.
15835
15836 * undo.c: Make symbols static if they're not exported.
15837 (last_undo_buffer, last_boundary_position, pending_boundary):
15838 Now static.
15839
15840 * textprop.c (interval_insert_behind_hooks): Now static.
15841 (interval_insert_in_front_hooks): Likewise.
15842
15843 * term.c: Make symbols static if they're not exported.
15844 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15845 (max_frame_lines, tty_set_terminal_modes):
15846 (tty_reset_terminal_modes, tty_turn_off_highlight):
15847 (get_tty_terminal): Now static.
15848 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15849 * termhooks.h (term_mouse_moveto): Do not declare if
15850 HAVE_WINDOW_SYSTEM.
15851 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15852 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15853
15854 * sysdep.c: Make symbols static if they're not exported.
15855 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15856 Now static.
15857 (sigprocmask_set, full_mask): Remove; unused.
15858 (wait_debugging): Mark as visible.
15859 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15860 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15861
15862 * syntax.c (syntax_temp): Define only if !__GNUC__.
15863
15864 * sound.c (current_sound_device, current_sound): Now static.
15865
15866 * search.c (searchbufs, searchbuf_head): Now static.
15867
15868 * scroll.c (scroll_cost): Remove; unused.
15869 * dispextern.h (scroll_cost): Remove decl.
15870
15871 * region-cache.h (pp_cache): Mark as externally visible.
15872
15873 * process.c: Make symbols static if they're not exported.
15874 (process_tick, update_tick, create_process, chan_process):
15875 (Vprocess_alist, proc_buffered_char, datagram_access):
15876 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15877 (deactivate_process): Mark defn as static, as well as decl.
15878 * lisp.h (create_process): Remove decl.
15879 * process.h (chan_process, Vprocess_alist): Remove decls.
15880
15881 * print.c: Make symbols static if they're not exported.
15882 (print_depth, new_backquote_output, being_printed, print_buffer):
15883 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15884 (print_interval, print_number_index, initial_stderr_stream):
15885 Now static.
15886 * lisp.h (Fprinc): Remove decl.
15887 (debug_output_compilation_hack): Mark as externally visible.
15888
15889 * sysdep.c (croak): Move decl from here to syssignal.h.
15890 * syssignal.h (croak): Put it here, so the API can be checked when
15891 'croak' is called from dissociate_if_controlling_tty.
15892
15893 * minibuf.c: Make symbols static if they're not exported.
15894 (minibuf_save_list, choose_minibuf_frame): Now static.
15895 * lisp.h (choose_minibuf_frame): Remove decl.
15896
15897 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15898
15899 * lread.c: Make symbols static if they're not exported.
15900 (read_objects, initial_obarray, oblookup_last_bucket_number):
15901 Now static.
15902 (make_symbol): Remove; unused.
15903 * lisp.h (initial_obarray, make_symbol): Remove decls.
15904
15905 * keyboard.c: Make symbols static if they're not exported.
15906 (single_kboard, recent_keys_index, total_keys, recent_keys):
15907 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15908 (this_single_command_key_start, echoing, last_auto_save):
15909 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15910 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15911 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15912 (Vlispy_mouse_stem, double_click_count):
15913 Now static.
15914 (force_auto_save_soon): Define only if SIGDANGER.
15915 (ignore_mouse_drag_p): Now static if
15916 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15917 (print_help): Remove; unused.
15918 (stop_character, last_timer_event): Mark as externally visible.
15919 * keyboard.h (ignore_mouse_drag_p): Declare only if
15920 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15921 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15922 * lisp.h (echoing): Remove decl.
15923 (force_auto_save_soon): Declare only if SIGDANGER.
15924 * xdisp.c (redisplay_window): Simplify code, to make it more
15925 obvious that ignore_mouse_drag_p is not accessed if !defined
15926 USE_GTK && !defined HAVE_NS.
15927
15928 * intervals.c: Make symbols static if they're not exported.
15929 (merge_properties_sticky, merge_interval_right, delete_interval):
15930 Now static.
15931 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15932
15933 * insdel.c: Make symbols static if they're not exported.
15934 However, leave prepare_to_modify_buffer alone. It's never
15935 called from outside this function, but that appears to be a bug.
15936 (combine_after_change_list, combine_after_change_buffer):
15937 (adjust_after_replace, signal_before_change): Now static.
15938 (adjust_after_replace_noundo): Remove; unused.
15939 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15940 (signal_before_change): Remove decls.
15941
15942 * indent.c (val_compute_motion, val_vmotion): Now static.
15943
15944 * image.c: Make symbols static if they're not exported.
15945 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15946 if USE_GTK.
15947 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15948 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15949
15950 * fringe.c (standard_bitmaps): Now static.
15951 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15952
15953 * frame.c: Make symbols static if they're not exported.
15954 (x_report_frame_params, make_terminal_frame): Now static.
15955 (get_frame_param): Now static, unless HAVE_NS.
15956 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15957 (x_get_resource_string): Remove; not used.
15958 * frame.h (make_terminal_frame, x_report_frame_params):
15959 (x_get_resource_string); Remove decls.
15960 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15961 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15962
15963 * font.c, fontset.c: Make symbols static if they're not exported.
15964 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15965 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15966 * font.c (font_close_object): Now static.
15967 * font.h (font_close_object): Remove.
15968 * fontset.c (FONTSET_OBJLIST): Remove.
15969 (free_realized_fontset) #if-0 the body, which does nothing.
15970 (face_suitable_for_char_p): #if-0, as it's never called.
15971 * fontset.h (face_suitable_for_char_p): Remove decl.
15972 * xfaces.c (face_at_string_position):
15973 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15974 since 0 is always ASCII.
15975
15976 * fns.c (weak_hash_tables): Now static.
15977
15978 * fileio.c: Make symbols static if they're not exported.
15979 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15980 (Vwrite_region_annotation_buffers): Now static.
15981
15982 * eval.c: Make symbols static if they're not exported.
15983 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15984 * lisp.h (backtrace_list): Remove decl.
15985
15986 * emacs.c: Make symbols static if they're not exported.
15987 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15988 (fatal_error_code, fatal_error_signal_hook, standard_args):
15989 Now static.
15990 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15991 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15992 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15993 * lisp.h (fatal_error_signal_hook): Remove decl.
15994 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15995
15996 * editfns.c: Move a (normally-unused) function to its only use.
15997 * editfns.c, lisp.h (get_operating_system_release): Remove.
15998 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15999 worth the hassle of breaking this out.
16000
16001 * xterm.c: Make symbols static if they're not exported.
16002 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16003 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16004 (x_destroy_window, x_delete_display):
16005 Now static.
16006 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16007 (x_mouse_leave): Remove; unused.
16008 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16009 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16010 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16011 Remove decls.
16012 (x_mouse_leave): Declare only if WINDOWSNT.
16013 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16014 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16015 USE_X_TOOLKIT.
16016
16017 * ftxfont.c: Make symbols static if they're not exported.
16018 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16019 HAVE_FREETYPE.
16020 * font.h (ftxfont_driver): Likewise.
16021
16022 * xfns.c: Make symbols static if they're not exported.
16023 (x_last_font_name, x_display_info_for_name):
16024 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16025 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16026 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16027 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16028 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16029 (last_show_tip_args): Now static.
16030 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16031 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16032 (x_screen_planes): Remove; unused.
16033 * dispextern.h (x_screen_planes): Remove decl.
16034
16035 * dispnew.c: Make symbols static if they're not exported.
16036 * dispextern.h (redraw_garbaged_frames, scrolling):
16037 (increment_row_positions): Remove.
16038 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16039 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16040 Now static.
16041 (redraw_garbaged_frames): Remove; unused.
16042
16043 * xfaces.c: Make symbols static if they're not exported.
16044 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16045 Remove decls.
16046 * xterm.h (defined_color): Remove decls.
16047 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16048 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16049 (menu_face_changed_default, defined_color, free_realized_face):
16050 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16051 (ascii_face_of_lisp_face): Remove; unused.
16052
16053 * xdisp.c: Make symbols static if they're not exported.
16054 * dispextern.h (scratch_glyph_row, window_box_edges):
16055 (glyph_to_pixel_coords, set_cursor_from_row):
16056 (get_next_display_element, set_iterator_to_next):
16057 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16058 (show_mouse_face): Remove decls
16059 * frame.h (message_buf_print): Likewise.
16060 * lisp.h (pop_message, set_message, check_point_in_composition):
16061 Likewise.
16062 * xterm.h (set_vertical_scroll_bar): Likewise.
16063 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16064 (message_buf_print, scratch_glyph_row, displayed_buffer):
16065 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16066 (get_next_display_element, show_mouse_face, window_box_edges):
16067 (frame_to_window_pixel_xy, check_point_in_composition):
16068 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16069 (glyph_to_pixel_coords): Remove; unused.
16070
16071 * dired.c (file_name_completion): Now static.
16072
16073 * dbusbind.c (xd_in_read_queued_messages): Now static.
16074
16075 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16076 * data.c (circular_list_error): Remove.
16077
16078 * commands.h (last_point_position, last_point_position_buffer):
16079 (last_point_position_window): Remove decls.
16080 * keyboard.c: Make these variables static.
16081
16082 * coding.h (coding, code_convert_region, encode_coding_gap):
16083 Remove decls.
16084 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16085 (iso_code_class, detect_coding, code_convert_region): Now static.
16086 (encode_coding_gap): Remove; unused.
16087
16088 * chartab.c (chartab_chars, chartab_bits): Now static.
16089
16090 * charset.h (charset_iso_8859_1): Remove decl.
16091 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16092 Now static.
16093
16094 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16095 * ccl.c (Vccl_program_table): Now static.
16096 (check_ccl_update): Remove; unused.
16097
16098 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16099 * category.h: ... from here.
16100 * category.c (check_category_table, set_category_set): Now static.
16101
16102 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16103 * lisp.h: Remove these decls.
16104
16105 * buffer.c (buffer_count): Remove unused var.
16106
16107 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16108 so that it's not optimized away.
16109 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16110 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16111 exported only to the debugger.
16112
16113 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16114 * atimer.h (run_all_atimers): Remove; not exported.
16115
16116 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16117 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16118 was inaccessible from Lisp.
16119 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16120 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16121
16122 alloc.c: Import and export fewer symbols, and remove unused items.
16123 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16124 is defined.
16125 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16126 it's not optimized away by whole-program optimization.
16127 (message_enable_multibyte, free_misc): Remove.
16128 (catchlist, handlerlist, mark_backtrace):
16129 Declare only if BYTE_MARK_STACK.
16130 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16131 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16132 (message_enable_multibyte): Remove decl.
16133 (free_misc, interval_free_list, float_block, float_block_index):
16134 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16135 (cons_free_list, last_marked_index):
16136 Now static.
16137 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16138 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16139 (mark_backtrace): Define only if BYTE_MARK_STACK.
16140 * xdisp.c (message_enable_multibyte): Now static.
16141
16142 Declare Lisp_Object Q* variables to be 'static' if not exported.
16143 This makes it easier for human readers (and static analyzers)
16144 to see whether these variables are used from other modules.
16145 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16146 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16147 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16148 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16149 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16150 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16151 * xmenu.c, xselect.c:
16152 Declare Q* vars static if they are not used in other modules.
16153 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16154 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16155 Remove decls of unexported vars.
16156 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16157
16158 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16159
16160 Make Emacs functions such as Fatom 'static' by default.
16161 This makes it easier for human readers (and static analyzers)
16162 to see whether these functions can be called from other modules.
16163 DEFUN now defines a static function. To make the function external
16164 so that it can be used in other C modules, use the new macro DEFUE.
16165 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16166 (Finit_image_library):
16167 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16168 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16169 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16170 Remove decls, since these functions are now static.
16171 (Funintern, Fget_internal_run_time): New decls, since these functions
16172 were already external.
16173
16174 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16175 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16176 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16177 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16178 * keyboard.c, keymap.c, lread.c:
16179 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16180 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16181 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16182 Mark functions with DEFUE instead of DEFUN,
16183 if they are used in other modules.
16184 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16185 decls for now-static functions.
16186 * buffer.h (Fdelete_overlay): Remove decl.
16187 * callproc.c (Fgetenv_internal): Mark as internal.
16188 * composite.c (Fremove_list_of_text_properties): Remove decl.
16189 (Fcomposition_get_gstring): New forward static decl.
16190 * composite.h (Fcomposite_get_gstring): Remove decl.
16191 * dired.c (Ffile_attributes): New forward static decl.
16192 * doc.c (Fdocumntation_property): New forward static decl.
16193 * eval.c (Ffetch_bytecode): New forward static decl.
16194 (Funintern): Remove extern decl; now in .h file where it belongs.
16195 * fileio.c (Fmake_symbolic_link): New forward static decl.
16196 * image.c (Finit_image_library): New forward static decl.
16197 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16198 * intervals.h (Fprevious_property_change):
16199 (Fremove_list_of_text_properties): Remove decls.
16200 * keyboard.c (Fthis_command_keys): Remove decl.
16201 (Fcommand_execute): New forward static decl.
16202 * keymap.c (Flookup_key): New forward static decl.
16203 (Fcopy_keymap): Now static.
16204 * keymap.h (Flookup_key): Remove decl.
16205 * process.c (Fget_process): New forward static decl.
16206 (Fprocess_datagram_address): Mark as internal.
16207 * syntax.c (Fsyntax_table_p): New forward static decl.
16208 (skip_chars): Remove duplicate decl.
16209 * textprop.c (Fprevious_property_change): New forward static decl.
16210 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16211 Now internal.
16212 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16213 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16214
16215 * editfns.c (Fformat): Remove unreachable code.
16216
16217 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16218
16219 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16220 change. (Bug#8496)
16221
16222 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16223
16224 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16225 when at ZV. (Bug#8487)
16226
16227 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16228
16229 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16230 (Bug#8437)
16231 * keyboard.c (parse_tool_bar_item): Likewise.
16232 * sound.c (sound_cleanup, alsa_close): Likewise.
16233 * termcap.c (tgetent): Likewise.
16234 * xfns.c (x_default_font_parameter): Likewise.
16235 * xsettings.c (read_and_apply_settings): Likewise.
16236
16237 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16238 (overrun_check_free): Protoize.
16239
16240 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16241
16242 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16243 since callers should never pass a negative size.
16244 Change the signature to match that of plain 'read' and 'write'; see
16245 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16246 * lisp.h: Update prototypes of emacs_write and emacs_read.
16247
16248 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16249
16250 * xdisp.c (redisplay_window): Don't try to determine the character
16251 position of the scroll margin if the window start point w->startp
16252 is outside the buffer's accessible region. (Bug#8468)
16253
16254 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16255
16256 Fix write-region and its subroutines for buffers > 2GB.
16257 * fileio.c (a_write, e_write): Modify declaration of arguments and
16258 local variables to support buffers larger than 2GB.
16259 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16260
16261 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16262 argument, local variables, and return value.
16263
16264 * lisp.h: Update prototypes of emacs_write and emacs_read.
16265
16266 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16267
16268 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16269
16270 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16271
16272 Fix more problems found by GCC 4.6.0's static checks.
16273
16274 * xdisp.c (vmessage): Use a better test for character truncation.
16275
16276 * charset.c (load_charset_map): <, not <=, for optimization,
16277 and to avoid potential problems with integer overflow.
16278 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16279 * casetab.c (set_identity, shuffle): Likewise.
16280 * editfns.c (Fformat): Likewise.
16281 * syntax.c (skip_chars): Likewise.
16282
16283 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16284 This also lets GCC 4.6.0 generate slightly better loop code.
16285
16286 * callint.c (Fcall_interactively): <, not <=, for optimization.
16287 (Fcall_interactively): Count the number of arguments produced,
16288 not the number of arguments given. This is simpler and lets GCC
16289 4.6.0 generate slightly better code.
16290
16291 * ftfont.c: Distingish more carefully between FcChar8 and char.
16292 The previous code passed unsigned char * to a functions like
16293 strlen and xstrcasecmp that expect char *, which does not
16294 conform to the C standard.
16295 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16296 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16297 char * when the C standard requires it.
16298
16299 * keyboard.c (read_char): Remove unused var.
16300
16301 * eval.c: Port to Windows vsnprintf (Bug#8435).
16302 Include <limits.h>.
16303 (SIZE_MAX): Define if the headers do not.
16304 (verror): Do not give up if vsnprintf returns a negative count.
16305 Instead, grow the buffer. This ports to Windows vsnprintf, which
16306 does not conform to C99. Problem reported by Eli Zaretskii.
16307 Also, simplify the allocation scheme, by avoiding the need for
16308 calling realloc, and removing the ALLOCATED variable.
16309
16310 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16311
16312 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16313 But keep the doprint source code for now, as we might revamp it
16314 and use it again (Bug#8435).
16315 * lisp.h (doprnt): Remove.
16316 * Makefile.in (base_obj): Remove doprnt.o.
16317 * deps.mk (doprnt.o): Remove.
16318
16319 error: Print 32- and 64-bit integers portably (Bug#8435).
16320 Without this change, on typical 64-bit hosts error ("...%d...", N)
16321 was used to print both 32- and 64-bit integers N, which relied on
16322 undefined behavior.
16323 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16324 * lisp.h (error, verror): Mark as printf-like functions.
16325 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16326 Report overflow in size calculations when allocating printf buffer.
16327 Do not truncate output string at its first null byte.
16328 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16329 Truncate the output at a character boundary, since vsnprintf does not
16330 do that.
16331 * charset.c (check_iso_charset_parameter): Convert internal
16332 character to string before calling 'error', since %c now has the
16333 printf meaning.
16334 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16335 overflow when computing char to be passed to 'error'. Do not
16336 pass Lisp_Object to 'error'; pass the integer instead.
16337 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16338 formatted with plain %d.
16339
16340 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16341
16342 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16343
16344 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16345
16346 * xterm.c (x_catch_errors): Remove duplicate declaration.
16347
16348 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16349
16350 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16351
16352 2011-04-10 Jim Meyering <meyering@redhat.com>
16353
16354 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16355 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16356 return ssize_t not "int", and use size_t as the buffer length.
16357 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16358 * gnutls.h: Update declarations.
16359 * process.c (read_process_output): Use ssize_t, to match.
16360 (send_process): Likewise.
16361
16362 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16363
16364 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16365
16366 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16367
16368 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16369 Use unsigned char, to match FcChar8 type definition.
16370
16371 * xterm.c (handle_one_xevent):
16372 * xmenu.c (create_and_show_popup_menu):
16373 * xselect.c (x_decline_selection_request)
16374 (x_reply_selection_request): Avoid type-punned deref of X events.
16375
16376 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16377
16378 Fix some uses of `int' instead of EMACS_INT.
16379 * search.c (string_match_1, fast_string_match)
16380 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16381 (scan_buffer, find_next_newline_no_quit)
16382 (find_before_next_newline, search_command, Freplace_match)
16383 (Fmatch_data): Make some `int' variables be EMACS_INT.
16384
16385 * xdisp.c (display_count_lines): 3rd argument and return value now
16386 EMACS_INT. All callers changed.
16387 (pint2hrstr): Last argument is now EMACS_INT.
16388
16389 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16390 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16391 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16392 (decode_coding_utf_16, decode_coding_emacs_mule)
16393 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16394 (decode_coding_ccl, decode_coding_charset)
16395 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16396 (decode_coding_iso_2022, decode_coding_emacs_mule)
16397 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16398 <char_offset, last_offset>: Declare EMACS_INT.
16399 (encode_coding_utf_8, encode_coding_utf_16)
16400 (encode_coding_emacs_mule, encode_invocation_designation)
16401 (encode_designation_at_bol, encode_coding_iso_2022)
16402 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16403 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16404 Declare EMACS_INT.
16405 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16406 (encode_invocation_designation): Last argument P_NCHARS is now
16407 EMACS_INT.
16408 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16409 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16410
16411 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16412 All users changed.
16413
16414 * ccl.c (Fccl_execute_on_string): Declare some variables
16415 EMACS_INT.
16416
16417 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16418
16419 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16420
16421 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16422
16423 * process.c (Fformat_network_address): Doc fix.
16424
16425 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16426
16427 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16428
16429 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16430
16431 * keyboard.c (read_char): Call Lisp function help-form-show,
16432 instead of using internal_with_output_to_temp_buffer.
16433 (Qhelp_form_show): New var.
16434 (syms_of_keyboard): Use DEFSYM macro.
16435
16436 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16437
16438 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16439
16440 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16441
16442 * process.c (Flist_processes): Remove to Lisp.
16443 (list_processes_1): Delete.
16444
16445 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16446
16447 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16448
16449 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16450
16451 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16452
16453 Fix more problems found by GCC 4.6.0's static checks.
16454
16455 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16456
16457 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16458
16459 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16460
16461 * xdisp.c (vmessage): Mark as a printf-like function.
16462
16463 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16464
16465 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16466
16467 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16468 printf-like functions.
16469 (tiff_load): Add casts to remove these marks before passing them
16470 to system-supplied API.
16471
16472 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16473
16474 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16475 This avoids several warnings with gcc -Wstrict-overflow.
16476 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16477 directly, rather than having caller test rule sign. This avoids
16478 some unnecessary tests.
16479 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16480 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16481 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16482
16483 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16484 (xfont_open): Avoid unnecessary tests.
16485
16486 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16487
16488 * composite.h, composite.c (composition_gstring_put_cache):
16489 Use EMACS_INT, not int, for length.
16490
16491 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16492 breaking out part of COMPOSITION_DECODE_RULE.
16493 (COMPOSITION_DECODE_RULE): Use it.
16494 * composite.c (get_composition_id): Remove unused local vars,
16495 by using the new macro.
16496
16497 * textprop.c (set_text_properties_1): Change while to do-while,
16498 since the condition is always true at first.
16499
16500 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16501 (interval_deletion_adjustment): Return unsigned value.
16502 All uses changed.
16503
16504 * process.c (list_processes_1, create_pty, read_process_output):
16505 (exec_sentinel): Remove vars that were set but not used.
16506 (create_pty): Remove unnecessary "volatile"s.
16507 (Fnetwork_interface_info): Avoid possibility of int overflow.
16508 (read_process_output): Do adaptive read buffering even if carryover.
16509 (read_process_output): Simplify nbytes computation if buffered.
16510
16511 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16512
16513 * syntax.c (scan_words): Remove var that was set but not used.
16514 (update_syntax_table): Use unsigned instead of int.
16515
16516 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16517 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16518 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16519
16520 * print.c (print_error_message): Avoid int overflow.
16521
16522 * font.c (font_list_entities): Redo for clarity,
16523 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16524
16525 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16526 (font_score): Avoid potential overflow in diff calculation.
16527
16528 * fns.c (substring_both): Remove var that is set but not used.
16529 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16530
16531 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16532
16533 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16534 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16535 can always succeed if overflow has undefined behavior.
16536
16537 * search.c (boyer_moore, wordify): Remove vars set but not used.
16538 (wordify): Omit three unnecessary tests.
16539
16540 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16541 All callers changed. This avoids the need for an unused var.
16542
16543 * casefiddle.c (casify_region): Remove var that is set but not used.
16544
16545 * dired.c (file_name_completion): Remove var that is set but not used.
16546
16547 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16548
16549 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16550 (Finsert_file_contents): Remove unnecessary code checking fd.
16551
16552 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16553 Check for integer overflow on size calculations.
16554
16555 * buffer.c (Fprevious_overlay_change): Remove var that is set
16556 but not used.
16557
16558 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16559 Remove vars that are set but not used.
16560 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16561 (timer_check_2): Mark vars as initialized.
16562
16563 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16564
16565 * image.c (lookup_image): Remove var that is set but not used.
16566 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16567
16568 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16569 that are set but not used.
16570
16571 * xfns.c (make_invisible_cursor): Don't return garbage
16572 if XCreateBitmapFromData fails (Bug#8410).
16573
16574 * xselect.c (x_get_local_selection, x_handle_property_notify):
16575 Remove vars that are set but not used.
16576
16577 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16578 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16579
16580 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16581 Remove var that is set but not used.
16582 (scroll_bar_windows_size): Now size_t, not int.
16583 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16584 Check for overflow.
16585
16586 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16587 (map_tty_color) [!defined MSDOS]: Likewise.
16588
16589 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16590
16591 * coding.c: Remove vars that are set but not used.
16592 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16593 All callers changed.
16594 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16595 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16596 (decode_coding_charset): Remove vars that are set but not used.
16597
16598 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16599 that is set but not used.
16600
16601 * print.c (print_object): Remove var that is set but not used.
16602
16603 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16604 The gnulib version avoids calling malloc in the usual case,
16605 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16606 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16607 * filelock.c (current_lock_owner): Likewise.
16608 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16609 * sysdep.c: Include allocator.h, careadlinkat.h.
16610 (emacs_no_realloc_allocator): New static constant.
16611 (emacs_readlink): New function.
16612 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16613 ../lib/careadlinkat.h.
16614
16615 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16616
16617 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16618 first non-nil return value).
16619
16620 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16621
16622 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16623 if not defined (Bug#8403).
16624
16625 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16626
16627 * xdisp.c (display_count_lines): Remove parameter `start',
16628 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16629 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16630 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16631 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16632 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16633 and thereabouts. All callers changed.
16634 (get_per_char_metric): Remove parameter `f', unused since
16635 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16636
16637 2011-04-02 Jim Meyering <meyering@redhat.com>
16638
16639 do not dereference NULL upon failed strdup
16640 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16641 (ns_get_family): Likewise.
16642
16643 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16644
16645 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16646
16647 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16648
16649 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16650 later (Bug#8403).
16651
16652 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16653
16654 Add lexical binding.
16655
16656 * window.c (Ftemp_output_buffer_show): New fun.
16657 (Fsave_window_excursion):
16658 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16659
16660 * lread.c (lisp_file_lexically_bound_p): New function.
16661 (Fload): Bind Qlexical_binding.
16662 (readevalloop): Remove `evalfun' arg.
16663 Bind Qinternal_interpreter_environment.
16664 (Feval_buffer): Bind Qlexical_binding.
16665 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16666 Mark as dynamic.
16667 (syms_of_lread): Declare `lexical-binding'.
16668
16669 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16670
16671 * keyboard.c (eval_dyn): New fun.
16672 (menu_item_eval_property): Use it.
16673
16674 * image.c (parse_image_spec): Use Ffunctionp.
16675
16676 * fns.c (concat, mapcar1): Accept byte-code-functions.
16677
16678 * eval.c (Fsetq): Handle lexical vars.
16679 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16680 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16681 (FletX, Flet): Obey lexical binding.
16682 (Fcommandp): Handle closures.
16683 (Feval): New `lexical' arg.
16684 (eval_sub): New function extracted from Feval. Use it almost
16685 everywhere where Feval was used. Look up vars in lexical env.
16686 Handle closures.
16687 (Ffunctionp): Move from subr.el.
16688 (Ffuncall): Handle closures.
16689 (apply_lambda): Remove `eval_flags'.
16690 (funcall_lambda): Handle closures and new byte-code-functions.
16691 (Fspecial_variable_p): New function.
16692 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16693 but without exporting it to Lisp.
16694
16695 * doc.c (Fdocumentation, store_function_docstring):
16696 * data.c (Finteractive_form): Handle closures.
16697
16698 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16699 interactive spec.
16700
16701 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16702 New byte-codes.
16703 (exec_byte_code): New function extracted from Fbyte_code to handle new
16704 calling convention for byte-code-functions. Add new byte-codes.
16705
16706 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16707
16708 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16709
16710 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16711
16712 * xdisp.c (redisplay_internal): Fix prototype.
16713
16714 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16715
16716 * xdisp.c (SCROLL_LIMIT): New macro.
16717 (try_scrolling): Use it when setting scroll_limit.
16718 Limit scrolling to 100 screen lines.
16719 (redisplay_window): Even when falling back on "recentering",
16720 position point in the window according to scroll-conservatively,
16721 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16722
16723 (try_scrolling): When point is above the window, allow searching
16724 as far as scroll_max, or one screenful, to compute vertical
16725 distance from PT to the scroll margin position. This prevents
16726 try_scrolling from unnecessarily failing when
16727 scroll-conservatively is set to a value slightly larger than the
16728 window height. Clean up the case of PT below the margin at bottom
16729 of window: scroll_max can no longer be INT_MAX. When aggressive
16730 scrolling is in use, don't let point enter the opposite scroll
16731 margin as result of the scroll.
16732 (syms_of_xdisp) <scroll-conservatively>: Document the
16733 threshold of 100 lines for never-recentering scrolling.
16734
16735 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16736
16737 * dispextern.h (move_it_by_lines):
16738 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16739 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16740 (message_log_check_duplicate): Remove parameters `prev_bol' and
16741 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16742 (redisplay_internal): Remove parameter `preserve_echo_area',
16743 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16744
16745 * indent.c (Fvertical_motion):
16746 * window.c (window_scroll_pixel_based, Frecenter):
16747 Don't pass `need_y_p' to `move_it_by_lines'.
16748
16749 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16750
16751 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16752 steal a few bits to be more compact.
16753 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16754 Remove unneeded casts.
16755
16756 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16757
16758 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16759
16760 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16761 binding" message (bug#7967).
16762
16763 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16764
16765 Fix more problems found by GCC 4.6.0's static checks.
16766
16767 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16768 Remove unused local var.
16769
16770 * editfns.c (Fmessage_box): Remove unused local var.
16771
16772 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16773 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16774 Omit unused local vars.
16775 * window.c (shrink_windows): Omit unused local var.
16776 * menu.c (digest_single_submenu): Omit unused local var.
16777 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16778 Omit unused local var.
16779
16780 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16781 Don't assume string length fits in int.
16782 (keyremap_step, read_key_sequence): Use size_t for sizes.
16783 (read_key_sequence): Don't check last_real_key_start redundantly.
16784
16785 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16786 instead of alloca (Bug#8344).
16787
16788 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16789 (Fbacktrace_frame): Don't assume nframes fits in int.
16790
16791 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16792
16793 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16794 concerns.
16795
16796 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16797
16798 * cm.c (calccost): Turn while-do into do-while, for clarity.
16799
16800 * keyboard.c (syms_of_keyboard): Use the same style as later
16801 in this function when indexing through an array. This also
16802 works around GCC bug 48267.
16803
16804 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16805
16806 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16807
16808 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16809 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16810
16811 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16812 This avoids undefined behavior on integer overflow, and is a bit
16813 more convenient anyway since it is compared to a size_t variable.
16814
16815 Variadic C functions now count arguments with size_t, not int.
16816 This avoids an unnecessary limitation on 64-bit machines, which
16817 caused (substring ...) to crash on large vectors (Bug#8344).
16818 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16819 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16820 All variadic functions and their callers changed accordingly.
16821 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16822 * data.c (arith_driver, float_arith_driver): Likewise.
16823 * editfns.c (general_insert_function): Likewise.
16824 * eval.c (struct backtrace.nargs, interactive_p)
16825 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16826 (funcall_lambda, mark_backtrace): Likewise.
16827 * fns.c (concat): Likewise.
16828 * frame.c (x_set_frame_parameters): Likewise.
16829 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16830 0 if not found, not -1. All callers changed.
16831
16832 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16833 (stack_copy_size): Now size_t, not int.
16834 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16835
16836 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16837
16838 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16839 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16840 All callers changed.
16841
16842 * lisp.h (multibyte_char_to_unibyte):
16843 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16844 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16845 * character.h (CHAR_TO_BYTE8):
16846 * cmds.c (internal_self_insert):
16847 * editfns.c (general_insert_function):
16848 * keymap.c (push_key_description):
16849 * search.c (Freplace_match):
16850 * xdisp.c (message_dolog, set_message_1): All callers changed.
16851
16852 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16853
16854 * keyboard.c (safe_run_hook_funcall): New function.
16855 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16856 don't set the hook to nil, but remove the offending function instead.
16857 (Qcommand_hook_internal): Remove, unused.
16858 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16859 Vcommand_hook_internal.
16860
16861 * eval.c (enum run_hooks_condition): Remove.
16862 (funcall_nil, funcall_not): New functions.
16863 (run_hook_with_args): Call each function through a `funcall' argument.
16864 Remove `cond' argument, now redundant.
16865 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16866 (Frun_hook_with_args_until_failure): Adjust accordingly.
16867 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16868
16869 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16870
16871 * dispextern.h (string_buffer_position): Remove declaration.
16872
16873 * print.c (strout): Remove parameter `multibyte', unused since
16874 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16875
16876 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16877 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16878 All callers changed.
16879
16880 * w32.c (_wsa_errlist): Use braces for struct initializers.
16881
16882 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16883 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16884 All callers changed.
16885 (string_buffer_position): Likewise. Also, make static (it's never
16886 used outside xdisp.c).
16887 (cursor_row_p): Remove parameter `w', unused since
16888 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16889 (decode_mode_spec): Remove parameter `precision', introduced during
16890 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16891 All callers changed.
16892
16893 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16894
16895 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16896
16897 2011-03-27 Anders Lindgren <andlind@gmail.com>
16898
16899 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16900 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16901 (ns_update_auto_hide_menu_bar): New functions.
16902 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16903 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16904 ns_constrain_all_frames.
16905 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16906 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16907
16908 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16909
16910 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16911
16912 2011-03-27 Glenn Morris <rgm@gnu.org>
16913
16914 * syssignal.h: Replace RETSIGTYPE with void.
16915 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16916 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16917 Replace SIGTYPE with void everywhere.
16918 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16919 * s/template.h (SIGTYPE): Remove commented out definition.
16920
16921 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16922
16923 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16924 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16925
16926 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16927
16928 * w32.c (read_unc_volume): Use parameter `henum', instead of
16929 global variable `wget_enum_handle'.
16930
16931 * keymap.c (describe_vector): Remove parameters `indices' and
16932 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16933 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16934
16935 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16936
16937 * keyboard.c (timer_check): Remove parameter `do_it_now',
16938 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16939 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16940 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16941
16942 * keyboard.c (read_char):
16943 * w32menu.c (w32_menu_display_help):
16944 * xmenu.c (show_help_event, menu_help_callback):
16945 Adjust calls to `show_help_echo'.
16946
16947 * gtkutil.c (xg_maybe_add_timer):
16948 * keyboard.c (readable_events):
16949 * process.c (wait_reading_process_output):
16950 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16951
16952 * insdel.c (adjust_markers_gap_motion):
16953 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16954 (gap_left, gap_right): Don't call it.
16955
16956 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16957
16958 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16959 incurred during fontification.
16960
16961 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16962
16963 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16964 (DEFVAR_PER_BUFFER): Don't pass it.
16965
16966 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16967 (scrolling_window): Don't pass it.
16968
16969 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16970
16971 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16972
16973 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16974 and `suffix'.
16975 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16976 of variables specific to SELinux and computation of `encoded_absname'.
16977
16978 * image.c (XPutPixel): Remove unused variable `height'.
16979
16980 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16981
16982 * unexw32.c (get_section_info): Remove unused variable `section'.
16983
16984 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16985 (system_process_attributes): Remove unused variable `sess'.
16986 (sys_read): Remove unused variable `err'.
16987
16988 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16989 (w32_wnd_proc): Remove unused variable `isdead'.
16990 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16991 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16992 (x_create_tip_frame): Remove unused variable `tem'.
16993
16994 * w32inevt.c (w32_console_read_socket):
16995 Remove unused variable `no_events'.
16996
16997 * w32term.c (x_draw_composite_glyph_string_foreground):
16998 Remove unused variable `width'.
16999
17000 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17001
17002 * w32term.c (x_set_glyph_string_clipping):
17003 Don't pass uninitialized region to CombineRgn.
17004
17005 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17006
17007 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17008 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17009 (Fx_close_connection): Remove unused variable `i'.
17010
17011 * w32font.c (w32font_draw): Return number of glyphs.
17012 (w32font_open_internal): Remove unused variable `i'.
17013 (w32font_driver): Add missing initializer.
17014
17015 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17016 (fill_in_menu): Remove unused variable `items_added'.
17017
17018 * w32term.c (last_mouse_press_frame): Remove static global variable.
17019 (w32_clip_to_row): Remove unused variable `f'.
17020 (x_delete_terminal): Remove unused variable `i'.
17021
17022 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17023 (NOTHING): Remove unused static global variable.
17024 (uniscribe_check_otf): Remove unused variable `table'.
17025 (uniscribe_font_driver): Add missing initializers.
17026
17027 2011-03-23 Julien Danjou <julien@danjou.info>
17028
17029 * term.c (Fsuspend_tty, Fresume_tty):
17030 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17031 * window.c (temp_output_buffer_show):
17032 * insdel.c (signal_before_change):
17033 * frame.c (Fhandle_switch_frame):
17034 * fileio.c (Fdo_auto_save):
17035 * emacs.c (Fkill_emacs):
17036 * editfns.c (save_excursion_restore):
17037 * cmds.c (internal_self_insert):
17038 * callint.c (Fcall_interactively):
17039 * buffer.c (Fkill_all_local_variables):
17040 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17041 Use Frun_hooks.
17042 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17043 unconditionally since it does the check itself.
17044
17045 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17046
17047 Fix more problems found by GCC 4.5.2's static checks.
17048
17049 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17050 the first time through the loop, since we know p0 < p1 then.
17051 This also avoids a gcc -Wstrict-overflow warning.
17052
17053 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17054 leading to a memory leak, possible in functions like
17055 load_charset_map_from_file that can allocate an unbounded number
17056 of objects (Bug#8318).
17057
17058 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17059 that could (at least in theory) be that large.
17060
17061 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17062 This is less likely to overflow, and avoids undefined behavior if
17063 overflow does occur. All callers changed. Use strtoul to scan
17064 for the unsigned long integer.
17065 (pint2hrstr): Simplify and tune code slightly.
17066 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17067
17068 * scroll.c (do_scrolling): Work around GCC bug 48228.
17069 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17070
17071 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17072 This also avoids a warning with gcc -Wstrict-overflow.
17073 (validate_x_resource_name): Simplify count usage.
17074 This also avoids a warning with gcc -Wstrict-overflow.
17075
17076 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17077 fail (Bug#8306).
17078
17079 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17080
17081 * process.c (Fmake_network_process): Use socklen_t, not int,
17082 where POSIX says socklen_t is required in portable programs.
17083 This fixes a porting bug on hosts like 64-bit HP-UX, where
17084 socklen_t is wider than int (Bug#8277).
17085 (Fmake_network_process, server_accept_connection):
17086 (wait_reading_process_output, read_process_output):
17087 Likewise.
17088
17089 * process.c: Rename or move locals to avoid shadowing.
17090 (list_processes_1, Fmake_network_process):
17091 (read_process_output_error_handler, exec_sentinel_error_handler):
17092 Rename or move locals.
17093 (Fmake_network_process): Define label "retry_connect" only if needed.
17094 (Fnetwork_interface_info): Fix pointer signedness.
17095 (process_send_signal): Add cast to avoid pointer signedness problem.
17096 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17097 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17098
17099 Make tparam.h and terminfo.c consistent.
17100 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17101 Include tparam.h instead, since it declares them.
17102 * cm.h (PC): Remove extern decl; tparam.h now does this.
17103 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17104 * terminfo.c: Include tparam.h, to check interfaces.
17105 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17106 (tparam): Adjust signature to match interface in tparam.h;
17107 this removes some undefined behavior. Check that outstring and len
17108 are zero, which they always are with Emacs.
17109 * tparam.h (PC, BC, UP): New extern decls.
17110
17111 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17112 (xftfont_open): Rename locals to avoid shadowing.
17113
17114 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17115 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17116 (OTF_TAG_SYM): Omit macro if not needed.
17117 (ftfont_list): Remove unused local.
17118 (get_adstyle_property, ftfont_pattern_entity):
17119 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17120 Rename locals to avoid shadowing.
17121
17122 * xfont.c (xfont_list_family): Mark var as initialized.
17123
17124 * xml.c (make_dom): Now static.
17125
17126 * composite.c (composition_compute_stop_pos): Rename local to
17127 avoid shadowing.
17128 (composition_reseat_it): Remove unused locals.
17129 (find_automatic_composition, composition_adjust_point): Likewise.
17130 (composition_update_it): Mark var as initialized.
17131 (find_automatic_composition): Mark vars as initialized,
17132 with a FIXME (Bug#8290).
17133
17134 character.h: Rename locals to avoid shadowing.
17135 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17136 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17137 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17138 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17139 to avoid shadowing.
17140
17141 * textprop.c (property_change_between_p): Remove; unused.
17142
17143 * intervals.c (interval_start_pos): Now static.
17144
17145 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17146
17147 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17148 Rename locals to avoid shadowing.
17149
17150 * sound.c (wav_play, au_play, Fplay_sound_internal):
17151 Fix pointer signedness.
17152 (alsa_choose_format): Remove unused local var.
17153 (wav_play): Initialize a variable to 0, to prevent undefined
17154 behavior (Bug#8278).
17155
17156 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17157
17158 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17159
17160 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17161 clobbering (Bug#8298).
17162 * sysdep.c (sys_subshell): Likewise.
17163 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17164
17165 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17166 This should get cleaned up, so that child_setup has the
17167 same signature on all platforms.
17168
17169 * callproc.c (call_process_cleanup): Now static.
17170 (relocate_fd): Rename locals to avoid shadowing.
17171
17172 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17173
17174 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17175 not to be necessary, and produces flickering.
17176
17177 2011-03-20 Glenn Morris <rgm@gnu.org>
17178
17179 * config.in: Remove file.
17180
17181 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17182
17183 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17184 are now in src/globals.h.
17185 (syms_of_minibuf): Remove spurious & from previous change.
17186
17187 2011-03-20 Leo Liu <sdl.web@gmail.com>
17188
17189 * minibuf.c (completing-read-function): New variable.
17190 (completing-read-default): Rename from completing-read.
17191 (completing-read): Call completing-read-function.
17192
17193 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17194
17195 * xfaces.c (Fx_load_color_file):
17196 Read color file from absolute filename (bug#8250).
17197
17198 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17199
17200 * makefile.w32-in: Update dependencies.
17201
17202 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17203
17204 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17205
17206 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17207
17208 Fix more problems found by GCC 4.5.2's static checks.
17209
17210 * process.c (make_serial_process_unwind, send_process_trap):
17211 (sigchld_handler): Now static.
17212
17213 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17214 That way, the code declares only the vars that it needs.
17215 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17216 * s/cygwin.h (PTY_ITERATION): Likewise.
17217 * s/darwin.h (PTY_ITERATION): Likewise.
17218 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17219
17220 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17221 * process.c (allocate_pty): Don't declare stb unless it's needed.
17222
17223 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17224 (CONSTANTLIM): Remove; unused.
17225 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17226 Define only if needed.
17227
17228 * unexelf.c (unexec): Name an expression,
17229 to avoid gcc -Wbad-function-cast warning.
17230 Use a different way to cause a compilation error if anyone uses
17231 n rather than nn, a way that does not involve shadowing.
17232 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17233
17234 * deps.mk (unexalpha.o): Remove; unused.
17235
17236 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17237 * unexec.h: New file.
17238 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17239 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17240 Depend on unexec.h.
17241 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17242 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17243 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17244 Change as necessary to match prototype in unexec.h.
17245
17246 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17247 shadowing.
17248 (back_comment, skip_chars): Mark vars as initialized.
17249
17250 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17251 Rename locals to avoid shadowing.
17252
17253 * lread.c (read1): Rewrite so as not to use empty "else".
17254 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17255
17256 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17257
17258 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17259 warning when compiling print.c.
17260
17261 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17262 instead of using an uninitialized var.
17263 (font_sort_entities): Mark var as initialized.
17264
17265 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17266
17267 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17268 pointers to constants.
17269 (font_parse_fcname): Remove unused vars.
17270 (font_delete_unmatched): Now static.
17271 (font_get_spec): Remove; unused.
17272 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17273 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17274 Rename or move locals to avoid shadowing.
17275
17276 * fns.c (require_nesting_list, require_unwind): Now static.
17277 (Ffillarray): Rename locals to avoid shadowing.
17278
17279 * floatfns.c (domain_error2): Define only if needed.
17280 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17281
17282 * alloc.c (mark_backtrace): Move decl from here ...
17283 * lisp.h: ... to here, so that it can be checked.
17284
17285 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17286 (Fdefvar): Rewrite so as not to use empty "else".
17287 (lisp_indirect_variable): Name an expression,
17288 to avoid gcc -Wbad-function-cast warning.
17289 (Fdefvar): Rename locals to avoid shadowing.
17290
17291 * callint.c (quotify_arg, quotify_args): Now static.
17292 (Fcall_interactively): Rename locals to avoid shadowing.
17293 Use const pointer when appropriate.
17294
17295 * lisp.h (get_system_name, get_operating_system_release):
17296 Move decls here, to check interfaces.
17297 * process.c (get_operating_system_release): Move decl to lisp.h.
17298 * xrdb.c (get_system_name): Likewise.
17299 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17300 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17301 some of which prompt warnings from gcc -Wbad-function-cast.
17302 (Fformat_time_string, Fencode_time, Finsert_char):
17303 (Ftranslate_region_internal, Fformat):
17304 Rename or remove local vars to avoid shadowing.
17305 (Ftranslate_region_internal): Mark var as initialized.
17306
17307 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17308 avoid shadowing.
17309
17310 * lisp.h (eassert): Check that the argument compiles, even if
17311 ENABLE_CHECKING is not defined.
17312
17313 * data.c (Findirect_variable): Name an expression, to avoid
17314 gcc -Wbad-function-cast warning.
17315 (default_value, arithcompare, arith_driver, arith_error): Now static.
17316 (store_symval_forwarding): Rename local to avoid shadowing.
17317 (Fmake_variable_buffer_local, Fmake_local_variable):
17318 Mark variables as initialized.
17319 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17320
17321 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17322 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17323 Rename locals to avoid shadowing.
17324 (mark_stack): Move local variables into the #ifdef region where
17325 they're used.
17326 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17327 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17328 needed otherwise.
17329 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17330 (GC_STRING_CHARS): Remove; not used.
17331 (Fmemory_limit): Cast sbrk's returned value to char *.
17332
17333 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17334 avoids undefined behavior in theory.
17335
17336 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17337
17338 Use functions, not macros, for up- and down-casing (Bug#8254).
17339 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17340 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17341 to use the following functions instead of these macros.
17342 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17343 EMACS_INT, since callers assume the returned value fits in int.
17344 (upcase1): Likewise, for UPCASE_TABLE.
17345 (uppercasep, lowercasep, upcase): New static inline functions.
17346 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17347 the race-condition problem in the old DOWNCASE.
17348
17349 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17350 Rename locals to avoid shadowing.
17351 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17352 (regex_compile, re_search_2, re_match_2_internal):
17353 Remove unused local vars.
17354 (FREE_VAR): Rewrite so as not to use empty "else",
17355 which gcc can warn about.
17356 (regex_compile, re_match_2_internal): Mark locals as initialized.
17357 (RETALLOC_IF): Define only if needed.
17358 (WORDCHAR_P): Likewise. This one is never needed, but is used
17359 only in a comment talking about a compiler bug, so put inside
17360 the #if 0 of that comment.
17361 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17362 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17363 Remove; unused.
17364
17365 * search.c (boyer_moore): Rename locals to avoid shadowing.
17366 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17367 (PREV_CHAR_BOUNDARY): Likewise.
17368
17369 * search.c (simple_search): Remove unused var.
17370
17371 * dired.c (compile_pattern): Move decl from here ...
17372 * lisp.h: ... to here, so that it can be checked.
17373 (struct re_registers): New forward decl.
17374
17375 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17376
17377 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17378 All uses changed.
17379 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17380 Rename locals to avoid shadowing.
17381 (Fvertical_motion): Mark locals as initialized.
17382
17383 * casefiddle.c (casify_object, casify_region): Now static.
17384 (casify_region): Mark local as initialized.
17385
17386 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17387
17388 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17389 New macros, so that the caller can use some names other than
17390 gcpro1, gcpro2, etc.
17391 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17392 of the new macros.
17393 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17394 argument, for consistency with GCPRO2_VAR, etc: it is now the
17395 prefix of the variable, not the variable itself. All uses
17396 changed.
17397 * dired.c (directory_files_internal, file_name_completion):
17398 Rename locals to avoid shadowing.
17399
17400 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17401 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17402 dired.c's scmp function, had undefined behavior.
17403 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17404 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17405 * buffer.h: ... to here, because these macros use current_buffer,
17406 and the new implementation with inline functions needs to have
17407 current_buffer in scope now, rather than later when the macros
17408 are used.
17409 (downcase, upcase1): New static inline functions.
17410 (DOWNCASE, UPCASE1): Reimplement using these functions.
17411 This avoids undefined behavior in expressions like
17412 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17413 from race conditions in accessing the global variables
17414 case_temp1 and case_temp2.
17415 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17416 * lisp.h (case_temp1, case_temp2): Remove their decls.
17417 * character.h (ASCII_CHAR_P): Move from here ...
17418 * lisp.h: ... to here, so that the inline functions mentioned
17419 above can use them.
17420
17421 * dired.c (directory_files_internal_unwind): Now static.
17422
17423 * fileio.c (file_name_as_directory, directory_file_name):
17424 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17425 Now static.
17426 (file_name_as_directory): Use const pointers when appropriate.
17427 (Fexpand_file_name): Likewise. In particular, newdir might
17428 point at constant storage, so make it a const pointer.
17429 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17430 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17431 signedness issues.
17432 (Fset_file_times, Finsert_file_contents, auto_save_error):
17433 Rename locals to avoid shadowing.
17434
17435 * minibuf.c (choose_minibuf_frame_1): Now static.
17436 (Ftry_completion, Fall_completions): Rename or remove locals
17437 to avoid shadowing.
17438
17439 * marker.c (bytepos_to_charpos): Remove; unused.
17440
17441 * lisp.h (verify_bytepos, count_markers): New decls,
17442 so that gcc does not warn that these functions aren't declared.
17443
17444 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17445 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17446 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17447 (copy_text): Remove unused local var.
17448
17449 * filelock.c (within_one_second): Now static.
17450 (lock_file_1): Rename local to avoid shadowing.
17451
17452 * buffer.c (fix_overlays_before): Mark locals as initialized.
17453 (fix_start_end_in_overlays): Likewise. This function should be
17454 simplified by using pointers-to-pointers, but that's a different
17455 matter.
17456 (switch_to_buffer_1): Now static.
17457 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17458 (report_overlay_modification): Rename locals to avoid shadowing.
17459
17460 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17461 Fix pointer signedness issue.
17462 (sys_subshell): Mark local as volatile if checking for lint,
17463 to suppress a gcc -Wclobbered warning that does not seem to be right.
17464 (MAXPATHLEN): Define only if needed.
17465
17466 * process.c (serial_open, serial_configure): Move decls from here ...
17467 * systty.h: ... to here, so that they can be checked.
17468
17469 * fns.c (get_random, seed_random): Move extern decls from here ...
17470 * lisp.h: ... to here, so that they can be checked.
17471
17472 * sysdep.c (reset_io): Now static.
17473 (wait_for_termination_signal): Remove; unused.
17474
17475 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17476 (copy_keymap_item, append_key, push_text_char_description):
17477 Now static.
17478 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17479 (DENSE_TABLE_SIZE): Remove; unused.
17480 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17481 (describe_map_tree):
17482 Rename locals to avoid shadowing.
17483
17484 * keyboard.c: Declare functions static if they are not used elsewhere.
17485 (echo_char, echo_dash, cmd_error, top_level_2):
17486 (poll_for_input, handle_async_input): Now static.
17487 (read_char, kbd_buffer_get_event, make_lispy_position):
17488 (make_lispy_event, make_lispy_movement, apply_modifiers):
17489 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17490 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17491 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17492 (read_key_sequence, read_char): Mark locals as initialized.
17493 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17494
17495 * keyboard.h (make_ctrl_char): New decl.
17496 (mark_kboards): Move decl here ...
17497 * alloc.c (mark_kboards): ... from here.
17498
17499 * lisp.h (force_auto_save_soon): New decl.
17500
17501 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17502 (DEFINE_DUMMY_FUNCTION): New macro.
17503 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17504 Use it.
17505 (main): Add casts to avoid warnings
17506 if GCC considers string literals to be constants.
17507
17508 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17509
17510 * dbusbind.c: Pointer signedness fixes.
17511 (xd_signature, xd_append_arg, xd_initialize):
17512 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17513 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17514 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17515 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17516
17517 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17518 if GCC considers string literals to be constants.
17519 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17520
17521 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17522
17523 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17524 (print_preprocess, print_object): New macro to fix last change.
17525
17526 * print.c (print_preprocess): Don't forget font objects.
17527
17528 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17529
17530 * emacs.c (USAGE3): Doc fixes.
17531
17532 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17533
17534 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17535 structure.
17536
17537 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17538
17539 * lisp.h (VWindow_system, Qfile_name_history):
17540 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17541 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17542 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17543
17544 * w32select.c: Don't #include "keyboard.h".
17545 (run_protected): Add extern declaration for waiting_for_input.
17546
17547 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17548 * w32console.c (detect_input_pending, read_input_pending)
17549 (encode_terminal_code):
17550 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17551 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17552 (w32_system_caret_y, Qfile_name_history):
17553 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17554 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17555 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17556 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17557 * w32proc.c (Qlocal, report_file_error):
17558 * w32term.c (Vwindow_system, updating_frame):
17559 * w32uniscribe.c (initialized, uniscribe_font_driver):
17560 Remove unneeded extern declarations.
17561
17562 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17563
17564 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17565
17566 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17567
17568 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17569 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17570 These macros can no longer be used for assignment.
17571
17572 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17573 Assign struct members directly, instead of using BUF_BEGV etc.
17574 (record_buffer_markers, fetch_buffer_markers): New functions for
17575 recording and fetching special buffer markers.
17576 (set_buffer_internal_1, set_buffer_temp): Use them.
17577
17578 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17579
17580 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17581
17582 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17583 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17584
17585 * xdisp.c (hscroll_window_tree):
17586 (reconsider_clip_changes): Use PT instead of BUF_PT.
17587
17588 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17589
17590 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17591 $(EMACS_ROOT)/lib/intprops.h.
17592
17593 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17594
17595 Fix more problems found by GCC 4.5.2's static checks.
17596
17597 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17598 to unsigned char * to avoid compiler diagnostic.
17599 (xg_free_frame_widgets): Make it clear that a local variable is
17600 needed only if USE_GTK_TOOLTIP.
17601 (gdk_window_get_screen): Make it clear that this macro is needed
17602 only if USE_GTK_TOOLTIP.
17603 (int_gtk_range_get_value): New function, which avoids a diagnostic
17604 from gcc -Wbad-function-cast.
17605 (xg_set_toolkit_scroll_bar_thumb): Use it.
17606 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17607 diagnostic from gcc -Wbad-function-cast.
17608 (get_utf8_string, xg_get_file_with_chooser):
17609 Rename locals to avoid shadowing.
17610 (create_dialog): Move locals to avoid shadowing.
17611
17612 * xgselect.c (xg_select): Remove unused var.
17613
17614 * image.c (four_corners_best): Mark locals as initialized.
17615 (gif_load): Initialize transparent_p to zero (Bug#8238).
17616 Mark another local as initialized.
17617 (my_png_error, my_error_exit): Mark with NO_RETURN.
17618
17619 * image.c (clear_image_cache): Now static.
17620 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17621 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17622 (x_edge_detection): Remove unnecessary cast that
17623 gcc -Wbad-function-cast diagnoses.
17624 (gif_load): Fix pointer signedness.
17625 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17626 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17627
17628 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17629
17630 Improve quality of tests for time stamp overflow.
17631 For example, without this patch (encode-time 0 0 0 1 1
17632 1152921504606846976) returns the obviously-bogus value (-948597
17633 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17634 reports time overflow. See
17635 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17636 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17637 * editfns.c: Include limits.h and intprops.h.
17638 (TIME_T_MIN, TIME_T_MAX): New macros.
17639 (time_overflow): Move earlier, to before first use.
17640 (hi_time, lo_time): New functions, for an accurate test for
17641 out-of-range times.
17642 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17643 (Fget_internal_run_time): Don't assume time_t fits in int.
17644 (make_time): Use list2 instead of Fcons twice.
17645 (Fdecode_time): More accurate test for out-of-range times.
17646 (check_tm_member): New function.
17647 (Fencode_time): Use it, to test for out-of-range times.
17648 (lisp_time_argument): Don't rely on undefined left-shift and
17649 right-shift behavior when checking for time stamp overflow.
17650
17651 * editfns.c (time_overflow): New function, refactoring common code.
17652 (Fformat_time_string, Fdecode_time, Fencode_time):
17653 (Fcurrent_time_string): Use it.
17654
17655 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17656 * dired.c (make_time): Move to ...
17657 * editfns.c (make_time): ... here.
17658 * systime.h: Note the move.
17659
17660 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17661
17662 * fringe.c (update_window_fringes): Remove unused variables.
17663
17664 * unexmacosx.c (copy_data_segment): Also copy __got section.
17665 (Bug#8223)
17666
17667 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17668
17669 * termcap.c [MSDOS]: Include "msdos.h".
17670 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17671 Constify `char *' arguments and their references according to
17672 prototypes in tparam.h.
17673
17674 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17675
17676 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17677 Adapt all references accordingly.
17678
17679 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17680
17681 2011-03-11 Tom Tromey <tromey@redhat.com>
17682
17683 * buffer.c (syms_of_buffer): Remove obsolete comment.
17684
17685 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17686
17687 * termhooks.h (encode_terminal_code): Declare prototype.
17688
17689 * msdos.c (encode_terminal_code): Don't declare prototype.
17690
17691 * term.c (encode_terminal_code): Now external again, used by
17692 w32console.c and msdos.c.
17693
17694 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17695 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17696
17697 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17698
17699 Fix some minor problems found by GCC 4.5.2's static checks.
17700
17701 * fringe.c (update_window_fringes): Mark locals as initialized
17702 (Bug#8227).
17703 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17704
17705 * alloc.c (mark_fringe_data): Move decl from here ...
17706 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17707 to check its interface.
17708 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17709
17710 * fontset.c (free_realized_fontset): Now static.
17711 (Fset_fontset_font): Rename local to avoid shadowing.
17712 (fontset_font): Mark local as initialized.
17713 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17714
17715 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17716
17717 * xselect.c (x_disown_buffer_selections): Remove; not used.
17718 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17719 (x_own_selection, Fx_disown_selection_internal): Rename locals
17720 to avoid shadowing.
17721 (x_handle_dnd_message): Remove local to avoid shadowing.
17722
17723 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17724 so that the caller can use some name other than gcpro1.
17725 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17726 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17727 (Fx_backspace_delete_keys_p):
17728 Use them to avoid shadowing, and rename vars to avoid shadowing.
17729 (x_decode_color, x_set_name, x_window): Now static.
17730 (Fx_create_frame): Add braces to silence GCC warning.
17731 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17732 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17733 Remove unused locals.
17734 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17735 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17736 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17737 macros.
17738
17739 * xterm.h (x_mouse_leave): New decl.
17740
17741 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17742 Remove unused functions.
17743 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17744 (x_calc_absolute_position): Now static.
17745 (XTread_socket): Don't define label "out" unless it's used.
17746 Don't declare local "event" unless it's used.
17747 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17748 unless they are used.
17749 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17750 (x_fatal_error_signal): Remove; not used.
17751 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17752 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17753 (x_error_catcher, x_connection_closed, x_error_handler):
17754 (x_error_quitter, xembed_send_message, x_iconify_frame):
17755 (my_log_handler): Rename locals to avoid shadowing.
17756 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17757 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17758
17759 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17760 Rename or move locals to avoid shadowing.
17761 (tty_defined_color, merge_face_heights): Now static.
17762 (free_realized_faces_for_fontset): Remove; not used.
17763 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17764 does not deduce is never used uninitialized.
17765 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17766 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17767
17768 * terminal.c (store_terminal_param): Now static.
17769
17770 * xmenu.c (menu_highlight_callback): Now static.
17771 (set_frame_menubar): Remove unused local.
17772 (xmenu_show): Rename parameter to avoid shadowing.
17773 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17774 since they might point to immutable storage.
17775 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17776 since it's unused otherwise.
17777
17778 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17779 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17780 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17781 avoids a gcc -Wuninitialized diagnostic.
17782 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17783 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17784 does not deduce are never used uninitialized.
17785
17786 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17787
17788 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17789 * window.c (window_loop, size_window):
17790 (run_window_configuration_change_hook, enlarge_window): Likewise.
17791
17792 * window.c (display_buffer): Now static.
17793 (size_window): Mark variables that gcc -Wuninitialized
17794 does not deduce are never used uninitialized.
17795 * window.h (check_all_windows): New decl, to forestall
17796 gcc -Wmissing-prototypes diagnostic.
17797 * dispextern.h (bidi_dump_cached_states): Likewise.
17798
17799 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17800 shadowing.
17801 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17802 Include <limits.h>.
17803 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17804 and to avoid gcc -Wuninitialized warning.
17805 (load_charset_map): Mark variables that gcc -Wuninitialized
17806 does not deduce are never used uninitialized.
17807 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17808
17809 * coding.c (coding_set_source, coding_set_destination):
17810 Use "else { /* comment */ }" rather than "else /* comment */;"
17811 for clarity, and to avoid gcc -Wempty-body warning.
17812 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17813 a block, when the outer 'i' will do.
17814 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17815 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17816 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17817 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17818 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17819 Rename locals to avoid shadowing.
17820 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17821 * coding.c (emacs_mule_char, encode_invocation_designation):
17822 Now static, since they're not used elsewhere.
17823 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17824 (decode_coding_object, encode_coding_object, detect_coding_system):
17825 (decode_coding_emacs_mule): Mark variables that gcc
17826 -Wuninitialized does not deduce are never used uninitialized.
17827 (detect_coding_iso_2022): Initialize a local variable that might
17828 be used uninitialized. Leave a FIXME because it's not clear that
17829 this initialization is needed. (Bug#8211)
17830 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17831 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17832 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17833 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17834 Remove unused macros.
17835
17836 * category.c (hash_get_category_set): Remove unused local var.
17837 (copy_category_table): Now static, since it's not used elsewhere.
17838 * character.c (string_count_byte8): Likewise.
17839
17840 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17841 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17842
17843 * chartab.c (copy_sub_char_table): Now static, since it's not used
17844 elsewhere.
17845 (sub_char_table_ref_and_range, char_table_ref_and_range):
17846 Rename locals to avoid shadowing.
17847 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17848
17849 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17850 (BIDI_BOB): Remove unused macro.
17851
17852 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17853 deduce are never used uninitialized.
17854 * term.c (encode_terminal_code): Likewise.
17855
17856 * term.c (encode_terminal_code): Now static. Remove unused local.
17857
17858 * tparam.h: New file.
17859 * term.c, tparam.h: Include it.
17860 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17861 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17862 Move these decls to tparam.h, and make them agree with what
17863 is actually in tparam.c. The previous trick of using incompatible
17864 decls in different modules does not conform to the C standard.
17865 All callers of tparam changed to use tparam's actual API.
17866 * tparam.c (tparam1, tparam, tgoto):
17867 Use const pointers where appropriate.
17868
17869 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17870 * cm.h (struct cm): Likewise.
17871 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17872 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17873 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17874 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17875 (turn_on_face, init_tty): Likewise.
17876 * termchar.h (struct tty_display_info): Likewise.
17877
17878 * term.c (term_mouse_position): Rename local to avoid shadowing.
17879
17880 * alloc.c (mark_ttys): Move decl from here ...
17881 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17882
17883 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17884
17885 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17886
17887 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17888
17889 * search.c (compile_pattern_1): Remove argument regp, unused since
17890 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17891 (compile_pattern): Don't pass it.
17892
17893 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17894
17895 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17896 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17897 for ! HAVE_GTK3.
17898 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17899
17900 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17901
17902 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17903 gdk_window_get_screen, gdk_window_get_geometry,
17904 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17905 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17906 (xg_get_pixbuf_from_pixmap): New function.
17907 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17908 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17909 Call xg_get_pixbuf_from_pixmap instead of
17910 gdk_pixbuf_get_from_drawable.
17911 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17912 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17913 (xg_check_special_colors): Use GtkStyleContext and its functions
17914 for HAVE_GTK3.
17915 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17916 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17917 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17918 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17919 Call gtk_widget_get_preferred_size.
17920 (xg_frame_resized): gdk_window_get_geometry only takes 5
17921 parameters.
17922 (xg_win_to_widget, xg_event_is_for_menubar):
17923 Call gdk_x11_window_lookup_for_display.
17924 (xg_set_widget_bg): New function.
17925 (delete_cb): New function.
17926 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17927 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17928 (xg_set_background_color): Call xg_set_widget_bg.
17929 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17930 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17931 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17932 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17933 if ! HAVE_GTK3.
17934 (update_frame_tool_bar): Call gtk_widget_hide.
17935 (xg_initialize): Use GDK_KEY_g.
17936
17937 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17938 if ! HAVE_GTK3
17939 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17940
17941 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17942 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17943 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17944
17945 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17946
17947 * w32xfns.c (select_palette): Check success of RealizePalette against
17948 GDI_ERROR, not zero.
17949
17950 See ChangeLog.11 for earlier changes.
17951
17952 ;; Local Variables:
17953 ;; coding: utf-8
17954 ;; End:
17955
17956 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17957
17958 This file is part of GNU Emacs.
17959
17960 GNU Emacs is free software: you can redistribute it and/or modify
17961 it under the terms of the GNU General Public License as published by
17962 the Free Software Foundation, either version 3 of the License, or
17963 (at your option) any later version.
17964
17965 GNU Emacs is distributed in the hope that it will be useful,
17966 but WITHOUT ANY WARRANTY; without even the implied warranty of
17967 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17968 GNU General Public License for more details.
17969
17970 You should have received a copy of the GNU General Public License
17971 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.