]> code.delx.au - gnu-emacs/blob - src/ChangeLog
image.c, indent.c: Use bool for booleans.
[gnu-emacs] / src / ChangeLog
1 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2
3 image.c, indent.c: Use bool for booleans.
4 * dispextern.h (struct image_type): Members valid_p, load, init
5 now return bool, not int. All uses changed.
6 * image.c: Omit unnecessary static decls.
7 (x_create_bitmap_mask, x_build_heuristic_mask):
8 Return void, not int, since callers don't care about the return value.
9 (x_create_bitmap_mask, define_image_type, valid_image_p)
10 (struct image_keyword, parse_image_spec, image_spec_value)
11 (check_image_size, image_background)
12 (image_background_transparent, x_clear_image_1)
13 (postprocess_image, lookup_image, x_check_image_size)
14 (x_create_x_image_and_pixmap, xbm_image_p)
15 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
16 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
17 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
18 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
19 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
20 (png_image_p, init_png_functions, png_load_body, png_load)
21 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
22 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
23 (init_gif_functions, gif_load, imagemagick_image_p)
24 (imagemagick_load_image, imagemagick_load, svg_image_p)
25 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
26 (gs_load):
27 * nsimage.m (ns_load_image):
28 * nsterm.m (ns_defined_color):
29 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
30 * xfns.c (x_defined_color):
31 * xterm.c (x_alloc_lighter_color_for_widget)
32 (x_alloc_nearest_color_1, x_alloc_nearest_color)
33 (x_alloc_lighter_color):
34 * indent.c (disptab_matches_widthtab, current_column)
35 (scan_for_column, string_display_width, indented_beyond_p)
36 (compute_motion, vmotion, Fvertical_motion):
37 Use bool for booleans.
38
39 2012-09-24 Chong Yidong <cyd@gnu.org>
40
41 * chartab.c (Fset_char_table_default): Obsolete function removed.
42
43 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
44
45 Move pid_t related decls out of lisp.h.
46 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
47 (interruptible_wait_for_termination):
48 Move these decls from lisp.h to syswait.h, since they use pid_t.
49 Needed on FreeBSD; see Herbert J. Skuhra in
50 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
51 * callproc.c: Include syswait.h.
52
53 gnutls.c, gtkutil.c: Use bool for boolean.
54 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
55 (emacs_gnutls_handle_error):
56 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
57 (xg_hide_tooltip, xg_create_frame_widgets)
58 (create_dialog, xg_uses_old_file_dialog)
59 (xg_get_file_with_chooser, xg_get_file_with_selection)
60 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
61 (xg_item_label_same_p, xg_update_menubar)
62 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
63 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
64 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
65 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
66 (update_frame_tool_bar, free_frame_tool_bar):
67 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
68 * nsmenu.m (ns_update_menubar):
69 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
70 * xfns.c (Fx_show_tip) [USE_GTK]:
71 Use bool for boolean.
72 * gtkutil.c (xg_update_frame_menubar):
73 * xmenu.c (update_frame_menubar):
74 Return void, not int, since caller ignores return value.
75 * gtkutil.c (xg_change_toolbar_position):
76 Return void, not 1.
77
78 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
79
80 * makefile.w32-in (BLOCKINPUT_H): Remove.
81 (SYSSIGNAL_H): New macro.
82 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
83 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
84 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
85 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
86 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
87 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
88 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
89 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
90 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
91 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
92 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
93 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
94 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
95 ($(BLD)/w32xfns.$(O)): Update dependencies.
96
97 2012-09-23 Eli Zaretskii <eliz@gnu.org>
98
99 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
100 fatal_error_backtrace.
101
102 * w32proc.c (sys_kill): Undo last change: don't do anything when
103 invoked to deliver SIGABRT to our own process. This is now
104 handled by emacs_raise.
105
106 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
107
108 * w32term.c (w32_read_socket): Remove leftover reference to
109 interrupt_input_pending.
110
111 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
112
113 Do not use SA_NODEFER.
114 Problem reported by Dani Moncayo in
115 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
116 * alloc.c (die):
117 * sysdep.c (emacs_abort): Do not reset signal handler.
118 * emacs.c (terminate_due_to_signal): Reset signal handler here.
119 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
120 wanted even on POSIXish hosts, and it doesn't work on Windows.
121
122 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
123
124 * xterm.c (x_term_init): Call fixup_locale before and after calling
125 gtk_init (Bug#12392).
126
127 2012-09-23 Chong Yidong <cyd@gnu.org>
128
129 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
130 Vdynamic_library_alist.
131
132 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
133 (Fgnutls_available_p): Caller changed.
134
135 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
136 (Flibxml_parse_xml_region): Likewise.
137
138 * dispextern.h (struct image_type): Remove arg from init function.
139
140 * image.c (Finit_image_library, lookup_image_type)
141 (define_image_type): Remove now-unneeded second arg.
142 (init_xpm_functions, init_png_functions, init_jpeg_functions)
143 (init_tiff_functions, init_gif_functions, init_svg_functions):
144 Arglist and w32_delayed_load calling convention changed.
145 (gs_type): Remove init_gs_functions; there is no such function.
146 (valid_image_p, make_image): Fix caller to lookup_image_type.
147
148 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
149
150 Simplify and avoid signal-handling races (Bug#12471).
151 * alloc.c (die):
152 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
153 Avoid recursive loop if there's a fatal error in the function itself.
154 * atimer.c (pending_atimers):
155 * blockinput.h: Don't include "atimer.h"; no longer needed.
156 (interrupt_input_pending): Remove. All uses removed.
157 pending_signals now counts both atimers and ordinary interrupts.
158 This is less racy than having three separate pending-signal flags.
159 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
160 (input_blocked_p):
161 Rename from their upper-case counterparts BLOCK_INPUT,
162 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
163 INPUT_BLOCKED_P, and turn into functions. All uses changed.
164 This makes it easier to access volatile variables more accurately.
165 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
166 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
167 that's more reliable if the code is buggy and sets
168 interrupt_input_blocked to a negative value. All uses changed.
169 * atimer.c (deliver_alarm_signal):
170 Remove. No need to deliver this to the parent; any thread can
171 handle this signal now. All uses replaced by underlying handler.
172 * atimer.c (turn_on_atimers):
173 * dispnew.c (handle_window_change_signal):
174 * emacs.c (handle_danger_signal):
175 * keyboard.c (kbd_buffer_get_event):
176 Don't reestablish signal handler; not needed with sigaction.
177 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
178 (UNBLOCK_INPUT_TO):
179 Rework to avoid unnecessary accesses to volatile variables.
180 (UNBLOCK_INPUT_TO): Now a function.
181 (totally_unblock_input, unblock_input): New decls.
182 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
183 (init_data): Remove. Necessary stuff now done in init_signal.
184 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
185 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
186 (fatal_error_code): Remove; no longer needed.
187 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
188 it doesn't always backtrace. All uses changed. No need to reset
189 signal to default, since sigaction and/or die does that for us now.
190 Use emacs_raise (FOO), not kill (getpid (), FOO).
191 (main): Check more-accurately whether we're dumping.
192 Move fatal-error setup to sysdep.c
193 * floatfns.c: Do not include "syssignal.h"; no longer needed.
194 * gtkutil.c (xg_get_file_name, xg_get_font):
195 Remove no-longer-needed signal-mask manipulation.
196 * keyboard.c, process.c (POLL_FOR_INPUT):
197 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
198 * keyboard.c (read_avail_input): Remove.
199 All uses replaced by gobble_input.
200 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
201 (kbd_buffer_store_event_hold, gobble_input):
202 (record_asynch_buffer_change) [USABLE_SIGIO]:
203 (store_user_signal_events):
204 No need to mess with signal mask.
205 (gobble_input): If blocking input and there are terminals, simply
206 set pending_signals to 1 and return. All hooks changed to not
207 worry about whether input is blocked.
208 (process_pending_signals): Clear pending_signals before processing
209 them, in case a signal comes in while we're processing.
210 By convention callers now test pending_signals before calling us.
211 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
212 New functions, to support changes to blockinput.h.
213 (handle_input_available_signal): Now extern.
214 (reinvoke_input_signal): Remove. All uses replaced by
215 handle_async_input.
216 (quit_count): Now volatile, since a signal handler uses it.
217 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
218 callers changed. Block SIGINT only if not already blocked.
219 Clear sigmask reliably, even if Fsignal returns, which it can.
220 Omit unnecessary accesses to volatile var.
221 (quit_throw_to_read_char): No need to restore sigmask.
222 * keyboard.c (gobble_input, handle_user_signal):
223 * process.c (wait_reading_process_output):
224 Call signal-handling code rather than killing ourselves.
225 * lisp.h: Include <float.h>, for...
226 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
227 (pending_signals): Now volatile.
228 (syms_of_data): Now const if IEEE floating point.
229 (handle_input_available_signal) [USABLE_SIGIO]:
230 (terminate_due_to_signal, record_child_status_change): New decls.
231 * process.c (create_process): Avoid disaster if memory is exhausted
232 while we're processing a vfork, by tightening the critical section
233 around the vfork.
234 (send_process_frame, process_sent_to, handle_pipe_signal)
235 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
236 ignores SIGPIPE.
237 (send_process): No need for setjmp/longjmp any more, since the
238 SIGPIPE stuff is now gone. Instead, report an error if errno
239 is EPIPE.
240 (record_child_status_change): Now extern. PID and W are now args.
241 Return void, not bool. All callers changed.
242 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
243 Remove. All uses removed. This bug should be fixed now in a
244 different way.
245 (wait_for_termination_1): Use waitpid rather than sigsuspend,
246 and record the child status change directly. This avoids the
247 need to futz with the signal mask.
248 (process_fatal_action): Move here from emacs.c.
249 (emacs_sigaction_flags): New function, containing
250 much of what used to be in emacs_sigaction_init.
251 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
252 caught by emacs, to make races less likely.
253 (deliver_process_signal): Rename from handle_on_main_thread.
254 All uses changed.
255 (BACKTRACE_LIMIT_MAX): Now at top level.
256 (thread_backtrace_buffer, threadback_backtrace_pointers):
257 New static vars.
258 (deliver_thread_signal, deliver_fatal_thread_signal):
259 New functions, for more-accurate delivery of thread-specific signals.
260 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
261 (deliver_arith_signal): Handle in this thread, not
262 in the main thread, since it's triggered by this thread.
263 (maybe_fatal_sig): New function.
264 (init_signals): New arg DUMPING so that we can be more accurate
265 about whether we're dumping. Caller changed.
266 Treat thread-specific signals differently from process-general signals.
267 Block all signals while handling fatal error; that's safer.
268 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
269 on IEEE hosts.
270 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
271 Ignore SIGPIPE unless batch.
272 (emacs_backtrace): Output backtrace for the appropriate thread,
273 which is not necessarily the main thread.
274 * syssignal.h: Include <stdbool.h>.
275 (emacs_raise): New macro.
276 * xterm.c (x_connection_signal): Remove; no longer needed
277 now that we use sigaction.
278 (x_connection_closed): No need to mess with sigmask now.
279 (x_initialize): No need to reset SIGPIPE handler here, since
280 init_signals does this for us now.
281
282 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
283
284 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
285 background rect may be larger (Bug#12445).
286
287 2012-09-23 Chong Yidong <cyd@gnu.org>
288
289 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
290
291 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
292
293 * .gdbinit: Just stop at fatal_error_backtrace.
294 See Stefan Monnier's request in
295 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
296 Remove no-longer-used query of system type.
297
298 2012-09-22 Chong Yidong <cyd@gnu.org>
299
300 * search.c (Freplace_match): Doc fix (Bug#12325).
301
302 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
303
304 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
305 (Fline_end_position): Doc fix.
306
307 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
308
309 2012-09-22 Chong Yidong <cyd@gnu.org>
310
311 * dispextern.h (struct image_type): Add new slot, storing a type
312 initialization function.
313
314 * image.c (define_image_type): Call the image initializer function
315 if it is defined. Arguments and return value changed.
316 (valid_image_p, make_image): Callers changed.
317 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
318 (gif_type, imagemagick_type, svg_type, gs_type): Add
319 initialization functions.
320 (Finit_image_library): Call lookup_image_type.
321 (CHECK_LIB_AVAILABLE): Macro deleted.
322 (lookup_image_type): Call define_image_type here, rather than via
323 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
324 (syms_of_image): Move define_image_type calls for xbm_type and
325 pbm_type to lookup_image_type.
326
327 2012-09-22 Eli Zaretskii <eliz@gnu.org>
328
329 * keyboard.c (timer_check_2): Move calculation of 'timers' and
330 'idle_timers' from here ...
331 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
332 lists, to avoid infloops when the timer does something stupid,
333 like reinvoke itself with the same or smaller time-out.
334 (Bug#12447)
335
336 2012-09-22 Martin Rudalics <rudalics@gmx.at>
337
338 * window.c (Fsplit_window_internal): Handle only Qt value of
339 Vwindow_combination_limit separately.
340 (Qtemp_buffer_resize): New symbol.
341 (Vwindow_combination_limit): New default value. Rewrite
342 doc-string.
343
344 2012-09-22 Eli Zaretskii <eliz@gnu.org>
345
346 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
347 the new overlay string. (Bug#10159)
348
349 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
350
351 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
352 or that fprintf is async-signal-safe. POSIX doesn't require
353 either assumption.
354
355 2012-09-22 Chong Yidong <cyd@gnu.org>
356
357 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
358 (Bug#8207).
359
360 2012-09-22 Kenichi Handa <handa@gnu.org>
361
362 * composite.c (composition_reseat_it): Handle the case that a
363 grapheme cluster is not covered by a single font (Bug#12352).
364
365 2012-09-21 Chong Yidong <cyd@gnu.org>
366
367 * image.c (define_image_type): Avoid adding duplicate types to
368 image_types (Bug#12463). Suggested by Jörg Walter.
369
370 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
371
372 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
373 (print_load_command_name): Add case LC_DATA_IN_CODE.
374 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
375
376 2012-09-21 Glenn Morris <rgm@gnu.org>
377
378 * eval.c (Frun_hook_with_args_until_success)
379 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
380
381 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
382
383 * fileio.c (Ffile_selinux_context): Only call freecon when
384 lgetfilecon succeeded.
385 (Fset_file_selinux_context): Likewise. (Bug#12444)
386
387 2012-09-21 Eli Zaretskii <eliz@gnu.org>
388
389 * xdisp.c (try_window_reusing_current_matrix): Under bidi
390 reordering, locate the cursor by calling set_cursor_from_row; if
391 that fails, clear the desired glyph matrix before returning a
392 failure indication to the caller. Fixes leaving garbled display
393 when fast scrolling with a down-key. (Bug#12403)
394 (compute_stop_pos_backwards): Fix a typo that caused crashes while
395 scrolling through multibyte text.
396
397 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
398
399 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
400 calling mark_vectorlike since that's the one that marks the window.
401 (mark_discard_killed_buffers): Mark the final cdr.
402 * window.h (struct window): Move prev/next_buffers to the
403 non-standard fields.
404 * window.c (make_window): Initialize prev/next_buffers manually.
405
406 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
407
408 Omit unused arg EXPECTED from socket hooks.
409 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
410 * nsterm.m (ns_term_init):
411 * termhooks.h (struct terminal.read_socket_hook):
412 * w32inevt.c (w32_console_read_socket):
413 * w32term.c (w32_read_socket):
414 * xterm.c (XTread_socket):
415 Omit unused arg EXPECTED. All callers changed.
416 (store_user_signal_events): Return void, not int, since callers no
417 longer care about the return value. All uses changed.
418
419 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
420
421 * w32gui.h (XParseGeometry): Do not declare.
422
423 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
424
425 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
426 Ignore 'expected'. See Eli Zaretskii in
427 <http://bugs.gnu.org/12471#8> (last line).
428
429 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
430 (XParseGeometry): Now static. Substitute extremal values for
431 values that are out of range.
432
433 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
434
435 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
436
437 * nsfns.m (XParseGeometry): Remove.
438 (Fx_create_frame): Call x_set_offset to correctly interpret
439 top_pos in geometry.
440
441 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
442 (Fx_parse_geometry): If there is a space in string, call
443 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
444
445 2012-09-17 Eli Zaretskii <eliz@gnu.org>
446
447 * search.c (scan_buffer): Use character positions in calls to
448 region_cache_forward and region_cache_backward, not byte
449 positions. (Bug#12196)
450
451 * w32term.c (w32_read_socket): Set pending_signals to 1, like
452 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
453
454 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
455 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
456 emacs_blocked_malloc, now deleted.
457
458 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
459
460 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
461 The workaround was for improving performance on Solaris 2.4, but
462 is getting in the way now. Emacs will still work if someone is
463 still running Solaris 2.4 in a museum somewhere; Sun dropped
464 support for Solaris 2.4 in 2003.
465 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
466 * process.c (create_process) [HAVE_WORKING_VFORK]:
467 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
468 since Emacs no longer uses vfork on that platform.
469
470 2012-09-17 Glenn Morris <rgm@gnu.org>
471
472 * emacs.c: Use COPYRIGHT.
473
474 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
475
476 Remove configure's --without-sync-input option (Bug#12450).
477 When auditing signal-handling in preparation for cleaning it up,
478 I found that SYNC_INPUT has race conditions and would be a real
479 pain to fix. Since it's an undocumented and deprecated
480 configure-time option, now seems like a good time to remove it.
481 Also see <http://bugs.gnu.org/11080#16>.
482 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
483 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
484 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
485 (malloc_hysteresis):
486 (check_depth) [XMALLOC_OVERRUN_CHECK]:
487 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
488 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
489 (dont_register_blocks, bytes_used_when_reconsidered)
490 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
491 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
492 [!SYSTEM_MALLOC && !SYNC_INPUT]:
493 Remove. All uses removed.
494 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
495 implementation, one that depends on whether the new macro
496 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
497 is defined.
498 * atimer.c (run_timers, handle_alarm_signal):
499 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
500 (handle_async_input, process_pending_signals)
501 (handle_input_available_signal, init_keyboard):
502 * nsterm.m (ns_read_socket):
503 * process.c (wait_reading_process_output):
504 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
505 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
506 (emacs_write):
507 * xterm.c (XTread_socket):
508 Assume SYNC_INPUT.
509 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
510 * eval.c (handling_signal): Remove. All uses removed.
511 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
512 All uses replaced with the SYNC_INPUT version.
513 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
514 Remove decls.
515 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
516 Now static.
517
518 * font.c (Ffont_shape_gstring): Remove unused local.
519
520 2012-09-16 Glenn Morris <rgm@gnu.org>
521
522 * Makefile.in (clean): No longer run nextstep's clean.
523
524 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
525 (ns_frag): Remove.
526 (ns-app): Move here from ns.mk, and simplify.
527 (clean): Simplify nextstep entry.
528 * ns.mk: Remove file.
529
530 2012-09-17 Kenichi Handa <handa@gnu.org>
531
532 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
533 not covert the last few charactes.
534
535 2012-09-16 Kenichi Handa <handa@gnu.org>
536
537 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
538 here, but just check the validity of glyphs in the glyph-string.
539
540 2012-09-16 Martin Rudalics <rudalics@gmx.at>
541
542 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
543 any window as argument (Bug#12452).
544
545 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
546
547 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
548 to ns_term_init to avoid memory leak.
549
550 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
551 explicit retain/release.
552 (ns_term_init): Only allow one display. Initialize outerpool and
553 ns_*_types.
554
555 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
556
557 Port _setjmp fix to POSIXish hosts as well as Microsoft.
558 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
559 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
560 the Microsoft problem in a different way, by altering ../nt/config.nt.
561
562 2012-09-15 Eli Zaretskii <eliz@gnu.org>
563
564 * w32xfns.c:
565 * w32uniscribe.c:
566 * w32term.c:
567 * w32select.c:
568 * w32reg.c:
569 * w32proc.c:
570 * w32menu.c:
571 * w32inevt.c:
572 * w32heap.c:
573 * w32font.c:
574 * w32fns.c:
575 * w32console.c:
576 * w32.c:
577 * w16select.c: Remove inclusion of setjmp.h, as it is now included
578 by lisp.h. This completes removal of setjmp.h inclusion
579 erroneously announced in the previous commit. (Bug#12446)
580
581 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
582 more accurate.
583
584 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
585 not defined as a macro. The latter happens on MS-Windows.
586 (Bug#12446)
587
588 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
589
590 Port better to POSIX hosts lacking _setjmp (Bug#12446).
591 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
592 Some instances of '#include <setjmp.h>' removed, if the
593 only reason for the instance was because "lisp.h" was included.
594 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
595 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
596 and _longjmp with the new symbols. Emacs already uses _setjmp if
597 available, so this change affects only POSIXish hosts that have
598 sigsetjmp but not _setjmp, such as some versions of Solaris and
599 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
600 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
601 (png_load_body) [HAVE_PNG]:
602 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
603 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
604 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
605 since PNG requires jmp_buf. This is the only exception to the
606 general rule that we now use sys_setjmp and sys_longjmp.
607 This exception is OK since this code does not change the signal
608 mask or longjmp out of a signal handler.
609
610 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
611
612 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
613 Include "syssignal.h", for 'main_thread'.
614
615 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
616
617 Avoid out-of-range marker position (Bug#12426).
618 * insdel.c (replace_range, replace_range_2): Adjust
619 markers before overlays, as suggested by comments.
620 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
621 Remove redundant check before calling offset_intervals.
622
623 2012-09-14 Martin Rudalics <rudalics@gmx.at>
624
625 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
626 current buffer (Bug#12387).
627
628 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
629
630 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
631
632 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
633
634 Use a more backwards-compatible timer format (Bug#12430).
635 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
636 vector element, not from the 4th, since PSECS is now at the end.
637 (Fcurrent_idle_time): Doc fix.
638
639 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
640
641 Function to mark objects and remove killed buffers at once.
642 * alloc.c (discard_killed_buffers): Rename to ...
643 (mark_discard_killed buffers) ... new name. Add marking
644 of remaining objects. Fix comment. Adjust users.
645 (mark_object): Do not touch frame buffer lists here.
646 * frame.c (delete_frame): Reset frame buffer lists here.
647
648 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
649
650 Better workaround for GNOME bug when --enable-gcc-warnings.
651 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
652 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
653 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
654
655 Simplify SIGIO usage (Bug#12408).
656 The code that dealt with SIGIO was crufty and confusing, e.g., it
657 played tricks like "#undef SIGIO" but these tricks were not used
658 consistently. Simplify mostly by not #undeffing standard symbols,
659 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
660 or not as we please) rather than "defined SIGIO" (standard symbol
661 that we probably shouldn't #undef).
662 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
663 Modules that need it can include it.
664 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
665 * dispextern.h (ignore_sigio): New decl.
666 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
667 unconditionally, since it's now a no-op if !USABLE_SIGIO.
668 * emacs.c (shut_down_emacs):
669 * keyboard.c (kbd_buffer_store_event_hold):
670 Use ignore_sigio rather than invoking 'signal' directly.
671 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
672 for FIONREAD.
673 (FIONREAD, SIGIO): Do not #undef.
674 (tty_read_avail_input): Use #error rather than a syntax error.
675 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
676 for I_PIPE, used by SETUP_SLAVE_PTY.
677 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
678 * sysdep.c (croak): Remove; no longer needed. This bit of
679 temporary code, with Fred N. Fish's comment that it's temporary,
680 has been in Emacs since at least 1992!
681 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
682 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
683 * syssignal.h (croak): Remove decl.
684 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
685 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
686 now that we're termios-only.
687 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
688 * term.c (dissociate_if_controlling_tty): Use #error rather than
689 a run-time error.
690
691 Work around GCC and GNOME bugs when --enable-gcc-warnings.
692 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
693 to work around GNOME bug 683906.
694 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
695 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
696 This works around GCC bug 54561.
697
698 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
699
700 More fixes for 'volatile' and setjmp/longjmp.
701 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
702 * image.c (struct png_load_context) [HAVE_PNG]: New type.
703 (png_load_body) [HAVE_PNG]:
704 (jpeg_load_body) [HAVE_JPEG]:
705 New function, with most of the old parent function's body.
706 (png_load) [HAVE_PNG]:
707 (jpeg_load) [HAVE_JPEG]:
708 Invoke the new function, to avoid longjmp munging our locals.
709 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
710 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
711 longjmp is passed 2, as the C standard doesn't guarantee this.
712 Instead, store the failure code into mgr->failure_code.
713
714 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
715
716 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
717 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
718 (syms_of_keyboard): Remove support for unread-command-char.
719
720 2012-09-12 Eli Zaretskii <eliz@gnu.org>
721
722 * w32proc.c (sys_kill): If PID is our process ID and the signal is
723 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
724 violation. (Bug#12426)
725
726 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
727
728 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
729
730 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
731
732 * eval.c: Add `inhibit-debugger'.
733 (Qinhibit_debugger): New symbol.
734 (call_debugger): Bind it instead of Qdebug_on_error.
735 (maybe_call_debugger): Test Vinhibit_debugger.
736 (syms_of_eval): Define inhibit-debugger.
737 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
738 (syms_of_xdisp): Remove inhibit-debug-on-message.
739
740 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
741
742 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
743 If a nonvolatile local variable is written before a _longjmp to
744 the frame containing the variable, and is read after the _longjmp,
745 the value read is indeterminate. Some local variables of type
746 'struct handler' and 'struct catchtag' are used in this way, so
747 mark each of their slots as volatile if the slot can be set before
748 _longjmp and read afterwards.
749 * lisp.h (struct handler): var and chosen_clause are now volatile.
750 (struct catchtag): val, next, and pdlcount are now volatile.
751
752 * bidi.c (bidi_push_it, bidi_pop_it):
753 * fns.c (copy_hash_table):
754 * image.c (define_image_type):
755 * keyboard.c (kbd_buffer_store_event_hold):
756 * process.c (Fprocess_send_eof):
757 * xfaces.c (x_create_gc) [HAVE_NS]:
758 * xgselect.c (xg_select):
759 Prefer assignment to memcpy when either will do.
760
761 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
762 Use pointer-to-a-pointer to simplify and avoid a NILP check each
763 time an item is removed. No need to mark this function 'inline';
764 the compiler knows better than we do.
765
766 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
767
768 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
769 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
770 to change_frame_size (Bug#12388).
771 (windowDidResize:): Pass YES to updateFrameSize.
772
773 * nsterm.h: Add delay parameter to updateFrameSize.
774
775 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
776
777 Discard killed buffers from deleted window and frame objects.
778 This reduces an amount of references to killed buffers and
779 helps GC to reclaim them faster.
780 * alloc.c (discard_killed_buffers): New function.
781 (mark_object): Use it for deleted windows and frames.
782 (mark_object): If symbol's value is set up for a killed buffer
783 or deleted frame, restore it's global binding.
784 * data.c (swap_in_global_binding): Add GC notice.
785 (swap_in_symval_forwarding): Use convenient set_blv_where.
786 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
787 * window.h: ... to here.
788
789 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
790
791 Convenient macro to check whether the buffer is live.
792 * buffer.h (BUFFER_LIVE_P): New macro.
793 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
794 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
795
796 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
797
798 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
799 composition cases (Bug#12364).
800
801 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
802 overhang of succeeding glyphs overlapping box cursor.
803
804 * w32term.c (x_draw_glyph_string): Likewise.
805
806 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
807
808 Simplify, document, and port floating-point (Bug#12381).
809 The porting part of this patch fixes bugs on non-IEEE platforms
810 with frexp, ldexp, logb.
811 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
812 Now static.
813 * floatfns.c: Simplify discussion of functions that Emacs doesn't
814 support, by removing commented-out code and briefly listing the
815 C89 functions excluded. The commented-out stuff was confusing
816 maintenance, e.g., we thought we needed cbrt but it was commented out.
817 (logb): Remove decl; no longer needed.
818 (isfinite): New macro, if not already supplied.
819 (isnan): Don't replace any existing macro.
820 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
821 are present on all C89 platforms.
822 (Ffrexp): Do not special-case zero, as frexp does the right thing
823 for that case.
824 (Flogb): Do not use logb, as it doesn't have the desired meaning
825 on hosts that use non-base-2 floating point. Instead, stick with
826 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
827 frexp, to avoid getting an unspecified result.
828
829 * xdisp.c (Qinhibit_debug_on_message): Now static.
830
831 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
832
833 * nsterm.m (ns_update_begin): Set clip path to whole view by using
834 NSBezierPath (Bug#12131).
835
836 2012-09-10 Chong Yidong <cyd@gnu.org>
837
838 * fns.c (Fdelq, Fdelete): Doc fix.
839
840 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
841
842 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
843 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
844
845 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
846
847 * lisp.h (make_lisp_ptr): New macro to replace XSET.
848 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
849 Use it.
850
851 2012-09-09 Eli Zaretskii <eliz@gnu.org>
852
853 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
854 left fringe if the window has a left margin. This avoids leaving
855 traces of the cursor because its leftmost pixel is not drawn over.
856
857 * dispnew.c (update_window_line): When the left margin area of a
858 screen line is updated, set the redraw_fringe_bitmaps_p flag of
859 that screen line. (Bug#12277)
860
861 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
862
863 Assume C89 or later for math functions (Bug#12381).
864 This simplifies the code, and makes it a bit smaller and faster,
865 and (most important) makes it easier to clean up signal handling
866 since we can stop worring about floating-point exceptions in
867 library code. That was a problem before C89, but the problem
868 went away many years ago on all practical Emacs targets.
869 * data.c, image.c, lread.c, print.c:
870 Don't include <math.h>; no longer needed.
871 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
872 might be autoconfigured, as that never happens.
873 * data.c (fmod):
874 * doprnt.c (DBL_MAX_10_EXP):
875 * print.c (DBL_DIG):
876 Remove. C89 or later always defines these.
877 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
878 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
879 (arith_error, domain_error, domain_error2):
880 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
881 no longer needed -- we simply return what C returns. All uses removed.
882 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
883 the wrapped code.
884 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
885 Remove. All uses expanded, as these macros are no longer used
886 more than once and are now more trouble than they're worth.
887 (Ftan): Use tan, not sin / cos.
888 (Flogb): Assume C89 frexp.
889 (fmod_float): Assume C89 fmod.
890 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
891 (init_floatfns): Remove. All uses removed.
892
893 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
894
895 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
896 compositeToPoint for OSX < 10.6 (Bug#12390).
897
898 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
899
900 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
901 This produces more-accurate results.
902
903 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
904
905 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
906 changes (Bug#12088).
907
908 2012-09-08 Chong Yidong <cyd@gnu.org>
909
910 * syntax.c (Fstring_to_syntax): Doc fix.
911
912 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
913
914 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
915 in the internal border.
916 (x_set_window_size): Remove static variables and their usage.
917 (ns_redraw_scroll_bars): Fix NSTRACE arg.
918 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
919 fringe/internal border adjustment (Bug#11052).
920 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
921 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
922 (ns_fix_rect_ibw): Remove.
923 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
924 (ns_dumpglyphs_box_or_relief): Ditto.
925 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
926 adjustment.
927 (ns_dumpglyphs_image): Ditto.
928 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
929 border adjustment.
930 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
931 their usage. Add fringe_extended_p and its use as in other terms.
932 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
933 scroll bar was removed.
934 (updateFrameSize): New function.
935 (windowDidResize): Move code to updateFrameSize and call it.
936
937 * nsterm.h (EmacsView): Add updateFrameSize.
938
939 2012-09-07 Chong Yidong <cyd@gnu.org>
940
941 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
942
943 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
944
945 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
946
947 More signal-handler cleanup (Bug#12327).
948 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
949 Problem introduced when merging patches. Noted by Eli Zaretskii in
950 <http://bugs.gnu.org/12327#67>.
951 * floatfns.c: Comment fix.
952 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
953 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
954 and anyway the declaration is harmless even if SIGDANGER is not defined.
955 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
956 defined BROKEN_FIONREAD). systty.h formerly did this, but other
957 source files not surprisingly expected syssignal.h to define, or
958 not define, SIGIO, and it's cleaner to do it that way, for consistency.
959 Include <sys/ioctl.h>, for FIONREAD.
960 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
961 This eliminates a problem whereby other files mysteriously had
962 to include "syssignal.h" before including "systty.h" if they
963 wanted to use "#ifdef SIGIO".
964
965 2012-09-07 Eli Zaretskii <eliz@gnu.org>
966
967 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
968
969 * w32.c (sigemptyset): Empty the set.
970 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
971
972 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
973
974 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
975
976 * alloc.c (mark_buffer): Revert unsafe marking optimization.
977 (mark_object): Likewise for frame objects.
978
979 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
980
981 * syssignal.h (handle_on_main_thread): Always declare,
982 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
983 This ports to platforms without HAVE_PTHREAD.
984
985 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
986
987 Signal-handler cleanup (Bug#12327).
988 Emacs's signal handlers were written in the old 4.2BSD style with
989 sigblock and sigmask and so forth, and this led to some
990 inefficiencies and confusion. Rewrite these to use
991 pthread_sigmask etc. without copying signal sets around. Also,
992 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
993 'signal', and instead use functions that do not attempt to take
994 over the system name space. This patch causes Emacs's text
995 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
996 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
997 Do not include <signal.h> or "syssignal.h", as these
998 modules do not use signals.
999 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1000 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1001 Do not include <signal.h>, as "syssignal.h" does that for us now.
1002 * atimer.c (sigmask_atimers): New function.
1003 (block_atimers, unblock_atimers): New functions,
1004 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1005 All uses replaced.
1006 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1007 no longer needed here.
1008 * emacs.c (main): Inspect existing signal handler with sigaction,
1009 so that there's no need to block and unblock SIGHUP.
1010 * sysdep.c (struct save_signal): New member 'action', replacing
1011 old member 'handler'.
1012 (save_signal_handlers, restore_signal_handlers):
1013 Use sigaction instead of 'signal' to save and restore.
1014 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1015 New function. All users of 'signal' modified to use set_sighandler
1016 if they're writeonly, and to use sys_signal if they're read+write.
1017 (emacs_sigaction_init, forwarded_signal): New functions.
1018 (sys_signal): Remove. All uses replaced by calls to sigaction
1019 and emacs_sigaction_init, or by direct calls to 'signal'.
1020 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1021 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1022 all uses replaced by pthread_sigmask etc. calls.
1023 * syssignal.h: Include <signal.h>.
1024 (emacs_sigaction_init, forwarded_signal): New decls.
1025 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1026 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1027 (sigmask, sys_sigmask): Remove; no longer needed.
1028 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1029 (sigblock, sigunblock, sigfree):
1030 (sigsetmask) [!defined sigsetmask]:
1031 Remove. All uses replaced by pthread_sigmask.
1032 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1033 no longer need to be replaced, and its typical old uses
1034 are now done via emacs_sigaction_init and sigaction.
1035 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1036 (sys_sigdel): Remove; unused.
1037 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1038
1039 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1040
1041 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1042 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1043
1044 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1045
1046 Explicitly mark buffer_defaults and buffer_local_symbols.
1047 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1048 mark_local_symbols here.
1049 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1050 since special buffers aren't marked here any more.
1051 (allocate_buffer): Chain new buffer with all_buffers here...
1052 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1053 not here.
1054 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1055 (syms_of_buffer): Remove staticpro of the above.
1056 (init_buffer_once): Set names for buffer_defaults and
1057 buffer_local_symbols.
1058
1059 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1060
1061 Use bool for booleans in font-related modules.
1062 * font.c (font_intern_prop, font_style_to_value)
1063 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1064 (generate_otf_features, font_check_otf_features, font_check_otf)
1065 (font_match_p, font_list_entities, font_at):
1066 * fontset.c (fontset_id_valid_p, reorder_font_vector
1067 (fontset_find_font, Fset_fontset_font)
1068 (face_suitable_for_char_p) [0]:
1069 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1070 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1071 (m17n_flt_initialized, ftfont_shape_by_flt):
1072 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1073 * nsfont.m (nsfont_draw):
1074 * w32font.c (w32font_draw):
1075 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1076 Use bool for booleans.
1077 * font.h: Adjust to above API changes.
1078 (struct font, struct font_driver, struct font_driver_list):
1079 Use bool for booleans.
1080 (struct font): Remove useless member encoding_type.
1081 All users removed.
1082 * fontset.c, xftfont.c: Omit unnecessary static decls.
1083
1084 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1085
1086 * alloc.c (mark_object): Revert window marking code
1087 since it's unsafe for the Fset_window_configuration.
1088
1089 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1090
1091 Fix race conditions with signal handlers and errno (Bug#12327).
1092 Be more systematic about preserving errno whenever a signal
1093 handler returns, even if it's not in the main thread. Do this by
1094 renaming signal handlers to distinguish between signal delivery
1095 and signal handling. All uses changed.
1096 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1097 * data.c (deliver_arith_signal): Rename from arith_error.
1098 * dispnew.c (deliver_window_change_signal): Rename from
1099 window_change_signal.
1100 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1101 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1102 * keyboard.c (deliver_input_available_signal): Rename from
1103 input_available_signal.
1104 (deliver_user_signal): Rename from handle_user_signal.
1105 (deliver_interrupt_signal): Rename from interrupt_signal.
1106 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1107 (deliver_child_signal): Rename from sigchld_handler.
1108 * atimer.c (handle_alarm_signal):
1109 * data.c (handle_arith_signal):
1110 * dispnew.c (handle_window_change_signal):
1111 * emacs.c (handle_fatal_signal, handle_danger_signal):
1112 * keyboard.c (handle_input_available_signal):
1113 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1114 * process.c (handle_pipe_signal, handle_child_signal):
1115 New functions, with the actual signal-handling code taken from the
1116 original respective signal handlers, sans the sporadic attempts to
1117 preserve errno, since that's now done by handle_on_main_thread.
1118 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1119 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1120 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1121 Move to sysdep.c.
1122 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1123 Move initialization of main_thread to sysdep.c's init_signals.
1124 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1125 our usage, and simplifies the mainline code.
1126 (record_child_status_change): New static function, as a helper
1127 for handle_child_signal, and with most of the old child handler's
1128 contents.
1129 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1130 (handle_child_signal): Use the above.
1131 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1132 Moved here from emacs.c.
1133 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1134 code moved here from emacs.c's main function.
1135 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1136 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
1137 lets callers save and restore errno properly.
1138
1139 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1140
1141 Remove redundant or unused things here and there.
1142 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1143 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1144 * editfns.c (Fcompare_buffer_substrings): Likewise.
1145 * frame.h (struct terminal, struct font_driver_list):
1146 Remove redundant declarations.
1147 * window.h (Qleft, Qright): Likewise.
1148
1149 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1150
1151 Do not mark objects from deleted buffers, windows and frames.
1152 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1153 (mark_object): Likewise for windows and frames.
1154
1155 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1156
1157 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1158 buffer_defaults and buffer_local_symbols as valid objects.
1159 Return special value to denote them.
1160
1161 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1162
1163 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1164 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1165 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1166 (file_name_absolute_p, Fsubstitute_in_file_name):
1167 (check_executable, check_writable, Ffile_accessible_directory_p)
1168 (Fset_file_selinux_context, Fdefault_file_modes)
1169 (Finsert_file_contents, choose_write_coding_system)
1170 (Fwrite_region, build_annotations, a_write, e_write)
1171 (Fdo_auto_save):
1172 * filelock.c (boot_time_initialized, get_boot_time)
1173 (get_boot_time_1, lock_file_1, within_one_second):
1174 * floatfns.c (in_float):
1175 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1176 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1177 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1178 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1179 * window.c (compare_window_configurations):
1180 Use bool for booleans.
1181 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1182 (Fdefault_file_modes): Now mode_t, not int, for modes.
1183 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1184 (internal_delete_file): Now returns void, not a (boolean) int,
1185 since nobody was looking at the return value.
1186 * lisp.h, window.h: Adjust to above API changes.
1187
1188 * xdisp.c (set_message): Simplify and reindent last change.
1189
1190 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1191
1192 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1193
1194 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1195
1196 * eval.c (call_debugger): Make the function non-static so that we
1197 can call it from set_message.
1198
1199 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1200 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1201
1202 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1203
1204 Give more-useful info on a fatal error (Bug#12328).
1205 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1206 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1207 of doing the work ourselves.
1208 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1209 do most of the work.
1210 (fatal_error_backtrace): New function, taken from the guts
1211 of the old fatal_error_signal, but with a new option to output
1212 a backtrace.
1213 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1214 info about the signal than just its number.
1215 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1216 * sysdep.c: Include <execinfo.h>
1217 (emacs_backtrace): New function, taken partly from the previous
1218 code of the 'die' function.
1219 (emacs_abort): Call fatal_error_backtrace rather than abort.
1220
1221 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1222
1223 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1224 eager (load-time) macro-expansion.
1225 * lisp.mk (lisp): Add macroexp.
1226
1227 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1228
1229 Simplify redefinition of 'abort' (Bug#12316).
1230 Do not try to redefine the 'abort' function. Instead, redo
1231 the code so that it calls 'emacs_abort' rather than 'abort'.
1232 This removes the need for the NO_ABORT configure-time macro
1233 and makes it easier to change the abort code to do a backtrace.
1234 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1235 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1236 Remove; sysdep.c's emacs_abort now takes its place.
1237 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1238 'abort' changed to use 'emacs_abort'.
1239 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1240 (abort) [!defined abort]: Rename to ...
1241 (emacs_abort): ... new name.
1242 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1243 the place of the old 'abort' in emacs.c.
1244 * w32.c, w32fns.c (abort): Do not #undef.
1245 * w32.c (emacs_abort): Rename from w32_abort.
1246
1247 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1248
1249 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1250 offsets[j].dv, since the y axis of the screen coordinates points
1251 down, while the y axis of the font definition coordinates points
1252 up. This fixes display of Arabic diacritics such as KASRA and
1253 KASRATAN. (Bug#11860)
1254
1255 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1256
1257 Be more systematic about _setjmp vs setjmp.
1258 * alloc.c (test_setjmp, mark_stack):
1259 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1260 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1261 (png_load, my_error_exit, jpeg_load):
1262 * process.c (send_process_trap, send_process):
1263 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1264 The underscored versions are up to 30x faster on some hosts.
1265 Formerly, the code used setjmp+longjmp sometimes and
1266 _setjmp+_longjmp at other times, with no particular reason to
1267 prefer setjmp+longjmp.
1268
1269 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1270
1271 Fix minor problem found by static checking.
1272 * buffer.c (Fdelete_all_overlays): Return nil.
1273
1274 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1275
1276 * buffer.c (Fdelete_all_overlays): New function.
1277
1278 2012-09-03 Chong Yidong <cyd@gnu.org>
1279
1280 * gtkutil.c: Add extern decl for Qxft.
1281
1282 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1283
1284 * emacs.c, eval.c: Use bool for boolean.
1285 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1286 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1287 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1288 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1289 (main, decode_env_path, Fdaemon_initialized):
1290 * eval.c (call_debugger, Finteractive_p, interactive_p):
1291 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1292 (maybe_call_debugger, Fbacktrace):
1293 * process.c (read_process_output, exec_sentinel):
1294 Use bool for booleans.
1295 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1296 All callers changed.
1297 * eval.c (interactive_p): Omit always-true boolean argument
1298 EXCLUDE_SUBRS_P. All callers changed.
1299 * dispextern.h, lisp.h: Reflect above API changes.
1300 * firstfile.c (dummy): Use the address of 'main', whose signature
1301 won't change, instead of the address of 'initialize', whose
1302 signature just changed from int to bool.
1303 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1304 * msdos.c (fatal_error_in_progress): ... from here.
1305 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1306 of incrementing it.
1307 (redisplay_internal, unwind_redisplay): Simply clear
1308 REDISPLAYING_P when unwinding, instead of saving its previous,
1309 always-false value and then restoring it.
1310
1311 Clean up some extern decls.
1312 Mostly, this hoists extern decls out of .c files and into .h files.
1313 That way, we're more likely to catch errors if the interfaces change.
1314 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1315 declare xg_mark_data.
1316 * dispextern.h (x_frame_parm_handlers):
1317 * font.h (Qxft):
1318 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1319 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1320 (Qultra_bold, Qoblique, Qitalic):
1321 Move extern decl here from .c file.
1322 * alloc.c (xg_mark_data) [USE_GTK]:
1323 * doc.c (Qclosure):
1324 * eval.c (Qlexical_binding):
1325 * fns.c (time) [!HAVE_UNISTD_H]:
1326 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1327 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1328 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1329 * lread.c (Qinternal_interpreter_environment):
1330 * minibuf.c (Qbuffer):
1331 * process.c (QCfamily, QCfilter):
1332 * widget.c (free_frame_faces):
1333 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1334 * xfont.c (x_clear_errors):
1335 * xterm.c (x_frame_parm_handlers):
1336 Remove now-redundant extern decls.
1337 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1338 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1339 Now static.
1340 * xfaces.c: Remove unnecessary static decls.
1341 * xterm.c (updating_frame): Remove decl of nonexistent object.
1342
1343 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1344 when building globals.h, as the objects that are not built on
1345 this host are not needed to compile C files on this host.
1346
1347 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1348
1349 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1350
1351 * frame.h: Add missing prototype for x_wm_set_size_hint.
1352
1353 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1354
1355 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1356 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1357 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1358 (Fsubstitute_command_keys):
1359 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1360 (save_excursion_save, save_excursion_restore)
1361 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1362 (format_time_string, general_insert_function)
1363 (make_buffer_string, make_buffer_string_both)
1364 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1365 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1366 (copy_text, insert_1, insert_1_both, insert_from_string)
1367 (insert_from_string_before_markers, insert_from_string_1)
1368 (insert_from_buffer, insert_from_buffer_1, replace_range)
1369 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1370 (del_range_2, modify_region):
1371 * intervals.c (intervals_equal, balance_possible_root_interval)
1372 (adjust_intervals_for_insertion, merge_properties_sticky)
1373 (graft_intervals_into_buffer, lookup_char_property)
1374 (adjust_for_invis_intang, set_point_both)
1375 (get_property_and_range, compare_string_intervals)
1376 (set_intervals_multibyte_1, set_intervals_multibyte):
1377 * keyboard.c (decode_timer):
1378 Use bool for boolean.
1379 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1380 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1381
1382 2012-09-02 Chong Yidong <cyd@gnu.org>
1383
1384 * keymap.c (push_key_description): Print M-TAB as C-M-i
1385 (Bug#11758).
1386
1387 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1388
1389 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1390 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1391 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1392 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1393 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1394 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1395 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1396
1397 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1398
1399 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1400 more than one grapheme cluster passed to the shaper: compute the
1401 offset adjustment values separately for each cluster. (Bug#11860)
1402
1403 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1404 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1405 about implicit conversions from integer to pointer.
1406
1407 2012-09-01 Daniel Colascione <dancol@dancol.org>
1408
1409 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1410 system used too early.
1411
1412 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1413
1414 Better seed support for (random).
1415 * emacs.c (main): Call init_random.
1416 * fns.c (Frandom): Set the seed from a string argument, if given.
1417 Remove long-obsolete Gentzel cruft.
1418 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1419 (init_random): New function.
1420
1421 2012-09-01 Daniel Colascione <dancol@dancol.org>
1422
1423 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1424 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1425 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1426 x_wm_set_size_hint, x_query_colors, x_real_positions,
1427 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1428 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1429 all of which have been moved to common code.
1430
1431 * xfaces.c: Include TERM_HEADER instead of listing all possible
1432 window-system headers.
1433
1434 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1435 to match header.
1436
1437 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1438 directly accessing frame internals.
1439
1440 * w32font.h: Include font.h. Define syms_of_w32font and
1441 globals_of_w32font.
1442
1443 * process.c: Include TERM_HEADER instead of listing all possible
1444 window-system headers.
1445
1446 * nsterm.h: Remove declarations now in frame.h. Define
1447 FRAME_X_SCREEN, FRAME_X_VISUAL.
1448
1449 * menu.c: Include TERM_HEADER instead of listing all possible
1450 window-system headers.
1451
1452 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1453 window system.
1454
1455 * keyboard.c: Include TERM_HEADER instead of listing all possible
1456 window-system headers.
1457
1458 * image.c: Include TERM_HEADER instead of listing all possible
1459 window-system headers. Declare Vlibrary_cache when compiling for
1460 Windows.
1461
1462 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1463 window system declarations.
1464
1465 * frame.h: Move common functions here: set_frame_menubar,
1466 x_set_window_size, x_sync, x_get_focus_frame,
1467 x_set_mouse_position, x_set_mouse_pixel_position,
1468 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1469 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1470 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1471 x_activate_menubar, x_real_positions, x_bitmap_icon,
1472 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1473 and x_query_colors.
1474
1475 * frame.c: Include TERM_HEADER instead of listing all possible
1476 window-system headers.
1477
1478 * font.c: Include TERM_HEADER instead of listing all possible
1479 window-system headers.
1480
1481 * emacs.c: Include TERM_HEADER.
1482
1483 * dispnew.c: Include TERM_HEADER instead of listing all possible
1484 window-system headers.
1485
1486 * ccl.h: Include character.h.
1487
1488 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1489 the current window system; include in list of objects to link into
1490 Emacs.
1491
1492 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1493
1494 Remove mark_ttys function and fix tty_display_info initialization.
1495 * lisp.h (mark_ttys): Remove prototype.
1496 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1497 to mark_ttys because all possible values of 'top_frame' slot are
1498 the frames which are reachable from Vframe_list.
1499 * term.c (mark_ttys): Remove.
1500 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1501
1502 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1503
1504 Change struct frame bitfields from unsigned char to unsigned.
1505 * frame.h (struct frame): Change type of 'display_preempted',
1506 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1507 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1508 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1509 bitfields from unsigned char to unsigned.
1510
1511 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1512
1513 Remove unused member of struct x_output and struct w32_output.
1514 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1515 * w32term.h (struct w32_output): Likewise.
1516
1517 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1518
1519 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1520 does not become zero (Bug#12234).
1521
1522 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1523
1524 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1525 for GCC 4.7.1 x86-64.
1526
1527 2012-08-30 Glenn Morris <rgm@gnu.org>
1528
1529 * lread.c (init_lread): For out-of-tree builds, only add the
1530 source directory's site-lisp dir to the load-path if it exists,
1531 consistent with in-tree builds. (Bug#12302)
1532
1533 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1534
1535 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1536 button_values to NULL. Call setStykeMask so dialogs get a close button.
1537 (windowShouldClose:): Set window_closed.
1538 (dealloc): New member, free button_values.
1539 (process_dialog:): Make member function. Remove window argument,
1540 replace window with self. Count buttons and allocate and store values
1541 in button_values.
1542 (addButton:value:row:): value is int with the name tag. Call setTag
1543 with tag. Remove return self, declare return value as void.
1544 (addString:row:): Remove return self, declare return value as void.
1545 (addSplit): Remove return self, declare return value as void.
1546 (clicked:): Remove return self, declare return value as void.
1547 Set dialog_return to button_values[seltag]. Code formatting change.
1548 (initFromContents:isQuestion:): Adjust call to process_dialog.
1549 Code formatting change.
1550 (timeout_handler:): Set timer_fired to YES.
1551 (runDialogAt:): Set timer_fired to NO.
1552 Handle click on close button as quit.
1553
1554 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1555 Add window_closed and button_values. Add void as return value for
1556 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1557 Add process_dialog as new member.
1558
1559 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1560
1561 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1562 is not one of the heaps we manage. (Bug#12242)
1563
1564 2012-08-28 Glenn Morris <rgm@gnu.org>
1565
1566 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1567
1568 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1569
1570 * window.c (Fset_window_configuration): Remove handling of
1571 auto-buffer-name window parameter. Install revision of reverted
1572 fix.
1573
1574 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1575
1576 Do not allow to set major mode for a dead buffer.
1577 * buffer.c (Fset_buffer_major_mode): Signal an error
1578 if the buffer is dead.
1579 (Fother_buffer, other_buffer_safely): Remove redundant
1580 nested declaration.
1581
1582 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1583
1584 Always use set_buffer_if_live to restore original buffer at unwind.
1585 * buffer.h (record_unwind_current_buffer): New function.
1586 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1587 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1588 * undo.c, window.c: Adjust users.
1589 * buffer.c (set_buffer_if_live): Fix comment.
1590
1591 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1592
1593 Fix usage of set_buffer_internal.
1594 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1595 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1596 * coding.c (decode_coding): Omit redundant test.
1597 * fileio.c (decide_coding_unwind): Likewise.
1598 * fns.c (secure_hash): Likewise.
1599 * insdel.c (modify_region): Likewise.
1600 * keyboard.c (command_loop_1): Likewise.
1601 * print.c (PRINTFINISH): Likewise.
1602 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1603
1604 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1605
1606 * dispnew.c: Use bool for boolean.
1607 (frame_garbaged, display_completed, delayed_size_change)
1608 (fonts_changed_p, add_window_display_history)
1609 (add_frame_display_history, verify_row_hash)
1610 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1611 (row_equal_p, realloc_glyph_pool)
1612 (allocate_matrices_for_frame_redisplay)
1613 (showing_window_margins_p)
1614 (adjust_frame_glyphs_for_frame_redisplay)
1615 (build_frame_matrix_from_leaf_window, make_current)
1616 (mirrored_line_dance, mirror_line_dance, update_frame)
1617 (update_window_tree, update_single_window)
1618 (check_current_matrix_flags, update_window, update_text_area)
1619 (update_window_line, set_window_update_flags, scrolling_window)
1620 (update_frame_1, scrolling, buffer_posn_from_coords)
1621 (do_pending_window_change, change_frame_size)
1622 (change_frame_size_1, sit_for):
1623 Use bool for boolean.
1624 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1625 and remove last int (actually boolean) argument, which was always 0.
1626 All callers changed.
1627 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1628 * dispextern.h (struct composition_it): Use bool for boolean.
1629 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1630 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1631 * dired.c (file_name_completion):
1632 Use bool for boolean. (This was missed in an earlier change.)
1633
1634 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1635
1636 * window.c (Fset_window_configuration): Revert first part of
1637 last change.
1638
1639 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1640
1641 * nsterm.h (NSPanel): New class variable dialog_return.
1642
1643 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1644 dialog_return.
1645 (windowShouldClose:): Use stop instead of stopModalWithCode.
1646 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1647 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1648 event.
1649 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1650 modal loop returns.
1651
1652 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1653
1654 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1655 * composite.c (find_composition, composition_gstring_p)
1656 (composition_reseat_it, find_automatic_composition):
1657 * data.c (let_shadows_buffer_binding_p)
1658 (let_shadows_global_binding_p, set_internal, make_blv)
1659 (Fmake_variable_buffer_local, Fmake_local_variable)
1660 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1661 (cons_to_signed, arith_driver):
1662 * dbusbind.c (xd_in_read_queued_messages):
1663 * dired.c (directory_files_internal, file_name_completion):
1664 Use bool for booleans.
1665 * dired.c (file_name_completion):
1666 * process.h (fd_callback):
1667 Omit int (actually boolean) argument. It wasn't being used.
1668 All uses changed.
1669 * composite.h, lisp.h: Reflect above API changes.
1670
1671 * cmds.c, coding.c: Use bool for booleans.
1672 * cmds.c (move_point, Fself_insert_command):
1673 * coding.h (struct composition status, struct coding_system):
1674 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1675 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1676 (emacs_mule_char, decode_coding_emacs_mule)
1677 (encode_coding_emacs_mule, detect_coding_iso_2022)
1678 (decode_coding_iso_2022, encode_invocation_designation)
1679 (encode_designation_at_bol, encode_coding_iso_2022)
1680 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1681 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1682 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1683 (encode_coding_raw_text, detect_coding_charset)
1684 (decode_coding_charset, encode_coding_charset, detect_eol)
1685 (detect_coding, get_translation_table, produce_chars)
1686 (consume_chars, reused_workbuf_in_use)
1687 (make_conversion_work_buffer, code_conversion_save)
1688 (decode_coding_object, encode_coding_object)
1689 (detect_coding_system, char_encodable_p)
1690 (Funencodable_char_position, code_convert_region)
1691 (code_convert_string, code_convert_string_norecord)
1692 (Fset_coding_system_priority):
1693 * fileio.c (Finsert_file_contents):
1694 Use bool for booleans.
1695 * coding.h, lisp.h: Reflect above API changes.
1696 * coding.c: Remove unnecessary static function decls.
1697 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1698 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1699 not a boolean 'int', since callers never look at the return value.
1700 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1701 * coding.h (decoding_buffer_size, encoding_buffer_size)
1702 (emacs_mule_string_char): Remove unused extern decls.
1703 (struct iso_2022_spec, struct coding_system):
1704 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1705 (struct emacs_mule_spec): Remove unused field 'full_support'.
1706 All initializations removed.
1707 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1708
1709 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1710
1711 Fix spare memory change (Bug#12286).
1712 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1713 (valid_lisp_object_p): Likewise.
1714
1715 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1716
1717 * window.c (Fset_window_configuration): Record any window's old
1718 buffer if it's replaced (see Bug#8789). If the new current
1719 buffer doesn't appear in the selected window, go to its old
1720 point (Bug#12208).
1721
1722 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1723
1724 Special MEM_TYPE_SPARE to denote reserved memory.
1725 * alloc.c (enum mem_type): New memory type.
1726 (refill_memory_reserve): Use new type for spare memory.
1727 This prevents live_cons_p and live_string_p from incorrect
1728 detection of uninitialized objects from spare memory as live.
1729
1730 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1731
1732 Spelling fixes.
1733 * Makefile.in (.PHONY): versioclean -> versionclean.
1734
1735 Remove unused external symbols.
1736 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1737 * window.c (Qwindow_valid_p, decode_valid_window):
1738 Now static, not extern.
1739 * data.c (Qinterval): Remove; unused.
1740 (syms_of_data): Do not define 'interval'.
1741 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1742 * window.h (decode_valid_window):
1743 Remove decls.
1744
1745 * character.c, charset.c, chartab.c: Use bool for booleans.
1746 * character.c (lisp_string_width, string_count_byte8)
1747 (string_escape_byte8):
1748 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1749 (load_charset_map_from_file, map_charset_chars)
1750 (Fdefine_charset_internal, define_charset_internal)
1751 (Fdeclare_equiv_charset, find_charsets_in_text)
1752 (Ffind_charset_region, char_charset, Fiso_charset):
1753 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1754 (sub_char_table_set, sub_char_table_set_range)
1755 (char_table_set_range, optimize_sub_char_table)
1756 (map_sub_char_table):
1757 Use bool for boolean.
1758 * character.c (str_to_unibyte): Omit last boolean argument; it was
1759 always 0. All callers changed.
1760 * character.h, charset.h: Adjust to match previous changes.
1761 * character.h (char_printable_p): Remove decl of nonexistent function.
1762 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1763 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1764 are all boolean, so make them single-bit bitfields.
1765
1766 * lisp.h (ASET): Remove attempt to detect side effects.
1767 It was meant to be temporary and it often doesn't work,
1768 because when IDX has side effects the behavior of IDX==IDX
1769 is undefined. See Stefan Monnier in
1770 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1771
1772 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1773
1774 * lisp.h (functionp): New function (extracted from Ffunctionp).
1775 (FUNCTIONP): Use it.
1776 * eval.c (Ffunctionp): Use it.
1777
1778 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1779
1780 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1781 as that's faster and simpler than static storage. Don't bother
1782 with the g_main_context_query overhead if g_main_context_pending
1783 says no events are pending.
1784 (gfds, gfds_size): Remove these static vars.
1785 (xgselect_initialize): Remove; no longer needed.
1786 All uses and decls removed.
1787
1788 * emacs.c (fatal_error_signal_hook): Remove.
1789 All uses removed. This leftover from old code was always 0.
1790
1791 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1792 * casefiddle.c (casify_object, casify_region):
1793 * casetab.c (set_case_table):
1794 * category.c, category.h (word_boundary_p):
1795 * category.h (CHAR_HAS_CATEGORY):
1796 Use bool for booleans, instead of int.
1797
1798 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1799
1800 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1801
1802 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1803
1804 On assertion failure, print backtrace if available.
1805 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1806 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1807 * Makefile.in (LIB_EXECINFO): New macro.
1808 (LIBES): Use it.
1809
1810 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1811 * bytecode.c (exec_byte_code):
1812 * callint.c (check_mark, Fcall_interactively):
1813 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1814 (getenv_internal, sync_process_alive, call_process_exited):
1815 * lisp.h (USE_SAFE_ALLOCA):
1816 Use bool for booleans, instead of int.
1817 * lisp.h, process.h: Adjust prototypes to match above changes.
1818 * callint.c (Fcall_interactively): Don't assume the mark's
1819 offset fits in 'int'.
1820
1821 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1822
1823 * buffer.c, buffer.h: Use bool for boolean.
1824 * buffer.c (reset_buffer_local_variables)
1825 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1826 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1827 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1828 (overlay_touches_p, overlay_strings, Foverlay_put)
1829 (report_overlay_modification, call_overlay_mod_hooks):
1830 (mmap_enlarge, mmap_set_vars):
1831 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1832 Use bool for booleans, instead of int.
1833 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1834 since the 1-or-0 return value is always ignored anyway.
1835 (mmap_initialized_p):
1836 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1837 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1838
1839 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1840
1841 * bidi.c: Use bool for boolean.
1842 This is a bit more readable, and makes the text segment of bidi.o
1843 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1844 Presumably it's faster too.
1845 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1846 Now bool.
1847 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1848 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1849 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1850 (bidi_explicit_dir_char, bidi_level_of_next_char)
1851 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1852 Use bool for booleans, instead of int.
1853 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1854 (bidi_unshelve_cache): Adjust decls to match code.
1855
1856 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1857
1858 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1859 argument.
1860
1861 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1862
1863 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1864 * atimer.h: Include <stdbool.h>.
1865
1866 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1867
1868 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1869 compile time tests instead of run time tests on systems that do
1870 not use them.
1871 (FRAME_MAC_P): Remove leftover from deleted code.
1872 * frame.c (syms_of_frame): Remove leftover from deleted code.
1873
1874 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1875
1876 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1877
1878 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1879
1880 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1881 Otherwise, the compiler complains about (A?B:C) where B is void
1882 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1883 (fontset_add): Return void, for FONTSET_ADD.
1884
1885 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1886
1887 * alloc.c: Use bool for booleans.
1888 (gc_in_progress, abort_on_gc)
1889 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1890 (dont_register_blocks) [GC_MALLOC_CHECK]:
1891 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1892 (check_string_bytes, make_specified_string, memory_full)
1893 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1894 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1895 (mark_stack, valid_pointer_p, make_pure_string)
1896 (Fgarbage_collect, survives_gc_p, gc_sweep):
1897 Use bool for booleans, instead of int.
1898 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1899 Remove unused local.
1900 * alloc.c (PURE_POINTER_P):
1901 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1902 * editfns.c (Fformat):
1903 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1904 (Fdo_auto_save):
1905 * fns.c (sweep_weak_table):
1906 * lisp.h (suppress_checking, push_message, survives_gc_p)
1907 (make_pure_string, gc_in_progress, abort_on_gc):
1908 * lread.c (readchar, read1):
1909 * print.c (Fprin1_to_string):
1910 * xdisp.c (push_message):
1911 Use bool for booleans affected directly or indirectly by
1912 alloc.c's changes.
1913
1914 Make recently-introduced setters macros.
1915 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1916 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1917 (set_fontset_default, set_fontset_fallback): Rename from their
1918 upper-case counterparts, and make them functions rather than macros.
1919 This is more consistent with the other recently-introduced setters.
1920 These don't need to be inline, since they're local.
1921
1922 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1923
1924 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1925 the loop (Bug#12247).
1926
1927 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1928
1929 * lisp.h (vcopy): Use memcpy rather than our own loop.
1930 This fixes a performance regression introduced by the recent
1931 addition of vcopy. This means 'vcopy' will need to be modified
1932 for a copying collector, but that's OK. Also, tighten the
1933 checking in the assertion.
1934
1935 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1936
1937 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1938 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1939 non-base glyph for the width of the base character, according to
1940 what x_draw_composite_glyph_string_foreground expects.
1941 Generate WADJUST value according to composition_gstring_width's
1942 expectations, to produce correct width of the composed character.
1943 Reverse the sign of the DU offset produced by ScriptPlace.
1944
1945 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1946
1947 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1948
1949 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1950
1951 Avoid direct writes to contents member of struct Lisp_Vector.
1952 * lisp.h (vcopy): New function to copy data into vector.
1953 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1954 * fns.c (Ffillarray): Use ASET.
1955 * keyboard.c (timer_check_2): Use AREF and ASET.
1956 (append_tool_bar_item, Frecent_keys): Use vcopy.
1957 * lread.c (read_vector): Use ASET.
1958 * msdos.c (Frecent_doskeys): Use vcopy.
1959 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1960 (Finternal_merge_in_global_face): Use ASET and vcopy.
1961 * xfont.c (xfont_list_pattern): Likewise.
1962
1963 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1964
1965 * window.c (Fwindow_point): For the selected window always return
1966 the position of its buffer's point.
1967 (Fset_window_point): For the selected window always go in its
1968 buffer to the specified position.
1969
1970 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1971
1972 Setter macros for fontsets.
1973 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1974 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1975 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1976 Adjust users.
1977
1978 2012-08-20 Glenn Morris <rgm@gnu.org>
1979
1980 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1981 Don't assume that `ln -f' works.
1982
1983 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1984
1985 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1986 and later about non-assignments with no effect. See discussion at
1987 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1988 details.
1989
1990 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1991
1992 Inline setter functions for Lisp_Objects slots of struct specbinding.
1993 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1994 Adjust users.
1995
1996 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1997
1998 * window.c (select_window): Always make selected window's buffer
1999 current.
2000
2001 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2002
2003 Use AREF and ASET for docstrings of category tables.
2004 * category.h (CATEGORY_DOCSTRING): Use AREF.
2005 (SET_CATEGORY_DOCSTRING): Use ASET.
2006 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2007
2008 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2009
2010 Inline setter functions for hash table members.
2011 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2012 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2013 (set_hash_key_and_value, set_hash_index, set_hash_next)
2014 (set_hash_hash): New functions.
2015 * charset.c, fns.c: Adjust users.
2016
2017 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2018
2019 Inline getter and setter functions for per-buffer values.
2020 * buffer.h (per_buffer_default, set_per_buffer_default)
2021 (per_buffer_value, set_per_buffer_value): New functions.
2022 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2023 * buffer.c, data.c: Adjust users.
2024
2025 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2026
2027 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2028
2029 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2030
2031 Rely on <config.h> + <unistd.h> to declare 'environ',
2032 as gnulib does this if the system doesn't.
2033 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2034 Remove declaration. MS-Windows declares it on stdlib.h which is
2035 included by conf_post.h.
2036 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2037 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2038 * vm-limit.c: Include <unistd.h>, for 'environ'.
2039
2040 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2041 (start_of_data): Remove decl; mem-limits.h provides it.
2042
2043 * xdisp.c (handle_invisible_prop): Make it a bit faster
2044 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2045
2046 2012-08-19 Chong Yidong <cyd@gnu.org>
2047
2048 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2049 ends (Bug#3874).
2050
2051 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2052
2053 * .gdbinit: Use call instead of set when calling a function in the
2054 inferior.
2055
2056 * data.c (set_internal): Don't use set_blv_found.
2057 (Fkill_local_variable): Likewise.
2058
2059 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2060
2061 * nsfont.m (ns_ascii_average_width): Ensure the string
2062 ascii_printable is initialized with a null-terminated character
2063 array. Otherwise, it can contain undesired extra characters.
2064
2065 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2066
2067 port new setting code to Sun C 5.8 2005/10/13
2068 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2069 Return void, not Lisp_Object. Otherwise, the compiler
2070 complains about (A?B:C) where B is void and C is Lisp_Object
2071 when compiling CHAR_TABLE_SET, due to the recent change to
2072 the API of sub_char_table_set_contents.
2073
2074 2012-08-18 Chong Yidong <cyd@gnu.org>
2075
2076 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2077 for the string case (Bug#3874).
2078
2079 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2080
2081 * buffer.h (BSET): Remove (Bug#12215).
2082 Replace all uses with calls to new setter functions.
2083 (bset_bidi_paragraph_direction, bset_case_canon_table)
2084 (bset_case_eqv_table, bset_directory, bset_display_count)
2085 (bset_display_time, bset_downcase_table)
2086 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2087 (bset_last_selected_window, bset_local_var_alist)
2088 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2089 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2090 (bset_width_table):
2091 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2092 (bset_auto_fill_function, bset_auto_save_file_format)
2093 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2094 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2095 (bset_cache_long_line_scans, bset_case_fold_search)
2096 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2097 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2098 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2099 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2100 (bset_header_line_format, bset_indicate_buffer_boundaries)
2101 (bset_indicate_empty_lines, bset_invisibility_spec)
2102 (bset_left_fringe_width, bset_major_mode, bset_mark)
2103 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2104 (bset_name, bset_overwrite_mode, bset_pt_marker)
2105 (bset_right_fringe_width, bset_save_length)
2106 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2107 (bset_scroll_up_aggressively, bset_selective_display)
2108 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2109 (bset_word_wrap, bset_zv_marker):
2110 * category.c (bset_category_table):
2111 * syntax.c (bset_syntax_table):
2112 New setter functions.
2113
2114 * process.h (PSET): Remove (Bug#12215).
2115 Replace all uses with calls to new setter functions.
2116 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2117 (PROCESS_INLINE): New macro.
2118 (pset_childp): New setter function.
2119 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2120 * process.c (PROCESS_INLINE):
2121 Define to EXTERN_INLINE, so that the corresponding functions
2122 are compiled into code.
2123 (pset_buffer, pset_command, pset_decode_coding_system)
2124 (pset_decoding_buf, pset_encode_coding_system)
2125 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2126 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2127 (pset_type, pset_write_queue): New setter functions.
2128
2129 * window.h (WSET): Remove (Bug#12215).
2130 Replace all uses with calls to new setter functions.
2131 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2132 (WINDOW_INLINE): New macro.
2133 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2134 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2135 (wset_total_lines, wset_vertical_scroll_bar)
2136 (wset_window_end_pos, wset_window_end_valid)
2137 (wset_window_end_vpos): New setter functions.
2138 * window.c (WINDOW_INLINE):
2139 Define to EXTERN_INLINE, so that the corresponding functions
2140 are compiled into code.
2141 (wset_combination_limit, wset_dedicated, wset_display_table)
2142 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2143 (wset_new_normal, wset_new_total, wset_next_buffers)
2144 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2145 (wset_prev_buffers, wset_right_fringe_width)
2146 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2147 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2148 (wset_window_parameters):
2149 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2150 (wset_column_number_displayed, wset_region_showing):
2151 New setter functions.
2152
2153 * termhooks.h (TSET): Remove (Bug#12215).
2154 Replace all uses with calls to new setter functions.
2155 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2156 (TERMHOOKS_INLINE): New macro.
2157 (tset_charset_list, tset_selection_alist): New setter functions.
2158 * terminal.c (TERMHOOKS_INLINE):
2159 Define to EXTERN_INLINE, so that the corresponding functions
2160 are compiled into code.
2161 (tset_param_alist): New setter function.
2162
2163 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2164
2165 * keyboard.h (KSET): Remove (Bug#12215).
2166 Replace all uses with calls to new setter functions.
2167 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2168 (KEYBOARD_INLINE): New macro.
2169 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2170 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2171 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2172 New setter functions.
2173 * keyboard.c (KEYBOARD_INLINE):
2174 Define to EXTERN_INLINE, so that the corresponding functions
2175 are compiled into code.
2176 (kset_echo_string, kset_kbd_queue)
2177 (kset_keyboard_translate_table, kset_last_prefix_arg)
2178 (kset_last_repeatable_command, kset_local_function_key_map)
2179 (kset_overriding_terminal_local_map, kset_real_last_command)
2180 (kset_system_key_syms): New setter functions.
2181
2182 * frame.h (FSET): Remove (Bug#12215).
2183 Replace all uses with calls to new setter functions.
2184 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2185 (FRAME_INLINE): New macro.
2186 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2187 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2188 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2189 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2190 (fset_param_alist, fset_root_window, fset_scroll_bars)
2191 (fset_selected_window, fset_title, fset_tool_bar_items)
2192 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2193 * frame.c (FRAME_INLINE):
2194 Define to EXTERN_INLINE, so that the corresponding functions
2195 are compiled into code.
2196 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2197
2198 A few more naming-convention fixes for getters and setters.
2199 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2200 and rename from buffer_overlays_set_before.
2201 (set_buffer_overlays_after): Move here from buffer.h, and rename
2202 from buffer_overlays_set_after.
2203 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2204 All uses changed.
2205 (set_buffer_intervals): Rename from buffer_set_intervals.
2206 * intervals.c (set_interval_object): Move here from intervals.h,
2207 and rename from interval_set_object.
2208 (set_interval_left): Move here from intervals.h, and rename from
2209 interval_set_left.
2210 (set_interval_right): Move here from intervals.h, and rename from
2211 interval_set_right.
2212 (copy_interval_parent): Move here from intervals.h, and rename from
2213 interval_copy_parent.
2214 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2215 (set_interval_plist): Rename from interval_set_plist.
2216 Return void, not Lisp_Object, since no caller uses the result.
2217 * lisp.h (string_intervals): Rename from string_get_intervals.
2218 (set_string_intervals): Rename from string_set_intervals.
2219
2220 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2221 (set_char_table_contents): Rename from char_table_set_contents.
2222 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2223 All uses changed. See the end of
2224 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2225
2226 * lisp.h (CSET): Remove (Bug#12215).
2227 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2228 (set_char_table_purpose): New functions,
2229 replacing CSET. All uses changed. For example, replace
2230 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2231 "set_char_table_parent (char_table, parent);".
2232 The old version was confusing because it used the same name
2233 'parent' for two different things.
2234
2235 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2236
2237 Functions to get and set Lisp_Object fields of buffer-local variables.
2238 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2239 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2240 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2241 * data.c, eval.c, frame.c: Adjust users.
2242
2243 2012-08-17 Chong Yidong <cyd@gnu.org>
2244
2245 * xfaces.c (merge_face_vectors): If the target font specfies a
2246 font spec, make the font's attributes take precedence over
2247 directly-specified attributes.
2248 (merge_face_ref): Recognize :font.
2249
2250 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2251
2252 Do not use memcpy for copying intervals.
2253 * intervals.c (reproduce_interval): New function.
2254 (reproduce_tree, reproduce_tree_obj): Use it.
2255 (reproduce_tree_obj): Remove prototype.
2256
2257 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2258
2259 * lisp.h (duration_to_sec_usec): Remove unused decl.
2260
2261 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2262
2263 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2264 to an allocated instance of NSString, not to the class itself.
2265
2266 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2267
2268 * makefile.w32-in (C_CTYPE_H): New macro.
2269 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2270 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2271 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2272
2273 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2274
2275 Use ASCII tests for character types.
2276 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2277 * xfns.c, xterm.c:
2278 Don't include <ctype.h>; was not needed.
2279 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2280 * sysdep.c, xfaces.c:
2281 Include <c-ctype.h> instead of <ctype.h>.
2282 * nsterm.m: Include <c-ctype.h>.
2283 * charset.c (read_hex):
2284 * doc.c (Fsnarf_documentation):
2285 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2286 (DRIVE_LETTER) [DOS_NT]:
2287 (Ffile_name_directory, Fexpand_file_name)
2288 (Fsubstitute_in_file_name):
2289 * font.c (font_parse_xlfd, font_parse_fcname):
2290 * frame.c (x_set_font_backend):
2291 * gtkutil.c (xg_get_font):
2292 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2293 * nsimage.m (hexchar):
2294 * nsterm.m (ns_xlfd_to_fontname):
2295 * sysdep.c (system_process_attributes):
2296 * xfaces.c (hash_string_case_insensitive):
2297 Use C-locale tests instead of locale-specific tests for character
2298 types, since we want the ASCII interpretation here, not the
2299 interpretation suitable for whatever happens to be the current locale.
2300
2301 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2302
2303 Consistently check windows for validity/liveness
2304 (Bug#11984, Bug#12025, Bug#12026).
2305 * lisp.h (CHECK_VALID_WINDOW): New macro.
2306 * window.c (decode_window): Rename to decode_live_window.
2307 (decode_valid_window, Fwindow_valid_p): New functions.
2308 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2309 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2310 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2311 (Fwindow_prev_sibling, Fwindow_combination_limit)
2312 (Fset_window_combination_limit, Fwindow_use_time)
2313 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2314 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2315 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2316 (Fwindow_hscroll, Fset_window_hscroll)
2317 (Fwindow_redisplay_end_trigger)
2318 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2319 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2320 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2321 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2322 (Fwindow_end, Fset_window_point, Fset_window_start)
2323 (Fpos_visible_in_window_p, Fwindow_line_height)
2324 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2325 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2326 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2327 (Fset_window_parameter, Fwindow_display_table)
2328 (Fset_window_display_table, Fdelete_other_windows_internal)
2329 (Fset_window_buffer, Fset_window_new_total)
2330 (Fset_window_new_normal, Fdelete_window_internal)
2331 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2332 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2333 (Fwindow_scroll_bars): Check whether argument window is a valid or
2334 live window. Update doc-strings.
2335 (syms_of_window): New symbol Qwindow_valid_p.
2336 * keyboard.c (Fposn_at_x_y): Check whether argument
2337 frame_or_window denotes a valid window.
2338
2339 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2340
2341 Fix previous char table change.
2342 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2343 * chartab.c (optimize_sub_char_table): Likewise.
2344
2345 2012-08-16 Chong Yidong <cyd@gnu.org>
2346
2347 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2348
2349 * xfont.c (xfont_open):
2350 * xftfont.c (xftfont_open): Set the font's max_width field.
2351
2352 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2353 min_width to space_width and average_width to the average over
2354 printable ASCII characters.
2355 (ns_char_width): Code cleanup.
2356 (ns_ascii_average_width): New utility function.
2357
2358 * font.h (struct font): Update comments.
2359
2360 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2361
2362 Simple interface to set Lisp_Object fields of character tables.
2363 * lisp.h (CSET): New macro.
2364 (char_table_set_extras, char_table_set_contents)
2365 (sub_char_table_set_contents): New function.
2366 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2367 * syntax.c: Adjust users.
2368
2369 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2370
2371 * eval.c (eval_sub): Bind lexical-binding.
2372 * lread.c (Qlexical_binding): Make non-static.
2373
2374 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2375
2376 * nsmenu.m (popupSession): Remove.
2377 (pop_down_menu): Remove endModalSession.
2378 (timeout_handler:): New method.
2379 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2380 Call runModalForWindow. Check timer_fired when it returns.
2381 If not set, cancel timer and break out of loop.
2382 Otherwise loop again, with a new timeout.
2383
2384 * nsterm.m: Include fcntl.h if present.
2385 (fd_entry, t_readfds, inNsSelect): Remove.
2386 (select_writefds, select_valid, select_timeout, selfds)
2387 (select_mutex, apploopnr): Add.
2388 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2389 Otherwise call kbd_buffer_store_event.
2390 (ns_send_appdefined): Remove release of fd_entry.
2391 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2392 Increment and decrement apploopnr.
2393 (ns_select): If no file descriptors, just do a NSTimer.
2394 Otherwise copy read/write masks and start select thread (fd_handler).
2395 Start main loop and wait for application defined event.
2396 Inform select thread to stop selecting after main loop is exited.
2397 (ns_term_init): Create selfds pipe and set non-blocking.
2398 Initialize select_mutex. Start the select thread (fd_handler).
2399 (fd_handler:): Loop forever, wait for info from the main thread
2400 to either start or stop selecting. When select returns, send
2401 and appdefined event.
2402 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2403 If not call kbd_buffer_store_event.
2404
2405 * nsterm.h (EmacsApp): fd_handler takes id argument.
2406 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2407
2408 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2409
2410 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2411
2412 * region-cache.c (move_cache_gap): Update gap_len using the actual
2413 growth of the boundaries array. Do not change cache_len.
2414 (Bug#12196)
2415
2416 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2417
2418 Generalize and cleanup font subsystem checks.
2419 * font.h (FONT_DEBUG, font_assert): Remove.
2420 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2421 Change font_assert to eassert. Use eassert where appropriate.
2422
2423 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2424
2425 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2426
2427 2012-08-15 Chong Yidong <cyd@gnu.org>
2428
2429 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2430 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2431 extract the font descriptor instead of just the font name.
2432 In that case, return a font spec instead of a string.
2433 (x_last_font_name): Move to this file from xfns.c.
2434
2435 * xfns.c (Fx_select_font): The return value can also be a font
2436 spec. Move x_last_font_name management to gtkutil.c.
2437
2438 * xfaces.c: Make font weight and style symbols non-static.
2439
2440 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2441
2442 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2443 (bug#12117).
2444
2445 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2446
2447 * alloc.c (Fgarbage_collect): Use plural form consistently.
2448
2449 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2450
2451 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2452 iteration through the command loop. Fixes a problem whereby mouse
2453 movements are ignored until the first mouse click.
2454
2455 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2456
2457 Use bool, not int, for Lisp booleans.
2458 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2459 makes Emacs a bit smaller and presumably a bit faster.
2460 * lisp.h: Include <stdbool.h>.
2461 (struct Lisp_Boolfwd, defvar_bool):
2462 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2463 * regex.c [!emacs]: Include <stdbool.h>.
2464 (false, true): Remove; <stdbool.h> does this for us now.
2465
2466 2012-08-14 Chong Yidong <cyd@gnu.org>
2467
2468 * character.c (Fcharacterp): Doc fix (Bug#12076).
2469
2470 * data.c (Findirect_variable): Doc fix (Bug#11040).
2471
2472 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2473
2474 * editfns.c (Fformat): Doc fix (Bug#12059).
2475 (Fsave_current_buffer): Doc fix (Bug#11542).
2476
2477 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2478
2479 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2480 (bug#12022).
2481
2482 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2483
2484 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2485 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2486 * minibuf.c (choose_minibuf_frame, read_minibuf):
2487 * w32fns.c (x_create_tip_frame):
2488 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2489 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2490
2491 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2492
2493 * intervals.c (offset_intervals): Remove obsolete comment.
2494
2495 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2496
2497 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2498
2499 2012-08-14 Gergely Risko <gergely@risko.hu>
2500
2501 * coding.c (decode_coding): Record buffer modification before
2502 disabling undo_list (Bug#11773).
2503
2504 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2505
2506 Revert and cleanup some recent overlay changes.
2507 * buffer.h (enum overlay_type): Remove.
2508 (buffer_get_overlays, buffer_set_overlays): Likewise.
2509 (buffer_set_overlays_before, buffer_set_overlays_after):
2510 New function. Adjust users.
2511 (unchain_both): Add eassert.
2512
2513 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2514
2515 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2516
2517 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2518
2519 * gtkutil.c (xg_mark_data): Don't assume C99.
2520
2521 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2522
2523 * gtkutil.c (xg_frame_tb_info): New struct.
2524 (TB_INFO_KEY): New define.
2525 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2526 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2527 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2528 if not present.
2529 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2530 is up to date. Otherwise store new data.
2531 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2532
2533 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2534
2535 Use KSET for write access to Lisp_Object members of struct kboard.
2536 * keyboard.h (KSET): New macro.
2537 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2538 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2539 * xterm.c: Adjust users.
2540
2541 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2542
2543 Use BSET for write access to Lisp_Object members of struct buffer.
2544 * buffer.h (BSET): New macro.
2545 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2546 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2547 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2548 * window.c, xdisp.c, xfns.c: Adjust users.
2549
2550 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2551
2552 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2553
2554 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2555
2556 * nsterm.m (not_in_argv): New function.
2557 (application:openFile, application:openTempFile:):
2558 (application:openFileWithoutUI:, application:openFiles:): Open file
2559 if not_in_argv returns non-zero (bug#12171).
2560
2561 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2562 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2563 Define for Gtk+ versions less than 3.2.
2564 (xg_get_font_name): Use those functions/macros here.
2565 Reported by Frans Oilinki <moilinki@gmail.com>.
2566
2567 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2568
2569 * unexmacosx.c (copy_data_segment): Copy initialized data in
2570 statically linked libraries from input file rather than memory.
2571
2572 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2573 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2574 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2575
2576 2012-08-10 Glenn Morris <rgm@gnu.org>
2577
2578 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2579 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2580
2581 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2582
2583 Fix last change to allow compilation with low optimization levels.
2584 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2585 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2586
2587 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2588
2589 Use common inline syntax in intervals.h.
2590 * intervals.h (INTERVALS_INLINE): New macro.
2591 Change all users from LISP_INLINE.
2592
2593 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2594
2595 Define Qnone once for all platforms.
2596 * frame.c (Qnone): Define here.
2597 (syms_of_frame): DEFSYM it.
2598 * lisp.h (Qnone): New declaration.
2599 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2600 * xfns.c: Remove duplication. Adjust users.
2601
2602 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2603
2604 Remove unused macros from intervals.h.
2605 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2606 * intervals.c: Adjust comment.
2607
2608 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2609
2610 * w32fns.c <w32_unicode_gui>: New static variable.
2611 (globals_of_w32fns): Initialize it according to os_subtype.
2612 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2613 testing os_subtype.
2614
2615 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2616 Eli Zaretskii <eliz@gnu.org>
2617
2618 Fix bug #10299 with Unicode characters sent by customized
2619 keyboards created by MSKLC.
2620 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2621 (w32_init_class): Use it to initialize the Emacs class with either
2622 ANSI or Unicode API calls.
2623 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2624 later.
2625 (w32_wnd_proc): If the character code sent by WM_CHAR or
2626 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2627 original message. Call DefWindowProcW on NT and later.
2628
2629 2012-08-10 Glenn Morris <rgm@gnu.org>
2630
2631 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2632
2633 * lisp.h (DIRECTORY_SEP): Let configure set it.
2634
2635 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2636
2637 Use TSET for write access to Lisp_Object slots of struct terminal.
2638 * termhooks.h (TSET): New macro.
2639 * coding.c, terminal.c, xselect.c: Adjust users.
2640
2641 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2642
2643 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2644 the failing expression, include them in the error message.
2645 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2646 * lisp.h (internal_condition_case_n): Update declaration.
2647
2648 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2649
2650 Inline functions to examine and change buffer overlays.
2651 * buffer.c (unchain_both): New function.
2652 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2653 (buffer_has_overlays): New function.
2654 (enum overlay_type): New enum.
2655 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2656 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2657
2658 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2659
2660 Inline functions to examine and change buffer intervals.
2661 * alloc.c (mark_interval_tree): Remove.
2662 (MARK_INTERVAL_TREE): Simplify.
2663 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2664 * intervals.c (buffer_balance_intervals): New function.
2665 (graft_intervals_into_buffer): Adjust indentation.
2666 (set_intervals_multibyte): Simplify.
2667 * buffer.h (BUF_INTERVALS): Remove.
2668 (buffer_get_intervals, buffer_set_intervals): New function.
2669 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2670 * intervals.c, textprop.c: Adjust users.
2671
2672 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2673
2674 Inline functions to examine and change string intervals.
2675 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2676 (string_get_intervals, string_set_intervals): New function.
2677 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2678 * lread.c, print.c, textprop.c: Adjust users.
2679
2680 2012-08-08 Glenn Morris <rgm@gnu.org>
2681
2682 * lisp.mk (lisp): Remove language/persian.elc.
2683
2684 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2685
2686 Cleanup intervals.
2687 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2688 (NULL_INTERVAL_P): Likewise. Adjust users.
2689 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2690 Adjust comment. Move under #if 0.
2691 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2692 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2693
2694 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2695
2696 Check total length of intervals with eassert.
2697 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2698 * intervals.c: Change all users to eassert.
2699
2700 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2701
2702 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2703 Rename fields to match removal of FGET and WGET and disuse of
2704 INTERNAL_FIELD in Lisp_Cons.
2705
2706 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2707
2708 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2709 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2710 name since all xname users are fixed long time ago. Do not
2711 use INTERNAL_FIELD.
2712 (set_symbol_name, set_symbol_function, set_symbol_plist):
2713 (set_symbol_next, set_overlay_plist): New function.
2714 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2715 (struct Lisp_Overlay): Likewise.
2716 (CVAR, MVAR, SVAR): Remove.
2717 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2718 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2719 * xterm.c: Adjust users.
2720 * .gdbinit: Change to use name field of struct Lisp_Symbol
2721 where appropriate.
2722
2723 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2724
2725 Basic functions to set Lisp_Object and pointer slots of intervals.
2726 * intervals.h (interval_set_parent, interval_set_object):
2727 (interval_set_left, interval_set_right, interval_set_plist):
2728 (interval_copy_parent): New function.
2729 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2730 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2731 Adjust indentation.
2732 (INTERVAL_SIZE): Remove. Adjust users.
2733 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2734
2735 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2736
2737 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2738 * process.h (PGET): Remove.
2739 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2740 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2741
2742 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2743
2744 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2745 * window.h (WGET): Remove.
2746 (struct window): Do not use INTERNAL_FIELD.
2747 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2748 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2749 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2750 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2751 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2752 Adjust users.
2753
2754 2012-08-07 Chong Yidong <cyd@gnu.org>
2755
2756 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2757 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2758 (Fdelete_window_internal): Signal an error if the window is not on
2759 a live frame (Bug#12025).
2760
2761 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2762
2763 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2764 * frame.h (FGET): Remove.
2765 (struct frame): Do not use INTERNAL_FIELD.
2766 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2767 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2768 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2769 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2770
2771 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2772
2773 * w32.c: Silence compiler warnings.
2774 (map_w32_filename): Remove unused variable `is_fat'.
2775 (chase_symlinks): Add parentheses around expression.
2776
2777 2012-08-06 Glenn Morris <rgm@gnu.org>
2778
2779 * sysdep.c: Respect BROKEN_GETWD.
2780
2781 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2782 Let configure handle it.
2783 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2784
2785 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2786
2787 Use GCALIGNMENT where appropriate.
2788 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2789 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2790 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2791
2792 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2793
2794 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2795 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2796
2797 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2798
2799 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2800 that should be sufficient for everyone.
2801
2802 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2803
2804 * keyboard.c (timer_check_2): Add break so timer_check returns next
2805 timeout.
2806
2807 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2808
2809 Fix Windows build errors introduced after converting to WGET and WSET.
2810 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2811 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2812
2813 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2814
2815 * nsterm.m (ns_frame_rehighlight): Use FSET.
2816
2817 * nsmenu.m (ns_update_menubar): Use FSET.
2818
2819 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2820
2821 Separate read and write access to Lisp_Object slots of Lisp_Process.
2822 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2823 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2824
2825 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2826
2827 Separate read and write access to Lisp_Object slots of struct window.
2828 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2829 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2830 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2831 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2832 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2833 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2834 Adjust users.
2835
2836 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2837
2838 Fix Windows build errors introduced after converting to FGET and FSET.
2839 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2840 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2841 (w32_judge_scroll_bars): Change to use FSET.
2842 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2843
2844 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2845
2846 Fix replacement typo.
2847 * window.c (replace_window): Set root_window instead of
2848 selected_window. This fixes a total window subsystem
2849 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2850
2851 2012-08-06 Glenn Morris <rgm@gnu.org>
2852
2853 * lisp.mk (lisp): Add language/persian.elc.
2854
2855 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2856
2857 Separate read and write access to Lisp_Object slots of struct frame.
2858 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2859 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2860 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2861 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2862 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2863
2864 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2865
2866 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2867
2868 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2869
2870 Generalize common compile-time constants.
2871 * lisp.h (header_size, bool_header_size, word_size): Now here.
2872 (struct Lisp_Vector): Add comment.
2873 (struct Lisp_Bool_Vector): Move up to define handy constants.
2874 (VECSIZE, PSEUDOVECSIZE): Simplify.
2875 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2876 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2877 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2878 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2879 * xfont.c, xmenu.c: Use word_size where appropriate.
2880
2881 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2882
2883 * search.c (Freplace_match): Treat \? in the replacement text
2884 literally (Bug#8161).
2885
2886 2012-08-05 Chong Yidong <cyd@gnu.org>
2887
2888 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2889 * frame.c (Vdelete_frame_functions):
2890 * emacs.c (Vkill_emacs_hook): Doc fix.
2891
2892 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2893
2894 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2895 --with-x-toolkit=no builds.
2896 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2897
2898 2012-08-04 Chong Yidong <cyd@gnu.org>
2899
2900 * syntax.c (Fmodify_syntax_entry): Doc fix.
2901
2902 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2903
2904 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2905 * w32.c (init_environment): Change the default values of many
2906 environment variables in dflt_envvars[] to NULL, to avoid pushing
2907 them into environment when they were not already defined.
2908 Remove the code that deletes site-lisp subdirectories from the default
2909 value of EMACSLOADPATH, as it is no longer needed.
2910 (check_windows_init_file): Now external, not static.
2911 Use Vload_path as is, without adding anything, as this function is now
2912 called when Vload_path is already set up.
2913
2914 * w32.h (check_windows_init_file): Add prototype.
2915
2916 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2917 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2918 compatibility with Posix platforms.
2919 (main): Move the call to check_windows_init_file to here from
2920 w32.c.
2921 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2922 any, in the DEFALT argument into the root of the Emacs build or
2923 installation tree, as appropriate.
2924
2925 * callproc.c (init_callproc_1): Call decode_env_path instead of
2926 doing its equivalent by hand.
2927 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2928 the code that sets Vexec_path run on MS-Windows.
2929
2930 * lread.c (init_lread): Add comments to #ifdef's.
2931
2932 * msdos.c (dos_set_window_size, IT_update_begin)
2933 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2934 instead of direct references.
2935
2936 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2937
2938 Export DEFAULT_REHASH_* to GDB.
2939 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2940 Now constants, not macros.
2941
2942 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2943
2944 Remove unnecessary casts involving pointers.
2945 These casts are no longer needed now that we assume C89 or later,
2946 since they involve casting to or from void *.
2947 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2948 (make_pure_float, make_pure_vector):
2949 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2950 * macros.c (Fstart_kbd_macro):
2951 * menu.c (find_and_return_menu_selection):
2952 * minibuf.c (read_minibuf_noninteractive):
2953 * sysdep.c (closedir):
2954 * xdisp.c (x_produce_glyphs):
2955 * xfaces.c (compare_fonts_by_sort_order):
2956 * xfns.c (x_real_positions, select_visual):
2957 * xselect.c (x_stop_queuing_selection_requests)
2958 (x_get_window_property, x_get_window_property_as_lisp_data):
2959 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2960 Remove unnecessary pointer casts.
2961 * alloc.c (record_xmalloc): New function.
2962 * lisp.h (record_xmalloc): New decl.
2963 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2964 more like a function. This is because the pointer cast is not
2965 needed. All uses changed.
2966 * print.c (print_string, print_error_message): Avoid length recalc.
2967
2968 Improve fix for macroexp crash with debugging (Bug#12118).
2969 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2970 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2971 not supposed to be invoked from the garbage collector.
2972 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2973 (gc_aset): New function, which is like ASET but can be
2974 used in the garbage collector.
2975 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2976 (set_hash_index): Use it instead of ASET.
2977
2978 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2979
2980 Support symlinks on latest versions of MS-Windows.
2981 * w32.c: Include winioctl.h and aclapi.h.
2982 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2983 (revert_to_self): Forward declarations of static functions.
2984 <static BOOL g_b_init_get_security_info>:
2985 <g_b_init_create_symbolic_link>: New static flags.
2986 (globals_of_w32): Initialize them to zero.
2987 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2988 (map_w32_filename): Improve commentary. Simplify switch.
2989 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2990 headers (most versions of MinGW w32api don't).
2991 (get_security_info, create_symbolic_link)
2992 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2993 New functions.
2994 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2995 in the argument file name.
2996 (sys_access): Call unc_volume_file_attributes only if
2997 GetFileAttributes fails with network-related error codes.
2998 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2999 have the required privileges.
3000 (get_file_security_desc_by_name): Rename from
3001 get_file_security_desc.
3002 (stat_worker): New function, with most of the guts of 'stat', and
3003 with addition of handling of symlinks and support for 'lstat'.
3004 If possible, get file's attributes and security information by
3005 handle, not by name. Produce S_IFLNK bit for symlinks, when
3006 called from 'lstat'.
3007 (stat, lstat): New functions, call 'stat_worker'.
3008 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3009 symlinks when the underlying filesystem supports them.
3010
3011 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3012
3013 Fix macroexp crash on Windows with debugging (Bug#12118).
3014 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3015 checking subscripts; problem introduced with the recent
3016 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3017 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3018 since it's used in non-static inline functions now.
3019
3020 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3021 Don't assume buffer size fits in 'int'. Remove unused local.
3022
3023 Use C99-style 'extern inline' if available.
3024 * buffer.h (BUFFER_INLINE):
3025 * category.h (CATEGORY_INLINE):
3026 * character.h (CHARACTER_INLINE):
3027 * charset.h (CHARSET_INLINE):
3028 * composite.h (COMPOSITE_INLINE):
3029 * dispextern.h (DISPEXTERN_INLINE):
3030 * lisp.h (LISP_INLINE):
3031 * systime.h (SYSTIME_INLINE):
3032 New macro, replacing 'static inline' in this header.
3033 * buffer.h, category.h, character.h, charset.h, composite.h:
3034 * dispextern.h, lisp.h, systime.h:
3035 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3036 * alloc.c (LISP_INLINE):
3037 * buffer.c (BUFFER_INLINE):
3038 * category.c (CATEGORY_INLINE):
3039 * character.c (CHARACTER_INLINE):
3040 * charset.c (CHARSET_INLINE):
3041 * composite.c (COMPOSITE_INLINE):
3042 * dispnew.c (DISPEXTERN_INLINE):
3043 * sysdep.c (SYSTIME_INLINE):
3044 Define to EXTERN_INLINE, so that the corresponding functions
3045 are compiled into code.
3046 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3047 (INLINE_HEADER_END): New macros.
3048 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3049 since it's used in non-static inline functions now.
3050 (VALMASK) [!USE_LSB_TAG]: Likewise.
3051
3052 2012-08-02 Glenn Morris <rgm@gnu.org>
3053
3054 * s/: Remove empty directory.
3055
3056 * s/ms-w32.h: Move to ../nt/inc.
3057 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3058 Update for new ms-w32.h location.
3059
3060 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3061
3062 Port to Solaris 8.
3063 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3064
3065 2012-08-02 Glenn Morris <rgm@gnu.org>
3066
3067 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3068 hard-coding the path separator.
3069
3070 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3071
3072 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3073 This how ASET and AREF are supposed to work, and makes
3074 it easier to think about future improvements. See
3075 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3076 * charset.h (set_charset_attr): New function.
3077 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3078 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3079 (aref_addr): New function. All uses of &AREF(...) changed.
3080 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3081 (set_hash_index): New functions. All lvalue-style uses of
3082 HASH_KEY etc. changed.
3083 * keyboard.c (set_prop): New function. All lvalue-style uses
3084 of PROP changed.
3085
3086 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3087
3088 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3089 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3090 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3091 * nsfns.m (ns_set_name_as_filename): Likewise.
3092 * nsmenu.m (ns_update_menubar): Likewise.
3093 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3094
3095 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3096
3097 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3098 Adapt to latest changes in field names of the corresponding Lisp
3099 objects.
3100
3101 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3102
3103 2012-08-01 Glenn Morris <rgm@gnu.org>
3104
3105 * s/msdos.h: Remove file.
3106 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3107 * Makefile.in (S_FILE): Remove.
3108 (config_h): Remove S_FILE.
3109
3110 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3111
3112 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3113 Remove; moved to nt/config.nt.
3114
3115 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3116
3117 Use INTERNAL_FIELD for conses and overlays.
3118 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3119 Remove obsolete comment.
3120 (MVAR): New macro.
3121 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3122 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3123
3124 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3125
3126 Use INTERNAL_FIELD for symbols.
3127 * lisp.h (SVAR): New macro. Adjust users.
3128 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3129 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3130
3131 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3132
3133 Use INTERNAL_FIELD for processes.
3134 * process.h (PVAR): New macro. Adjust style.
3135 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3136 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3137
3138 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3139
3140 Use INTERNAL_FIELD for windows.
3141 * window.h (WVAR): New macro.
3142 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3143 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3144 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3145 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3146 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3147 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3148
3149 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3150
3151 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3152
3153 2012-08-01 Glenn Morris <rgm@gnu.org>
3154
3155 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3156 Move to configure.ac.
3157
3158 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3159
3160 * makefile.w32-in (CONFIG_H): Update dependencies.
3161 (CONF_POST_H): New macro.
3162
3163 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3164
3165 2012-07-31 Glenn Morris <rgm@gnu.org>
3166
3167 * Makefile.in (S_FILE): No longer set by configure.
3168
3169 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3170 is available.
3171 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3172
3173 * process.h (NULL_DEVICE):
3174 * emacs.c (SEPCHAR):
3175 * editfns.c (USER_FULL_NAME): Let configure set them.
3176
3177 * s/README, s/template.h: Remove files.
3178
3179 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3180
3181 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3182 Move to configure.ac.
3183
3184 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3185
3186 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3187 resulting renaming of 'struct frame' members.
3188
3189 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3190
3191 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3192 after introduction of FVAR.
3193
3194 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3195
3196 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3197
3198 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3199 instead of compositeToPoint.
3200 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3201
3202 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3203
3204 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3205
3206 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3207 * lisp.h (INTERNAL_FIELD): New macro.
3208 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3209 (BVAR): Change to use INTERNAL_FIELD.
3210 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3211 (KVAR): Change to use INTERNAL_FIELD.
3212 * frame.h (FVAR): New macro.
3213 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3214 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3215 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3216 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3217 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3218
3219 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3220
3221 Miscellaneous fixes for non-default X toolkits.
3222 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3223 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3224 Move under #ifdef USE_LUCID.
3225 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3226 definition and usage to avoid warnings.
3227
3228 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3229
3230 * nsterm.m (openFiles): Fix previous checkin.
3231
3232 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3233
3234 * indent.c (compute_motion): Remove unused local.
3235
3236 2012-07-31 Glenn Morris <rgm@gnu.org>
3237
3238 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3239
3240 * conf_post.h [USG5_4]:
3241 Move remaining contents of s/usg5-4-common.h here.
3242 * s/usg5-4-common.h: Remove file.
3243
3244 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3245 * s/irix6-5.h: Remove file.
3246
3247 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3248 * s/darwin.h: Remove file.
3249
3250 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3251 * s/hpux10-20.h: Remove file, which is now empty.
3252
3253 2012-07-30 Glenn Morris <rgm@gnu.org>
3254
3255 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3256 * Makefile.in (config_h): Add conf_post.h.
3257 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3258
3259 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3260
3261 * nsterm.m (ns_do_open_file): New variable.
3262 (ns_term_init): Set ns_do_open_file to YES after run returns.
3263 (openFile, openTempFile, openFileWithoutUI, openFiles):
3264 Open files only if ns_do_open_file.
3265
3266 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3267
3268 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3269 This no-op macro hasn't been needed for many years.
3270 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3271
3272 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3273 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3274 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3275 gdb_make_enums_visible.
3276 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3277 (DIRECTORY_SEP): Now a constant, not a macro.
3278
3279 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3280
3281 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3282 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3283
3284 * w32term.c <w32_keyboard_codepage>: Renamed from
3285 keyboard_codepage and now external. All users changed.
3286
3287 * w32term.h: Add declaration of w32_keyboard_codepage.
3288
3289 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3290 the codepage to translate keys to Unicode. If this argument is
3291 -1, use the value returned by GetConsoleCP. All callers changed.
3292
3293 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3294
3295 Update .PHONY listings in makefiles.
3296 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3297 bootstrap-clean, distclean, maintainer-clean, versioclean,
3298 extraclean, frc.
3299
3300 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3301 This is a bit clearer. Fix some commentary typos.
3302
3303 2012-07-30 Glenn Morris <rgm@gnu.org>
3304
3305 * s/netbsd.h: Let configure include signal.h if needed.
3306 Remove file, which is now empty.
3307
3308 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3309 Let configure set them.
3310 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3311 No more need to undefine.
3312
3313 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3314
3315 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3316 non-single-byte char when adding meta modifier. (Bug#12090)
3317
3318 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3319
3320 Convert safe_call to use variable number of arguments.
3321 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3322 (safe_call2): Fix comment.
3323 * lisp.h (safe_call): Adjust prototype.
3324 * coding.c (encode_coding_object): Change to use safe_call2.
3325 * xfaces.c (merge_face_heights): Change to use safe_call1.
3326
3327 2012-07-30 Glenn Morris <rgm@gnu.org>
3328
3329 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3330 does that unconditionally. Remove file, which is now empty.
3331
3332 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3333 Remove empty files.
3334
3335 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3336
3337 Export to GDB most of lisp.h's remaining object-like macros.
3338 * lisp.h (min, max): Move earlier, because they're used earlier now.
3339 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3340 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3341 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3342 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3343 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3344 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3345 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3346 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3347 Now constants, for GDB. They need not be macros.
3348 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3349 Now constants, for GDB, as well as macros, for static initializers.
3350 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3351 Move to after the definition of struct Lisp_Char_Table,
3352 since the former now needs that type defined.
3353 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3354 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3355 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3356 New enums, for gdb_make_enums_visible.
3357 (GLYPH_MODE_LINE_FACE): Remove; unused.
3358 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3359 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3360 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3361 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3362 enum maxargs, enum MAX_ALLOCA.
3363 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3364 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3365 no longer needed, now that they are done in lisp.h.
3366
3367 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3368
3369 Cleanup string bytes checking.
3370 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3371 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3372 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3373 (check_sblock, compact_small_strings): Simplify.
3374
3375 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3376
3377 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3378 These macros are confusing and no longer need to be defined, as
3379 the enum values now suffice. All uses replaced with definiens.
3380 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3381
3382 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3383
3384 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3385 ($(BLD)/w32console.$(O)): Update dependencies.
3386
3387 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3388
3389 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3390 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3391 time. Adjust users.
3392 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3393
3394 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3395
3396 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3397 setting sitelisp (Bug#12010).
3398
3399 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3400
3401 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3402
3403 * w32heap.c (cache_system_info):
3404 * w32.c (sys_rename):
3405 * w32proc.c (find_child_console, sys_kill): All users changed.
3406
3407 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3408
3409 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3410
3411 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3412
3413 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3414
3415 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3416
3417 Cleanup statistics calculation in Fgarbage_collect.
3418 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3419 Fix zombies percentage calculation. Simplify elapsed time calculation.
3420
3421 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3422
3423 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3424 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3425 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3426 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3427 (replace_range, replace_range_2, del_range_2): Change to eassert.
3428 * marker.c (byte_char_debug_check): Adjust style.
3429
3430 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3431
3432 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3433 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3434 long-ago-commented-out code that talks about "WIN32".
3435 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3436 All uses changed.
3437
3438 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3439
3440 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3441 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3442 Simplify by using alignof.
3443 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3444 * lisp.h: Include <stdalign.h>.
3445 (GCALIGNMENT): New macro and constant.
3446 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3447 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3448 (stdalign): New macro, if not already defined.
3449
3450 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3451
3452 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3453 * w32inevt.c: Include w32inevt.h.
3454 (w32_read_console_input): New inline function, calls either
3455 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3456 w32_console_unicode_input.
3457 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3458 (w32_kbd_patch_key, key_event): Use the codepage returned by
3459 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3460 (key_event): use uChar.UnicodeChar only if
3461 w32_console_unicode_input is non-zero.
3462
3463 * w32console.c: Include w32heap.h.
3464 <w32_console_unicode_input>: New global variable.
3465 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3466 family of Windows, zero otherwise.
3467
3468 * w32inevt.h: Declare w32_console_unicode_input.
3469
3470 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3471 --without-x. (Bug#11742)
3472
3473 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3474
3475 Adjust GDB to reflect pvec_type changes (Bug#12036).
3476 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3477 2012-07-04 changes to pseudovector representation.
3478 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3479
3480 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3481
3482 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3483 bus address.
3484 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3485
3486 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3487
3488 * alloc.c (listn): Fix the order the arguments are consed onto the
3489 list.
3490
3491 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3492 enumeration constants, as PURE and HEAP are too general, and clash
3493 with other headers and sources, such as gmalloc.c and the
3494 MS-Windows system headers. All users changed.
3495
3496 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3497
3498 Revert last save_excursion_save and save_excursion_restore changes.
3499 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3500 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3501
3502 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3503
3504 Fix recently-introduced typos in Windows port.
3505 Reported by Martin Rudalics <rudalics@gmx.at>.
3506 * w32.c (init_environment): Replace comma with semicolon.
3507 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3508
3509 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3510
3511 Improve GDB symbol export (Bug#12036).
3512 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3513 arms of an 'if', not using conditional expressions; otherwise GDB
3514 complains about the types in the unevaluated arm when the argument
3515 is an integer literal.
3516 (xgetint): Simplify expression.
3517 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3518 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3519 Zaretskii in <http://bugs.gnu.org/12036#13>.
3520 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3521 needed now that we have gdb_make_enums_visible.
3522 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3523 (enum enum_USE_LSB_TAG):
3524 New enum types, packaging up enums that need to be exported to GDB.
3525
3526 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3527
3528 Utility function to make a list from specified amount of objects.
3529 * lisp.h (enum constype): New datatype.
3530 (listn): New prototype.
3531 * alloc.c (listn): New function.
3532 (Fmemory_use_count, syms_of_alloc): Use it.
3533 * buffer.c (syms_of_buffer): Likewise.
3534 * callint.c (syms_of_callint): Likewise.
3535 * charset.c (define_charset_internal): Likewise.
3536 * coding.c (syms_of_coding): Likewise.
3537 * keymap.c (syms_of_keymap): Likewise.
3538 * search.c (syms_of_search): Likewise.
3539 * syntax.c (syms_of_syntax): Likewise.
3540 * w32.c (init_environment): Likewise.
3541 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3542 * xdisp.c (syms_of_xdisp): Likewise.
3543 * xfns.c (syms_of_xfns): Likewise.
3544
3545 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3546
3547 Fast save_excursion_save and save_excursion_restore.
3548 * lisp.h (struct Lisp_Excursion): New data type.
3549 (PVEC_EXCURSION): New pseudovector type.
3550 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3551 to deal with it. Adjust comments.
3552 (init_marker, attach_marker): New prototype.
3553 (unchain_marker): Adjust prototype.
3554 * marker.c (attach_marker): Change to global.
3555 (init_marker): New function.
3556 * alloc.c (Fmake_marker, build_marker): Use it.
3557 (build_marker): More easserts.
3558 (mark_object): Handle struct Lisp_Excursion.
3559 * editfns.c (save_excursion_save, save_excursion_restore):
3560 Reimplement to use struct Lisp_Excursion. Add comments.
3561
3562 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3563
3564 Fix export of symbols to GDB (Bug#12036).
3565 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3566 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3567 emacs.c, as this is a more-suitable home. Had this been done earlier
3568 the fix for 12036 would have avoided some of the problems noted in
3569 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3570 would have been more obvious.
3571 * emacs.c: Do not include <verify.h>; no longer needed.
3572 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3573 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3574 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3575 Remove; now done in lisp.h.
3576 * lisp.h (PUBLISH_TO_GDB): New macro.
3577 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3578 (DATA_SEG_BITS): Use it.
3579 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3580 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3581 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3582 not be usable in #if. This simplifies things.
3583
3584 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3585
3586 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3587
3588 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3589
3590 Simplify export of symbols to GDB (Bug#12036).
3591 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3592 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3593 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3594 Adjust to changes in lisp.h and emacs.c, by using
3595 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3596 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3597 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3598 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3599 instead of gdb_valbits.
3600 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3601 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3602 instead of gdb_array_mark_flag.
3603 (xboolvector): Get size from $->size, not $->header.size.
3604 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3605 (xreload, hook-run, hookpost-run): Remove.
3606 * emacs.c: Include <verify.h>.
3607 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3608 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3609 Remove.
3610 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3611 (gdb_USE_LSB_TAG): New enum constants.
3612 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3613 Also define these as enum constants, so they're visible to GDB.
3614 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3615 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3616 as constants, so they're visible to GDB.
3617 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3618 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3619 Now enum constants, not macros, so they're visible to GDB.
3620 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3621 more convenient now. All uses changed.
3622 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3623 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3624
3625 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3626
3627 Explicitly free restriction data that are not needed anymore.
3628 * editfns.c (save_restriction_restore): Free restriction data.
3629
3630 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3631
3632 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3633 add argument, tune behavior, and adjust all callers.
3634
3635 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3636
3637 Use typedef for EMACS_INT, EMACS_UINT.
3638 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3639 than macros. This simplifies debugging in the usual case, since
3640 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3641 and it allows expressions involving EMACS_INT casts.
3642 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3643
3644 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3645
3646 * nsterm.m (ns_read_socket): Return early if there is a modal
3647 window (Bug#12043).
3648
3649 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3650
3651 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3652 that FOCUS-FRAME can be omitted.
3653
3654 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3655
3656 Adjust buffer text indirection counters at the end of Fkill_buffer.
3657 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3658 buffer is definitely dead. This should really fix an issue reported
3659 by Christoph Scholtes again. (Bug#12007).
3660 (init_buffer_once): Initialize indirection counters of
3661 buffer_defaults and buffer_local_symbols (for sanity and safety).
3662
3663 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3664
3665 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3666 and continuation glyphs on tooltip frames, leave them at zero.
3667 Avoids continued lines in tooltips. (Bug#11832)
3668
3669 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3670
3671 Simplify copy_overlay.
3672 * buffer.c (copy_overlay): Simplify. Use build_marker.
3673 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3674
3675 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3676
3677 * print.c (print_object): Don't crash when a frame's name is nil
3678 or invalid. (Bug#12025)
3679
3680 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3681 it signals an error when a tooltip frame is being created.
3682
3683 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3684
3685 Cleanup miscellaneous objects allocation and initialization.
3686 * alloc.c (allocate_misc): Change to static. Add argument to
3687 specify the subtype. Adjust comment and users.
3688 (build_overlay): New function.
3689 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3690 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3691 (allocate_misc): Remove prototype.
3692 (build_overlay): Add prototype.
3693
3694 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3695
3696 Swap buffer text indirection counters in Fbuffer_swap_text.
3697 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3698 This avoids crash reported by Christoph Scholtes at
3699 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3700
3701 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3702
3703 * nsmenu.m (Popdown_data): New struct.
3704 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3705 free Popdown_data.
3706 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3707 (initWithContentRect): Make imgView and contentView non-static
3708 and autorelease them. Also autorelease img and matrix (Bug#12005).
3709 (dealloc): Remove (Bug#12005).
3710
3711 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3712
3713 Adjust consing_since_gc when objects are explicitly freed.
3714 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3715 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3716 (free_cons, free_misc): Subtract object size from consing_since_gc.
3717
3718 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3719
3720 Simplify and cleanup markers positioning code.
3721 * marker.c (attach_marker): More useful eassert.
3722 (live_buffer, set_marker_internal): New function.
3723 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3724 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3725
3726 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3727
3728 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3729 as it's limited by the amount of memory, not by INT_MAX.
3730
3731 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3732
3733 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3734 in special-event-map. See the discussion at
3735 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3736 for the reasons.
3737
3738 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3739 info.dwItemData. Fixes crashes on 64-bit Windows.
3740 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3741
3742 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3743
3744 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3745 (conversationIdentifier): Return value is NSInteger.
3746 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3747
3748 2012-07-21 Chong Yidong <cyd@gnu.org>
3749
3750 * window.c (decode_any_window): Signal an error if the window is
3751 on a dead frame (Bug#11984).
3752
3753 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3754
3755 Add indirection counting to speed up Fkill_buffer.
3756 * buffer.h (struct buffer): New member.
3757 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3758 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3759 base buffer indirection counter.
3760 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3761 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3762 through buffer list if indirection counter is 0.
3763
3764 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3765
3766 Extend the value returned by Fgarbage_collect with heap statistics.
3767 * alloc.c (Qheap): New symbol.
3768 (syms_of_alloc): DEFSYM it.
3769 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3770 (Fmemory_free): Remove.
3771 (syms_of_alloc): Don't defsubr it.
3772 * buffer.c (Fcompact_buffer): Remove.
3773 (syms_of_buffer): Don't defsubr it.
3774
3775 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3776
3777 Make maybe_gc inline.
3778 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3779 * lisp.h (consing_since_gc, gc_relative_threshold)
3780 (memory_full_cons_threshold): Revert declaration.
3781 (maybe_gc): Remove prototype, define as inline.
3782 * alloc.c: Remove old commented-out code.
3783 (consing_since_gc, gc_relative_threshold)
3784 (memory_full_cons_threshold): Revert to global.
3785 (maybe_gc): Remove.
3786
3787 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3788
3789 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3790 * lisp.h (build_unibyte_string): New function.
3791 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3792 * sysdep.c, w32fns.c, xfns.c: Use it.
3793 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3794 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3795 Adjust users accordingly.
3796 * font.h (font_open_by_name): Adjust prototype.
3797
3798 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3799
3800 Cleanup calls to Fgarbage_collect.
3801 * lisp.h (maybe_gc): New prototype.
3802 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3803 Remove declarations.
3804 * alloc.c (maybe_gc): New function.
3805 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3806 Make them static.
3807 * bytecode.c (MAYBE_GC): Use maybe_gc.
3808 * eval.c (eval_sub, Ffuncall): Likewise.
3809 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3810 to avoid dependency from auto-save feature.
3811
3812 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3813
3814 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3815 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3816 'for_each_per_buffer_object_at'.
3817 All uses changed. It's better to use upper-case for macros that
3818 cannot be implemented as functions, to give the reader a clue
3819 that they're special.
3820
3821 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3822
3823 * alloc.c (Fgarbage_collect): Tweak docstring.
3824
3825 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3826
3827 Tweak the value returned from Fgarbage_collect again.
3828 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3829 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3830 Adjust documentation.
3831 (total_vector_bytes): Rename to total_vector_slots, adjust
3832 accounting.
3833 (total_free_vector_bytes): Rename to total_free_vector_slots,
3834 adjust accounting.
3835 (Qstring_bytes, Qvector_slots): New symbols.
3836 (syms_of_alloc): DEFSYM them.
3837
3838 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3839
3840 Buffer compaction primitive which may be used from Lisp.
3841 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3842 (syms_of_buffer): Register Fcompact_buffer.
3843 * alloc.c (Fgarbage_collect): Use compact_buffer.
3844 * buffer.h (compact_buffer): New prototype.
3845 (struct buffer_text): New member.
3846
3847 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3848
3849 New macro to iterate over all buffers, miscellaneous cleanups.
3850 * lisp.h (all_buffers): Remove declaration.
3851 * buffer.h (all_buffers): Add declaration, with comment.
3852 (for_each_buffer): New macro.
3853 * alloc.c (Fgarbage_collect, mark_object): Use it.
3854 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3855 (init_buffer): Likewise.
3856 * data.c (Fset_default): Likewise.
3857 * coding.c (code_conversion_restore): Remove redundant check
3858 for dead buffer.
3859 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3860
3861 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3862
3863 Fix bug that created negative-length intervals.
3864 * intervals.c (merge_interval_right, merge_interval_left):
3865 Do not zero out this interval if it is absorbed by its children,
3866 as this interval's total length doesn't change in that case. See
3867 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3868
3869 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3870
3871 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3872 when invoking (make-bool-vector N t) and N is a positive
3873 multiple of 8 -- the last 8 bits were mistakenly cleared.
3874
3875 Remove some struct layout assumptions in bool vectors.
3876 * alloc.c (bool_header_size): New constant.
3877 (header_size, word_size): Move earlier, as they're now used earlier.
3878 Use 'word_size' in a few more places, where it's appropriate.
3879 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3880 padding before the data member of a bool vector.
3881 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3882 than doing the check by hand with an abort ().
3883
3884 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3885
3886 * eval.c (Fdefvar): Don't check constants since we only set the var if
3887 it's not yet defined anyway (bug#11904).
3888
3889 * lisp.h (last_undo_boundary): Declare new var.
3890 * keyboard.c (command_loop_1): Set it.
3891 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3892 were auto-added by the command loop (bug#11774).
3893
3894 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3895
3896 * w32font.c (Qsymbol): Remove local definition.
3897 (syms_of_w32font): Don't DEFSYM it.
3898
3899 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3900
3901 Fix sweep_vectors to handle large bool vectors correctly.
3902 * alloc.c (sweep_vectors): Account total_vector_bytes for
3903 bool vectors larger than VBLOCK_BYTES_MAX.
3904
3905 2012-07-18 Chong Yidong <cyd@gnu.org>
3906
3907 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3908 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3909
3910 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3911
3912 Return more descriptive data from Fgarbage_collect.
3913 Suggested by Stefan Monnier in
3914 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3915 * alloc.c (bounded_number): New function.
3916 (total_buffers, total_vectors): New variable.
3917 (total_string_size): Rename to total_string_bytes, adjust users.
3918 (total_vector_size): Rename to total_vector_bytes, adjust users.
3919 (sweep_vectors): Account total_vectors and total_vector_bytes.
3920 (Fgarbage_collect): New return value. Adjust documentation.
3921 (gc_sweep): Account total_buffers.
3922 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3923 (VECTOR_SIZE): Remove.
3924 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3925 (Qinterval, Qmisc): New symbols.
3926 (syms_of_data): Initialize them.
3927 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3928 (Qcons, Qbuffer): New declarations.
3929
3930 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3931
3932 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3933 Round up, not down. Improve doc.
3934
3935 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3936
3937 Restore old code in allocate_string_data to avoid Faset breakage.
3938 Reported by Julien Danjou <julien@danjou.info> in
3939 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3940 * alloc.c (allocate_string_data): Restore old code with minor
3941 adjustments, fix comment to explain this subtle issue.
3942
3943 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3944
3945 Remove FILE_SYSTEM_CASE.
3946 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3947
3948 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3949 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3950 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3951 call-process-region passes it through expand-file-name.
3952
3953 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3954
3955 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3956
3957 Fix crash when creating indirect buffer (Bug#11917)
3958 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3959 Don't handle unbound variables specially if non-zero.
3960 (Fbuffer_local_variables): Pass zero.
3961 (clone_per_buffer_values): Pass non-zero.
3962
3963 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3964
3965 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3966 to make the loop interruptible.
3967
3968 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3969
3970 * gnutls.c (emacs_gnutls_handshake): Only retry if
3971 GNUTLS_E_INTERRUPTED.
3972
3973 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3974
3975 Cleanup and convert miscellaneous checks to eassert.
3976 * alloc.c (mark_interval): Fix comment, partially rephrase
3977 old comment from intervals.h (see below).
3978 * intervals.c (find_interval, adjust_intervals_for_insertion)
3979 (delete_interval, adjust_intervals_for_deletion)
3980 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3981 Convert to eassert.
3982 (adjust_intervals_for_insertion, make_new_interval):
3983 Remove obsolete and unused code.
3984 * intervals.h (struct interval): Remove obsolete comment.
3985 * textprotp.c (erase_properties): Remove unused code.
3986 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3987 (Fremove_list_of_text_properties): Convert to eassert.
3988
3989 2012-07-17 Chong Yidong <cyd@gnu.org>
3990
3991 * editfns.c (Finsert_char): Doc fix.
3992
3993 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3994
3995 Fix previous change to make Fmemory_free always accurate.
3996 * alloc.c (make_interval): Update total_free_intervals.
3997 (make_float): Likewise for total_free_floats.
3998 (free_cons, Fcons): Likewise for total_free_conses.
3999 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4000 Likewise for total_free_vector_bytes.
4001 (Fmake_symbol): Likewise for total_free_symbols.
4002 (bytes_free): Remove.
4003
4004 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4005
4006 Simple free memory accounting feature.
4007 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4008 (sweep_vectors): Accumulate size of free vectors.
4009 (Fgarbage_collect): Setup bytes_free.
4010 (Fmemory_free): New function.
4011 (syms_of_alloc): Register it.
4012
4013 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4014
4015 Cleanup overlays checking.
4016 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4017 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4018 eassert and OVERLAYP.
4019 (sort_overlays): Change to use OVERLAYP.
4020
4021 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4022
4023 * editfns.c (Finsert_char): Make it interactive, and make the
4024 second arg optional. Copy interactive spec and docstring from
4025 ucs-insert.
4026
4027 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4028
4029 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4030 Unlike the other wrapped functions, fabs has an unspecified
4031 effect on errno.
4032
4033 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4034
4035 * nsterm.m (keyDown): Interpret flags without left/right bits
4036 as the left key (Bug#11670).
4037
4038 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4039
4040 Remove empty and useless init functions.
4041 * lisp.h (init_character_once, init_fns, init_image)
4042 (init_filelock, init_sound): Remove prototype.
4043 * character.c (init_character_once): Remove.
4044 * filelock.c (init_filelock): Likewise.
4045 * fns.c (init_fns): Likewise.
4046 * image.c (init_image): Likewise.
4047 * sound.c (init_sound): Likewise.
4048 * emacs.c (main): Adjust accordingly.
4049
4050 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4051
4052 * gtkutil.h: Tiny cleanups.
4053 (use_old_gtk_file_dialog): Remove useless declaration.
4054 (xg_uses_old_file_dialog): Add suggested const attribute.
4055
4056 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4057
4058 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4059 (bidi_paragraph_init): Use it to limit search forward for a strong
4060 directional character in abnormally large paragraphs full of
4061 neutral or weak characters. (Bug#11943)
4062
4063 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4064
4065 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4066 the toolbar (Bug#9451).
4067 (xg_make_tool_item): Give the widget event box a transparent
4068 background.
4069
4070 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4071
4072 Cleanup basic allocation variables and functions.
4073 * alloc.c (ignore_warnings, init_intervals, init_float)
4074 (init_cons, init_symbol, init_marker): Remove.
4075 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4076 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4077 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4078 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4079 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4080 (staticidx, init_alloc_once, init_strings, free_ablock):
4081 Remove redundant initialization.
4082 * fns.c (init_weak_hash_tables): Remove.
4083 * lisp.h (init_weak_hash_tables): Remove prototype.
4084
4085 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4086
4087 Use zero_vector where appropriate.
4088 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4089 accordingly.
4090 * lisp.h (zero_vector): New declaration.
4091 * font.c (null_vector): Remove.
4092 (syms_of_font): Remove initialization and staticpro.
4093 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4094 * keymap.c (Faccessible_keymaps): Likewise.
4095
4096 2012-07-15 Leo Liu <sdl.web@gmail.com>
4097
4098 * fringe.c: Fix typo in comments.
4099
4100 2012-07-14 Leo Liu <sdl.web@gmail.com>
4101
4102 * fringe.c: Add a new bitmap exclamation-mark.
4103
4104 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4105
4106 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4107
4108 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4109 (HAVE_MENUS): Don't define, defined by editing config.in with
4110 msdos/sed2v2.inp.
4111 (GMALLOC_INHIBIT_VALLOC): Don't define.
4112 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4113
4114 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4115
4116 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4117
4118 2012-07-14 Glenn Morris <rgm@gnu.org>
4119
4120 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4121 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4122 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4123
4124 2012-07-13 Glenn Morris <rgm@gnu.org>
4125
4126 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4127
4128 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4129 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4130
4131 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4132
4133 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4134 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4135 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4136 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4137 where appropriate.
4138 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4139 as boolean expression.
4140 (x_set_window_size): Remove unused variable toolbar.
4141 (ns_get_color_default, ns_mod_to_lisp): Remove.
4142 (ns_mouse_position): Remove unused variables xchar and ychar.
4143 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4144 (ns_set_vertical_scroll_bar): Remove unused variable count.
4145 (ns_delete_terminal): Remove unused variable i.
4146 (ns_term_init): Remove unused variables r, g and b.
4147 (mouseDown): Remove unused variable window.
4148 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4149 (initFrameFromEmacs): Remove unused variable vbextra.
4150 (mouseEntered): Remove unused variables p and dpyinfo.
4151 (mouseExited): Remove unused variables p and r.
4152 (ns_define_frame_cursor, ns_clear_frame_area)
4153 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4154 (menuDown): Assign [sender tag] to variable and cast the variable.
4155
4156 * nsterm.h (menuDown): Add id as type to argument sender.
4157 (ns_display_info_for_name): Add Lisp_Object argument.
4158 (ns_term_init): Add Lisp_Object argument.
4159 (ns_map_event_to_object): Add void argument.
4160 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4161 prototype with arguments and only declare if __OBJC__.
4162 (nxatoms_of_nsselect): Add void argument.
4163 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4164 (ns_alloc_autorelease_pool): Add void argument.
4165 (ns_release_autorelease_pool): Add void* argument.
4166 (ns_get_defaults_value): Add const char* argument.
4167
4168 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4169 (initFromContents): Use SSDATA where appropriate.
4170 (ns_update_menubar): Add braces to ambigous if-else.
4171 (initWithTitle): Put () around assignment in if statement.
4172 (ns_menu_show): Remove unused variables window and keymap.
4173 (update_frame_tool_bar): Remove unused variable selected_p.
4174 (initWithContentRect): Remove unused variable this_cmd_name.
4175
4176 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4177 appropriate.
4178 (setXBMColor): Remove unused variable len.
4179 (setPixmapData): Put () around assignment in loop statement.
4180
4181 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4182 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4183 where appropriate.
4184 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4185 around assignment in loop statement.
4186 (nsfont_open): Remove unused variable i.
4187 (nsfont_open): Remove unused variable len.
4188 (nsfont_draw): Remove unused variable cs.
4189
4190 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4191 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4192 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4193 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4194 (Fns_font_name, Fns_perform_service)
4195 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4196 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4197 (ns_set_name): Remove unused variable view.
4198 (x_set_menu_bar_lines): Remove unused variable olines.
4199 (x_set_tool_bar_lines): Remove unused variable root_window.
4200 (Fns_list_colors): Put () around assignment in while statement.
4201 (Fns_perform_service): Remove unused variable len.
4202 (Fns_display_usable_bounds): Remove unused variable top.
4203 (syms_of_nsfns): Remove unused variable i.
4204
4205 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4206 memcpy (Bug#11907).
4207
4208 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4209
4210 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4211 and free it with DestroyExceptionInfo (Bug#11558).
4212
4213 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4214
4215 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4216 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4217 Set here, not in nt/config.nt.
4218
4219 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4220
4221 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4222 cursor overflow into the last glyph on display line when the right
4223 fringe is off. (Bug#11832)
4224
4225 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4226
4227 * xdisp.c (produce_special_glyphs): Now static.
4228 * dispextern.h (produce_special_glyphs): Remove decl.
4229
4230 2012-07-13 Glenn Morris <rgm@gnu.org>
4231
4232 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4233 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4234
4235 * s/usg5-4-common.h (USG, USG5):
4236 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4237 * s/sol2-6.h (SOLARIS2):
4238 * s/irix6-5.h (IRIX6_5):
4239 * s/hpux10-20.h (USG, USG5, HPUX):
4240 * s/gnu-linux.h (USG, GNU_LINUX):
4241 * s/freebsd.h (BSD_SYSTEM):
4242 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4243 * s/cygwin.h (CYGWIN):
4244 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4245 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4246
4247 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4248
4249 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4250
4251 2012-07-13 Glenn Morris <rgm@gnu.org>
4252
4253 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4254
4255 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4256
4257 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4258 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4259
4260 2012-07-12 Glenn Morris <rgm@gnu.org>
4261
4262 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4263
4264 * process.c (init_process_emacs): Rename from init_process.
4265 The old name is also the name of a Mach system call.
4266 * lisp.h, emacs.c: Update for this name change.
4267 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4268 longer needed.
4269
4270 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4271
4272 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4273 memmove call that removes glyphs covered by the left truncation
4274 glyph. Improve commentary.
4275 (display_line): Fix display of continuation glyphs on GUI frames
4276 when the right fringe is turned off and variable-size fonts are
4277 used in the window. Move the code that appends a stretch glyph to
4278 produce_special_glyphs, so that it could be used for truncation
4279 and continuation glyphs alike.
4280 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4281 glyph of a suitably computed width, to align the special glyphs at
4282 the window margin. Code moved from display_line. (Bug#11832)
4283
4284 2012-07-12 Glenn Morris <rgm@gnu.org>
4285
4286 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4287
4288 * s/gnu-linux.h, s/hpux10-20.h:
4289 Do not unconditionally define HAVE_XRMSETDATABASE.
4290
4291 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4292
4293 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4294
4295 Fix typos that broke OS X build.
4296 Reported by Randal L. Schwartz in
4297 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4298 * nsterm.m (ns_timeout): Add missing local decl.
4299 (ns_get_color): snprintf -> sprintf, to fix typo.
4300
4301 2012-07-12 Glenn Morris <rgm@gnu.org>
4302
4303 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4304 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4305 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4306 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4307
4308 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4309 Move PTY_OPEN to configure.
4310
4311 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4312 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4313 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4314
4315 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4316
4317 Use empty_unibyte_string where applicable.
4318 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4319 * lread.c (read1): Likewise.
4320 * xsettings.c (syms_of_xsettings): Likewise.
4321
4322 2012-07-12 Glenn Morris <rgm@gnu.org>
4323
4324 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4325 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4326 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4327 * s/hpux10-20.h (RUN_TIME_REMAP):
4328 * s/bsd-common.h (TABDLY): Move to configure.
4329
4330 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4331
4332 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4333
4334 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4335 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4336
4337 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4338
4339 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4340 * s/template.h: Move NARROWPROTO to configure.
4341
4342 2012-07-11 Glenn Morris <rgm@gnu.org>
4343
4344 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4345 unused since 2011-01-17 change to systty.h.
4346
4347 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4348 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4349 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4350
4351 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4352
4353 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4354
4355 2012-07-11 Glenn Morris <rgm@gnu.org>
4356
4357 * s/darwin.h, s/gnu-linux.h, s/template.h:
4358 Move INTERRUPT_INPUT to configure.
4359
4360 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4361
4362 Minor adjustments to interning code.
4363 * lisp.h (intern, intern_c_string): Redefine as static inline
4364 wrappers for intern_1 and intern_c_string_1, respectively.
4365 (intern_1, intern_c_string_1): Rename prototypes.
4366 * lread.c (intern_1, intern_c_string_1, oblookup):
4367 Simplify Vobarray checking.
4368 * font.c (font_intern_prop): Likewise. Adjust comment.
4369 * w32font.c (intern_font_name): Likewise.
4370
4371 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4372
4373 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4374
4375 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4376 of Fcar/Fcdr if possible.
4377 * font.c (check_otf_features): Likewise.
4378 * fontset.c (Fnew_fontset): Likewise.
4379 * gnutls.c (Fgnutls_boot): Likewise.
4380 * minibuf.c (read_minibuf): Likewise.
4381 * msdos.c (IT_set_frame_parameters): Likewise.
4382 * xmenu.c (Fx_popup_dialog): Likewise.
4383 * w32menu.c (Fx_popup_dialog): Likewise.
4384
4385 2012-07-11 Glenn Morris <rgm@gnu.org>
4386
4387 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4388 since nothing has defined it on these platforms.
4389
4390 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4391 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4392
4393 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4394 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4395 Move CLASH_DETECTION to configure.
4396
4397 * s/gnu.h: Remove file, which is now empty.
4398
4399 * s/gnu.h, s/gnu-linux.h:
4400 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4401
4402 2012-07-11 John Wiegley <johnw@newartisans.com>
4403
4404 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4405 function attribute, so we only use it if it exists in the
4406 compiler.
4407
4408 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4409
4410 Avoid call to strlen in fast_c_string_match_ignore_case.
4411 * search.c (fast_c_string_match_ignore_case): Change to use
4412 length argument. Adjust users accordingly.
4413 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4414
4415 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4416
4417 Assume mkdir, rmdir.
4418 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4419 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4420
4421 Assume rename.
4422 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4423
4424 Assume perror.
4425 * s/hpux10-20.h (HAVE_PERROR): Remove.
4426 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4427 Remove dummy definition, as this problem was obsolete long ago.
4428
4429 Assume strerror.
4430 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4431
4432 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4433
4434 Avoid calls to strlen in font processing functions.
4435 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4436 (font_open_by_name): Change to use length argument.
4437 Adjust users accordingly.
4438 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4439 Adjust prototypes.
4440 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4441 Change to return ptrdiff_t.
4442 (xfont_list_pattern, xfont_match): Use length returned by
4443 xfont_decode_coding_xlfd.
4444 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4445
4446 2012-07-11 Glenn Morris <rgm@gnu.org>
4447
4448 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4449 Move DONT_REOPEN_PTY to configure.
4450
4451 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4452 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4453
4454 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4455
4456 Remove "#define unix" that is no longer needed (Bug#11905).
4457 * s/aix4-2.h (unix): Remove; no longer needed.
4458
4459 EMACS_TIME simplification (Bug#11875).
4460 This replaces macros (which typically do not work in GDB)
4461 with functions, typedefs and enums, making the code easier to debug.
4462 The functional style also makes code easier to read and maintain.
4463 * systime.h: Include <sys/time.h> on all hosts, not just if
4464 WINDOWSNT, since 'struct timeval' is needed in general.
4465 (EMACS_TIME): Now a typedef, not a macro.
4466 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4467 not macros.
4468 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4469 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4470 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4471 (EMACS_TIME_LE): Now functions, not macros.
4472 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4473 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4474 which are not functions. All uses rewritten to use:
4475 (make_emacs_time): New function.
4476 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4477 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4478 not functions. All uses rewritten to use the following, respectively:
4479 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4480 (add_emacs_time, sub_emacs_time): New functions.
4481 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4482 * fileio.c (Fcopy_file):
4483 * xterm.c (XTflash): Get the current time closer to when it's used.
4484 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4485
4486 * bytecode.c (targets): Suppress -Woverride-init warnings.
4487
4488 Simplify by avoiding confusing use of strncpy etc.
4489 * doc.c (Fsnarf_documentation):
4490 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4491 * frame.c (Fmake_terminal_frame):
4492 * gtkutil.c (get_utf8_string):
4493 * lread.c (openp):
4494 * nsmenu.m (ns_update_menubar):
4495 * regex.c (regerror):
4496 Prefer memcpy to strncpy and strncat when either will do.
4497 * fileio.c (Fsubstitute_in_file_name):
4498 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4499 (menu_separator_name_p):
4500 * nsmenu.m (ns_update_menubar):
4501 Prefer memcmp to strncmp when either will do.
4502 * nsterm.m: Include <ftoastr.h>.
4503 (ns_get_color):
4504 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4505 Prefer snprintf to strncpy.
4506 * nsterm.m (ns_term_init):
4507 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4508 * nsterm.m (ns_term_init):
4509 Avoid the need for strncpy, by using build_string or
4510 make_unibyte_string directly. Use dtoastr, not snprintf.
4511 * process.c (Fmake_network_process): Diagnose service names that
4512 are too long, rather than silently truncating them or creating
4513 non-null-terminated names.
4514 (Fnetwork_interface_info): Likewise, for interface names.
4515 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4516 Prefer sprintf to strncat.
4517 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4518 Prefer vsnprintf to vsprintf + strncpy.
4519
4520 2012-07-10 Glenn Morris <rgm@gnu.org>
4521
4522 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4523 Clarify fallback case.
4524
4525 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4526
4527 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4528 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4529 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4530 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4531 where argument type is known to be a Lisp_Cons.
4532
4533 2012-07-10 Tom Tromey <tromey@redhat.com>
4534
4535 * bytecode.c (BYTE_CODE_THREADED): New macro.
4536 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4537 (enum byte_code_op): New type.
4538 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4539 (exec_byte_code): Use them. Use token threading when applicable.
4540
4541 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4542
4543 Optimize pure C strings initialization.
4544 * lisp.h (make_pure_string): Fix prototype.
4545 (build_pure_c_string): New function, defined as static inline. This
4546 provides a better opportunity to optimize away calls to strlen when
4547 the function is called with compile-time constant argument.
4548 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4549 argument, adjust users accordingly. Use build_pure_c_string where
4550 appropriate.
4551 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4552 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4553 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4554
4555 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4556
4557 Avoid calls to strlen in miscellaneous functions.
4558 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4559 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4560 * lread.c (openp): Likewise.
4561
4562 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4563
4564 Avoid calls to strlen in path processing functions.
4565 * fileio.c (file_name_as_directory): Add comment. Change to add
4566 srclen argument and return the length of result. Adjust users
4567 accordingly.
4568 (directory_file_name): Fix comment. Change to add srclen argument,
4569 swap 1st and 2nd arguments to obey the common convention.
4570 Adjust users accordingly.
4571 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4572
4573 2012-07-10 Glenn Morris <rgm@gnu.org>
4574
4575 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4576 Move PENDING_OUTPUT_COUNT definition to configure.
4577
4578 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4579 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4580 * s/gnu.h (DATA_START): Move definitions to configure.
4581
4582 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4583 We include usg5-4-common.h, which defines them both.
4584
4585 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4586 O_RDONLY already includes it).
4587
4588 Stop ns builds setting the EMACSLOADPATH environment variable.
4589 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4590 Now it does not set EMACSLOADPATH, just returns the load-path string.
4591 * nsterm.h: Update accordingly.
4592 * lread.c [HAVE_NS]: Include nsterm.h.
4593 (init_lread) [HAVE_NS]: Use ns_load_path.
4594 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4595
4596 2012-07-09 Glenn Morris <rgm@gnu.org>
4597
4598 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4599 since the included bsd-common.h does so.
4600
4601 Stop ns builds setting the EMACSPATH environment variable.
4602 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4603 (ns_init_paths): Do not set EMACSPATH.
4604 * nsterm.h (ns_exec_path): Add it.
4605 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4606 Use ns_exec_path.
4607
4608 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4609
4610 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4611
4612 * process.c (wait_reading_process_output): 'waitchannels' was unset
4613 when read_kbd || !NILP (wait_for_cell); fix this.
4614
4615 Add GCC-style 'const' attribute to functions that can use it.
4616 * character.h (char_resolve_modifier_mask):
4617 * keyboard.h (make_ctrl_char):
4618 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4619 (init_character_once, next_almost_prime, init_fns, init_image)
4620 (flush_pending_output, init_sound):
4621 * mem-limits.h (start_of_data):
4622 * menu.h (finish_menu_items):
4623 Add ATTRIBUTE_CONST.
4624 * emacs.c (DEFINE_DUMMY_FUNCTION):
4625 Declare the dummy function with ATTRIBUTE_CONST.
4626 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4627 Add decls with ATTRIBUTE_CONST.
4628
4629 Minor improvements to make_formatted_string.
4630 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4631 where int is good enough, as vsprintf returns an int.
4632 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4633
4634 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4635
4636 Use make_formatted_string to avoid double length calculation.
4637 * lisp.h (make_formatted_string): New prototype.
4638 * alloc.c (make_formatted_string): New function.
4639 * buffer.c (Fgenerate_new_buffer_name): Use it.
4640 * dbus.c (syms_of_dbusbind): Likewise.
4641 * editfns.c (Fcurrent_time_zone): Likewise.
4642 * filelock.c (get_boot_time): Likewise.
4643 * frame.c (make_terminal_frame, set_term_frame_name)
4644 (x_report_frame_params): Likewise.
4645 * image.c (gs_load): Likewise.
4646 * minibuf.c (get_minibuffer): Likewise.
4647 * msdos.c (dos_set_window_size): Likewise.
4648 * process.c (make_process): Likewise.
4649 * xdisp.c (ensure_echo_area_buffers): Likewise.
4650 * xsettings.c (apply_xft_settings): Likewise.
4651
4652 2012-07-09 Glenn Morris <rgm@gnu.org>
4653
4654 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4655 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4656 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4657 * nsterm.h (ns_etc_directory): Add it.
4658 * callproc.c [HAVE_NS]: Include nsterm.h.
4659 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4660
4661 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4662
4663 Move marker debugging code under MARKER_DEBUG.
4664 * marker.c (MARKER_DEBUG): Move marker debugging code under
4665 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4666 for bootstrap with --enable-checking (~3x slowdown reported
4667 by Juanma Barranquero <lekktu@gmail.com>).
4668 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4669
4670 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4671
4672 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4673 See <http://bugs.gnu.org/11825#29>.
4674
4675 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4676
4677 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4678 has no font, use the frame's font. (Bug#11813)
4679 (display_line): Add commentary about displaying truncation glyphs
4680 on GUI frames.
4681 (produce_special_glyphs): Move here from term.c.
4682
4683 * term.c (produce_special_glyphs): Move to xdisp.c.
4684
4685 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4686 section.
4687
4688 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4689
4690 * xdisp.c (display_line): Avoid warning about implicit declaration
4691 of FRAME_FONT.
4692
4693 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4694
4695 * lisp.h: Remove empty conditional.
4696
4697 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4698
4699 * lread.c (load_path_check): Now static.
4700
4701 Fix some minor --with-ns problems found by static checking.
4702 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4703 (x_set_font) [!HAVE_X_WINDOWS]:
4704 * image.c (xpm_load_image) [HAVE_NS]:
4705 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4706 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4707 Remove unused local.
4708 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4709 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4710 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4711 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4712 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4713 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4714 Fix pointer signedness problem.
4715 * xfaces.c (FRAME_X_FONT_TABLE):
4716 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4717
4718 2012-07-07 Glenn Morris <rgm@gnu.org>
4719
4720 * lread.c (load_path_check): New function, split from init_lread.
4721 (init_lread): Reorganize. Motivation:
4722 If EMACSLOADPATH is set, check/warn about that rather than the
4723 defaults, which we are not going to use. Hence we can remove
4724 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4725 Don't warn if site-lisp directories are missing.
4726 If not installed, start from a blank load-path, since
4727 PATH_LOADSEARCH refers to the eventual installation directories.
4728
4729 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4730
4731 Support truncation and continuation glyphs on GUI frames, when
4732 fringes are disabled. (Bug#11832)
4733 * xdisp.c (init_iterator): Get dimensions of truncation and
4734 continuation glyphs even if on GUI frames.
4735 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4736 or both, are absent.
4737 (start_display, move_it_in_display_line_to): Handle the case of a
4738 GUI frame without a fringe to display continuation or truncation
4739 glyphs.
4740 (insert_left_trunc_glyphs): Support GUI frames: make sure
4741 truncation glyphs overwrite enough glyphs from the current line to
4742 have sufficient space in pixels.
4743 (display_line): Support truncation and continuation glyphs on GUI
4744 frames. If some spare pixels are left on the line after inserting
4745 the truncation glyphs, fill that space with a stretch glyph of a
4746 suitably computed width.
4747
4748 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4749 produce_glyphs, to support GUI sessions.
4750
4751 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4752
4753 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4754
4755 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4756
4757 Do not require float-time's arg to fit in time_t (Bug#11825).
4758 This works better on hosts where time_t is unsigned, and where
4759 float-time is applied to the (negative) difference between two times.
4760 * editfns.c (decode_time_components): Last arg is now double *,
4761 not int *, and means to store all the result as a double, without
4762 worrying about whether the seconds part fits in time_t.
4763 All callers changed.
4764 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4765 All callers changed.
4766 (Ffloat_time): Do not fail merely because the specified time falls
4767 outside of time_t range.
4768
4769 2012-07-07 Glenn Morris <rgm@gnu.org>
4770
4771 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4772 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4773 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4774
4775 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4776
4777 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4778 Update dependencies.
4779
4780 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4781
4782 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4783
4784 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4785 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4786 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4787 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4788 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4789 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4790
4791 * xfont.c (compare_font_names): Redo to omit the need for casts.
4792
4793 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4794
4795 * xfns.c (Fx_change_window_property): Doc fix.
4796 * w32fns.c (Fx_change_window_property): Doc fix.
4797
4798 * w32fns.c (Fx_window_property): Accept the same arguments as the
4799 X Windows version. Doc fix.
4800 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4801
4802 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4803 Eli Zaretskii <eliz@gnu.org>
4804
4805 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4806 Windows-specific code from nt/config.nt moved here.
4807 Obsolete settings removed.
4808
4809 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4810
4811 * process.c: Avoid unnecessary calls to gettime.
4812 (wait_reading_process_output): Don't get the time of day
4813 when gobbling data immediately and not waiting, as there's no need
4814 for it in that case. This removes a FIXME.
4815
4816 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4817
4818 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4819 is defined (Bug#11768).
4820
4821 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4822
4823 Fix marker debugging code.
4824 * marker.c (byte_char_debug_check): Do not perform the check
4825 if buffer is not multibyte.
4826 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4827 Call byte_char_debug_check with correct arguments.
4828
4829 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4830
4831 Compile marker debugging code only if ENABLE_CHECKING is defined.
4832 * marker.c (byte_char_debug_check, count_markers):
4833 Use only if ENABLE_CHECKING is defined.
4834 (byte_debug_flag): Remove.
4835 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4836 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4837
4838 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4839
4840 Avoid code repetition in marker-related functions.
4841 * marker.c (attach_marker): New function.
4842 (Fset_marker, set_marker_restricted, set_marker_both)
4843 (set_marker_restricted_both): Use it.
4844 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4845 Consistently rename charno to charpos.
4846 (marker_position): Add eassert.
4847 (marker_byte_position): Convert to eassert.
4848
4849 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4850
4851 Simplify list operations in unchain_overlay and unchain_marker.
4852 * buffer.c (unchain_overlay): Simplify. Add comment.
4853 * marker.c (unchain_marker): Simplify. Fix comments.
4854
4855 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4856
4857 Introduce fast path for the widely used marker operation.
4858 * alloc.c (build_marker): New function.
4859 * lisp.h (build_marker): New prototype.
4860 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4861 * composite.c (autocmp_chars): Likewise.
4862 * editfns.c (buildmark): Remove.
4863 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4864 (save_restriction_save): Use build_marker.
4865 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4866 * window.c (save_window_save): Likewise.
4867
4868 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4869
4870 Do not use Fdelete_overlay in delete_all_overlays
4871 to avoid redundant calls to unchain_overlay.
4872 * buffer.c (drop_overlay): New function.
4873 (delete_all_overlays, Fdelete_overlay): Use it.
4874 * minibuf.c (get_minibuffer): Fix comment.
4875
4876 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4877
4878 Port to OpenBSD 5.1 amd64.
4879 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4880 This is needed for OpenBSD, and should be harmless on all BSD systems.
4881 Also, include <sys/sysctl.h>, as it should be available on all
4882 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4883 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4884 use p_pid member, not kp_proc.pid.
4885
4886 2012-07-06 Glenn Morris <rgm@gnu.org>
4887
4888 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4889
4890 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4891
4892 More xmalloc and related cleanup.
4893 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4894 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4895 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4896 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4897 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4898 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4899 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4900 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4901 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4902 * xterm.c:
4903 Omit needless casts involving void * pointers and allocation.
4904 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4905 as the former is more robust if P's type is changed.
4906 Prefer xzalloc to xmalloc + memset 0.
4907 Simplify malloc-or-realloc to realloc.
4908 Don't worry about xmalloc returning a null pointer.
4909 Prefer xstrdup to xmalloc + strcpy.
4910 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4911 growing it.
4912 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4913 alloca of a constant.
4914
4915 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4916
4917 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4918 hscroll is larger than the line width. Fixes long and futile
4919 looping inside extend_face_to_end_of_line (on a TTY) producing
4920 glyphs that are not needed and thrown away.
4921
4922 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4923
4924 * marker.c (set_marker_restricted_both): Simplify by using
4925 clip_to_bounds.
4926
4927 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4928
4929 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4930
4931 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4932
4933 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4934 not defined (Bug#11768).
4935 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4936 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4937 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4938 followed by gtk_box_set_homogeneous (Bug#11768).
4939 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4940 (update_theme_scrollbar_width, xg_create_scroll_bar):
4941 Use gtk_scrollbar_new (Bug#11768).
4942 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4943 (is_box_type): New function (Bug#11768).
4944 (xg_tool_item_stale_p): Call is_box_type.
4945 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4946 with default display (Bug#11768).
4947
4948 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4949
4950 * xdisp.c (window_hscroll_limited): New function.
4951 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4952 coordinates when window's hscroll is set to insanely large
4953 values. (Bug#11857)
4954
4955 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4956
4957 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4958 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4959
4960 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4961
4962 Cleanup xmalloc.
4963 * lisp.h (xzalloc): New prototype. Omit needless casts.
4964 * alloc.c (xzalloc): New function. Omit needless casts.
4965 * charset.c: Omit needless casts. Convert all calls to
4966 xmalloc with following memset to xzalloc.
4967 * dispnew.c: Likewise.
4968 * fringe.c: Likewise.
4969 * image.c: Likewise.
4970 * sound.c: Likewise.
4971 * term.c: Likewise.
4972 * w32fns.c: Likewise.
4973 * w32font.c: Likewise.
4974 * w32term.c: Likewise.
4975 * xfaces.c: Likewise.
4976 * xfns.c: Likewise.
4977 * xterm.c: Likewise.
4978 * atimer.c: Omit needless casts.
4979 * buffer.c: Likewise.
4980 * callproc.c: Likewise.
4981 * ccl.c: Likewise.
4982 * coding.c: Likewise.
4983 * composite.c: Likewise.
4984 * doc.c: Likewise.
4985 * doprnt.c: Likewise.
4986 * editfns.c: Likewise.
4987 * emacs.c: Likewise.
4988 * eval.c: Likewise.
4989 * filelock.c: Likewise.
4990 * fns.c: Likewise.
4991 * gtkutil.c: Likewise.
4992 * keyboard.c: Likewise.
4993 * lisp.h: Likewise.
4994 * lread.c: Likewise.
4995 * minibuf.c: Likewise.
4996 * msdos.c: Likewise.
4997 * print.c: Likewise.
4998 * process.c: Likewise.
4999 * region-cache.c: Likewise.
5000 * search.c: Likewise.
5001 * sysdep.c: Likewise.
5002 * termcap.c: Likewise.
5003 * terminal.c: Likewise.
5004 * tparam.c: Likewise.
5005 * w16select.c: Likewise.
5006 * w32.c: Likewise.
5007 * w32reg.c: Likewise.
5008 * w32select.c: Likewise.
5009 * w32uniscribe.c: Likewise.
5010 * widget.c: Likewise.
5011 * xdisp.c: Likewise.
5012 * xmenu.c: Likewise.
5013 * xrdb.c: Likewise.
5014 * xselect.c: Likewise.
5015
5016 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5017
5018 * fileio.c (time_error_value): Check the right error number.
5019 Problem reported by Troels Nielsen in
5020 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5021
5022 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5023
5024 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5025 This should be fixed in a better way; see Eli Zaretskii in
5026 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5027 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5028
5029 * fileio.c (time_error_value): Rename from special_mtime.
5030 The old name's problems were noted by Eli Zaretskii in
5031 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5032
5033 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5034 This variable's comment says Emacs needs at least one GDB-visible
5035 symbol of type enum pvec_type, to work around GDB problems.
5036 The symbol's value doesn't matter.
5037
5038 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5039 that causes compilation to fail on pre-C99 compilers.
5040
5041 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5042
5043 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5044 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5045
5046 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5047
5048 * buffer.c (init_buffer_once): Fix initialization of
5049 headers for buffer_defaults and buffer_local_symbols.
5050 Reported by Juanma Barranquero <lekktu@gmail.com>.
5051
5052 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5053
5054 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5055 * lisp.h (enum pvec_type): Use fewer bits.
5056 (PSEUDOVECTOR_SIZE_BITS): New constant.
5057 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5058 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5059 change in pvec_type.
5060 (PSEUDOVECTOR_TYPEP): New macro.
5061 (TYPED_PSEUDOVECTORP): Use it.
5062 * fns.c (internal_equal): Adapt code to extract pvectype.
5063 * emacs.c (gdb_pvec_type): Update type.
5064 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5065 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5066 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5067 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5068 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5069 abusing vector->header.next.nbytes.
5070 (live_vector_p): Use PVEC_TYPE.
5071 (mark_object): Adapt code to extract pvectype. Use switch.
5072
5073 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5074
5075 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5076 Tighten new eassert a bit.
5077
5078 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5079
5080 Fix compilation with --enable-gcc-warnings and -O1
5081 optimization level.
5082 * doprnt.c (doprnt): Change type of tem to int, initialize
5083 to avoid compiler warning. Add eassert.
5084 * search.c (simple_search): Initialize match_byte to avoid
5085 compiler warning. Add eassert.
5086
5087 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5088
5089 Avoid weird behavior with large horizontal scrolls.
5090 Without this change, for example, large hscroll values would
5091 mess up Emacs's display on Fedora 15 x86, presumably due to
5092 overflows in int calculations in the display code.
5093 Also, if buffers had long lines, Emacs would freeze.
5094 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5095 (set_window_hscroll): New function, containing the old guts of
5096 Fset_window_hscroll. Return the clipped value.
5097 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5098 This avoids the need to check against PTRDIFF_MAX.
5099
5100 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5101
5102 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5103
5104 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5105
5106 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5107
5108 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5109 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5110 since GCC 4.4.6 issues a bogus warning for them.
5111
5112 Fix bugs in file timestamp newness comparisons.
5113 * fileio.c (Ffile_newer_than_file_p):
5114 * lread.c (Fload): Use full timestamp resolution of files,
5115 not just the 1-second resolution, so that files that are only
5116 slightly newer still count as newer.
5117 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5118 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5119
5120 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5121
5122 * fileio.c: Improve handling of file time marker. (Bug#11852)
5123 (special_mtime): New function.
5124 (Finsert_file_contents, Fverify_visited_file_modtime):
5125 Use it to set special mtime values consistently.
5126
5127 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5128
5129 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5130 marker for non-existing file. (Bug#11852)
5131
5132 2012-07-03 Glenn Morris <rgm@gnu.org>
5133
5134 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5135 and did not make it into globals.h).
5136
5137 2012-07-03 Tom Tromey <tromey@redhat.com>
5138
5139 * window.c (Fset_window_margins, Fset_window_fringes)
5140 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5141 * textprop.c (Fprevious_property_change): No longer static.
5142 * syntax.c (Fsyntax_table_p): No longer static.
5143 * process.c (Fget_process, Fprocess_datagram_address): No longer
5144 static.
5145 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5146 * keyboard.c (Fcommand_execute): No longer static.
5147 Remove EXFUN.
5148 * insdel.c (Fcombine_after_change_execute): No longer static.
5149 * image.c (Finit_image_library): No longer static.
5150 * fileio.c (Fmake_symbolic_link): No longer static.
5151 * eval.c (Ffetch_bytecode): No longer static.
5152 * editfns.c (Fuser_full_name): No longer static.
5153 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5154 No longer static.
5155 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5156 static.
5157 * dired.c (Ffile_attributes): No longer static.
5158 * composite.c (Fcomposition_get_gstring): No longer static.
5159 * callproc.c (Fgetenv_internal): No longer static.
5160
5161 * ccl.h: Remove EXFUNs.
5162 * buffer.h: Remove EXFUNs.
5163 * dispextern.h: Remove EXFUNs.
5164 * intervals.h: Remove EXFUNs.
5165 * fontset.h: Remove EXFUN.
5166 * font.h: Remove EXFUNs.
5167 * dosfns.c (system_process_attributes): Remove EXFUN.
5168 * keymap.h: Remove EXFUNs.
5169 * lisp.h: Remove EXFUNs.
5170 * w32term.h: Remove EXFUNs.
5171 * window.h: Remove EXFUNs.
5172 * xsettings.h: Remove EXFUN.
5173 * xterm.h: Remove EXFUN.
5174
5175 2012-07-03 Glenn Morris <rgm@gnu.org>
5176
5177 * lisp.h (Frandom): Make it visible to C.
5178 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5179 buffer for invisible buffers. (Bug#1229)
5180
5181 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5182
5183 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5184 values which aren't power of 2.
5185 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5186 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5187 accordingly.
5188
5189 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5190
5191 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5192
5193 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5194
5195 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5196
5197 * alloc.c (allocate_vector_block): Remove redundant
5198 calls to mallopt if DOUG_LEA_MALLOC is defined.
5199 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5200 avoid calls to mallopt if zero_vector is returned.
5201
5202 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5203
5204 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5205 is enabled, avoid dereferencing NULL current_sblock if
5206 running undumped.
5207
5208 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5209
5210 Cleanup basic buffer management.
5211 * buffer.h (struct buffer): Change layout to use generic vector
5212 marking code. Fix some comments. Change type of 'clip_changed'
5213 to bitfield. Remove unused #ifndef old.
5214 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5215 (GET_OVERLAYS_AT): Fix indentation.
5216 (for_each_per_buffer_object_at): New macro.
5217 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5218 (Fbuffer_local_variables): Use it.
5219 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5220 * alloc.c (allocate_buffer): Adjust to match new layout of
5221 struct buffer. Fix comment.
5222 (mark_overlay): New function.
5223 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5224 Lisp area of struct buffer.
5225 (mark_object): Use it. Adjust marking of misc objects
5226 and related comments.
5227
5228 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5229
5230 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5231 wrapper that is not needed because the wrapped code is a no-op (zero
5232 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5233 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5234
5235 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5236
5237 * alloc.c (mark_buffer): Simplify. Remove prototype.
5238 (mark_object): Add comment. Reorganize marking of vector-like
5239 objects. Use CHECK_LIVE for all vector-like objects except buffers
5240 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5241 Avoid redundant calls to mark_vectorlike for bool vectors.
5242
5243 2012-06-30 Glenn Morris <rgm@gnu.org>
5244
5245 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5246
5247 * epaths.in (PATH_SITELOADSEARCH): New.
5248 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5249 This is rather than relying on --enable-locallisppath elements
5250 having "site-lisp" in their names. (Bug#10208#25, 11658)
5251
5252 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5253
5254 * w32proc.c (sys_select): Accept and ignore one more argument.
5255
5256 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5257
5258 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5259 (pselect) [!MS_DOS]: Redirect to sys_select.
5260
5261 * sysdep.c: Don't include dos.h and dosfns.h.
5262
5263 * process.c (sys_select):
5264 * msdos.c (sys_select): Accept one more argument and ignore it.
5265
5266 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5267 adapt data types and code to that.
5268
5269 * dosfns.c:
5270 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5271 which clashes with the gnulib function of the same name.
5272
5273 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5274
5275 * font.c (font_style_to_value, font_style_symbolic)
5276 (font_prop_validate_style): Add type checks for values in
5277 font_style_table.
5278
5279 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5280 argument.
5281 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5282 uses.
5283
5284 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5285
5286 * xdisp.c (try_window_id): Undo last change.
5287
5288 * w32.c (getwd): Adjust commentary about startup_dir.
5289 (init_environment): Always call sys_access, even in non-MSVC
5290 builds. Don't chdir to the directory of the Emacs executable.
5291 This undoes code from 1997 which was justified by the need to
5292 "avoid conflicts when removing and renaming directories". But its
5293 downside was that every relative file name was being interpreted
5294 relative to the directory of the Emacs executable, which can never
5295 be TRT. In particular, it broke sys_access when called with
5296 relative file names.
5297 (sys_access): Map GetLastError to errno.
5298
5299 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5300
5301 * window.h (struct window): Change type of 'fringes_outside_margins'
5302 to bitfield. Fix comment. Adjust users accordingly.
5303 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5304 Adjust comment.
5305 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5306 to ptrdiff_t.
5307
5308 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5309
5310 * gnutls.c (emacs_gnutls_handshake):
5311 Add QUIT to make the loop interruptible.
5312
5313 2012-06-29 Glenn Morris <rgm@gnu.org>
5314
5315 * charset.c (init_charset): Make lack of etc/charsets fatal.
5316
5317 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5318
5319 * editfns.c (region_limit): Fix type mismatch.
5320
5321 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5322
5323 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5324 undefined. Convert from xassert to eassert.
5325 * nsmenu.m: Convert from xassert to eassert.
5326 * nsterm.m: Likewise.
5327
5328 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5329
5330 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5331
5332 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5333
5334 Avoid integer overflow on scroll-left and scroll-right.
5335 * window.c (HSCROLL_MAX): New macro.
5336 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5337 overflow when requested scroll falls outside ptrdiff_t range.
5338
5339 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5340
5341 * window.h (struct window): Change type of 'hscroll',
5342 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5343 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5344 Adjust users accordingly.
5345 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5346 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5347 from EMACS_INT to ptrdiff_t.
5348 (make_window): Omit redundant initialization.
5349
5350 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5351
5352 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5353
5354 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5355
5356 * window.h (struct window): Change type of 'use_time' and
5357 'sequence_number' from Lisp_Object to int.
5358 * frame.c (make_frame): Adjust users accordingly.
5359 * print.c (print_object): Likewise.
5360 * window.c (select_window, Fwindow_use_time, make_parent_window)
5361 (make_window): Likewise.
5362
5363 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5364
5365 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5366 enabled with --enable-checking=[all,glyphs] configure option.
5367 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5368 adjust comments accordingly.
5369 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5370 undefined, adjust comments accordingly.
5371 * image.c: Likewise.
5372 * scroll.c: Likewise.
5373 * w32fns.c: Likewise.
5374 * w32term.c: Likewise.
5375 * xdisp.c: Likewise.
5376 * xfaces.c: Likewise.
5377 * xfns.c: Likewise.
5378 * xterm.c: Likewise.
5379
5380 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5381
5382 Generalize run-time debugging checks.
5383 * dispextern.h (XASSERTS): Remove.
5384 * fontset.c (xassert): Remove.
5385 Convert from xassert to eassert.
5386 * alloc.c: Convert from xassert to eassert.
5387 * bidi.c: Likewise.
5388 * dispnew.c: Likewise.
5389 * fns.c: Likewise.
5390 * fringe.c: Likewise.
5391 * ftfont.c: Likewise.
5392 * gtkutil.c: Likewise.
5393 * image.c: Likewise.
5394 * keyboard.c: Likewise.
5395 * menu.c: Likewise.
5396 * process.c: Likewise.
5397 * scroll.c: Likewise.
5398 * sound.c: Likewise.
5399 * term.c: Likewise.
5400 * w32console.c: Likewise.
5401 * w32fns.c: Likewise.
5402 * w32term.c: Likewise.
5403 * window.c: Likewise.
5404 * xdisp.c: Likewise.
5405 * xfaces.c: Likewise.
5406 * xfns.c: Likewise.
5407 * xselect.c: Likewise.
5408 * xterm.c: Likewise.
5409
5410 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5411
5412 * fns.c (maybe_resize_hash_table): Output message when growing the
5413 purify-hashtable.
5414
5415 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5416
5417 * alloc.c (allocate_string_data): Remove dead code.
5418 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5419 avoid GCC warning about unused macro.
5420
5421 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5422
5423 * alloc.c (allocate_string): Omit intervals initialization.
5424 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5425 as in make_pure_string and make_pure_c_string.
5426
5427 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5428
5429 * alloc.c (allocate_string): Fix last change.
5430
5431 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5432
5433 * alloc.c (allocate_string): Remove two redundant calls
5434 to memset, add explicit initialization where appropriate.
5435
5436 2012-06-27 Glenn Morris <rgm@gnu.org>
5437
5438 * lisp.mk (lisp): Remove paths.elc.
5439
5440 2012-06-27 Chong Yidong <cyd@gnu.org>
5441
5442 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5443
5444 2012-06-26 John Wiegley <johnw@newartisans.com>
5445
5446 * unexmacosx.c (copy_data_segment): Add two section names used
5447 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5448
5449 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5450 when building with Clang.
5451
5452 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5453
5454 * eval.c (Fapply): Allow calling it with a single argument.
5455
5456 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5457
5458 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5459 _stricmp and _strnicmp.
5460 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5461
5462 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5463
5464 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5465 allocated window.
5466 (allocate_process): Likewise for new process.
5467 (allocate_terminal): Change to use offsetof.
5468 (allocate_frame): Likewise.
5469 * frame.c (make_frame): Omit redundant initialization.
5470 * window.c (make_parent_window): Use memset.
5471 (make_window): Omit redundant initialization.
5472 * process.c (make_process): Omit redundant initialization.
5473 * terminal.c (create_terminal): Likewise.
5474
5475 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5476
5477 * term.c (delete_tty): Remove redundant call to memset.
5478
5479 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5480
5481 * alloc.c: Remove build_string.
5482 * lisp.h: Define build_string as static inline. This provides
5483 a better opportunity to optimize away calls to strlen when the
5484 function is called with compile-time constant argument.
5485 * image.c (imagemagick_error): Convert to build_string.
5486 * w32proc.c (sys_spawnve): Likewise.
5487 * xterm.c (x_term_init): Likewise.
5488
5489 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5490
5491 Use sprintf return value instead of invoking strlen on result.
5492 In the old days this wasn't portable, since some sprintf
5493 implementations returned char *. But they died out years ago and
5494 Emacs already assumes sprintf returns int.
5495 Similarly for float_to_string.
5496 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5497 * ccl.c (ccl_driver):
5498 * character.c (string_escape_byte8):
5499 * data.c (Fnumber_to_string):
5500 * doprnt.c (doprnt):
5501 * print.c (print_object):
5502 * xdisp.c (message_dolog):
5503 * xfns.c (syms_of_xfns):
5504 Use sprintf or float_to_string result to avoid need to call strlen.
5505 * data.c (Fnumber_to_string):
5506 Use make_unibyte_string, since the string must be ASCII.
5507 * lisp.h, print.c (float_to_string): Now returns int length.
5508 * term.c (produce_glyphless_glyph):
5509 Use sprintf result rather than recomputing it.
5510
5511 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5512 * Makefile.in (ALL_CFLAGS):
5513 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5514 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5515
5516 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5517
5518 * dispextern.h (xstrcasecmp): Define to library function
5519 strcasecmp if available.
5520 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5521
5522 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5523
5524 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5525 Avoid comma operator.
5526 * menu.c (push_submenu_start, push_submenu_end)
5527 (push_left_right_boundary, push_menu_pane): Likewise.
5528 * msdos.c (dos_rawgetc): Likewise.
5529
5530 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5531
5532 * xfns.c (xic_create_fontsetname): Remove redundant calls
5533 to memset.
5534
5535 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5536
5537 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5538 sprintf already null-terminates its output.
5539
5540 * xfns.c (x_window): Remove redundant cast.
5541
5542 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5543
5544 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5545 `const char *' to `char *' to avoid compiler warning.
5546
5547 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5548
5549 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5550 instead of truncating it to 63 (admittedly a generous limit).
5551
5552 * process.c: Fix spelling and caps in comments.
5553
5554 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5555
5556 * emacs.c (setpgrp): Remove definition, unused.
5557 * sysdep.c (setpgrp): Remove definition, not used in this file.
5558
5559 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5560
5561 * makefile.w32-in: Update dependencies.
5562
5563 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5564
5565 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5566 (SYSTIME_H): Add nt/inc/sys/time.h.
5567
5568 * systime.h [WINDOWSNT]: Include sys/time.h.
5569
5570 * s/ms-w32.h (struct timespec): Definition moved from
5571 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5572
5573 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5574
5575 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5576 * buffer.h (buffer_slot_type_mismatch):
5577 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5578 * eval.c (unwind_to_catch):
5579 * image.c (my_png_error, my_error_exit):
5580 * keyboard.c (quit_throw_to_read_char, user_error)
5581 (Fexit_recursive_edit, Fabort_recursive_edit):
5582 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5583 (wrong_type_argument, buffer_overflow, __executable_start)
5584 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5585 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5586 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5587 (fatal):
5588 (child_setup) [!DOS_NT]:
5589 * lread.c (end_of_file_error, invalid_syntax):
5590 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5591 * puresize.h (pure_write_error):
5592 * search.c (matcher_overflow):
5593 * sound.c (sound_perror, alsa_sound_perror):
5594 * sysdep.c, syssignal.h (croak):
5595 * term.c (maybe_fatal, vfatal):
5596 * textprop.c (text_read_only):
5597 * undo.c (user_error):
5598 * unexmacosx.c (unexec_error):
5599 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5600 Use _Noreturn rather than NO_RETURN.
5601 No need for separate decl merely because of _Noreturn.
5602 * sound.c (sound_warning, parse_sound):
5603 Remove unnecessary forward decls.
5604
5605 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5606
5607 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5608 * lisp.h (WAIT_READING_MAX): New macro.
5609 * dispnew.c (Fsleep_for, sit_for):
5610 * keyboard.c (kbd_buffer_get_event):
5611 * process.c (Faccept_process_output):
5612 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5613 This improves on the previous patch, which introduced a bug
5614 when time_t is unsigned and as wide as intmax_t.
5615 See <http://bugs.gnu.org/9000#51>.
5616
5617 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5618
5619 * dispnew.c (sit_for, Fsleep_for):
5620 * keyboard.c (kbd_buffer_get_event):
5621 * process.c (Faccept_process_output): Avoid compiler warnings when
5622 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5623
5624 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5625
5626 * makefile.w32-in: Update dependencies.
5627
5628 * w32.c (ltime): Add return type and declare static.
5629 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5630
5631 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5632
5633 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5634 Privately reported by Herbert J. Skuhra.
5635 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5636 All uses changed.
5637 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5638 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5639
5640 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5641
5642 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5643 last argument of make_unibyte_string.
5644
5645 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5646 language ID in the event parameters.
5647
5648 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5649 event.code, not the obscure "character set ID".
5650
5651 2012-06-23 Chong Yidong <cyd@gnu.org>
5652
5653 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5654
5655 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5656
5657 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5658 * w32.c (fdutimens): New function.
5659
5660 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5661
5662 * s/ms-w32.h (pselect): Redirect to sys_select.
5663
5664 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5665
5666 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5667 in the logic of incrementing and decrementing the value of
5668 use_relocatable_buffers.
5669
5670 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5671
5672 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5673 Privately reported by Herbert J. Skuhra.
5674 [__FreeBSD__]: Remove "*/" typo after "#include".
5675 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5676 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5677 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5678 Don't assume EMACS_TIME and struct timeval are the same type.
5679
5680 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5681
5682 Support higher-resolution time stamps (Bug#9000).
5683 The time stamps are only nanosecond-resolution at the C level,
5684 since that's the best that any real-world system supports now.
5685 But they are picosecond-resolution at the Lisp level, as that's
5686 easy, and leaves room for future OS improvements.
5687
5688 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5689 (LIBES): Use it.
5690
5691 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5692 Don't get current time unless it's needed.
5693
5694 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5695 now provides it if it's absent.
5696 (start_atimer): Port to higher-res time stamps.
5697 Check for time stamp overflow. Don't get current time more
5698 often than is needed.
5699
5700 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5701 Include systime.h, not time.h.
5702 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5703
5704 * dired.c: Include stat-time.h.
5705 (Ffile-attributes): File times now have higher resolution.
5706
5707 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5708 (struct image): Timestamp now has higher resolution.
5709
5710 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5711 has at least microseconds now. All uses removed.
5712 (update_frame, update_single_window, update_window, update_frame_1)
5713 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5714 (duration_to_sec_usec): Remove; no longer needed.
5715
5716 * editfns.c (time_overflow): Now extern.
5717 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5718 (float-time, Fformat_time_string, Fcurrent_time_string)
5719 (Fcurrent_time_zone): Accept and generate higher-resolution
5720 time stamps.
5721 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5722 (decode_time_components, lisp_seconds_argument): New functions.
5723 (make_time): Now static.
5724 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5725 Report an error if the time is invalid, rather than having the caller
5726 do that.
5727
5728 * fileio.c: Include <stat-time.h>
5729 (Fcopy_file): Copy higher-resolution time stamps.
5730 Prefer to set the time stamp via a file descriptor if that works.
5731 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5732 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5733 (Fvisited_file_modtime, Fset_visited_file_modtime):
5734 Support higher-resolution time stamps.
5735
5736 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5737
5738 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5739
5740 * image.c (prepare_image_for_display, clear_image_cache)
5741 (lookup_image): Port to higer-resolution time stamps.
5742
5743 * keyboard.c (start_polling, bind_polling_period):
5744 Check for time stamp overflow.
5745 (read_char, kbd_buffer_get_event, timer_start_idle)
5746 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5747 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5748 Port to higher-resolution time stamps. Do not assume time_t is signed.
5749 (decode_timer): New function. Timers are now vectors of length 9,
5750 not 8, to accommodate the picosecond component.
5751 (timer_check_2): Use it.
5752
5753 * nsterm.m (select_timeout, timeval_subtract): Remove.
5754 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5755 as they're a bit more accurate and handle overflow better.
5756 (ns_select): Change prototype to be compatible with pselect.
5757 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5758 * nsterm.h (ns_select): Adjust prototype.
5759
5760 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5761 us-resolution time stamps.
5762 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5763
5764 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5765
5766 * lisp.h (time_overflow): New decl.
5767 (wait_reading_process_output): First arg is now intmax_t, not int,
5768 to accommodate larger waits.
5769
5770 * process.h (struct Lisp_Process.read_output_delay):
5771 Now counts nanoseconds, not microseconds.
5772 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5773 EMACS_HAS_USECS.
5774 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5775 (wait_reading_process_output):
5776 Port to ns-resolution time stamps.
5777 (Faccept_process_output, wait_reading_process_output):
5778 Check for time stamp overflow. Do not assume time_t is signed.
5779 (select_wrapper): Remove; we now use pselect.
5780 (Fprocess_attributes): Now generates ns-resolution time stamps.
5781
5782 * sysdep.c: Include utimens.h. Don't include utime.h
5783 or worry about struct utimbuf; gnulib does that for us now.
5784 (gettimeofday): Remove; gnulib provides a substitute.
5785 (make_timeval): New function.
5786 (set_file_times): Now sets ns-resolution time stamps.
5787 New arg FD; all uses changed.
5788 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5789 (system_process_attributes):
5790 Now returns ns-resolution time stamp. All uses changed.
5791 Check for time stamp overflow.
5792
5793 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5794 provides a substitute now.
5795
5796 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5797 since it guarantees struct timespec.
5798 (EMACS_TIME): Now struct timespec, so that we can support
5799 ns-resolution time stamps.
5800 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5801 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5802 (EMACS_USECS): Remove.
5803 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5804 so multiply the arg by 1000 before storing it.
5805 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5806 New macros.
5807 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5808 Port to ns-resolution time stamps.
5809 (EMACS_TIME_NEG_P): Remove; replaced by....
5810 (EMACS_TIME_SIGN): New macro.
5811 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5812 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5813 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5814 (make_timeval, make_lisp_time, decode_time_components): New decls.
5815 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5816 that it mishandled time_t overflow. You can't compare by subtracting!
5817 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5818 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5819
5820 * term.c: Include <sys/time.h>.
5821 (timeval_to_Time): New function, for proper overflow wraparound.
5822 (term_mouse_position, term_mouse_click): Use it.
5823
5824 * undo.c (record_first_change): Support higher-resolution time stamps
5825 in the undo buffer.
5826 (Fprimitive_undo): Use them when restoring time stamps.
5827
5828 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5829 (w32_get_internal_run_time):
5830 Port to higher-resolution Emacs time stamps.
5831 (ltime): Now accepts single 64-bit integer, as that's more convenient
5832 for callers.
5833
5834 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5835
5836 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5837 for compatibility with pselect. Support ns-resolution time stamps.
5838
5839 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5840
5841 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5842 Check for time stamp overflow, and support ns-resolution time stamps.
5843
5844 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5845 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5846 (timeval_subtract): Remove; no longer needed.
5847 (XTflash, XTring_bell, x_wait_for_event):
5848 Port to ns-resolution time stamps. Don't assume time_t is signed.
5849
5850 2012-06-22 Chong Yidong <cyd@gnu.org>
5851
5852 * xdisp.c (x_consider_frame_title): Revert last change.
5853
5854 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5855
5856 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5857 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5858 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5859 staticidx goes up to 1597 out of 1600 = 0x640.)
5860
5861 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5862
5863 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5864 Otherwise, the umask might be mistakenly 0 while handling input signals.
5865
5866 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5867
5868 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5869
5870 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5871
5872 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5873 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5874 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5875 access to `contents' member of Lisp_Vector objects with AREF and ASET
5876 where appropriate.
5877
5878 2012-06-19 Chong Yidong <cyd@gnu.org>
5879
5880 * frame.c (delete_frame): When selecting a frame on a different
5881 text terminal, do not alter the terminal's top-frame.
5882
5883 * xdisp.c (format_mode_line_unwind_data): Record the target
5884 frame's selected window and its terminal's top-frame.
5885 (unwind_format_mode_line): Restore them.
5886 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5887 Callers changed.
5888 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5889 since tty frames can be explicitly named.
5890 (prepare_menu_bars): Likewise.
5891
5892 * term.c (Ftty_top_frame): New function.
5893
5894 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5895
5896 Port byte-code-meter to modern targets.
5897 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5898 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5899 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5900 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5901 (METER_1, METER_2): Simplify.
5902
5903 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5904
5905 * data.c (Fdefalias): Return `symbol' (bug#11686).
5906
5907 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5908
5909 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5910 gets killed during executing of this function (Bug#11665).
5911 Try to always return Qt when the buffer has been actually killed.
5912 (Vkill_buffer_query_functions): In doc-string say that functions
5913 run by this hook should not change the current buffer.
5914
5915 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5916
5917 Fix recently-introduced process.c problems found by static checking.
5918 * process.c (write_queue_push, write_queue_pop, send_process):
5919 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5920 (write_queue_pop): Fix pointer signedness problem.
5921 (send_process): Remove unused local.
5922
5923 2012-06-17 Chong Yidong <cyd@gnu.org>
5924
5925 * xdisp.c (redisplay_internal): No need to redisplay terminal
5926 frames that are not on top.
5927
5928 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5929
5930 * process.c (make_process): Initialize write_queue.
5931 (write_queue_push, write_queue_pop): New functions.
5932 (send_process): Use them to maintain correct ordering of process
5933 writes (Bug#10815).
5934
5935 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5936
5937 * lisp.h (eassert): Assume C89 or later.
5938 This removes the need for CHECK.
5939 (CHECK): Remove. Its comments about always evaluating its
5940 argument were confusing, as 'eassert' typically does not evaluate
5941 its argument.
5942
5943 * coding.c (produce_chars): Use ptrdiff_t, not int.
5944
5945 * xterm.c (x_draw_underwave): Check for integer overflow.
5946 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5947
5948 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5949
5950 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5951 referenced (Bug#11583).
5952
5953 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5954
5955 Implement wave-style variant of underlining.
5956 * dispextern.h (face_underline_type): New enum.
5957 (face): Add field for underline type.
5958 * nsterm.m (ns_draw_underwave): New function.
5959 (ns_draw_text_decoration): Use it.
5960 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5961 New functions.
5962 (x_draw_glyph_string): Use them.
5963 * xfaces.c (Qline, Qwave): New Lisp objects.
5964 (check_lface_attrs, merge_face_ref)
5965 (Finternal_set_lisp_face_attribute, realize_x_face):
5966 Handle wave-style underline face attributes.
5967 * xterm.c (x_draw_underwave): New function.
5968 (x_draw_glyph_string): Use it.
5969
5970 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5971
5972 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5973 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5974 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5975 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5976 ($(BLD)/w32select.$(O)): Update dependencies.
5977
5978 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5979
5980 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5981 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5982 * character.c (_fetch_multibyte_char_p): Remove.
5983 * alloc.c: Include "character.h" before "buffer.h".
5984 * bidi.c: Likewise.
5985 * buffer.c: Likewise.
5986 * bytecode.c: Likewise.
5987 * callint.c: Likewise.
5988 * callproc.c: Likewise.
5989 * casefiddle.c: Likewise.
5990 * casetab.c: Likewise.
5991 * category.c: Likewise.
5992 * cmds.c: Likewise.
5993 * coding.c: Likewise.
5994 * composite.c: Likewise.
5995 * dired.c: Likewise.
5996 * dispnew.c: Likewise.
5997 * doc.c: Likewise.
5998 * dosfns.c: Likewise.
5999 * editfns.c: Likewise.
6000 * emacs.c: Likewise.
6001 * fileio.c: Likewise.
6002 * filelock.c: Likewise.
6003 * font.c: Likewise.
6004 * fontset.c: Likewise.
6005 * fringe.c: Likewise.
6006 * indent.c: Likewise.
6007 * insdel.c: Likewise.
6008 * intervals.c: Likewise.
6009 * keyboard.c: Likewise.
6010 * keymap.c: Likewise.
6011 * lread.c: Likewise.
6012 * macros.c: Likewise.
6013 * marker.c: Likewise.
6014 * minibuf.c: Likewise.
6015 * nsfns.m: Likewise.
6016 * nsmenu.m: Likewise.
6017 * print.c: Likewise.
6018 * process.c: Likewise.
6019 * regex.c: Likewise.
6020 * region-cache.c: Likewise.
6021 * search.c: Likewise.
6022 * syntax.c: Likewise.
6023 * term.c: Likewise.
6024 * textprop.c: Likewise.
6025 * undo.c: Likewise.
6026 * unexsol.c: Likewise.
6027 * w16select.c: Likewise.
6028 * w32fns.c: Likewise.
6029 * w32menu.c: Likewise.
6030 * window.c: Likewise.
6031 * xdisp.c: Likewise.
6032 * xfns.c: Likewise.
6033 * xmenu.c: Likewise.
6034 * xml.c: Likewise.
6035 * xselect.c: Likewise.
6036
6037 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6038
6039 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6040 If all the glyphs of the glyph row came from strings, and we have no
6041 cursor positioning clues, put the cursor on the first glyph of the
6042 row.
6043 (handle_face_prop): Use chunk-relative overlay string index when
6044 indexing into it->string_overlays array. (Bug#11653)
6045 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6046 the rightmost. (Bug#11720)
6047
6048 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6049
6050 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6051 (CATEGORY_MEMBER): Enforce 1/0 value.
6052 * category.c (_temp_category_set): Remove.
6053
6054 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6055
6056 * window.c (Fdelete_other_windows_internal)
6057 (Fdelete_window_internal): Don't access frame's mouse highlight
6058 info of the initial frame. (Bug#11677)
6059
6060 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6061
6062 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6063 Assume USE_2_TAGS_FOR_INTS.
6064 (xreload): Adjust $tagmask width to match recent lisp.h change.
6065
6066 Simplify lisp.h in minor ways that should not affect code.
6067 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6068 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6069 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6070 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6071 (INTTYPEBITS): New macro, for clarity.
6072 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6073 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6074 Simplify now that USE_LSB_TAG is always defined.
6075 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6076 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6077
6078 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6079
6080 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6081
6082 2012-06-13 Glenn Morris <rgm@gnu.org>
6083
6084 * s/bsd-common.h (BSD4_3):
6085 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6086
6087 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6088
6089 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6090 instead of union.
6091 (XLI, XIL): Define.
6092 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6093 Use them.
6094 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6095 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6096 * alloc.c (widen_to_Lisp_Object): Remove.
6097 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6098 * frame.c (delete_frame): Remove outdated comment.
6099 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6100 USE_LISP_UNION_TYPE.
6101 (Fw32_unregister_hot_key): Likewise.
6102 (Fw32_toggle_lock_key): Likewise.
6103 * w32menu.c (add_menu_item): Likewise.
6104 (w32_menu_display_help): Use XIL instead of checking
6105 USE_LISP_UNION_TYPE.
6106 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6107 (init_heap): Likewise.
6108 * w32term.c (w32_read_socket): Update comment.
6109
6110 2012-06-13 Glenn Morris <rgm@gnu.org>
6111
6112 * s/usg5-4-common.h, src/s/unixware.h:
6113 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6114
6115 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6116
6117 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6118
6119 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6120 * alloc.c (make_number) [!defined make_number]:
6121 Remove, as lisp.h always defines this now.
6122 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6123 (roundup_size): Verify that it is a power of 2.
6124 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6125 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6126 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6127 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6128 USE_LSB_TAG now is always defined to be either 0 or 1.
6129 All uses changed.
6130 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6131 code works fine either way, and efficiency is not a concern here,
6132 as the union type is for debugging, not for production.
6133 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6134 Use an inline function on all platforms when using the union type,
6135 since this is simpler and 'static inline' can be used portably
6136 within Emacs now.
6137 (LISP_INITIALLY_ZERO): New macro.
6138 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6139 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6140
6141 2012-06-12 Glenn Morris <rgm@gnu.org>
6142
6143 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6144
6145 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6146
6147 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6148 Move BROKEN_SIGIO to configure.
6149
6150 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6151 Move NO_TERMIO to configure.
6152
6153 2012-06-12 Chong Yidong <cyd@gnu.org>
6154
6155 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6156 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6157 MagickExportImagePixels is undefined.
6158
6159 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6160
6161 * image.c (imagemagick_load_image): Remove unused label.
6162
6163 2012-06-11 Glenn Morris <rgm@gnu.org>
6164
6165 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6166 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6167 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6168 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6169
6170 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6171
6172 * alloc.c (make_byte_code): New function.
6173 (Fmake_byte_code): Use it. Don't purify here.
6174 * lread.c (read1): Use it as well to avoid extra allocation.
6175
6176 2012-06-11 Chong Yidong <cyd@gnu.org>
6177
6178 * image.c (imagemagick_load_image): Implement transparency.
6179
6180 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6181
6182 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6183 account for preceding backslashes. (Bug#11663)
6184
6185 2012-06-09 Chong Yidong <cyd@gnu.org>
6186
6187 * term.c: Support italics in capable terminals (Bug#9652).
6188 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6189 (turn_on_face): Output using TS_enter_italic_mode if available.
6190 Don't handle unused blinking and alt-charset cases.
6191 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6192 and tty_alt_charset_p cases.
6193 (tty_capable_p, init_tty): Support italics.
6194
6195 * termchar.h (struct tty_display_info): Add field for italics.
6196 Remove unused blink field.
6197
6198 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6199 Handle slant.
6200
6201 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6202 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6203 tty_alt_charset_p. Add tty_italic_p.
6204
6205 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6206
6207 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6208 dbus_type_is_basic if available.
6209 (xd_extract_signed, xd_extract_unsigned): Rename from
6210 extract_signed and extract_unsigned, respectively. Adapt callers.
6211
6212 2012-06-09 Chong Yidong <cyd@gnu.org>
6213
6214 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6215
6216 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6217 case (Bug#9752).
6218
6219 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6220
6221 * xdisp.c (vmessage): Treat frame message as multibyte.
6222 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6223 would generate the diagnostic "Making \302\247 buffer-local while
6224 let-bound!".
6225
6226 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6227
6228 * dispnew.c (showing_window_margins_p): Undo last change, which
6229 was done due to an inadvertent commit.
6230 (adjust_frame_glyphs_for_frame_redisplay): Do call
6231 showing_window_margins_p.
6232
6233 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6234
6235 * eval.c (Fmake_var_non_special): New primitive.
6236 (syms_of_eval): Defsubr it.
6237 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6238
6239 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6240
6241 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6242 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6243
6244 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6245
6246 * alloc.c (allocate_vectorlike): Fix last change.
6247
6248 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6249
6250 Block-based vector allocation of small vectors.
6251 * lisp.h (struct vectorlike_header): New field `nbytes',
6252 adjust comment accordingly.
6253 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6254 to denote vector blocks. Adjust users (live_vector_p,
6255 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6256 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6257 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6258 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6259 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6260 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6261 (roundup_size): New constant.
6262 (struct vector_block): New data type.
6263 (vector_blocks, vector_free_lists, zero_vector): New variables.
6264 (all_vectors): Rename to `large_vectors'.
6265 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6266 (sweep_vectors): New functions.
6267 (allocate_vectorlike): Return `zero_vector' as the only vector of
6268 0 items. Allocate new vector from block if vector size is less than
6269 or equal to VBLOCK_BYTES_MAX.
6270 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6271 (init_alloc_once): Add call to init_vectors.
6272
6273 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6274
6275 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6276
6277 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6278
6279 * doprnt.c (doprnt): Truncate multibyte char correctly.
6280 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6281 would mishandle a string argument "Xc" if X was a multibyte
6282 character of length 2: it would truncate after X's first byte
6283 rather than including all of X.
6284
6285 2012-06-06 Chong Yidong <cyd@gnu.org>
6286
6287 * buffer.c (word_wrap): Doc fix.
6288
6289 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6290
6291 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6292
6293 2012-06-03 Glenn Morris <rgm@gnu.org>
6294
6295 * xdisp.c (tool-bar-style): Doc fix.
6296
6297 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6298
6299 * Makefile.in (PAXCTL): Define.
6300 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6301 binary via PaX flags if the paxctl utility is available.
6302 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6303 Restore PaX flags to their default. (Bug#11398)
6304
6305 2012-06-03 Chong Yidong <cyd@gnu.org>
6306
6307 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6308 buffer (Bug#11226).
6309
6310 2012-06-03 Chong Yidong <cyd@gnu.org>
6311
6312 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6313 (note_mode_line_or_margin_highlight): If there is no help echo,
6314 use mode-line-default-help-echo. Handle the case where the mouse
6315 position is past the end of the mode line string.
6316
6317 * buffer.c (buffer_local_value_1): New function, split from
6318 Fbuffer_local_value; can return Qunbound.
6319 (Fbuffer_local_value): Use it.
6320 (Vmode_line_format): Docstring tweaks.
6321
6322 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6323
6324 * sysdep.c (system_process_attributes): Improve comment.
6325
6326 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6327
6328 * keyboard.c: Export real-this-command to Elisp.
6329 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6330 and DEFVAR it. Update all users.
6331
6332 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6333
6334 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6335
6336 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6337 Convert pctcpu and pctmem to Lisp float properly.
6338 Let the compiler fold better, as 100.0/0x8000 is exact.
6339
6340 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6341
6342 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6343 cons_block.
6344
6345 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6346
6347 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6348
6349 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6350
6351 For a 'struct window', replace some Lisp_Object fields to
6352 bitfields where appropriate, remove unused fields.
6353 * window.h (struct window): Remove unused 'last_mark_x' and
6354 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6355 change it's type from Lisp_Object to bitfield.
6356 Change type of 'force_start', 'optional_new_start',
6357 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6358 fields from Lisp_Object to bitfield. Adjust users accordingly.
6359
6360 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6361
6362 Pacify gcc -Wdouble-precision when using Xaw.
6363 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6364 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6365 Use 'float' consistently, rather than 'float' in most places
6366 and 'double' in a couple of places.
6367
6368 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6369
6370 * xdisp.c (handle_stop): Detect whether we have overlay strings
6371 loaded by testing it->current.overlay_string_index to be
6372 non-negative, instead of checking whether n_overlay_strings is
6373 positive. (Bug#11587)
6374
6375 2012-05-31 Chong Yidong <cyd@gnu.org>
6376
6377 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6378
6379 * doc.c (Fsubstitute_command_keys): Doc fix.
6380
6381 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6382
6383 * search.c (search_buffer): Remove calls to
6384 r_alloc_inhibit_buffer_relocation, as it is now called by
6385 maybe_unify_char, which was the cause of relocation of buffer text
6386 in bug#11519.
6387
6388 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6389
6390 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6391 for the duration of call to load_charset, to avoid problems with
6392 callers of maybe_unify_char that access buffer text through C
6393 pointers.
6394
6395 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6396 decrement the inhibition flag, instead of just setting or
6397 resetting it.
6398
6399 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6400
6401 Remove obsolete '#define static' cruft.
6402 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6403 This #undef was "temporary" in 2000; it is no longer needed
6404 now that '#define static' has gone away.
6405 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6406 (gray_bitmap_bits): Remove; no longer needed.
6407 All uses replaced with definiens.
6408 * xterm.c: Include "bitmaps/gray.xbm".
6409
6410 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6411
6412 Clean up __executable_start, monstartup when --enable-profiling.
6413 The following changes affect the code only when profiling.
6414 * dispnew.c (__executable_start): Rename from safe_bcopy.
6415 Define only on platforms that need it.
6416 * emacs.c: Include <sys/gmon.h> when profiling.
6417 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6418 (__executable_start): Remove decl, since lisp.h does it now.
6419 (safe_bcopy): Remove decl; no longer has that name.
6420 (main): Coalesce #if into single bit of code, for simplicity.
6421 Cast pointers to uintptr_t, since standard libraries want integers
6422 and not pointers.
6423 * lisp.h (__executable_start): New decl.
6424
6425 2012-05-31 Glenn Morris <rgm@gnu.org>
6426
6427 * image.c (Fimagemagick_types): Doc fix.
6428
6429 2012-05-30 Jim Meyering <meyering@redhat.com>
6430
6431 * callproc.c (Fcall_process_region): Include directory component
6432 in mkstemp error message (Bug#11586).
6433
6434 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6435
6436 * alloc.c, lisp.h (make_pure_vector): Now static.
6437
6438 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6439
6440 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6441 Move to byte-run.el.
6442 (Fautoload): Do the hash-doc more carefully.
6443 * data.c (Fdefalias): Purify definition, except for keymaps.
6444 (Qdefun): Move from eval.c.
6445 * lisp.h (Qdefun): Remove.
6446 * lread.c (read1): Tiny simplification.
6447
6448 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6449
6450 Do not create empty overlays with the evaporate property (Bug#9642).
6451 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6452 Bug#9642, but explicitly check that the buffer the overlay would
6453 be moved to is live and rearrange lines to make sure that errors
6454 will not put the overlay in an inconsistent state.
6455 (Fdelete_overlay): Cosmetics.
6456
6457 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6458
6459 * w32term.c (my_bring_window_to_top): New function.
6460 (x_raise_frame): Use handle returned by DeferWindowPos, which
6461 could be different from the original one.
6462 Call my_bring_window_to_top instead of my_set_foreground_window.
6463 (Bug#11513)
6464
6465 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6466 by calling BringWindowToTop.
6467
6468 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6469 (WM_EMACS_END): Increase by one.
6470
6471 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6472
6473 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6474 This avoids undefined behavior that might cause the eassert
6475 to not catch an out-of-range value.
6476
6477 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6478
6479 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6480 Update dependencies.
6481
6482 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6483
6484 * bidi.c (bidi_mirror_char): Fix last change.
6485
6486 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6487
6488 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6489 when referring to sectname field in printf format.
6490
6491 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6492
6493 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6494 Only r_alloc_inhibit_buffer_relocation needed to be added;
6495 the others were already declared.
6496
6497 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6498 before checking whether it's out of range. Put the check inside
6499 eassert. See
6500 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6501
6502 2012-05-27 Ken Brown <kbrown@cornell.edu>
6503
6504 * callproc.c (Fcall_process): Restore a line that was accidentally
6505 commented out in the 2011-02-13 change (bug#11547).
6506
6507 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6508
6509 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6510 defined on ralloc.c.
6511
6512 * buffer.c [REL_ALLOC]: Remove prototypes of
6513 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6514 they are now on lisp.h.
6515
6516 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6517
6518 * search.c (search_buffer): Use it to inhibit relocation of buffer
6519 text while re_search_2 is doing its job, because re_search_2 is
6520 passed C pointers to buffer text. (Bug#11519)
6521
6522 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6523 Update value to 24.
6524
6525 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6526 state after an additional call to move_it_in_display_line_to, keep
6527 the values of it->max_ascent and it->max_descent found for the
6528 entire line.
6529 (pos_visible_p): Revert the comparison against bottom_y to what it
6530 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6531 (Bug#11464)
6532
6533 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6534
6535 Fix coding-related core dumps with gcc -ftrapv.
6536 The code was computing A - B, where A and B are pointers, and B is
6537 random garbage. This can lead to core dumps on platforms that
6538 have special pointer registers, and it also leads to core dumps on
6539 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6540 A - B only when B is initialized properly.
6541 * coding.c (coding_set_source, coding_set_destination): Return void.
6542 (coding_change_source, coding_change_destinations): New functions,
6543 with the old behaviors of coding_set_source and coding_set_destination.
6544 All callers that need an offset changed to use these new functions.
6545
6546 2012-05-26 Glenn Morris <rgm@gnu.org>
6547
6548 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6549
6550 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6551
6552 Extend mouse support on W32 text-mode console.
6553 * xdisp.c (draw_row_with_mouse_face):
6554 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6555
6556 * w32console.c: Include window.h.
6557 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6558 New functions.
6559 (initialize_w32_display): Initialize mouse-highlight data.
6560
6561 * w32inevt.c: Include termchar.h and window.h.
6562 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6563 moves, call note_mouse_highlight. If help_echo changed, call
6564 gen_help_event to produce help-echo message in the echo area.
6565 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6566 highlight info.
6567
6568 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6569
6570 * lread.c (read1): Simplify slightly to avoid an overflow warning
6571 with GCC 4.7.0 on x86-64.
6572
6573 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6574
6575 * bidi.c (bidi_mirror_char): Revert last change: an int is
6576 definitely wide enough here.
6577
6578 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6579
6580 Fix integer width and related bugs (Bug#9874).
6581 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6582 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6583 (string_bytes, check_sblock, allocate_string_data):
6584 (compact_small_strings, Fmake_bool_vector, make_string)
6585 (make_unibyte_string, make_multibyte_string)
6586 (make_string_from_bytes, make_specified_string)
6587 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6588 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6589 (mark_vectorlike):
6590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6591 (allocate_pseudovector):
6592 Use int, not EMACS_INT, where int is wide enough.
6593 (inhibit_garbage_collection, Fgarbage_collect):
6594 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6595 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6596 int might not be wide enough.
6597 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6598 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6599 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6600 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6601 (bidi_level_of_next_char, bidi_move_to_visually_next):
6602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6603 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6604 (Fkill_buffer, Fset_buffer_major_mode)
6605 (advance_to_char_boundary, Fbuffer_swap_text)
6606 (Fset_buffer_multibyte, overlays_at, overlays_in)
6607 (overlay_touches_p, struct sortvec, record_overlay_string)
6608 (overlay_strings, recenter_overlay_lists)
6609 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6610 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6611 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6612 (Foverlay_recenter, last_overlay_modification_hooks_used)
6613 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6615 (validate_region): Omit unnecessary test for b <= e,
6616 since that's guaranteed by the previous test.
6617 (adjust_overlays_for_delete): Avoid pos + length overflow.
6618 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6619 (report_overlay_modification):
6620 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6621 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6622 Omit pointer cast, which isn't needed anyway, and doesn't work
6623 after the EMACS_INT -> ptrdiff_t change.
6624 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6625 * buffer.h: Adjust decls to match defn changes elsewhere.
6626 (struct buffer_text, struct buffer):
6627 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6628 Use EMACS_INT, not int, where int might not be wide enough.
6629 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6630 not int, to avoid needless 32-bit limit on 64-bit hosts.
6631 (exec_byte_code): Use tighter memory-full test, one that checks
6632 for alloca overflow. Don't compute the address of the object just
6633 before an array, as that's not portable. Use EMACS_INT, not
6634 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6635 * callint.c (Fcall_interactively):
6636 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6637 * callproc.c (call_process_kill, Fcall_process):
6638 Don't assume pid_t fits into an Emacs fixnum.
6639 (call_process_cleanup, Fcall_process, child_setup):
6640 Don't assume pid_t fits into int.
6641 (call_process_cleanup, Fcall_process, delete_temp_file)
6642 (Fcall_process_region):
6643 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6644 (Fcall_process): Simplify handling of volatile integers.
6645 Use int, not EMACS_INT, where int will do.
6646 * casefiddle.c (casify_object, casify_region, operate_on_word)
6647 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6648 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6649 (casify_object): Avoid integer overflow when overallocating buffer.
6650 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6651 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6652 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6653 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6654 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6655 integers are now checked earlier. All uses replaced with XINT.
6656 (ccl_driver):
6657 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6658 For CCL_MapSingle, check that content and value are in int range.
6659 (ccl_driver, Fregister_code_conversion_map):
6660 Check that Vcode_version_map_vector is a vector.
6661 (resolve_symbol_ccl_program): Check that vector header is in range.
6662 Always copy the vector, so that we can check its contents reliably
6663 now rather than having to recheck each instruction as it's being
6664 executed. Check that vector words fit in 'int'.
6665 (ccl_get_compiled_code, Fregister_ccl_program)
6666 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6667 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6668 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6669 contents are in range.
6670 (Fccl_execute_on_string): Check that status is in range.
6671 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6672 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6673 Accept and return EMACS_INT, not int, because callers can pass values
6674 out of 'int' range.
6675 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6676 (multibyte_chars_in_text, parse_str_as_multibyte)
6677 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6678 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6679 (string_escape_byte8, Fget_byte):
6680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6681 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6682 avoid mishandling large integers.
6683 * character.h: Adjust decls to match defn changes elsewhere.
6684 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6685 (Ffind_charset_region):
6686 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6687 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6688 (load_charset_map_from_vector, Fdefine_charset_internal):
6689 Don't assume fixnum fits in int.
6690 (load_charset_map_from_vector, Fmap_charset_chars):
6691 Remove now-unnecessary CHECK_NATNUMs.
6692 (Fdefine_charset_internal): Check ranges here, more carefully.
6693 Don't rely on undefined behavior with signed left shift overflow.
6694 Don't assume unsigned int fits into fixnum, or that fixnum fits
6695 into unsigned int. Don't require max_code to be a valid fixnum;
6696 that's not true for gb10830 4-byte on a 32-bit host. Allow
6697 invalid_code to be a cons, for the same reason. Require code_offset
6698 to be a character. Avoid int overflow if max_char is close
6699 to INT_MAX.
6700 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6701 this is intended anyway and avoids some undefined behavior.
6702 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6703 INDEX_TO_CODE_POINT, as that's what it expects.
6704 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6705 * charset.h (DECODE_CHAR): Return int, not unsigned;
6706 this is what was intended anyway, and it avoids undefined behavior.
6707 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6708 integer-overflow issues.
6709 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6710 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6711 where the argument is EMACS_INT, and this behavior is not intended.
6712 * chartab.c (Fmake_char_table, Fset_char_table_range)
6713 (uniprop_get_decoder, uniprop_get_encoder):
6714 Don't assume fixnum fits in int.
6715 * cmds.c (move_point): New function, that does the gist of
6716 Fforward_char and Fbackward_char, but does so while checking
6717 for integer overflow more accurately.
6718 (Fforward_char, Fbackward_char): Use it.
6719 (Fforward_line, Fend_of_line, internal_self_insert)
6720 (internal_self_insert):
6721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6722 Fix a FIXME, by checking for integer overflow when calculating
6723 target_clm and actual_clm.
6724 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6725 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6726 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6727 (coding_alloc_by_making_gap, alloc_destination)
6728 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6729 (encode_coding_utf_16, detect_coding_emacs_mule)
6730 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6731 (detect_coding_iso_2022, decode_coding_iso_2022)
6732 (encode_invocation_designation, encode_designation_at_bol)
6733 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6734 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6735 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6736 (encode_coding_ccl, encode_coding_raw_text)
6737 (detect_coding_charset, decode_coding_charset)
6738 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6739 (produce_composition, produce_charset, produce_annotation)
6740 (decode_coding, handle_composition_annotation)
6741 (handle_charset_annotation, consume_chars, decode_coding_gap)
6742 (decode_coding_object, encode_coding_object, detect_coding_system)
6743 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6744 (code_convert_region, code_convert_string)
6745 (Fdefine_coding_system_internal)
6746 (coding_set_source, coding_set_destination):
6747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6748 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6749 (Fdefine_coding_system_internal):
6750 Don't assume fixnums fit in int.
6751 (decode_coding_gap, decode_coding_object, encode_coding_object)
6752 (Fread_coding_system, Fdetect_coding_region)
6753 (Funencodable_char_position, Fcheck_coding_systems_region)
6754 (get_translation, handle_composition_annotation, consume_chars):
6755 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6756 (consume_chars): Rewrite to not calculate an address outside buffer.
6757 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6758 Don't access memory outside of the args array.
6759 (Fdefine_coding_system_internal): Check for charset-id overflow.
6760 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6761 result of ENCODE_CHAR.
6762 * coding.h: Adjust decls to match defn changes elsewhere.
6763 (struct coding_system):
6764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6765 * composite.c (get_composition_id, find_composition)
6766 (run_composition_function, update_compositions)
6767 (compose_text, composition_gstring_put_cache)
6768 (composition_gstring_p, composition_gstring_width)
6769 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6770 (composition_compute_stop_pos, composition_reseat_it)
6771 (composition_update_it, struct position_record)
6772 (find_automatic_composition, composition_adjust_point)
6773 (Fcomposition_get_gstring, Ffind_composition_internal):
6774 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6775 (update_compositions):
6776 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6777 * composite.h: Adjust decls to match defn changes elsewhere.
6778 (struct composition):
6779 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6780 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6781 Do not attempt to compute the address of the object just before a
6782 buffer; this is not portable.
6783 (Faref, Faset):
6784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6785 (Faset): Use int, not EMACS_INT, where int is wide enough.
6786 (Fstring_to_number): Don't assume fixnums fit in int.
6787 (Frem): Don't assume arg is nonnegative.
6788 * dbusbind.c (xd_append_arg): Check for integers out of range.
6789 (Fdbus_call_method): Don't overflow the timeout int.
6790 (extract_signed, extract_unsigned): New functions.
6791 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6792 (xd_get_connection_references): Return ptrdiff_t, not int.
6793 All uses changed.
6794 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6795 (xd_read_message_1):
6796 Use int, not unsigned, where the dbus API uses int.
6797 (Fdbus_message_internal): Don't overflow mtype.
6798 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6799 * dired.c (directory_files_internal, file_name_completion, scmp)
6800 (file_name_completion_stat):
6801 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6802 (file_name_completion): Don't overflow matchcount.
6803 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6804 * dispextern.h: Adjust decls to match defn changes elsewhere.
6805 (struct text_pos, struct glyph, struct bidi_saved_info)
6806 (struct bidi_string_data, struct bidi_it, struct composition_it)
6807 (struct it):
6808 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6809 (struct display_pos, struct composition_it, struct it):
6810 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6811 * dispnew.c (increment_matrix_positions)
6812 (increment_row_positions, mode_line_string)
6813 (marginal_area_string):
6814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6815 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6817 (duration_to_sec_usec): New function, to check for overflow better.
6818 (Fsleep_for, sit_for): Use it.
6819 * doc.c (get_doc_string, store_function_docstring):
6820 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6821 (get_doc_string, Fsnarf_documentation):
6822 Use int, not EMACS_INT, where int is wide enough.
6823 (get_doc_string):
6824 Use SAFE_ALLOCA, not alloca.
6825 Check for overflow when converting EMACS_INT to off_t.
6826 * doprnt.c (doprnt):
6827 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6828 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6829 Don't assume uid_t fits into fixnum.
6830 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6831 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6832 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6833 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6834 (general_insert_function)
6835 (Finsert_char, make_buffer_string, make_buffer_string_both)
6836 (update_buffer_properties, Fbuffer_substring)
6837 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6838 (Fsubst_char_in_region, check_translation)
6839 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6840 (transpose_markers, Ftranspose_regions):
6841 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6842 (clip_to_bounds): Move to lisp.h as an inline function).
6843 (Fconstrain_to_field): Don't assume integers are nonnegative.
6844 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6845 (Fsubst_char_in_region, Fsave_restriction):
6846 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6847 (Femacs_pid): Don't assume pid_t fits into fixnum.
6848 (lo_time): Use int, not EMACS_INT, when int suffices.
6849 (lisp_time_argument): Check for usec out of range.
6850 (Fencode_time): Don't assume fixnum fits in int.
6851 (Fuser_login_name, Fuser_full_name): Signal an error
6852 if a uid argument is out of range, rather than relying on
6853 undefined behavior.
6854 (Fformat_time_string): Remove now-unnecessary check.
6855 lisp_time_argument checks for out-of-range usec now.
6856 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6857 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6858 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6859 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6860 (init_cmdargs, Fdump_emacs):
6861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6862 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6863 the bottom (typically) 32 bits of the fixnum.
6864 * eval.c (specpdl_size, call_debugger):
6865 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6866 (when_entered_debugger, Fbacktrace_debug):
6867 Don't assume fixnum can fit in int.
6868 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6869 the object just before a buffer; this is not portable.
6870 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6871 (grow_specpdl, unbind_to):
6872 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6873 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6874 (grow_specpdl): Simplify allocation by using xpalloc.
6875 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6876 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6877 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6878 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6879 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6880 (a_write, e_write):
6881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6882 (Fcopy_file, non_regular_nbytes, read_non_regular)
6883 (Finsert_file_contents):
6884 Use int, not EMACS_INT, where int is wide enough.
6885 (READ_BUF_SIZE): Verify that it fits in int.
6886 (Finsert_file_contents): Check that counts are in proper range,
6887 rather than assuming fixnums fit into ptrdiff_t etc.
6888 Don't assume fixnums fit into int.
6889 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6890 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6891 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6892 (string_char_to_byte, string_byte_to_char)
6893 (string_make_multibyte, string_to_multibyte)
6894 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6895 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6896 (substring_both, Fdelete, internal_equal, Ffillarray)
6897 (Fclear_string, mapcar1)
6898 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6899 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6900 (larger_vector, make_hash_table, maybe_resize_hash_table)
6901 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6902 (Fmaphash, secure_hash):
6903 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6904 (concat): Check for string index and length overflow.
6905 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6906 (Frequire):
6907 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6908 (larger_vector): New API (vec, incr_min, size_max) replaces old
6909 one (vec, new_size, init). This catches size overflow.
6910 INIT was removed because it was always Qnil.
6911 All callers changed.
6912 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6913 the upper bound on a hash table index size.
6914 (make_hash_table, maybe_resize_hash_table): Use it.
6915 (secure_hash): Computer start_byte and end_byte only after
6916 they're known to be in ptrdiff_t range.
6917 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6918 (Ffont_get_glyphs, Ffont_at):
6919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6920 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6921 (Flist_fonts, Fopen_font):
6922 Don't assume fixnum can fit in int.
6923 (check_gstring): Don't assume index can fit in int.
6924 (font_match_p): Check that fixnum is a character, not a nonnegative
6925 fixnum, since the later code needs to stuff it into an int.
6926 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6927 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6928 conversion overflow issues.
6929 (Fopen_font): Check for integer out of range.
6930 (Ffont_get_glyphs): Don't assume index can fit in int.
6931 * font.h: Adjust decls to match defn changes elsewhere.
6932 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6933 integer overflow.
6934 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6935 printmax_t, where ptrdiff_t is wide enough.
6936 (Finternal_char_font):
6937 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6938 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6939 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6940 (Fset_frame_position, x_set_frame_parameters)
6941 (x_set_line_spacing, x_set_border_width)
6942 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6943 Check that fixnums are in proper range for system types.
6944 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6946 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6947 Use SAFE_ALLOCA_LISP, not alloca.
6948 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6949 intptr_t is wide enough.
6950 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6951 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6952 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6953 Check for fixnum out of range.
6954 * ftfont.c (ftfont_list): Don't assume index fits in int.
6955 Check that fixnums are in proper range for system types.
6956 (ftfont_shape_by_flt):
6957 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6958 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6960 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6961 Check that fixnums are in proper range for system types.
6962 * gnutls.h: Adjust decls to match defn changes elsewhere.
6963 * gtkutil.c (xg_dialog_run):
6964 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6965 (update_frame_tool_bar):
6966 Check that fixnums are in proper range for system types.
6967 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6968 (lookup_image): Check that fixnums are in range for system types.
6969 * indent.c (last_known_column, last_known_column_point):
6970 (current_column_bol_cache):
6971 (skip_invisible, current_column, check_display_width):
6972 (check_display_width, scan_for_column, current_column_1)
6973 (Findent_to, Fcurrent_indentation, position_indentation)
6974 (indented_beyond_p, Fmove_to_column, compute_motion):
6975 (Fcompute_motion, Fvertical_motion):
6976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6977 (last_known_column_modified): Use EMACS_INT, not int.
6978 (check_display_width):
6979 (Fcompute_motion):
6980 Check that fixnums and floats are in proper range for system types.
6981 (compute_motion): Don't assume index or fixnum fits in int.
6982 (compute_motion, Fcompute_motion):
6983 Use int, not EMACS_INT, when it is wide enough.
6984 (vmotion): Omit local var start_hpos that is always 0; that way
6985 we don't need to worry about overflow in expressions involving it.
6986 * indent.h: Adjust decls to match defn changes elsewhere.
6987 (struct position):
6988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6989 Use int, not EMACS_INT, where int is wide enough.
6990 Remove unused members ovstring_chars_done and tab_offset;
6991 all uses removed.
6992 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6993 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6994 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6995 (make_gap, copy_text, insert, insert_and_inherit)
6996 (insert_before_markers, insert_before_markers_and_inherit)
6997 (insert_1, count_combining_before, count_combining_after)
6998 (insert_1_both, insert_from_string)
6999 (insert_from_string_before_markers, insert_from_string_1)
7000 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7001 (adjust_after_replace, adjust_after_insert, replace_range)
7002 (replace_range_2, del_range, del_range_1, del_range_byte)
7003 (del_range_both, del_range_2, modify_region)
7004 (prepare_to_modify_buffer, signal_before_change)
7005 (signal_after_change, Fcombine_after_change_execute):
7006 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7007 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7008 (balance_an_interval, split_interval_right, split_interval_left)
7009 (find_interval, next_interval, update_interval)
7010 (adjust_intervals_for_insertion, delete_node, delete_interval)
7011 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7012 (static_offset_intervals, offset_intervals)
7013 (merge_interval_right, merge_interval_left, make_new_interval)
7014 (graft_intervals_into_buffer, temp_set_point_both)
7015 (temp_set_point, set_point, adjust_for_invis_intang)
7016 (set_point_both, move_if_not_intangible, get_property_and_range)
7017 (get_local_map, copy_intervals, copy_intervals_to_string)
7018 (compare_string_intervals, set_intervals_multibyte_1):
7019 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7020 * intervals.h: Adjust decls to match defn changes elsewhere.
7021 (struct interval):
7022 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7023 * keyboard.c (this_command_key_count, this_single_command_key_start)
7024 (before_command_key_count, before_command_echo_length, echo_now)
7025 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7026 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7027 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7028 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7029 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7030 (last_non_minibuf_size, last_point_position, echo_truncate)
7031 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7032 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7033 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7034 (stuff_buffered_input):
7035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7036 (last_auto_save, command_loop_1, read_char):
7037 Use EMACS_INT, not int, to avoid integer overflow.
7038 (record_char): Avoid overflow in total_keys computation.
7039 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7040 * keyboard.h: Adjust decls to match defn changes elsewhere.
7041 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7042 (Fkey_description, Fdescribe_vector, Flookup_key):
7043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7044 (click_position): New function, to check that positions are in range.
7045 (Fcurrent_active_maps):
7046 (describe_command):
7047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7048 (Faccessible_keymaps, Fkey_description):
7049 (preferred_sequence_p):
7050 Don't assume fixnum can fit into int.
7051 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7052 Check for integer overflow in size calculations.
7053 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7054 avoid mishandling large integers.
7055 * lisp.h: Adjust decls to match defn changes elsewhere.
7056 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7057 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7058 (struct Lisp_Marker):
7059 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7060 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7061 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7062 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7063 All callers changed.
7064 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7065 Assume the arg has valid form, since it always does.
7066 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7067 unsigned integer system type.
7068 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7069 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7070 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7071 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7072 (duration_to_sec_usec): New decl.
7073 * lread.c (read_from_string_index, read_from_string_index_byte)
7074 (read_from_string_limit, readchar, unreadchar, openp)
7075 (read_internal_start, read1, oblookup):
7076 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7077 (Fload, readevalloop, Feval_buffer, Feval_region):
7078 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7079 (openp): Check for out-of-range argument to 'access'.
7080 (read1): Use int, not EMACS_INT, where int is wide enough.
7081 Don't assume fixnum fits into int.
7082 Fix off-by-one error that can read outside a buffer.
7083 (read_filtered_event): Use duration_to_sec_usec
7084 to do proper overflow checking on durations.
7085 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7086 in size calculation.
7087 (Fexecute_kbd_macro):
7088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7089 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7090 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7091 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7092 (set_marker_both, set_marker_restricted_both, marker_position)
7093 (marker_byte_position, Fbuffer_has_markers_at):
7094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7095 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7096 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7097 It now merely ensures that the menu is large enough, without
7098 necessarily growing it, as this avoids some integer overflow issues.
7099 All callers changed.
7100 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7101 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7102 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7103 Use SAFE_ALLOCA_LISP, not alloca.
7104 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7105 to EMACS_INT. Check that fixnums are in proper range for system types.
7106 * minibuf.c (minibuf_prompt_width, string_to_object)
7107 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7108 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7109 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7110 (get_minibuffer, read_minibuf_unwind):
7111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7112 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7113 this simplifies overflow checking. All callers changed.
7114 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7115 (Ftest_completion):
7116 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7117 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7118 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7119 Check that fixnums are in proper range for system types.
7120 (Fx_create_frame, Fx_show_tip):
7121 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7122 * nsfont.m (ns_findfonts, nsfont_list_family):
7123 Don't assume fixnum fits in long.
7124 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7125 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7126 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7127 wide enough.
7128 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7129 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7130 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7131 (PRINTDECLARE, PRINTPREPARE):
7132 (strout, print_string):
7133 (print, print_preprocess, print_check_string_charset_prop)
7134 (print_object):
7135 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7136 (PRINTDECLARE):
7137 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7138 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7139 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7140 (printchar, strout): Use xpalloc to catch size calculation overflow.
7141 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7142 (print_error_message): Use SAFE_ALLOCA, not alloca.
7143 (print_object): Use int, not EMACS_INT, where int is wide enough.
7144 (print_depth, new_backquote_output, print_number_index):
7145 Use ptrdiff_t, not int, where int might not be wide enough.
7146 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7147 (Fset_process_window_size, Fformat_network_address)
7148 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7149 (sigchld_handler):
7150 Check that fixnums are in proper range for system types.
7151 (Fsignal_process): Simplify by avoiding a goto.
7152 Check for process-ids out of pid_t range rather than relying on
7153 undefined behavior.
7154 (process_tick, update_tick): Use EMACS_INT, not int.
7155 (Fformat_network_address, read_process_output, send_process)
7156 (Fprocess_send_region, status_notify):
7157 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7158 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7159 (wait_reading_process_output, read_process_output, exec_sentinel):
7160 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7161 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7162 (Faccept_process_output): Use duration_to_sec_usec to do proper
7163 overflow checking on durations.
7164 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7165 Don't assume pid_t fits in int.
7166 * process.h (struct Lisp_Process): Members tick and update_tick
7167 are now of type EMACS_INT, not int.
7168 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7169 configured --with-wide-int.
7170 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7171 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7172 * search.c (looking_at_1, string_match_1):
7173 (fast_string_match, fast_c_string_match_ignore_case)
7174 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7175 (scan_newline, find_before_next_newline, search_command)
7176 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7177 (set_search_regs, wordify):
7178 (Freplace_match):
7179 (Fmatch_data):
7180 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7181 (string_match_1, search_buffer, set_search_regs):
7182 (Fmatch_data):
7183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7184 (wordify): Check for overflow in size calculation.
7185 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7186 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7187 Check that fixnums are in proper range for system types.
7188 * sound.c (struct sound_device)
7189 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7190 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7191 (Fplay_sound_internal):
7192 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7193 * syntax.c (struct lisp_parse_state, find_start_modiff)
7194 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7195 (Fparse_partial_sexp):
7196 Don't assume fixnums can fit in int.
7197 (struct lisp_parse_state, find_start_pos, find_start_value)
7198 (find_start_value_byte, find_start_begv)
7199 (update_syntax_table, char_quoted, dec_bytepos)
7200 (find_defun_start, prev_char_comend_first, back_comment):
7201 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7202 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7203 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7204 (Finternal_describe_syntax_value): Check that match_lisp is a
7205 character, not an integer, since the code stuffs it into int.
7206 (scan_words, scan_sexps_forward):
7207 Check that fixnums are in proper range for system types.
7208 (Fforward_word):
7209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7210 (scan_sexps_forward):
7211 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7212 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7213 * syntax.h: Adjust decls to match defn changes elsewhere.
7214 (struct gl_state_s):
7215 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7216 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7217 MOST_POSITIVE_FIXNUM.
7218 * sysdep.c (wait_for_termination_1, wait_for_termination)
7219 (interruptible_wait_for_termination, mkdir):
7220 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7221 (emacs_read, emacs_write):
7222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7223 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7224 and double all fit in int.
7225 * term.c (set_tty_color_mode):
7226 Check that fixnums are in proper range for system types.
7227 * termhooks.h (struct input_event):
7228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7229 * textprop.c (validate_interval_range, interval_of)
7230 (Fadd_text_properties, set_text_properties_1)
7231 (Fremove_text_properties, Fremove_list_of_text_properties)
7232 (Ftext_property_any, Ftext_property_not_all)
7233 (copy_text_properties, text_property_list, extend_property_ranges)
7234 (verify_interval_modification):
7235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7236 (Fnext_single_char_property_change)
7237 (Fprevious_single_char_property_change):
7238 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7239 (copy_text_properties):
7240 Check for integer overflow in index calculation.
7241 * undo.c (last_boundary_position, record_point, record_insert)
7242 (record_delete, record_marker_adjustment, record_change)
7243 (record_property_change):
7244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7245 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7246 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7247 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7248 (Fx_hide_tip, Fx_file_dialog):
7249 * w32menu.c (set_frame_menubar):
7250 Use ptrdiff_t, not int, for consistency with rest of code.
7251 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7252 (select_window, Fdelete_other_windows_internal)
7253 (window_scroll_pixel_based, window_scroll_line_based)
7254 (Frecenter, Fset_window_configuration):
7255 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7256 (Fset_window_hscroll, run_window_configuration_change_hook)
7257 (set_window_buffer, temp_output_buffer_show, scroll_command)
7258 (Fscroll_other_window, Frecenter):
7259 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7260 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7261 Don't assume fixnum fits in int.
7262 (Fset_window_scroll_bars):
7263 Check that fixnums are in proper range for system types.
7264 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7265 (string_pos, c_string_pos, number_of_chars, init_iterator)
7266 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7267 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7268 (compute_display_string_end, handle_face_prop)
7269 (face_before_or_after_it_pos, handle_invisible_prop)
7270 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7271 (display_prop_intangible_p, string_buffer_position_lim)
7272 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7273 (get_overlay_strings_1, get_overlay_strings)
7274 (iterate_out_of_display_property, forward_to_next_line_start)
7275 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7276 (get_next_display_element, set_iterator_to_next)
7277 (get_visually_first_element, compute_stop_pos_backwards)
7278 (handle_stop_backwards, next_element_from_buffer)
7279 (move_it_in_display_line_to, move_it_in_display_line)
7280 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7281 (add_to_log, message_dolog, message_log_check_duplicate)
7282 (message2, message2_nolog, message3, message3_nolog
7283 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7284 (current_message_1, truncate_echo_area, truncate_message_1)
7285 (set_message, set_message_1, store_mode_line_noprop)
7286 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7287 (text_outside_line_unchanged_p, check_point_in_composition)
7288 (reconsider_clip_changes)
7289 (redisplay_internal, set_cursor_from_row, try_scrolling)
7290 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7291 (redisplay_window, find_last_unchanged_at_beg_row)
7292 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7293 (trailing_whitespace_p, find_row_edges, display_line)
7294 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7295 (display_mode_element, store_mode_line_string)
7296 (pint2str, pint2hrstr, decode_mode_spec)
7297 (display_count_lines, display_string, draw_glyphs)
7298 (x_produce_glyphs, x_insert_glyphs)
7299 (rows_from_pos_range, mouse_face_from_buffer_pos)
7300 (fast_find_string_pos, mouse_face_from_string_pos)
7301 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7303 (safe_call, init_from_display_pos, handle_fontified_prop)
7304 (handle_single_display_spec, load_overlay_strings)
7305 (with_echo_area_buffer, setup_echo_area_for_printing)
7306 (display_echo_area, echo_area_display)
7307 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7308 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7309 (redisplay_window, dump_glyph_row, display_mode_line)
7310 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7311 (handle_display_spec, display_prop_string_p):
7312 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7313 (handle_single_display_spec, build_desired_tool_bar_string)
7314 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7315 (get_specified_cursor_type):
7316 Check that fixnums are in proper range for system types.
7317 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7318 (Flookup_image_map):
7319 Don't assume fixnums fit in int.
7320 (compare_overlay_entries):
7321 Avoid mishandling comparisons due to subtraction overflow.
7322 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7323 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7324 (handle_tool_bar_click):
7325 Use int, not unsigned, since we prefer signed and the signedness
7326 doesn't matter here.
7327 (get_next_display_element, next_element_from_display_vector):
7328 Use int, not EMACS_INT, when int is wide enough.
7329 (start_hourglass): Use duration_to_sec_usec to do proper
7330 overflow checking on durations.
7331 * xfaces.c (Fbitmap_spec_p):
7332 Check that fixnums are in proper range for system types.
7333 (compare_fonts_by_sort_order):
7334 Avoid mishandling comparisons due to subtraction overflow.
7335 (Fx_family_fonts, realize_basic_faces):
7336 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7337 (Fx_family_fonts):
7338 Don't assume fixnum fits in int.
7339 Use SAFE_ALLOCA_LISP, not alloca.
7340 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7341 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7342 (face_at_buffer_position, face_for_overlay_string)
7343 (face_at_string_position):
7344 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7345 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7346 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7347 (Fx_show_tip):
7348 Check that fixnums are in proper range for system types.
7349 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7350 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7351 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7352 (Fx_change_window_property): Don't assume fixnums fit in int.
7353 * xfont.c (xfont_chars_supported):
7354 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7355 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7356 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7358 * xml.c (parse_region):
7359 * xrdb.c (magic_file_p):
7360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7361 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7362 (x_get_local_selection, x_reply_selection_request)
7363 (x_handle_selection_request, wait_for_property_change):
7364 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7365 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7366 short is wide enough.
7367 (x_send_client_event): Don't assume fixnum fits in int.
7368 * xterm.c (x_x_to_emacs_modifiers):
7369 Don't assume EMACS_INT overflows nicely into int.
7370 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7371 may come from Lisp.
7372 (handle_one_xevent): NATNUMP can eval its arg twice.
7373 (x_connection_closed):
7374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7375 * xterm.h: Adjust decls to match defn changes elsewhere.
7376 (struct scroll_bar): Use struct vectorlike_header
7377 rather than rolling our own approximation.
7378 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7379
7380 2012-05-25 Glenn Morris <rgm@gnu.org>
7381
7382 * lisp.mk (lisp): Update for more files being compiled now.
7383
7384 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7385
7386 * lread.c: Remove `read_pure' which makes no difference.
7387 (read_pure): Remove var.
7388 (unreadpure): Remove function.
7389 (readevalloop): Don't call read_list with -1 flag.
7390 (read1, read_vector): Don't test read_pure any more.
7391 (read_list): Simplify.
7392
7393 * fileio.c, character.h: Minor style tweaks.
7394
7395 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7396
7397 * window.h (clip_changed): Remove useless declaration.
7398
7399 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7400
7401 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7402 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7403
7404 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7405
7406 Remove src/m/*.
7407 This directory predates autoconf and is no longer needed nowadays.
7408 Move its few remaining bits of functionality to where they're needed.
7409 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7410 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7411 * m/template.h: Remove.
7412 * Makefile.in (M_FILE): Remove. All uses removed.
7413 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7414 * lisp.h (USE_LSB_TAG):
7415 * mem-limits.h (EXCEEDS_LISP_PTR):
7416 Use VAL_MAX, not VALBITS, in #if.
7417 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7418 (EMACS_UINT): Define unconditionally now.
7419 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7420 (BITS_PER_EMACS_INT): New constants, replacing
7421 what used to be in config.h, but not useful in #if.
7422 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7423 define them any more.
7424 (VAL_MAX): New macro.
7425 (VALMASK): Use it.
7426 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7427 BITS_PER_EMACS_INT, in #if.
7428 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7429 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7430 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7431 * s/ms-w32.h (DATA_START):
7432 Move here from removed file m/intel386.h.
7433 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7434 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7435
7436 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7437
7438 Assume C89 or later.
7439 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7440 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7441 (xrealloc):
7442 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7443 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7444 * textprop.c, tparam.c (NULL): Remove.
7445 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7446 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7447 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7448 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7449 * xterm.c (input_signal_count): Assume volatile works.
7450
7451 2012-05-21 Ken Brown <kbrown@cornell.edu>
7452
7453 * xgselect.c (xg_select): Fix first argument in call to 'select'
7454 (bug#11508).
7455
7456 2012-05-20 Ken Brown <kbrown@cornell.edu>
7457
7458 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7459 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7460
7461 2012-05-19 Ken Brown <kbrown@cornell.edu>
7462
7463 * xfns.c (x_in_use): Remove `static' qualifier.
7464 * xterm.h (x_in_use): Declare.
7465 * xgselect.c: Include xterm.h.
7466 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7467 and `display_arg' (bug#9754).
7468
7469 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7470
7471 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7472
7473 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7474 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7475
7476 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7477
7478 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7479
7480 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7481 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7482
7483 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7484 reference to image_cache->refcount.
7485 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7486
7487 2012-05-17 Juri Linkov <juri@jurta.org>
7488
7489 * search.c (Fword_search_regexp, Fword_search_backward)
7490 (Fword_search_forward, Fword_search_backward_lax)
7491 (Fword_search_forward_lax): Move functions to isearch.el
7492 (bug#10145, bug#11381).
7493
7494 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7495
7496 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7497
7498 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7499
7500 * lread.c (init_obarray): Declare Qt and Qnil as special.
7501
7502 2012-05-14 Glenn Morris <rgm@gnu.org>
7503
7504 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7505 Put "libexec" before "bin", for the sake of init_callproc_1.
7506
7507 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7508
7509 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7510
7511 * unexaix.c: Port to more-recent AIX compilers.
7512 (report_error, report_error_1, make_hdr, copy_sym)
7513 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7514 Make arguments const char *, not char *, to avoid violations of C
7515 standard and to fix some AIX warnings reported by Gilles Pion.
7516
7517 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7518
7519 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7520 already have overlays loaded.
7521 (handle_single_display_spec): Before returning without displaying
7522 fringe bitmap, synchronize the bidi iterator with the main display
7523 iterator, by calling iterate_out_of_display_property.
7524 (iterate_out_of_display_property): Detect buffer iteration by
7525 testing that it->string is a Lisp string.
7526 (get_next_display_element): When the current object is exhausted,
7527 and there's something on it->stack, call set_iterator_to_next to
7528 proceed with what's on the stack, instead of returning zero.
7529 (set_iterator_to_next): If called at the end of a Lisp string,
7530 proceed to consider_string_end without incrementing string
7531 position. Don't increment display vector index past the end of
7532 the display vector. (Bug#11417)
7533 (pos_visible_p): Don't report a position visible when move_it_to
7534 stopped at the last line of window, which happens to be scanned
7535 backwards by the bidi iteration. (Bug#11464)
7536
7537 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7538
7539 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7540 and right-margin display specs even if the spec is invalid or we
7541 are on a TTY, and thus unable to display on the fringes.
7542 That's because the text with the property will not be displayed anyway,
7543 so we need to signal to the caller that this is a "replacing"
7544 display spec. This fixes display when the spec is invalid or we
7545 are on a TTY.
7546
7547 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7548
7549 * unexaix.c (make_hdr): Fix typo in prototype.
7550 This bug broke the build on AIX. Problem reported by Gilles Pion.
7551
7552 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7553
7554 * keyboard.c (kbd_buffer_get_event): Read special events also in
7555 batch mode. (Bug#11415)
7556
7557 2012-05-12 Glenn Morris <rgm@gnu.org>
7558
7559 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7560
7561 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7562
7563 * lisp.mk (lisp): Add newcomment.elc.
7564
7565 2012-05-12 Glenn Morris <rgm@gnu.org>
7566
7567 * Makefile.in (MKDIR_P): New, set by configure.
7568 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7569
7570 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7571
7572 Remove unused function hourglass_started.
7573 * dispextern.h (hourglass_started):
7574 * w32fns.c (hourglass_started):
7575 * xdisp.c (hourglass_started): Remove.
7576
7577 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7578
7579 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7580 Update dependencies.
7581
7582 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7583
7584 * xgselect.c (xg_select): Put maxfds+1 into a var.
7585 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7586
7587 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7588
7589 2012-05-10 Dave Abrahams <dave@boostpro.com>
7590
7591 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7592 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7593
7594 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7595
7596 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7597 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7598 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7599 Initialize xd_registered_buses.
7600
7601 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7602
7603 Untag more efficiently if USE_LSB_TAG.
7604 This is based on a proposal by YAMAMOTO Mitsuharu in
7605 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7606 For an admittedly artificial (nth 8000 longlist) benchmark on
7607 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7608 Emacs's overall text size by 1%.
7609 * lisp.h (XUNTAG): New macro.
7610 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7611 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7612 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7613 * eval.c (Fautoload):
7614 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7615 * frame.h (XFRAME): Use XUNTAG.
7616
7617 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7618 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7619 Remove unportable assumptions about print widths of types like
7620 dbus_uint32_t.
7621 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7622 intptr_t when converting between pointer and integer, to avoid GCC
7623 warnings about wrong width.
7624
7625 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7626
7627 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7628 stack for each reader_thread, instead of defaulting to 8MB
7629 determined by the linker. This avoids failures in creating
7630 subprocesses on Windows 7, see the discussion in this thread:
7631 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7632
7633 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7634
7635 Fix up display of the *Minibuf-0* buffer in the mini window.
7636 * keyboard.c (read_char): Don't clear the echo area if there's no
7637 message to clear.
7638 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7639 contents of *Minibuf-0*) if there's no message displayed in its stead.
7640
7641 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7642
7643 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7644 batch mode.
7645
7646 2012-05-06 Chong Yidong <cyd@gnu.org>
7647
7648 * lisp.mk (lisp): Update.
7649
7650 2012-05-05 Jim Meyering <meyering@redhat.com>
7651
7652 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7653
7654 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7655
7656 * data.c (PUT_ERROR): New macro.
7657 (syms_of_data): Use it. Add new error type `user-error'.
7658 * undo.c (user_error): New function.
7659 (Fprimitive_undo): Use it.
7660 * print.c (print_error_message): Adjust print style for `user-error'.
7661 * keyboard.c (user_error): New function.
7662 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7663
7664 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7665
7666 Do not limit current-time-string to years 1000..9999.
7667 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7668 (Fcurrent_time_string): Support any year that is supported by the
7669 underlying localtime representation. Don't use asctime, as it
7670 has undefined behavior for years outside the range -999..9999.
7671
7672 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7673
7674 Fix race conditions involving setenv, gmtime, localtime, asctime.
7675 Without this fix, interrupts could mess up code that uses these
7676 nonreentrant functions, since setting TZ invalidates existing
7677 tm_zone or tzname values, and since most of these functions return
7678 pointers to static storage.
7679 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7680 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7681 Grow the critical sections to include not just invoking
7682 localtime/gmtime, but also accessing these functions' results
7683 including their tm_zone values if any, and any related TZ setting.
7684 (format_time_string): Last arg is now struct tm *, not struct tm **,
7685 so that the struct tm is saved in the critical section.
7686 All callers changed. Simplify allocation of initial buffer, partly
7687 motivated by the fact that memory allocation needs to be outside
7688 the critical section.
7689
7690 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7691
7692 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7693 with RESET_INTERVAL.
7694
7695 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7696 Remove duplicated buffer name initialization.
7697
7698 2012-05-02 Jim Meyering <jim@meyering.net>
7699
7700 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7701
7702 * xfns.c (x_window): Use xstrdup (Bug#11375).
7703
7704 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7705
7706 * xdisp.c (pos_visible_p): If already at a newline from the
7707 display string before the 'while' loop, don't walk back the glyphs
7708 from it3.glyph_row. Solves assertion violation when the display
7709 string begins with a newline (egg.el). (Bug#11367)
7710
7711 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7712
7713 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7714 Move to simple.el.
7715
7716 2012-05-01 Glenn Morris <rgm@gnu.org>
7717
7718 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7719 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7720 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7721 All were removed before 23.1.
7722
7723 * dispnew.c: Remove HAVE_LIBNCURSES test;
7724 it is always true on relevant platforms.
7725
7726 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7727 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7728
7729 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7730
7731 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7732
7733 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7734 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7735 Remove.
7736
7737 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7738
7739 Do not avoid creating empty evaporating overlays (Bug#9642).
7740 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7741 That is, do not delete an evaporating overlay if it becomes
7742 empty after its bounds are adjusted to fit within its buffer.
7743 This fix caused other problems, and I'm reverting it until we get
7744 to the bottom of them.
7745
7746 2012-04-27 Chong Yidong <cyd@gnu.org>
7747
7748 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7749
7750 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7751
7752 * xdisp.c (pos_visible_p): If the window start position is beyond
7753 ZV, start the display from buffer beginning. Prevents assertion
7754 violation in init_iterator when the minibuffer window is scrolled
7755 via the scroll bar.
7756
7757 * window.c (window_scroll_pixel_based): Likewise.
7758
7759 2012-04-27 Chong Yidong <cyd@gnu.org>
7760
7761 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7762
7763 2012-04-27 Glenn Morris <rgm@gnu.org>
7764
7765 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7766 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7767
7768 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7769
7770 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7771 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7772
7773 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7774
7775 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7776 display element, check also the underlying string or buffer
7777 character. (Bug#11341)
7778
7779 * w32menu.c: Include w32heap.h.
7780 (add_menu_item): If the call to AppendMenuW (via
7781 unicode_append_menu) fails, disable Unicode menus only if we are
7782 running on Windows 9X/Me.
7783
7784 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7785
7786 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7787 (xgetint): Add missing shift for LSB tags.
7788
7789 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7790
7791 * keyboard.c (read_char): Don't wipe echo area for select window
7792 events: These might get delayed via `mouse-autoselect-window'
7793 (Bug#11304).
7794
7795 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7796
7797 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7798 manipulation of :loaded-from data.
7799
7800 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7801
7802 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7803 now a cons (bug#11311).
7804
7805 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7806
7807 Do not create empty overlays with the evaporate property (Bug#9642).
7808 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7809 if it becomes empty after its bounds are adjusted to fit within
7810 its buffer. Without this fix, in a nonempty buffer (let ((o
7811 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7812 yields an empty overlay that has the evaporate property, which is
7813 not supposed to happen.
7814
7815 Fix minor GTK3 problems found by static checking.
7816 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7817 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7818 (struct _EmacsFixedClass, emacs_fixed_get_type):
7819 Move decls here from emacsgtkfixed.h, since they needn't be public.
7820 (emacs_fixed_get_type): Now static.
7821 (emacs_fixed_class_init): Omit unused local.
7822 (emacs_fixed_child_type): Remove; unused.
7823 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7824 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7825 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7826 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7827 (EMACS_FIXED_GET_CLASS): Remove; unused.
7828 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7829
7830 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7831 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7832
7833 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7834
7835 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7836 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7837 (__malloc_size_t, __malloc_ptrdiff_t):
7838 Remove. All uses removed, replaced by the definiens if needed,
7839 since we can assume C89 or better now.
7840 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7841 (protect_malloc_state, align, get_contiguous_space)
7842 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7843 (malloc_atfork_handler_child, malloc_enable_thread)
7844 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7845 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7846 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7847 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7848 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7849 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7850 Define using prototypes, not old style.
7851 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7852 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7853 (align): Don't assume that signed integer overflow wraps around.
7854 Omit unused local var.
7855 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7856 (_free_internal_nolock, memalign, mallochook, reallochook):
7857 Omit no-longer-needed casts.
7858 (valloc): Use getpagesize, not __getpagesize.
7859 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7860 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7861
7862 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7863
7864 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7865
7866 Move functions from C to Lisp. Make non-blocking method calls
7867 the default. Implement further D-Bus standard interfaces.
7868
7869 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7870 (QCdbus_request_name_allow_replacement)
7871 (QCdbus_request_name_replace_existing)
7872 (QCdbus_request_name_do_not_queue)
7873 (QCdbus_request_name_reply_primary_owner)
7874 (QCdbus_request_name_reply_in_queue)
7875 (QCdbus_request_name_reply_exists)
7876 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7877 (QCdbus_registered_serial, QCdbus_registered_method)
7878 (QCdbus_registered_signal): New Lisp objects.
7879 (XD_DEBUG_MESSAGE): Use sizeof.
7880 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7881 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7882 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7883 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7884 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7885 (xd_signature, xd_append_arg): Allow float for integer types.
7886 (xd_get_connection_references): New function.
7887 (xd_get_connection_address): Rename from xd_initialize.
7888 Return cached address.
7889 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7890 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7891 level.
7892 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7893 Return number of refcounts.
7894 (Fdbus_get_unique_name): Make stronger parameter check.
7895 (Fdbus_message_internal): New defun.
7896 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7897 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7898 (Fdbus_send_signal, Fdbus_register_service)
7899 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7900 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7901 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7902 (Vdbus_compiled_version, Vdbus_runtime_version)
7903 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7904 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7905 (Vdbus_message_type_signal): New defvars.
7906 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7907 Adapt docstring.
7908
7909 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7910
7911 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7912 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7913 Do not assume ptrdiff_t is the same width as 'int'.
7914
7915 * alloc.c: Handle unusual debugging option combinations.
7916 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7917 since the two debugging options are incompatible.
7918 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7919 is defined.
7920 (mem_init, mem_insert, mem_insert_fixup):
7921 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7922 (NEED_MEM_INSERT): Remove; no longer needed.
7923
7924 2012-04-22 Leo Liu <sdl.web@gmail.com>
7925
7926 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7927
7928 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7929
7930 * sysdep.c [__FreeBSD__]: Minor cleanups.
7931 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7932 Use Emacs indenting style more consistently. Avoid some casts.
7933 Use 'double' consistently rather than mixing 'float' and 'double'.
7934
7935 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7936
7937 * sysdep.c (list_system_processes, system_process_attributes):
7938 Add implementation for FreeBSD (Bug#5243).
7939
7940 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7941
7942 * lisp.mk (lisp): Update.
7943
7944 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7945
7946 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7947 It is never used otherwise.
7948
7949 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7950
7951 * print.c (print_preprocess): Only check print_depth if print-circle
7952 is nil.
7953 (print_object): Check for cycles even when print-circle is nil and
7954 print-gensym is t, but only check print_depth if print-circle is nil.
7955
7956 2012-04-20 Chong Yidong <cyd@gnu.org>
7957
7958 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7959 set the status to "failed" and ensure that sentinel is run.
7960
7961 2012-04-20 Glenn Morris <rgm@gnu.org>
7962
7963 * process.c (Fset_process_inherit_coding_system_flag)
7964 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7965 (Fmake_network_process, Fmake_serial_process): Doc fix.
7966
7967 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7968
7969 * xdisp.c (string_buffer_position_lim): Limit starting position to
7970 BEGV.
7971 (set_cursor_from_row): If called for a mode-line or header-line
7972 row, return zero immediately.
7973 (try_cursor_movement): If inside continuation line, don't back up
7974 farther than the first row after the header line, if any.
7975 Don't consider the header-line row as "partially visible", even if
7976 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7977
7978 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7979
7980 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7981 (bug#11238).
7982
7983 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7984 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7985
7986 configure: new option --enable-gcc-warnings (Bug#11207)
7987 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7988 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7989 (ALL_CFLAGS): Use new macros rather than old.
7990 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7991 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7992 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7993 -Wunused-result, -Wunused-variable. This should go away once
7994 the Emacs and Gnulib regex code is merged.
7995 (xmalloc, xrealloc): Now static.
7996
7997 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7998
7999 * dired.c (Fsystem_groups): Remove unused local.
8000
8001 2012-04-17 Glenn Morris <rgm@gnu.org>
8002
8003 * dired.c (Fsystem_users): Doc fix.
8004
8005 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8006
8007 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8008 (syms_of_dired): Add them.
8009
8010 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8011
8012 Fix minor alloc.c problems found by static checking.
8013 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8014 New extern decls, to avoid calling undeclared functions.
8015 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8016 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8017 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8018 (NEED_MEM_INSERT): New macro.
8019 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8020 Remove one incorrect comment and fix another.
8021
8022 Fix minor ralloc.c problems found by static checking.
8023 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8024 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8025 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8026 (r_alloc_sbrk): Now static.
8027
8028 Improve ralloc.c interface checking.
8029 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8030 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8031 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8032 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8033 [REL_ALLOC]: ... to here, to check interface.
8034 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8035 Remove decls. This fixes an "It stinks!".
8036
8037 * alloc.c (which_symbols): Fix alignment issue / type clash.
8038
8039 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8040
8041 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8042 (struct Lisp_Misc_Any): Likewise.
8043 (struct Lisp_Free): Likewise.
8044 * alloc.c (union aligned_Lisp_Symbol): Define.
8045 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8046 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8047 (union aligned_Lisp_Misc): Define.
8048 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8049 aligned_Lisp_Misc instead of union Lisp_Misc.
8050 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8051
8052 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8053
8054 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8055 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8056 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8057 * s/netbsd.h, s/sol2-6.h:
8058 Remove definition of GC_MARK_STACK, since the default now works.
8059 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8060 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8061 no longer the default.
8062 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8063
8064 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8065
8066 * lread.c (lisp_file_lexically_bound_p):
8067 Fix hang at ";-*-\n" (bug#11238).
8068
8069 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8070
8071 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8072 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8073
8074 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8075
8076 * nsterm.m (constrainFrameRect): Always constrain when there is only
8077 one screen (Bug#10962).
8078
8079 2012-04-13 Ken Brown <kbrown@cornell.edu>
8080
8081 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8082
8083 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8084
8085 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8086
8087 2012-04-11 Daniel Colascione <dancol@dancol.org>
8088
8089 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8090 against is gone. It's better to use vfork now so that when Cygwin
8091 gains a new, working vfork, we use it automatically (bug#10398).
8092
8093 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8094
8095 * window.c (save_window_save): Obey window-point-insertion-type.
8096
8097 2012-04-11 Glenn Morris <rgm@gnu.org>
8098
8099 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8100
8101 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8102
8103 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8104
8105 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8106
8107 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8108 (force_quit_count): New var.
8109 (handle_interrupt): Use it.
8110
8111 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8112
8113 * w32.c (w32_delayed_load): Record the full path of the library
8114 being loaded (bug#10424).
8115
8116 2012-04-09 Glenn Morris <rgm@gnu.org>
8117
8118 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8119 not just in the obarray, before snarfing them. (Bug#11036)
8120
8121 * Makefile.in ($(leimdir)/leim-list.el):
8122 Pass EMACS rather than BUILT_EMACS.
8123
8124 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8125
8126 * process.c (make_process):
8127 * process.h: Add integer `gnutls_handshakes_tried' member to
8128 process struct.
8129
8130 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8131 Add convenience `GNUTLS_LOG2i' macro.
8132
8133 * gnutls.c (gnutls_log_function2i): Convenience log function.
8134 (emacs_gnutls_read): Use new log functions,
8135 `gnutls_handshakes_tried' process member, and
8136 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8137 attempts per process (connection).
8138
8139 2012-04-09 Chong Yidong <cyd@gnu.org>
8140
8141 * eval.c (Fuser_variable_p, user_variable_p_eh)
8142 (lisp_indirect_variable): Functions deleted.
8143 (Fdefvar): Caller changed.
8144
8145 * callint.c (Finteractive, Fcall_interactively):
8146 * minibuf.c (Fread_variable): Callers changed.
8147
8148 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8149
8150 * xdisp.c (set_cursor_from_row): If the display string appears in
8151 the buffer at position that is closer to point than the position
8152 after the display string, display the cursor on the first glyph of
8153 the display string. Fixes cursor display when a 'display' text
8154 property immediately follows invisible text. (Bug#11094)
8155
8156 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8157
8158 composite.c: use 'double' consistently
8159 * composite.c (get_composition_id): Use 'double' consistently
8160 instead of converting 'float' to 'double' and vice versa; this is
8161 easier to understand and avoids a GCC warning.
8162
8163 2012-04-09 Glenn Morris <rgm@gnu.org>
8164
8165 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8166 preparation for dumping it with emacs. (Bug#4789)
8167 (leimdir): New variable.
8168 ($(leimdir)/leim-list.el): New rule.
8169 (emacs$(EXEEXT)): Depend on leim-list.el.
8170
8171 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8172 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8173 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8174
8175 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8176
8177 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8178 proper alignment.
8179
8180 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8181
8182 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8183 Remove unused local variable.
8184
8185 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8186
8187 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8188 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8189 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8190 objects, as mark_maybe_pointer will catch them otherwise.
8191 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8192 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8193
8194 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8195
8196 Fix typo that broke non-Windows builds.
8197 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8198
8199 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8200
8201 Support building on MS-Windows with libxml2.
8202
8203 * makefile.w32-in (OBJ2): Add xml.$(O).
8204 (GLOBAL_SOURCES): Add xml.c.
8205 ($(BLD)/xml.$(O)): New dependency list.
8206
8207 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8208 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8209 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8210 [!WINDOWSNT]: New macros.
8211 (init_libxml2_functions, libxml2_loaded_p): New functions.
8212 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8213 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8214 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8215 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8216 linked in).
8217 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8218 Call init_libxml2_functions before calling libxml2 functions.
8219 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8220
8221 * emacs.c: Don't include libxml/parser.h.
8222 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8223 xmlCleanupParser directly.
8224
8225 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8226
8227 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8228
8229 * indent.c (Fvertical_motion): If there is a display string at
8230 point, use it.vpos to compute how many lines to backtrack after
8231 move_it_to point. (Bug#11133)
8232
8233 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8234
8235 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8236 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8237 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8238 macros related to unification of CJK characters. For the details,
8239 see the discussion following the message here:
8240 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8241
8242 2012-04-04 Chong Yidong <cyd@gnu.org>
8243
8244 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8245
8246 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8247
8248 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8249 instead of alloca. (Bug#11138)
8250
8251 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8252
8253 * w32menu.c (is_simple_dialog): Properly check lisp types.
8254 (Bug#11141)
8255
8256 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8257
8258 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8259 position we get to after a call to move_it_to fails the
8260 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8261 only if we wind up in a string from display property. (Bug#11063)
8262
8263 * window.c (Fdelete_other_windows_internal): Invalidate the row
8264 and column information about mouse highlight, so that redisplay
8265 restores it after reallocating the glyph matrices. (Bug#7464)
8266
8267 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8268 string comes from a `display' text property, use the buffer
8269 position of that property as if we actually saw that position in
8270 the row's glyphs.
8271 (move_it_by_lines): Remove the assertion that
8272 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8273 violated when there's a before-string at the beginning of a line.
8274 (Bug#11063)
8275
8276 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8277
8278 * xdisp.c (append_space_for_newline): If the default face was
8279 remapped, use the remapped face for the appended newline.
8280 (extend_face_to_end_of_line): Use the remapped default face for
8281 extending the face to the end of the line.
8282 (display_line): Call extend_face_to_end_of_line when the default
8283 face was remapped. (Bug#11068)
8284
8285 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8286
8287 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8288
8289 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8290
8291 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8292
8293 2012-03-27 Glenn Morris <rgm@gnu.org>
8294
8295 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8296 Doc fixes.
8297
8298 2012-03-26 Kenichi Handa <handa@m17n.org>
8299
8300 * dispextern.h (struct glyph): Fix previous change. Change the
8301 bit length of glyphless.ch to 25 (Bug#11082).
8302
8303 2012-03-26 Chong Yidong <cyd@gnu.org>
8304
8305 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8306 (command_loop_1): Use it; inhibit selection update for
8307 handle-select-window too (Bug#8996).
8308
8309 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8310
8311 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8312
8313 2012-03-25 Kenichi Handa <handa@m17n.org>
8314
8315 * dispextern.h (struct glyph): Change the bit length of
8316 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8317
8318 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8319
8320 * s/ms-w32.h (tzname): Include time.h before redirecting to
8321 _tzname. Fixes the MSVC build. (Bug#9960)
8322
8323 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8324
8325 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8326 characters.
8327
8328 * xterm.c (XTread_socket): Only modify handling_signal if
8329 !SYNC_INPUT. (Bug#11080)
8330
8331 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8332
8333 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8334 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8335 when fetching a multibyte character consumes more bytes than
8336 CHAR_BYTES returns, due to unification of CJK characters in
8337 string_char. (Bug#11073)
8338
8339 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8340
8341 * process.c (wait_reading_process_output): Handle pty disconnect
8342 by refraining from sending oneself a SIGCHLD (bug#10933).
8343
8344 2012-03-22 Chong Yidong <cyd@gnu.org>
8345
8346 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8347
8348 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8349 Mark string as coming from a prefix property.
8350 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8351 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8352
8353 2012-03-21 Chong Yidong <cyd@gnu.org>
8354
8355 * xfaces.c (Vface_remapping_alist): Doc fix.
8356
8357 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8358
8359 * w32proc.c (Fw32_set_console_codepage)
8360 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8361 Doc fixes.
8362
8363 2012-03-20 Chong Yidong <cyd@gnu.org>
8364
8365 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8366 to reflect default non-nil value of redisplay-dont-pause.
8367
8368 2012-03-19 Kenichi Handa <handa@m17n.org>
8369
8370 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8371 it fit in a valid range (Bug#11003).
8372
8373 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8374
8375 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8376 that is not from display property, accept the row as a "cursor
8377 row" if one of the string's character has a non-nil `cursor'
8378 property. Fixes cursor positioning when there are newlines in
8379 overlay strings, e.g. in icomplete.el. (Bug#11035)
8380
8381 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8382
8383 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8384
8385 2012-03-12 Chong Yidong <cyd@gnu.org>
8386
8387 * eval.c (inhibit_lisp_code): Rename from
8388 inhibit_window_configuration_change_hook; move from window.c.
8389
8390 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8391 * window.c (run_window_configuration_change_hook)
8392 (syms_of_window): Callers changed.
8393
8394 2012-03-11 Chong Yidong <cyd@gnu.org>
8395
8396 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8397
8398 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8399
8400 2012-03-10 Chong Yidong <cyd@gnu.org>
8401
8402 * frame.c (other_visible_frames): Don't assume the selected frame
8403 is visible (Bug#10955).
8404
8405 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8406
8407 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8408
8409 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8410
8411 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8412 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8413 zero (Bug#10954).
8414
8415 2012-03-03 Glenn Morris <rgm@gnu.org>
8416
8417 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8418
8419 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8420
8421 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8422 position past the first glyph_row that ends at ZV. (Bug#10902)
8423 (redisplay_window, next_element_from_string): Fix typos in
8424 comments.
8425 (redisplay_window): Pass to move_it_vertically the margin in
8426 pixels, not in screen lines.
8427
8428 2012-03-02 Glenn Morris <rgm@gnu.org>
8429
8430 * buffer.c (buffer-list-update-hook): Doc fix.
8431
8432 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8433
8434 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8435 push_it before setting up the iterator for the first overlay
8436 string, even if we have an empty string loaded.
8437 (next_overlay_string): If there's an empty string on the iterator
8438 stack, pop the stack. (Bug#10903)
8439
8440 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8441
8442 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8443 Suggested by Stefan Monnier in
8444 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8445 * alloc.c (widen_to_Lisp_Object): New static function.
8446 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8447 and widening them to Lisp_Objects. This would work even if
8448 USE_LSB_TAG is defined and wide integers are used, which might
8449 happen in a future version of Emacs.
8450
8451 2012-02-25 Chong Yidong <cyd@gnu.org>
8452
8453 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8454 Doc fix.
8455
8456 * xselect.c (Fx_selection_exists_p): Doc fix.
8457 (x_clipboard_manager_save_all): Print an informative message
8458 before saving to clipboard manager.
8459
8460 2012-02-24 Chong Yidong <cyd@gnu.org>
8461
8462 * keyboard.c (process_special_events): Handle all X selection
8463 requests in kbd_buffer, not just the next one (Bug#8869).
8464
8465 2012-02-23 Chong Yidong <cyd@gnu.org>
8466
8467 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8468 call when setting menu-bar-lines and tool-bar-lines parameters.
8469 (unwind_create_frame_1): New helper function.
8470
8471 * window.c (inhibit_window_configuration_change_hook): New var.
8472 (run_window_configuration_change_hook): Obey it.
8473 (syms_of_window): Initialize it.
8474
8475 2012-02-22 Chong Yidong <cyd@gnu.org>
8476
8477 * xterm.c (x_draw_image_relief): Add missing type check for
8478 Vtool_bar_button_margin (Bug#10743).
8479
8480 2012-02-21 Chong Yidong <cyd@gnu.org>
8481
8482 * fileio.c (Vfile_name_handler_alist): Doc fix.
8483
8484 * buffer.c (Fget_file_buffer): Protect against invalid file
8485 handler return value.
8486
8487 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8488
8489 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8490 when computing $valmask.
8491
8492 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8493 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8494 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8495 It's useless in that case, and it can cause problems on hosts
8496 that allocate halves of EMACS_INT values separately.
8497 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8498 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8499 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8500 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8501 it avoids undefined behavior on hosts where shifting right by more
8502 than the word width has undefined behavior.
8503
8504 2012-02-19 Chong Yidong <cyd@gnu.org>
8505
8506 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8507 (Funhandled_file_name_directory, Ffile_name_as_directory)
8508 (Fdirectory_file_name, Fexpand_file_name)
8509 (Fsubstitute_in_file_name): Protect against invalid file handler
8510 return values (Bug#10845).
8511
8512 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8513
8514 * .gdbinit (pitx): Fix incorrect references to fields of the
8515 iterator stack.
8516
8517 2012-02-17 Chong Yidong <cyd@gnu.org>
8518
8519 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8520
8521 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8522
8523 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8524 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8525
8526 2012-02-15 Chong Yidong <cyd@gnu.org>
8527
8528 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8529 marked as special. Also, starting docstrings with * is obsolete.
8530
8531 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8532
8533 * gnutls.c (emacs_gnutls_write): Fix last change.
8534
8535 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8536
8537 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8538 send_process.
8539
8540 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8541
8542 * keymap.c (Fsingle_key_description): Handle char ranges.
8543
8544 2012-02-12 Chong Yidong <cyd@gnu.org>
8545
8546 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8547 as that creates a dangerous corner case.
8548
8549 * window.c (Fdelete_window_internal): Invalidate the mouse
8550 highlight (Bug#9904).
8551
8552 2012-02-12 Glenn Morris <rgm@gnu.org>
8553
8554 * xselect.c (Fx_own_selection_internal)
8555 (Fx_get_selection_internal, Fx_disown_selection_internal)
8556 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8557 * nsselect.m (Fx_own_selection_internal)
8558 (Fx_disown_selection_internal, Fx_selection_exists_p)
8559 (Fx_selection_owner_p, Fx_get_selection_internal):
8560 Sync docs and argument specs with the xselect.c versions.
8561
8562 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8563
8564 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8565
8566 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8567
8568 * w32select.c (Fx_selection_exists_p): Sync doc string and
8569 argument list with xselect.c. (Bug#10783)
8570
8571 * w16select.c (Fx_selection_exists_p): Sync doc string and
8572 argument list with xselect.c. (Bug#10783)
8573
8574 2012-02-10 Glenn Morris <rgm@gnu.org>
8575
8576 * fns.c (Fsecure_hash): Doc fix.
8577
8578 2012-02-09 Kenichi Handa <handa@m17n.org>
8579
8580 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8581
8582 2012-02-07 Chong Yidong <cyd@gnu.org>
8583
8584 * buffer.c (Fbuffer_local_variables)
8585 (buffer_lisp_local_variables): Handle unbound vars correctly;
8586 don't let Qunbound leak into Lisp.
8587
8588 2012-02-07 Glenn Morris <rgm@gnu.org>
8589
8590 * image.c (Fimagemagick_types): Doc fix.
8591
8592 * image.c (imagemagick-render-type): Change it from a lisp object
8593 to an integer. Move the doc here from the lisp manual.
8594 Treat all values not equal to 0 the same.
8595
8596 2012-02-06 Chong Yidong <cyd@gnu.org>
8597
8598 * doc.c (store_function_docstring): Avoid applying docstring of
8599 alias to base function (Bug#2603).
8600
8601 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8602
8603 * .gdbinit (pp1, pv1): Remove redundant defines.
8604 (pr): Use pp.
8605
8606 2012-02-04 Chong Yidong <cyd@gnu.org>
8607
8608 * nsterm.m: Declare a global (Bug#10694).
8609
8610 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8611
8612 * w32.c (get_emacs_configuration_options):
8613 Include --enable-checking, if specified, in the return value.
8614
8615 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8616
8617 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8618 after rounding frame sizes. (Bug#9723)
8619
8620 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8621
8622 * keyboard.c (adjust_point_for_property): Don't position point
8623 before BEGV. (Bug#10696)
8624
8625 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8626
8627 Handle overflow when computing char display width (Bug#9496).
8628 * character.c (char_width): Return EMACS_INT, not int.
8629 (char_width, c_string_width): Check for overflow when
8630 computing the width; this is possible now that individual
8631 characters can have unbounded width. Problem introduced
8632 by merge from Emacs 23 on 2012-01-19.
8633
8634 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8635
8636 * dbusbind.c (Fdbus_register_method): Mention the return value
8637 :ignore in the docstring.
8638
8639 2012-02-02 Glenn Morris <rgm@gnu.org>
8640
8641 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8642
8643 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8644 Unconditionally set to t. (Bug#10673)
8645 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8646 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8647 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8648
8649 2012-02-02 Kenichi Handa <handa@m17n.org>
8650
8651 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8652 0, do not call append_composite_glyph.
8653
8654 2012-02-02 Kenichi Handa <handa@m17n.org>
8655
8656 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8657 NULL (Bug#6988).
8658 (x_produce_glyphs): If the component of a composition is a null
8659 string, set it->pixel_width to 1 to avoid zero-width glyph.
8660
8661 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8662
8663 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8664 first 2 arguments are identical. This makes inserting large
8665 output from a subprocess an order of magnitude faster on
8666 MS-Windows, where all sbrk'ed memory is always contiguous.
8667
8668 2012-01-31 Glenn Morris <rgm@gnu.org>
8669
8670 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8671 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8672 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8673
8674 2012-01-29 Glenn Morris <rgm@gnu.org>
8675
8676 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8677
8678 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8679
8680 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8681
8682 2012-01-28 Chong Yidong <cyd@gnu.org>
8683
8684 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8685
8686 2012-01-26 Chong Yidong <cyd@gnu.org>
8687
8688 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8689
8690 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8691 repeat counts (Bug#10507).
8692
8693 2012-01-26 Glenn Morris <rgm@gnu.org>
8694
8695 * lread.c (syms_of_lread): Doc fix.
8696
8697 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8698
8699 * coding.c (encode_designation_at_bol): Change return value to
8700 EMACS_INT.
8701
8702 2012-01-25 Chong Yidong <cyd@gnu.org>
8703
8704 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8705
8706 2012-01-21 Chong Yidong <cyd@gnu.org>
8707
8708 * floatfns.c (Fcopysign): Make the second argument non-optional,
8709 since nil is not allowed anyway.
8710
8711 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8712
8713 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8714 (send_process): Likewise.
8715
8716 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8717
8718 * window.c (save_window_save, Fcurrent_window_configuration)
8719 (Vwindow_persistent_parameters): Do not use Qstate.
8720 Rewrite doc-strings.
8721
8722 2012-01-19 Kenichi Handa <handa@m17n.org>
8723
8724 * character.c (char_width): New function.
8725 (Fchar_width, c_string_width, lisp_string_width):
8726 Use char_width (Bug#9496).
8727
8728 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8729
8730 * window.c (Vwindow_persistent_parameters): New variable.
8731 (Fset_window_configuration, save_window_save): Handle persistent
8732 window parameters.
8733
8734 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8735
8736 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8737 thrashing the stack of the thread. (Bug#9087)
8738
8739 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8740
8741 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8742
8743 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8744
8745 * xdisp.c (rows_from_pos_range): Handle the case where the
8746 highlight ends on a newline. (Bug#10464)
8747 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8748 he end column for display of highlight that ends on a newline
8749 before a R2L line.
8750
8751 2012-01-11 Glenn Morris <rgm@gnu.org>
8752
8753 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8754 from load-path also when installation-directory is nil. (Bug#10208)
8755
8756 2012-01-10 Glenn Morris <rgm@gnu.org>
8757
8758 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8759
8760 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8761 Update template values to be closer to their typical values these days.
8762
8763 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8764
8765 * xdisp.c (rows_from_pos_range): Accept additional argument
8766 DISP_STRING, and accept any glyph in a row whose object is that
8767 string as eligible for mouse highlight. Fixes mouse highlight of
8768 display strings from overlays. (Bug#10464)
8769
8770 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8771
8772 emacs: fix an auto-save permissions race condition (Bug#10400)
8773 * fileio.c (auto_saving_dir_umask): New static var.
8774 (Fmake_directory_internal): Use it.
8775 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8776 creating the directory. The old code temporarily assigns
8777 too-generous permissions to the directory.
8778 (do_auto_save_eh): Clear it.
8779 (Fdo_auto_save): Catch all errors, not just file errors, so
8780 that the var is always cleared.
8781
8782 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8783
8784 * search.c (scan_buffer): Pass character positions to
8785 know_region_cache, not byte positions. (Bug#6540)
8786
8787 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8788
8789 * w32.c (sys_rename): Report EXDEV when rename of a directory
8790 fails because the target is on another logical disk. (Bug#10284)
8791
8792 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8793
8794 * xterm.c (x_embed_request_focus): New function.
8795
8796 * xterm.h: Add prototype.
8797
8798 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8799
8800 2012-01-05 Glenn Morris <rgm@gnu.org>
8801
8802 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8803
8804 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8805
8806 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8807 Load gnutls_transport_set_lowat only if GnuTLS version is below
8808 2.11.1.
8809 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8810 GnuTLS versions below 2.11.1.
8811
8812 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8813
8814 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8815 to the doc string advising against its use for altering the way
8816 windows are scrolled.
8817
8818 2011-12-28 Kenichi Handa <handa@m17n.org>
8819
8820 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8821 coding-system ASCII compatible only when it does not produce BOM
8822 on encoding (Bug#10383).
8823
8824 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8825
8826 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8827 can scroll.
8828 (create_and_show_popup_menu): Always use menu_position_func for
8829 Gtk3 (Bug#10361).
8830
8831 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8832
8833 * callint.c (Fcall_interactively): Don't truncate prompt string.
8834
8835 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8836
8837 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8838 property that ends at ZV, so that the bidi iteration could be
8839 resumed from there (after widening). (Bug#10360)
8840
8841 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8842
8843 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8844
8845 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8846
8847 * nsterm.m (x_free_frame_resources):
8848 Release f->output_data.ns->miniimage.
8849 (ns_index_color): Fix indentation. Do not retain
8850 color_table->colors[i].
8851
8852 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8853 before returning.
8854
8855 * nsfns.m (x_set_background_color): Assign return value from
8856 ns_index_color to face-background instead of NSColor*.
8857 (ns_implicitly_set_icon_type): Fix indentation.
8858 Change assignment in for loop to comparison.
8859
8860 * emacs.c (ns_pool): New variable.
8861 (main): Assign ns_pool.
8862 (Fkill_emacs): Call ns_release_autorelease_pool.
8863
8864 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8865 autorelease fdesc, release fdAttrs and tdict.
8866 (ns_get_covering_families): Release charset.
8867 (ns_findfonts): Release NSFontDescriptor created with new.
8868 (ns_uni_to_glyphs): Fix indentation.
8869 (setString): Release attrStr before assigning new value.
8870
8871 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8872
8873 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8874 and NS_IMPL_COCOA.
8875 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8876 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8877
8878 2011-12-18 David Reitter <reitter@cmu.edu>
8879
8880 * nsterm.m (ns_term_init): Subscribe for notifications
8881 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8882 to method trackingNotification in EmacsMenu.
8883
8884 * nsmenu.m (trackingMenu): New variable.
8885 (trackingNotification): New method (from Aquamacs).
8886 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8887 from Aquamacs (Bug#7030).
8888
8889 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8890
8891 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8892 (symbol_to_nsstring): Fix indentation.
8893 (ns_symbol_to_pb): New function.
8894 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8895 (Fns_rotate_cut_buffers_internal): Remove.
8896 (Fns_store_selection_internal): Rename from
8897 Fns_store_cut_buffer_internal.
8898 (ns_get_foreign_selection, Fx_own_selection_internal)
8899 (Fx_disown_selection_internal, Fx_selection_exists_p)
8900 (Fns_get_selection_internal, Fns_store_selection_internal):
8901 Use ns_symbol_to_pb and check if return value is nil.
8902 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8903 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8904 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8905 renamed to Sns_store_selection_internal.
8906 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8907 and remove this function.
8908 (ns_handle_selection_clear): Remove, never used.
8909 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8910 here.
8911
8912 2011-12-17 Ken Brown <kbrown@cornell.edu>
8913
8914 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8915 GID is unknown (Bug#10257).
8916
8917 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8918
8919 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8920 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8921 which caused a build failure on GNU/Linux IA-64. This problem was
8922 introduced by my 2011-10-07 patch.
8923
8924 2011-12-15 Juri Linkov <juri@jurta.org>
8925
8926 * image.c (imagemagick_error): New function. (Bug#10112)
8927 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8928 Use `imagemagick_error' where ImageMagick functions return
8929 `MagickFalse'.
8930 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8931 proper order.
8932
8933 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8934
8935 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8936 fill background (Bug#8992).
8937
8938 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8939
8940 * window.c (Vwindow_combination_resize)
8941 (Vwindow_combination_limit): Use t instead of non-nil in
8942 doc-strings.
8943 (Vrecenter_redisplay): Add first sentence of doc-string on
8944 separate line.
8945 (Frecenter): Fix doc-string typo.
8946
8947 2011-12-11 Kenichi Handa <handa@m17n.org>
8948
8949 * coding.c (Funencodable_char_position): Pay attention to the
8950 buffer text relocation (Bug#9389).
8951
8952 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8953
8954 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8955 gtk_init (Bug#10100).
8956
8957 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8958
8959 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8960 IT->string is nil. (Bug#10263)
8961
8962 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8963
8964 * nsterm.h (x_free_frame_resources): Declare.
8965
8966 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8967 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8968
8969 * nsterm.h (ns_get_defaults_value): Declare.
8970
8971 * nsterm.m (ns_default): Call ns_get_defaults_value.
8972
8973 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8974
8975 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8976 (Bug#10170)
8977
8978 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8979
8980 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8981 that where the value of an _OBJC_* symbol points to is in the .bss
8982 section (Bug#10240).
8983
8984 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8985
8986 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8987 after the loop to call ccl_driver at least once (Bug#8619).
8988
8989 2011-12-08 Kenichi Handa <handa@m17n.org>
8990
8991 * ftfont.c (get_adstyle_property): Fix previous change
8992 (Bug#10233).
8993
8994 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8995
8996 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8997 dirs from the default value of EMACSLOADPATH (bug#10208).
8998
8999 2011-12-07 Glenn Morris <rgm@gnu.org>
9000
9001 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9002 installation and source directories as well. (Bug#10208)
9003
9004 2011-12-06 Chong Yidong <cyd@gnu.org>
9005
9006 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9007
9008 2011-12-06 Glenn Morris <rgm@gnu.org>
9009
9010 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9011 as an error, not just -1. (Bug#10217)
9012
9013 2011-12-05 Chong Yidong <cyd@gnu.org>
9014
9015 * keyboard.c (process_special_events): New function.
9016 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9017
9018 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9019
9020 * coding.c (encode_designation_at_bol): Don't use uninitialized
9021 local variable (Bug#9318).
9022
9023 2011-12-05 Kenichi Handa <handa@m17n.org>
9024
9025 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9026 return Qnil (Bug#8046, Bug#10193).
9027
9028 2011-12-05 Kenichi Handa <handa@m17n.org>
9029
9030 * coding.c (encode_designation_at_bol): New args charbuf_end and
9031 dst. Return the number of produced bytes. Callers changed.
9032 (coding_set_source): Return how many bytes coding->source was
9033 relocated.
9034 (coding_set_destination): Return how many bytes
9035 coding->destination was relocated.
9036 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9037 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9038
9039 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9040
9041 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9042 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9043 macro (Bug#9318).
9044
9045 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9046
9047 The following changes are to fix Bug#9318.
9048
9049 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9050 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9051 (encode_coding_iso_2022, encode_coding_sjis)
9052 (encode_coding_big5, encode_coding_charset): Use the above macros.
9053
9054 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9055
9056 * lisp.h (process_quit_flag): Fix external declaration.
9057
9058 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9059
9060 Don't macro-inline non-performance-critical code.
9061 * eval.c (process_quit_flag): New function.
9062 * lisp.h (QUIT): Use it.
9063
9064 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9065
9066 * nsfns.m (get_geometry_from_preferences): New function.
9067 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9068
9069 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9070
9071 * emacs.c (Qkill_emacs): Define.
9072 (syms_of_emacs): Initialize it.
9073 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9074 Qquit_flag to `kill-emacs' instead.
9075 (quit_throw_to_read_char): Add parameter `from_signal'.
9076 All callers changed. Call Fkill_emacs if requested and safe.
9077 * lisp.h (QUIT): Call Fkill_emacs if requested.
9078
9079 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9080
9081 * widget.c (update_wm_hints): Return if wmshell is null.
9082 (widget_update_wm_size_hints): New function.
9083
9084 * widget.h (widget_update_wm_size_hints): Declare.
9085
9086 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9087 widget_update_wm_size_hints (Bug#10104).
9088
9089 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9090
9091 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9092 before a newline, prepare the bidi iterator for consuming the
9093 newline, and keep the current paragraph direction. (Bug#10183)
9094 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9095
9096 2011-12-02 Juri Linkov <juri@jurta.org>
9097
9098 * search.c (Fword_search_regexp): New Lisp function created from
9099 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9100 (Fword_search_backward, Fword_search_forward)
9101 (Fword_search_backward_lax, Fword_search_forward_lax):
9102 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9103 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9104
9105 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9106
9107 * fileio.c (Finsert_file_contents): Move after-change-function call
9108 to before the "handled:" label, since all "goto handled" appear in
9109 cases where the *-change-functions have already been properly called
9110 (bug#10117).
9111
9112 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9113
9114 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9115 waiting for input. (Bug#10169)
9116
9117 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9118
9119 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9120 verifies glyph row's hash code--we have just reallocated the
9121 glyphs, so their contents can be complete garbage. (Bug#10164)
9122
9123 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9124
9125 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9126
9127 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9128
9129 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9130 attributes are tested _before_ calling verify_row_hash, to protect
9131 against GCC re-ordering of the tests. (Bug#10164)
9132
9133 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9134
9135 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9136
9137 * xterm.c (handle_one_xevent): Only set async_visible and friends
9138 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9139 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9140 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9141
9142 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9143
9144 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9145 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9146 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9147 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9148 All uses changed to use GCPRO1 etc.
9149 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9150 Revert to old implementation (i.e., before 2011-03-11).
9151
9152 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9153
9154 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9155 of scroll runs so as to avoid assigning disabled bogus rows and
9156 unnecessary graphics copy operations.
9157
9158 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9159
9160 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9161 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9162 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9163 (malloc, free, realloc, calloc): Redirect to e_* only when
9164 compiling Emacs.
9165
9166 * lisp.h (GCTYPEBITS): Move before first use.
9167 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9168 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9169 this macro definition.
9170
9171 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9172 _MSC_VER.
9173
9174 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9175
9176 * gtkutil.c (xg_create_frame_widgets):
9177 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9178 present with Gtk+ 2.0.
9179
9180 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9181
9182 * fileio.c (Finsert_file_contents): Undo previous change; see
9183 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9184
9185 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9186
9187 Rename locals to avoid shadowing.
9188 * fileio.c (Finsert_file_contents):
9189 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9190 * process.c (wait_reading_process_output):
9191 Rename inner 'proc' to 'p' to avoid shadowing.
9192 Indent for consistency with usual Emacs style.
9193
9194 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9195
9196 * xdisp.c (redisplay_window): If cursor row is not fully visible
9197 after recentering, and scroll-conservatively is set to a large
9198 number, scroll window by a few more lines to make the cursor fully
9199 visible and out of scroll-margin. (Bug#10105)
9200 (start_display): Don't move to the next line if the display should
9201 start at a newline that is part of a display vector or an overlay
9202 string. (Bug#10119)
9203
9204 2011-11-24 Juri Linkov <juri@jurta.org>
9205
9206 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9207 after the `MagickPingImage' call. (Bug#10112)
9208
9209 2011-11-23 Chong Yidong <cyd@gnu.org>
9210
9211 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9212
9213 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9214
9215 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9216 making another buffer current. (Bug#10114)
9217
9218 2011-11-23 Glenn Morris <rgm@gnu.org>
9219
9220 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9221
9222 2011-11-23 Chong Yidong <cyd@gnu.org>
9223
9224 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9225 using it (Bug#5984).
9226
9227 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9228
9229 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9230 and header-lines, as they don't have one computed for them.
9231 (Bug#10098)
9232
9233 * .gdbinit (prow): Make displayed values more self-explaining.
9234 Add row's hash code.
9235
9236 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9237
9238 * process.c (wait_reading_process_output): Fix asynchrounous
9239 GnuTLS socket handling on some versions of the GnuTLS library.
9240 (wait_reading_process_output): Add comment and URL.
9241
9242 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9243
9244 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9245
9246 2011-11-21 Chong Yidong <cyd@gnu.org>
9247
9248 * window.c (Fnext_window, Fprevious_window): Doc fix.
9249
9250 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9251
9252 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9253
9254 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9255
9256 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9257
9258 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9259
9260 * window.c (Fset_window_combination_limit): Rename argument
9261 STATUS to LIMIT.
9262 (Vwindow_combination_limit): Remove "status" from doc-string.
9263
9264 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9265
9266 * m/ibms390.h: Remove.
9267 * m/ibms390x.h: Don't include "ibms390.h".
9268
9269 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9270
9271 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9272 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9273
9274 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9275
9276 * casetab.c (Fset_case_table):
9277 * charset.c (Fcharset_after): Fix typos.
9278
9279 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9280
9281 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9282 Otherwise, valgrind does not work on some platforms.
9283 Problem reported by Andreas Schwab in
9284 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9285 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9286 is set, removing the need for VIRT_ADDRESS_VARIES.
9287 (PURE_P): Use a more-efficient implementation that needs just one
9288 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9289 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9290 to 4 (xorl, subq, cmpq, setbe).
9291 * alloc.c (pure): Always extern now, since that's the
9292 VIRT_ADDR_VARIES behavior.
9293 (PURE_POINTER_P): Use a single comparison, not two, for
9294 consistency with the new puresize.h.
9295 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9296 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9297 Remove VIRT_ADDR_VARIES no longer needed.
9298
9299 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9300
9301 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9302 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9303 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9304 behave as if the cursor position were at the window margin.
9305
9306 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9307 and the cursor position is out of bounds, behave as if the cursor
9308 position were at the window margin. (Bug#10075)
9309
9310 2011-11-18 Chong Yidong <cyd@gnu.org>
9311
9312 * window.c (Fwindow_combination_limit): Make first argument
9313 non-optional, since it is meaningless for live windows like the
9314 selected window.
9315
9316 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9317
9318 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9319
9320 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9321
9322 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9323 (graft_intervals_into_buffer): Simplify.
9324
9325 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9326
9327 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9328 hash values of the two rows.
9329 (copy_row_except_pointers): Preserve the used[] arrays and the
9330 hash values of the two rows. (Bug#10035)
9331 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9332
9333 * xdisp.c (row_hash): New function, body extracted from
9334 compute_line_metrics.
9335 (compute_line_metrics): Call row_hash, instead of computing the
9336 hash code inline.
9337
9338 * dispnew.c (verify_row_hash): Call row_hash for computing the
9339 hash code of a row, instead of duplicating code from xdisp.c.
9340
9341 * dispextern.h (row_hash): Add prototype.
9342
9343 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9344
9345 * frame.c (delete_frame): Don't delete the terminal when the last
9346 X frame is closed if emacs is built with GTK toolkit.
9347
9348 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9349
9350 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9351
9352 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9353
9354 * window.c (Vwindow_splits): Rename to
9355 Vwindow_combination_resize. Suggested by Juri Linkov.
9356 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9357 of Vwindow_splits.
9358
9359 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9360
9361 * nsfns.m (Fns_font_name):
9362 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9363
9364 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9365
9366 * window.h (window): Rename slot "nest" to "combination_limit".
9367 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9368 (Fset_window_nest): Rename to Fset_window_combination_limit.
9369 (Vwindow_nest): Rename to Vwindow_combination_limit.
9370 (recombine_windows, make_parent_window, make_window)
9371 (Fsplit_window_internal, saved_window)
9372 (Fset_window_configuration, save_window_save): Rename all
9373 occurrences of window_nest to window_combination_limit.
9374
9375 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9376
9377 * image.c (imagemagick_load_image): Fix typo.
9378
9379 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9380
9381 * xdisp.c (display_line): Move the call to
9382 highlight_trailing_whitespace before the call to
9383 compute_line_metrics, since the latter needs to see the final
9384 faces of all the glyphs to compute ROW's hash value.
9385 Fixes assertion violations in row_equal_p. (Bug#10035)
9386
9387 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9388
9389 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9390 just return (bug#10044).
9391
9392 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9393
9394 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9395 with user-defined heap size. Bump the default size of the temacs
9396 heap to 27MB, to avoid memory warning when running temacs.
9397 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9398
9399 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9400 current_matrix and desired_matrix. (Bug#9990)
9401 (verify_row_hash) [XASSERTS]: New function.
9402 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9403 that the hash value of glyph rows is correct.
9404
9405 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9406
9407 * window.h (window): Remove splits slot.
9408 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9409 (Fdelete_other_windows_internal, make_parent_window)
9410 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9411 (Fset_window_configuration, save_window_save): Don't deal with
9412 split status of windows.
9413 (saved_window): Remove splits slot.
9414 (Vwindow_splits): Rewrite doc-string.
9415
9416 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9417
9418 * xfns.c (unwind_create_frame):
9419 * nsfns.m (unwind_create_frame):
9420 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9421 Vframe_list (Bug#9999).
9422
9423 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9424
9425 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9426
9427 2011-11-11 Kenichi Handa <handa@m17n.org>
9428
9429 * callproc.c (Fcall_process): Set the member dst_multibyte of
9430 process_coding.
9431
9432 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9433
9434 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9435 avoid a crash (bug#9496).
9436
9437 2011-11-09 Chong Yidong <cyd@gnu.org>
9438
9439 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9440 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9441
9442 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9443
9444 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9445
9446 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9447
9448 Avoid some portability problems by eschewing 'extern inline' functions.
9449 The trivial performance wins aren't worth the portability hassles; see
9450 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9451 et seq.
9452 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9453 (window_box_width, window_box_left, window_box_left_offset)
9454 (window_box_right, window_box_right_offset): Undo previous change,
9455 by removing the "extern"s.
9456 * intervals.c (adjust_intervals_for_insertion)
9457 (adjust_intervals_for_deletion): Undo previous change,
9458 making these static again.
9459 (offset_intervals, temp_set_point_both, temp_set_point)
9460 (copy_intervals_to_string): No longer inline.
9461 * xdisp.c (window_text_bottom_y, window_box_width)
9462 (window_box_height, window_box_left_offset)
9463 (window_box_right_offset, window_box_left, window_box_right)
9464 (window_box): No longer inline.
9465
9466 2011-11-08 Chong Yidong <cyd@gnu.org>
9467
9468 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9469 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9470 Signal an error if not a live window.
9471 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9472 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9473
9474 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9475
9476 * lisp.h (syms_of_abbrev): Remove declaration.
9477 Reported by CHENG Gao <chenggao@royau.me>.
9478
9479 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9480
9481 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9482 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9483 of temacs in GUI mode.
9484
9485 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9486
9487 * window.h: Declare delete_all_child_windows instead of
9488 delete_all_subwindows.
9489 * window.c (Fwindow_nest, Fset_window_nest)
9490 (Fset_window_new_total, Fset_window_new_normal)
9491 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9492 (delete_all_subwindows): Rename to delete_all_child_windows.
9493 (Fdelete_other_windows_internal, Fset_window_configuration):
9494 Call delete_all_child_windows instead of delete_all_subwindows.
9495 * frame.c (delete_frame): Call delete_all_child_windows instead
9496 of delete_all_subwindows.
9497
9498 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9499
9500 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9501 This is also needed for porting to any host where GC_MARK_STACK is
9502 not GC_MAKE_GCPROS_NOOPS.
9503 (which_symbols): Use it.
9504
9505 2011-11-07 Kenichi Handa <handa@m17n.org>
9506
9507 * coding.c (coding_set_destination): Check coding->src_pos only
9508 when coding->src_object is a buffer (bug#9910).
9509
9510 * process.c (send_process): Set the member src_multibyte of coding
9511 to 0 (bug#9911) when sending a unibyte text.
9512
9513 * callproc.c (Fcall_process): Set the member src_multibyte of
9514 process_coding to 0 (bug#9912).
9515
9516 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9517
9518 * xmenu.c (cleanup_widget_value_tree): New function.
9519 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9520 calling free_menubar_widget_value_tree directly (Bug#9830).
9521
9522 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9523
9524 Fix some portability problems with 'inline'.
9525 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9526 (window_box_width, window_box_left, window_box_left_offset)
9527 (window_box_right, window_box_right_offset): Declare extern.
9528 Otherwise, these inline functions do not conform to C99 and
9529 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9530 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9531 * intervals.c (adjust_intervals_for_insertion)
9532 (adjust_intervals_for_deletion): Now extern, because otherwise the
9533 extern inline functions 'offset_intervals' couldn't refer to it.
9534 (static_offset_intervals): Remove.
9535 (offset_intervals): Rewrite using the old contents of
9536 static_offset_intervals. The old version didn't conform to C99
9537 because an extern inline function contained a reference to an
9538 identifier with static linkage.
9539
9540 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9541
9542 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9543 GC.
9544
9545 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9546
9547 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9548 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9549 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9550 return Qleft_to_right.
9551
9552 2011-11-06 Chong Yidong <cyd@gnu.org>
9553
9554 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9555 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9556 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9557 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9558 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9559 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9560 (Fwindow_vscroll): Doc fix.
9561 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9562 argument, since it makes no sense to pass a live window and for
9563 consistency with window-child.
9564
9565 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9566
9567 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9568 support MSVC.
9569
9570 2011-11-05 Jason Rumney <jasonr@gnu.org>
9571
9572 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9573 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9574 fonts (Bug#6029).
9575 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9576 bitwise arithmetic preventing use of unicode-sip and non-truetype
9577 opentype fonts.
9578
9579 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9580
9581 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9582 "emacs"-only part.
9583
9584 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9585 initialization code to keep similarity to xfns.c after changes
9586 from 2011-11-05.
9587
9588 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9589
9590 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9591 (unwind_create_frame): New function (Bug#9943).
9592 (Fx_create_frame): Restructure code to be more similar to the one in
9593 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9594 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9595 Move terminal->reference_count++ just before making the frame official
9596 (Bug#9943).
9597
9598 * nsterm.m (x_free_frame_resources): New function.
9599 (x_destroy_window): Move code to x_free_frame_resources.
9600
9601 * xfns.c (unwind_create_frame): Fix comment.
9602 (Fx_create_frame, x_create_tip_frame):
9603 Move terminal->reference_count++ just before making the frame
9604 official. Move initialization of image_cache_refcount and
9605 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9606
9607 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9608
9609 Support MSVC build with newer versions of Visual Studio.
9610 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9611 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9612 nt/gmake.defs.
9613
9614 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9615 which are not supported by MSVC.
9616 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9617 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9618 bitfields.
9619 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9620 types in bitfields.
9621 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9622
9623 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9624
9625 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9626
9627 Support MSVC build with newer versions of Visual Studio.
9628 * w32.c: Don't include w32api.h for MSVC.
9629 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9630
9631 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9632 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9633 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9634 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9635 e_* cousins.
9636 (alloca) [_MSC_VER]: Define to _alloca.
9637
9638 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9639
9640 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9641
9642 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9643
9644 * xdisp.c (note_mouse_highlight): If either of
9645 previous/next-single-property-change returns nil, treat that as
9646 the beginning or the end of the buffer. (Bug#9955)
9647
9648 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9649
9650 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9651 label is not null (Bug#9951).
9652 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9653 may be NULL.
9654
9655 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9656
9657 * window.c (Fwindow_body_size): Mention in the doc string that the
9658 return value is in frame's canonical units. (Bug#9949)
9659
9660 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9661
9662 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9663
9664 * w32fns.c (unwind_create_frame): If needed, free the glyph
9665 matrices of the partially constructed frame. (Bug#9943)
9666 * xfns.c (unwind_create_frame): Likewise.
9667
9668 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9669
9670 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9671 Don't stop backward scan on the continuation glyph, even though
9672 its CHARPOS is positive.
9673 (mouse_face_from_buffer_pos, note_mouse_highlight):
9674 Rename cover_string to disp_string.
9675
9676 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9677
9678 * window.c (temp_output_buffer_show): Don't use
9679 Vtemp_buffer_show_specifiers.
9680 (Vtemp_buffer_show_specifiers): Remove unused variable.
9681
9682 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9683
9684 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9685 past the beginning of the current glyph matrix.
9686
9687 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9688
9689 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9690 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9691 HAVE_GTK3 (Bug#9869).
9692
9693 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9694 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9695
9696 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9697
9698 * xterm.c: Declare x_handle_net_wm_state to return int.
9699 (handle_one_xevent): Check if we are iconified but don't have
9700 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9701 (get_current_wm_state): Return non-zero if not hidden,
9702 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9703 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9704 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9705 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9706
9707 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9708
9709 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9710 so that this new function doesn't get optimized away by a
9711 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9712
9713 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9714
9715 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9716
9717 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9718
9719 Fix the `xbytecode' command.
9720 * .gdbinit (xprintbytestr): New command.
9721 (xwhichsymbols): Rename from `which'; all callers changed.
9722 (xbytecode): Print the byte-code string as well.
9723
9724 2011-10-29 Kim Storm <storm@cua.dk>
9725
9726 * alloc.c (which_symbols): New function.
9727
9728 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9729
9730 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9731 line. (Bug#9903)
9732
9733 2011-10-29 Glenn Morris <rgm@gnu.org>
9734
9735 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9736 Not clear what it was for, and it causes various bugs. (Bug#9839)
9737
9738 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9739
9740 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9741 possible random value that matches one of those tested as
9742 condition to clear the mouse face.
9743
9744 2011-10-28 Chong Yidong <cyd@gnu.org>
9745
9746 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9747
9748 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9749
9750 * window.c (make_window): Initialize phys_cursor_on_p.
9751
9752 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9753
9754 * lisp.h (struct Lisp_Symbol): Update comments.
9755
9756 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9757
9758 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9759
9760 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9761
9762 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9763 <oslsachem@gmail.com> for helping to debug this.
9764
9765 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9766 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9767 (g_b_init_get_glyph_outline_w): New static variables.
9768 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9769 (GetGlyphOutlineW_Proc): New typedefs.
9770 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9771 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9772 New functions.
9773 (w32font_open_internal, compute_metrics):
9774 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9775 instead of calling the "wide" APIs directly.
9776
9777 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9778
9779 * w32.h (syms_of_w32font): Add prototype.
9780
9781 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9782
9783 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9784 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9785 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9786 (Fmove_to_window_line): Doc fix.
9787
9788 2011-10-27 Chong Yidong <cyd@gnu.org>
9789
9790 * process.c (make_process): Set gnutls_state to NULL.
9791
9792 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9793 non-NULL, regardless of GNUTLS_INITSTAGE.
9794 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9795 an error. Set process slots as soon as we allocate them.
9796
9797 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9798
9799 2011-10-27 Chong Yidong <cyd@gnu.org>
9800
9801 * gnutls.c (emacs_gnutls_deinit): New function.
9802 Deallocate credentials structures as well as calling gnutls_deinit.
9803 (Fgnutls_deinit, Fgnutls_boot): Use it.
9804
9805 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9806 (deactivate_process): Call emacs_gnutls_deinit.
9807
9808 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9809
9810 * image.c (x_create_x_image_and_pixmap):
9811 * w32.c (sys_rename, w32_delayed_load):
9812 * w32font.c (fill_in_logfont):
9813 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9814
9815 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9816
9817 * w32fns.c (w32_default_color_map): New function,
9818 extracted from Fw32_default_color_map.
9819 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9820
9821 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9822
9823 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9824
9825 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9826
9827 * keyboard.c (test_undefined): New function (bug#9751).
9828 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9829
9830 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9831
9832 * sysdep.c (init_sys_modes): Fix the check for the controlling
9833 terminal (Bug#6649).
9834
9835 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9836
9837 * dispextern.h (struct bidi_it): New member next_en_type.
9838
9839 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9840 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9841 current character, check also for next_en_type being WEAK_EN.
9842 (bidi_resolve_weak): Don't enter the expensive loop if the current
9843 position is before next_en_pos. Record the bidi type of the first
9844 non-ET, non-BN character we find, in addition to its position.
9845 (bidi_level_of_next_char): Invalidate next_en_type when
9846 next_en_pos is over-stepped.
9847
9848 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9849
9850 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9851 * editfns.c: Rewrite current-time-zone so that it invokes
9852 the equivalent of (format-time-string "%Z") to get the time zone name.
9853 This fixes a bug when the time zone name contains characters that
9854 need converting from the system time locale to Emacs internal format.
9855 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9856 that patch fixed format-time-string to do the conversion, but
9857 I forgot to fix current-time-zone.
9858 (format_time_string): New function, containing most of
9859 what Fformat_time_string used to contain.
9860 (Fformat_time_string): Rewrite in terms of format_time_string.
9861 This doesn't change this function's behavior.
9862 (current-time-zone): Rewrite to use format_time_string.
9863 This fixes the bug reported by Michael Schierl in
9864 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9865 Jason Rumney's 2007-06-07 change worked around this bug, but
9866 didn't fix it.
9867 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9868
9869 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9870
9871 * xdisp.c (start_display): If the character at POS is displayed
9872 via a display vector, reset IT->current.dpvec_index to zero.
9873 (try_window_reusing_current_matrix): If a line ends in a display
9874 vector or the next line starts in a display vector, continue
9875 redrawing the window even though the character position of
9876 start_row was reached.
9877 (Bug#9771, part 2)
9878
9879 2011-10-18 Chong Yidong <cyd@gnu.org>
9880
9881 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9882 with nobreak-char-display too.
9883
9884 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9885
9886 Fix part 3 of bug#9771.
9887 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9888 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9889 non-neutral characters if the current character is a paragraph
9890 separator (a.k.a. Newline). This avoids running the same
9891 expensive loop twice, once when we consume the preceding newline
9892 and the other time when the line actually needs to be displayed.
9893 Avoid the loop when we see neutrals on the base embedding level
9894 following a character whose directionality is the same as the
9895 paragraph's. This avoids running the expensive loop when a line
9896 ends in a long sequence of neutrals, like control characters.
9897 Add assertion against STRONG_AL type. Slightly rearrange code
9898 that determines the type of a neutral given the first non-neutral
9899 that follows it.
9900 (bidi_level_of_next_char): Set next_en_pos to zero when
9901 invalidating its info.
9902
9903 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9904
9905 * xdisp.c (push_display_prop): Determine whether to record string
9906 or buffer position by IT->string, not by IT->method. Allow
9907 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9908 (move_it_vertically_backward): Don't look for character position
9909 immediately after the newline when in a continuation line.
9910 (Bug#9771, part 1)
9911
9912 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9913
9914 * window.c (coordinates_in_window): Rewrite and delabelize
9915 vertical border check. (Bug#5357) (Bug#9618)
9916
9917 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9918
9919 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9920 errors in XSetWindowBorder (bug#9310).
9921
9922 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9923
9924 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9925 avoid crash when xmalloc overrun checking is enabled.
9926
9927 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9928
9929 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9930 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9931 cursor motion with <left> and <right> arrow keys.
9932
9933 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9934 some callers set that themselves.
9935
9936 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9937
9938 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9939 display string and the previous row comes from the same string and
9940 is empty. (Bug#9739) (Bug#9738)
9941
9942 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9943
9944 * doc.c (get_doc_string): Encode file name (bug#9735).
9945
9946 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9947
9948 * bidi.c (bidi_level_of_next_char):
9949 * xdisp.c (get_visually_first_element): Remove old incorrect
9950 comments regarding the Unicode Line Separator character.
9951
9952 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9953
9954 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9955
9956 * alloc.c (Fgc_status): Do not access beyond zombies array
9957 boundary if nzombies > MAX_ZOMBIES.
9958 * alloc.c (dump_zombies): Add missing format specifier.
9959
9960 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9961
9962 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9963 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9964
9965 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9966 Some packages use them to denote characters with modifiers.
9967
9968 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9969
9970 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9971 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9972 matching a pp-number. Rename parameter var to var1.
9973
9974 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9975
9976 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9977
9978 2011-10-08 Glenn Morris <rgm@gnu.org>
9979
9980 * callint.c (Fcall_interactively): Give a more explicit error for the
9981 'c' case with a non-character input. (Bug#8479)
9982
9983 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9984
9985 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9986 lines.
9987 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9988 lines that are hscrolled on the left.
9989
9990 * dispnew.c (buffer_posn_from_coords): Account for a possible
9991 presence of header-line. (Bug#4426)
9992
9993 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9994
9995 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9996 Don't advertise functionality which we discourage or doesn't work.
9997
9998 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9999
10000 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10001 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10002 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10003 this makes Emacs dump core during garbage collection on rare
10004 occasions. sizeof is obviously inferior to offsetof here, so
10005 stick with offsetof.
10006 (GC_POINTER_ALIGNMENT): New macro.
10007 (mark_memory): Omit 3rd (offset) arg; caller changed.
10008 Don't assume EMACS_INT alignment is the same as pointer alignment.
10009
10010 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10011
10012 * keyboard.c (read_key_sequence_remapped): New var.
10013 (read_key_sequence): Compute remapping in the right buffer.
10014 (command_loop_1): Use read_key_sequence's remapping directly.
10015
10016 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10017
10018 * dired.c (file_name_completion): Don't expand file name.
10019 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10020 before checking file name handler.
10021
10022 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10023 they've been requested explicitly (bug#9591).
10024
10025 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10026
10027 * keymap.c (Fsingle_key_description): Use make_specified_string
10028 instead of build_string to build string from push_key_description.
10029 (Bug#5193)
10030
10031 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10032
10033 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10034 This fixes a Y2038 bug on 64-bit hosts.
10035 * buffer.c (reset_buffer):
10036 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10037 (Fclear_buffer_auto_save_failure):
10038 Use 0, not -1, to represent an unset failure time, since time_t
10039 might not be signed.
10040
10041 Remove dependency on glibc malloc internals.
10042 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10043 Move back here from lisp.h, but with their new implementations.
10044 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10045 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10046 * charset.c (charset_table_init): New static var.
10047 (syms_of_charset): Use it instead of xmalloc. This removes a
10048 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10049 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10050 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10051 Move back to alloc.c.
10052 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10053 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10054
10055 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10056
10057 * nsterm.m (windowDidResize): Call x_set_window_size only when
10058 ns_in_resize is true. Otherwise set pixelwidth/height and
10059 call change_frame_size (Bug#9628).
10060
10061 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10062
10063 Port --enable-checking=all to Fedora 14 x86-64.
10064 * charset.c (syms_of_charset): Also account for glibc malloc's
10065 internal overhead when calculating the initial malloc maximum.
10066
10067 Port --enable-checking=all to Fedora 14 x86.
10068 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10069 Move to lisp.h.
10070 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10071 (overrun_check_realloc, overrun_check_free):
10072 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10073 That way, xmalloc returns a properly-aligned pointer even if
10074 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10075 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10076 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10077 into account when calculating the initial malloc maximum.
10078 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10079 Move here from alloc.c, so that charset.c can use it too.
10080 Properly align; the old code wasn't right for common 32-bit hosts
10081 when configured with --enable-checking=all.
10082 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10083 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10084
10085 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10086
10087 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10088 use EDOM.
10089
10090 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10091
10092 * xdisp.c (compute_display_string_end): If there's no display
10093 string at CHARPOS, return -1.
10094
10095 * bidi.c (bidi_fetch_char): When compute_display_string_end
10096 returns a negative value, treat the character as a normal
10097 character not covered by a display string. (Bug#9624)
10098
10099 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10100
10101 * lread.c (Fread_from_string): Fix typo in docstring.
10102
10103 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10104
10105 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10106 newline, reseat the iterator instead of bidi-iterating there one
10107 character at a time. (Bug#9610)
10108 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10109 TO_CHARPOS if the bidi iterator is at base embedding level.
10110
10111 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10112
10113 * lread.c (readevalloop): Use correct code for NBSP.
10114 (read1): Likewise. (Bug#9608)
10115
10116 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10117
10118 * dbusbind.c (Fdbus_register_signal): When service is not
10119 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10120
10121 2011-09-25 Glenn Morris <rgm@gnu.org>
10122
10123 * buffer.c (truncate-lines): Doc fix.
10124
10125 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10126
10127 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10128 (Fset_window_next_buffers): Doc fix.
10129
10130 2011-09-24 Glenn Morris <rgm@gnu.org>
10131
10132 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10133
10134 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10135
10136 Fix minor problems found by static checking.
10137 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10138 * indent.c (Fvertical_motion): Fix == vs = typo.
10139
10140 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10141
10142 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10143 Default value is now t. Doc fix.
10144
10145 * indent.c (Fvertical_motion): Compute and apply the overshoot
10146 logic when moving up, not only when moving down. Fix the
10147 confusing name and values of the it_overshoot_expected variable;
10148 logic changes accordingly. (Bug#9254) (Bug#9549)
10149
10150 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10151 CHARPOS is covered by a display string which includes newlines.
10152 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10153 is covered by a display string with embedded newlines.
10154
10155 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10156
10157 * dbusbind.c (Fdbus_register_signal): Add match rule to
10158 Vdbus_registered_objects_table. (Bug#9581)
10159 (Fdbus_register_method, Vdbus_registered_objects_table):
10160 Fix docstring.
10161
10162 2011-09-24 Jim Meyering <meyering@redhat.com>
10163
10164 do not ignore write error for any output size
10165 The previous change was incomplete.
10166 While it makes emacs --batch detect the vast majority of stdout
10167 write failures, errors were still ignored whenever the output size is
10168 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10169 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10170 && echo FAIL: ignored write error
10171 FAIL: ignored write error
10172 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10173 && echo FAIL: ignored write error
10174 FAIL: ignored write error
10175 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10176
10177 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10178
10179 * emacs.c (Fkill_emacs): In noninteractive mode exit
10180 non-successfully if a write error occurred on stdout. (Bug#9574)
10181
10182 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10183
10184 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10185 the xassert test.
10186
10187 * dispextern.h (struct it): Update the comment documenting what
10188 can it->OBJECT be.
10189
10190 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10191
10192 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10193 a display string, extend search for cursor position to end of row.
10194 (find_row_edges): If the row ends in a newline from a display
10195 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10196 Handle the case of a display string with multiple newlines.
10197 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10198 non-empty line. Fixes confusing cursor motion with arrow keys at
10199 the beginning of a line that starts with whitespace.
10200
10201 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10202
10203 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10204 (bug#9493).
10205
10206 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10207
10208 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10209 boolean (Bug#9154).
10210
10211 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10212
10213 * xdisp.c (display_line): Record maximum and minimum buffer
10214 positions even if no glyphs were produced (e.g., by a zero-width
10215 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10216 buffer positions that will be removed from the glyph row because
10217 they don't fit.
10218 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10219 column is beyond frame width: don't subtract 1 "pixel" when
10220 computing width of the stretch.
10221 (reseat_at_next_visible_line_start): Undo the change made on
10222 2011-09-17 that saved paragraph information and restored it after
10223 the call to `reseat'. (Bug#9545)
10224
10225 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10226
10227 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10228 and turn window cursor on if cleared (Bug#9415).
10229
10230 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10231
10232 * search.c (boyer_moore): Take unibyte characters from pattern
10233 literally. (Bug#9458)
10234
10235 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10236
10237 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10238
10239 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10240
10241 Fix minor problem found by static checking.
10242 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10243 initialized, to pacify gcc -Wuninitialized.
10244
10245 * fileio.c: Report proper errno when syscall falls.
10246 (Finsert_file_contents): Save and restore errno,
10247 so that report_file_error outputs the correct diagnostic.
10248 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10249
10250 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10251
10252 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10253
10254 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10255
10256 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10257 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10258
10259 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10260
10261 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10262 about the current paragraph and restore it after the call to reseat.
10263
10264 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10265 (bidi_find_paragraph_start): Search back for paragraph beginning
10266 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10267 (bidi_move_to_visually_next): Only trigger paragraph-related
10268 computations when the last character is a newline or at EOB, not
10269 just any NEUTRAL_B. (Bug#9470)
10270
10271 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10272 truncated lines if point is covered by a display string. (Bug#9524)
10273
10274 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10275
10276 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10277 (cons_to_x_long): New function.
10278 (lisp_data_to_selection_data): Use it. Correct the test for
10279 short-versus-long data; it was negated. Break out of vector
10280 loop, for efficiency, when a long datum is discovered.
10281
10282 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10283
10284 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10285
10286 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10287
10288 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10289 GCC PR/17406) by declaring this function with external scope.
10290
10291 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10292
10293 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10294 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10295
10296 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10297
10298 * editfns.c (Fformat): Correctly handle text properties on "%%".
10299
10300 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10301
10302 * xterm.c (x_draw_composite_glyph_string_foreground):
10303 * w32term.c (x_draw_composite_glyph_string_foreground):
10304 * term.c (encode_terminal_code):
10305 * composite.c (composition_update_it, get_composition_id):
10306 * xdisp.c (get_next_display_element)
10307 (fill_composite_glyph_string): Add comments about special meaning
10308 of TAB characters in a composition.
10309
10310 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10311
10312 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10313 This occurs when processing a multibyte format.
10314 Problem reported by Wolfgang Jenker.
10315
10316 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10317
10318 * xdisp.c (try_cursor_movement): Only check for exact match if
10319 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10320
10321 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10322
10323 Remove unused external symbols.
10324 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10325 * xdisp.c (calc_pixel_width_or_height): Now static.
10326 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10327 * indent.c (check_display_width):
10328 * w32term.c: Fix comment to match code.
10329 * xterm.c, xterm.h (x_catching_errors): Remove.
10330
10331 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10332
10333 * xselect.c: Use signed conversions more consistently (Bug#9498).
10334 (selection_data_to_lisp_data): Assume incoming selection data are
10335 signed integers, not unsigned. This is to be consistent with
10336 outgoing selection data, which was modified to use signed integers
10337 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10338 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10339 expects long, not unsigned long.
10340
10341 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10342
10343 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10344 computation of loop end. Reported by Johan Bockgård
10345 <bojohan@gnu.org>.
10346
10347 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10348
10349 * frame.c (Fother_visible_frames_p): Function deleted.
10350
10351 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10352
10353 * indent.c (compute_motion): Process display vector front to back
10354 rather than the other way around. (Bug#2496)
10355
10356 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10357
10358 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10359
10360 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10361
10362 * minibuf.c (Fread_from_minibuffer): Doc fix.
10363
10364 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10365
10366 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10367 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10368
10369 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10370
10371 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10372 value for non-existent files.
10373
10374 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10375
10376 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10377 set its "size" to -1. This will set the modtime_size field of
10378 the corresponding buffer to -1, which is what
10379 verify-visited-file-modtime expects for files that do not exist.
10380 (Bug#9139)
10381
10382 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10383
10384 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10385 here ...
10386 * lisp.h: ... from here. push_key_description is no longer
10387 defined in keyboard.c, so its declaration should not be in
10388 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10389 logically belongs with push_key_description.
10390
10391 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10392
10393 * buffer.h: Include <sys/types.h> instead of <time.h>.
10394 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10395 Problem reported by Herbert J. Skuhra.
10396
10397 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10398
10399 * xml.c (parse_region): Make the parsing work for
10400 non-comment-starting XML files again (bug#9144).
10401
10402 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10403
10404 * image.c (gif_load): Fix calculation of bottom and right corner.
10405 (Bug#9468)
10406
10407 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10408
10409 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10410 redisplay in small windows.
10411
10412 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10413
10414 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10415
10416 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10417
10418 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10419 Operate on live windows only.
10420
10421 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10422
10423 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10424
10425 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10426
10427 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10428 only under bidi iteration.
10429
10430 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10431
10432 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10433
10434 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10435
10436 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10437 Without this fix, the command to link temacs failed due to an
10438 undefined symbol __builtin_isnan. This is because
10439 /usr/include/iso/math_c99.h #defines isnan(x) to
10440 __builtin_isnan(x), but the bundled gcc, which identifies itself
10441 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10442 a __builtin_isnan.
10443 * floatfns.c (isnan): #undef, and then #define to a clone of
10444 what's in data.c.
10445 (Fisnan): Always define, since it's always available now.
10446 (syms_of_floatfns): Always define isnan at the Lisp level.
10447
10448 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10449
10450 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10451
10452 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10453
10454 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10455 The previous code assumed that file offsets (off_t values) fit in
10456 EMACS_INT variables, which is not true on typical 32-bit hosts.
10457 The code messed up by falsely reporting buffer overflow in cases
10458 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10459 when "big" contains more than 2**29 bytes, even though this
10460 inserts just one byte and does not overflow the buffer.
10461 (Finsert_file_contents): Store file offsets as off_t
10462 values, not as EMACS_INT values. Check for overflow when
10463 converting between EMACS_INT and off_t. When checking for
10464 buffer overflow or for overlap, take the offsets into account.
10465 Don't use EMACS_INT for small values where int suffices.
10466 When checking for overlap, fix a typo: ZV was used where
10467 ZV_BYTE was intended.
10468 (Fwrite_region): Don't assume off_t fits into 'long'.
10469 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10470
10471 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10472
10473 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10474
10475 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10476
10477 sprintf-related integer and memory overflow issues (Bug#9412).
10478
10479 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10480 (esprintf, exprintf, evxprintf): New functions.
10481 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10482 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10483 (modify_event_symbol): Do not assume that the length of
10484 name_alist_or_stem is safe to alloca and fits in int.
10485 (Fexecute_extended_command): Likewise for function name and binding.
10486 (Frecursion_depth): Wrap around reliably on integer overflow.
10487 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10488 since some callers pass EMACS_INT values.
10489 (Fsingle_key_description): Don't crash if symbol name contains more
10490 than MAX_ALLOCA bytes.
10491 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10492 (get_minibuffer): Arg is now EMACS_INT, not int.
10493 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10494 (esprintf, exprintf, evxprintf): New decls.
10495 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10496
10497 * dbusbind.c (signature_cat): New function.
10498 (xd_signature, Fdbus_register_signal):
10499 Do not overrun buffer; instead, report string overflow.
10500
10501 * dispnew.c (add_window_display_history): Don't overrun buffer.
10502 Truncate instead; this is OK since it's just a log.
10503
10504 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10505 even if the time zone offset is outlandishly large.
10506 Don't mishandle offset == INT_MIN.
10507
10508 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10509 when creating daemon; the previous buffer-overflow check was incorrect.
10510
10511 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10512 which has the guts of the old verror function.
10513
10514 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10515 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10516
10517 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10518 (font_unparse_xlfd): Don't blindly alloca long strings.
10519 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10520 fits in int, when using sprintf. Use single snprintf to count
10521 length of string rather than counting it via multiple sprintfs;
10522 that's simpler and more reliable.
10523 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10524 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10525 sprintf, in case result does not fit in int.
10526
10527 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10528 (fontset_from_font): Print it.
10529
10530 * frame.c (tty_frame_count): Now printmax_t, not int.
10531 (make_terminal_frame, set_term_frame_name): Print it.
10532 (x_report_frame_params): In X, window IDs are unsigned long,
10533 not signed long, so print them as unsigned.
10534 (validate_x_resource_name): Check for implausibly long names,
10535 and don't assume name length fits in 'int'.
10536 (x_get_resource_string): Don't blindly alloca invocation name;
10537 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10538 not fit in int.
10539
10540 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10541 (xg_check_special_colors, xg_set_geometry):
10542 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10543
10544 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10545 Use esprintf, not sprintf, in case result does not fit in int.
10546
10547 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10548 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10549 it as a large positive number.
10550 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10551 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10552
10553 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10554 in case result does not fit in int.
10555
10556 * print.c (float_to_string): Detect width overflow more reliably.
10557 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10558 buffer overrun. Don't assume list length fits in 'int'. Treat
10559 print length of 0 as 0, not as infinity; to be consistent with other
10560 uses of print length in this function. Don't overflow print length
10561 index. Don't assume hash table size fits in 'long', or that
10562 vectorlike size fits in 'unsigned long'.
10563
10564 * process.c (make_process): Use printmax_t, not int, to format
10565 process-name gensyms.
10566
10567 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10568
10569 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10570 to avoid potential buffer overrun.
10571
10572 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10573 if X resource line is longer than 512 bytes.
10574
10575 * xfns.c (x_window): Make sprintf buffer a bit bigger
10576 to avoid potential buffer overrun.
10577
10578 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10579
10580 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10581
10582 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10583
10584 Integer overflow fixes for scrolling, etc.
10585 Without these, Emacs silently mishandles large integers sometimes.
10586 For example, "C-u 4294967297 M-x recenter" was treated as if
10587 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10588
10589 * xdisp.c (try_window_id): Check Emacs fixnum range before
10590 converting to 'int'.
10591
10592 * window.c (window_scroll_line_based, Frecenter):
10593 Check that an Emacs fixnum is in range before assigning it to 'int'.
10594 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10595 values converted from Emacs fixnums.
10596 (Frecenter): Don't wrap around a line count if it is out of 'int'
10597 range; instead, treat it as an extreme value.
10598 (Fset_window_configuration, compare_window_configurations):
10599 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10600
10601 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10602 that can exceed INT_MAX. Check that EMACS_INT value is in range
10603 before assigning it to the (possibly-narrower) index.
10604 (match_limit): Don't assume that a fixnum can fit in 'int'.
10605
10606 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10607 exceed INT_MAX.
10608
10609 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10610 (Fvertical_motion): Don't wrap around LINES values that don't fit
10611 in 'int'. Instead, treat them as extreme values. This is good
10612 enough for windows, which can't have more than INT_MAX lines anyway.
10613
10614 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10615
10616 * Require libxml/parser.h to avoid compilation warning.
10617
10618 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10619
10620 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10621 since this reportedly can destroy thread storage.
10622
10623 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10624
10625 * syntax.c (find_defun_start): Update all cache variables if
10626 exiting early (Bug#9401).
10627
10628 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10629
10630 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10631
10632 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10633 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10634 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10635
10636 * term.c (tty_append_glyph): New function.
10637 (produce_stretch_glyph): Static function and its prototype deleted.
10638
10639 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10640 Add prototypes.
10641
10642 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10643
10644 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10645 when checking :margin (Bug#9390).
10646 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10647 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10648 so that the name doesn't mislead. All uses changed.
10649
10650 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10651
10652 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10653 set_tty_hooks.
10654
10655 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10656
10657 * xdisp.c (move_it_to): Don't bail out early when reaching
10658 position beyond to_charpos, if we are scanning backwards.
10659 (move_it_vertically_backward): When DY == 0, make sure we get to
10660 the first character in the line after the newline.
10661
10662 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10663
10664 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10665 (ccl_driver): Do not generate an out-of-range pointer.
10666 (Fccl_execute_on_string): Remove unnecessary check for
10667 integer overflow, noted by Stefan Monnier in
10668 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10669 Remove a FIXME that didn't need fixing.
10670 Simplify the newly-introduced buffer reallocation code.
10671
10672 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10673
10674 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10675
10676 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10677
10678 Integer and memory overflow issues (Bug#9196).
10679
10680 * doc.c (get_doc_string): Rework so that
10681 get_doc_string_buffer_size is the actual buffer size, rather than
10682 being 1 less than the actual buffer size; this makes xpalloc more
10683 convenient.
10684
10685 * image.c (x_allocate_bitmap_record, cache_image):
10686 * xselect.c (Fx_register_dnd_atom):
10687 Simplify previous changes by using xpalloc.
10688
10689 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10690 since either will do and ptrdiff_t is convenient with xpalloc.
10691
10692 * charset.c (charset_table_size)
10693 (struct charset_sort_data.priority): Now ptrdiff_t.
10694 (charset_compare): Don't overflow if priorities differ greatly.
10695 (Fsort_charsets): Don't assume list length fits in int.
10696 Check for size-calculation overflow when allocating sort data.
10697 (syms_of_charset): Allocate an initial charset table that is
10698 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10699
10700 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10701
10702 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10703 The actual value is always <= INT_MAX, and leaving it unsigned made
10704 overflow checking harder.
10705
10706 * dispextern.h (struct glyph_matrix.rows_allocated)
10707 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10708 with xpalloc. The values are still always <= INT_MAX.
10709
10710 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10711
10712 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10713 (SAFE_NALLOCA): New macro.
10714
10715 * region-cache.c (struct boundary.pos, find_cache_boundary)
10716 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10717 (set_cache_region, invalidate_region_cache)
10718 (revalidate_region_cache, know_region_cache, region_cache_forward)
10719 (region_cache_backward, pp_cache):
10720 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10721 so that ptrdiff_t * can be passed to xpalloc.
10722 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10723 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10724 (pp_cache): Don't assume cache_len fits in int.
10725 * region-cache.h: Adjust extern decls to match.
10726
10727 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10728 EMACS_INT, since either will do, for xpalloc.
10729
10730 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10731 (xnmalloc, xnrealloc, xpalloc): New functions.
10732
10733 * bidi.c (bidi_shelve_header_size): New constant.
10734 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10735 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10736
10737 * bidi.c (bidi_cache_shrink):
10738 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10739 (overlay_strings):
10740 Don't update size of array until after memory allocation succeeds,
10741 because xmalloc/xrealloc may not return.
10742 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10743 now that we have proper integer overflow checking.
10744 (record_overlay_string, overlay_strings): Catch overflows when
10745 calculating size of overlay_str_buf.
10746
10747 * callproc.c (Fcall_process): Check for size overflow when
10748 calculating size of args2.
10749 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10750 Normally we prefer signed values, but sticking with ptrdiff_t would
10751 require adding more-complicated checks.
10752
10753 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10754 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10755 Redo buffer-overflow calculations to avoid integer overflow.
10756 Add a FIXME comment where memory seems to be over-allocated.
10757
10758 * character.c (Fstring): Check for size-calculation overflow.
10759
10760 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10761 unnecessary integer overflow. Check for size overflow.
10762 (encode_coding_object): Don't update size until xmalloc succeeds.
10763
10764 * composite.c (get_composition_id): Check for overflow in glyph
10765 length calculations.
10766
10767 Integer and memory overflow fixes for display code.
10768 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10769 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10770 (scrolling_window): Check for overflow in size calculations.
10771 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10772 Don't assume glyph table len fits in int.
10773 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10774 (row_table_size): Now ptrdiff_t, not int.
10775 (scrolling_window): Avoid overflow in size calculations.
10776 Don't update size until allocation succeeds.
10777 * fns.c (concat): Check for overflow in size calculations.
10778 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10779 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10780 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10781
10782 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10783 (get_doc_string): Check for size calculation overflow.
10784 Don't update size until allocation succeeds.
10785 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10786 EMACS_INT, where ptrdiff_t will do.
10787 (Fsubstitute_command_keys): Check for string overflow.
10788
10789 * editfns.c (set_time_zone_rule): Don't assume environment length
10790 fits in int.
10791 (message_length): Now ptrdiff_t, not int.
10792 (Fmessage_box): Don't update size until allocation succeeds.
10793 Don't assume message length fits in int.
10794 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10795
10796 * emacs.c (main): Do not reallocate argv, since there is a null at
10797 the end that can be overwritten, and this way there's no need to
10798 worry about size-calculation overflow.
10799 (sort_args): Check for size-calculation overflow.
10800
10801 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10802 alloc succeeds.
10803 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10804
10805 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10806 (x_set_scroll_bar_width, x_figure_window_size):
10807 Check for integer overflow.
10808 (x_set_alpha): Do not assume XINT fits in int.
10809
10810 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10811 This is for the members text_lines, text_cols, total_lines, total_cols,
10812 where the system imposes an 'int' limit.
10813
10814 * fringe.c (Fdefine_fringe_bitmap):
10815 Don't update size until alloc works.
10816
10817 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10818 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10819
10820 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10821 Check for size-calculation overflow.
10822 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10823 do, as we prefer signed integers.
10824 (id_to_widget.max_size, id_to_widget.used)
10825 (xg_store_widget_in_map, xg_remove_widget_from_map)
10826 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10827 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10828 Use and return ptrdiff_t, not int.
10829 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10830 * gtkutil.h: Change prototypes to match the above.
10831
10832 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10833 are duplicate now that they've been promoted to lisp.h.
10834 (x_allocate_bitmap_record, x_alloc_image_color)
10835 (make_image_cache, cache_image, xpm_load):
10836 Don't update size until alloc is done.
10837 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10838 (x_detect_edges):
10839 Check for size calculation overflow.
10840 (ct_colors_allocated_max): New constant.
10841 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10842 overflow.
10843
10844 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10845 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10846 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10847 Use ptrdiff_t, not int, to count maps.
10848 (read_char_minibuf_menu_prompt): Check for overflow in size
10849 calculations. Don't update size until allocation succeeds.
10850 Redo calculations to avoid overflow.
10851 * keyboard.h: Change prototypes to match the above.
10852
10853 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10854 to count maps.
10855 (current_minor_maps): Check for size calculation overflow.
10856 * keymap.h: Change prototypes to match the above.
10857
10858 * lread.c (read1, init_obarray): Don't update size until alloc done.
10859
10860 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10861 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10862
10863 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10864 Now ptrdiff_t, not int.
10865 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10866 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10867
10868 * process.c (Fnetwork_interface_list): Check for overflow
10869 in size calculation.
10870
10871 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10872
10873 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10874 overflow. Don't bother calling xmalloc when xrealloc will do.
10875
10876 * search.c (Freplace_match): Check for size calculation overflow.
10877 (Fset_match_data): Don't assume list lengths fit in 'int'.
10878
10879 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10880 for command line length. Do not attempt to address one before the
10881 beginning of an array, as that's not portable.
10882
10883 * term.c (max_frame_lines): Remove; unused.
10884 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10885 not int.
10886 (encode_terminal_code, calculate_costs): Check for size
10887 calculation overflow.
10888 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10889 table lengths and related sizes. Don't update size until alloc
10890 done. Redo calculations to avoid overflow.
10891 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10892
10893 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10894 subtracting pointers.
10895 (gobble_line): Check for overflow more carefully. Don't update size
10896 until alloc done.
10897
10898 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10899 Don't update size until alloc done.
10900 Redo size calculations to avoid overflow.
10901 Check for size calculation overflow.
10902 (main) [DEBUG]: Fix typo in invoking tparam1.
10903
10904 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10905 Use ptrdiff_t, not int, for sizes.
10906 (store_mode_line_noprop_char): Don't update size until alloc done.
10907
10908 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10909 Use ptrdiff_t, not int, for sizes.
10910 (Finternal_make_lisp_face, cache_face):
10911 Check for size calculation overflow.
10912 (cache_face): Treat size calculation overflows as if they were
10913 memory exhaustion (the usual treatment), rather than aborting.
10914
10915 * xfns.c (x_encode_text, x_set_name_internal)
10916 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10917 sizes, since they can exceed INT_MAX in size. Check for size
10918 calculation overflow.
10919
10920 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10921 (xg_select): Check for size calculation overflow.
10922 Don't update size until alloc done.
10923
10924 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10925 as sprintf is limited to int lengths.
10926
10927 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10928 (X_LONG_MIN): New macros.
10929 Use them to make the following changes clearer.
10930 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10931 This change doesn't affect the value now, but it may help remind
10932 future maintainers not to raise the value too much later.
10933 (SELECTION_QUANTUM): Remove, replacing with ...
10934 (selection_quantum): ... new function, which avoids overflow.
10935 All uses changed.
10936 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10937 assumption that selection length fits in 'int'.
10938 (x_reply_selection_request, x_handle_selection_request)
10939 (x_get_window_property, receive_incremental_selection)
10940 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10941 (lisp_data_to_selection_data, clean_local_selection_data):
10942 Use ptrdiff_t, not int, to record length of selection.
10943 (x_reply_selection_request, x_get_window_property)
10944 (receive_incremental_selection, x_property_data_to_lisp):
10945 Redo calculations to avoid overflow.
10946 (x_reply_selection_request): When sending hint, ceiling it at
10947 X_LONG_MAX rather than relying on wraparound overflow to send
10948 something.
10949 (x_get_window_property, receive_incremental_selection)
10950 (lisp_data_to_selection_data, x_property_data_to_lisp):
10951 Check for size-calculation overflow.
10952 (x_get_window_property, receive_incremental_selection)
10953 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10954 Don't store size until memory allocation succeeds.
10955 (x_get_window_property): Plug memory leak on memory exhaustion.
10956 Don't double-block input; malloc is safe here. Don't assume 2**34
10957 - 4 fits in unsigned long. Add an xassert to check
10958 XGetWindowProperty overflow. Be more careful about overflow
10959 calculations, and distinguish size from memory overflow better.
10960 (receive_incremental_selection): When tracing, don't assume
10961 unsigned int is less than INT_MAX.
10962 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10963 harmful) conversions of unsigned short to int.
10964 (lisp_data_to_selection_data): Don't assume that integers
10965 in the range -65535 through -1 fit in an X unsigned short.
10966 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10967 result parameters unless successful. Rely on cons_to_unsigned
10968 to report problems with elements; the old code wasn't right anyway.
10969 (x_check_property_data): Check for int overflow; we cannot use
10970 a wider type due to X limits.
10971 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10972
10973 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10974
10975 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10976 (x_term_init): Check for size calculation overflow.
10977 (x_color_cells): Don't store size until memory allocation succeeds.
10978 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10979 Don't assume alloca size is less than MAX_ALLOCA.
10980 (x_term_init): Don't assume length fits in int (sprintf is limited
10981 to int size).
10982
10983 Use ptrdiff_t for composition IDs.
10984 * character.c (lisp_string_width):
10985 * composite.c (composition_table_size, n_compositions)
10986 (get_composition_id, composition_gstring_from_id):
10987 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10988 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10989 * window.c (Frecenter):
10990 Use ptrdiff_t, not int, for composition IDs.
10991 * composite.c (get_composition_id): Check for integer overflow.
10992 * composite.h: Adjust prototypes to match the above changes.
10993
10994 Use ptrdiff_t for hash table indexes.
10995 * category.c (hash_get_category_set):
10996 * ccl.c (ccl_driver):
10997 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10998 * coding.c (coding_system_charset_list, detect_coding_system):
10999 * coding.h (struct coding_system.id):
11000 * composite.c (get_composition_id, gstring_lookup_cache):
11001 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11002 * image.c (xpm_get_color_table_h):
11003 * lisp.h (hash_lookup, hash_put):
11004 * minibuf.c (Ftest_completion):
11005 Use ptrdiff_t for hash table indexes, not int (which is too
11006 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11007 32-bit --with-wide-int hosts).
11008
11009 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11010 Add a FIXME comment about memory leaks.
11011 (syms_of_charset): Don't assume xmalloc returns.
11012
11013 Don't assume that stated character widths fit in int.
11014 * character.c (Fchar_width, c_string_width, lisp_string_width):
11015 * character.h (CHAR_WIDTH):
11016 * indent.c (MULTIBYTE_BYTES_WIDTH):
11017 Use sanitize_char_width to avoid undefined and/or bad behavior
11018 with outlandish widths.
11019 * character.h (sanitize_tab_width): Rename from sanitize_width,
11020 now that we have two such functions. All uses changed.
11021 (sanitize_char_width): New inline function.
11022
11023 Don't assume that tab-width fits in int.
11024 * character.h (sanitize_width): New inline function.
11025 (SANE_TAB_WIDTH): New macro.
11026 (ASCII_CHAR_WIDTH): Use it.
11027 * indent.c (sane_tab_width): Remove. All uses replaced by
11028 SANE_TAB_WIDTH (current_buffer).
11029 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11030
11031 * fileio.c: Integer overflow issues with file modes.
11032 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11033
11034 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11035 Remove unreachable code.
11036 (read_hex, load_charset_map_from_file): Check for integer overflow.
11037
11038 * xterm.c: Don't go over XClientMessageEvent limit.
11039 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11040 (x_send_scroll_bar_event): Likewise. Check that the size does not
11041 exceed limits imposed by XClientMessageEvent, as well as the usual
11042 ptrdiff_t and size_t limits.
11043
11044 * keyboard.c: Overflow, signedness and related fixes.
11045 (make_lispy_movement): Use same integer type in forward decl
11046 that is used in the definition.
11047 (read_key_sequence, keyremap_step):
11048 Change bufsize argument back to int, undoing my 2011-03-30 change.
11049 We prefer signed types, and int is wide enough here.
11050 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11051 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11052 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11053 length, not size_t. Use ptrdiff_t for index, not int.
11054 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11055 possibility of integer overflow.
11056
11057 Overflow, signedness and related fixes for images.
11058
11059 * dispextern.h (struct it.stack[0].u.image.image_id)
11060 (struct_it.image_id, struct image.id, struct image_cache.size)
11061 (struct image_cache.used, struct image_cache.ref_count):
11062 * gtkutil.c (update_frame_tool_bar):
11063 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11064 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11065 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11066 * nsmenu.m (update_frame_tool_bar):
11067 * xdisp.c (calc_pixel_width_or_height):
11068 * xfns.c (image_cache_refcount):
11069 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11070 on typical 64-bit hosts.
11071
11072 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11073 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11074 Omit unnecessary casts to int.
11075 (parse_image_spec): Check that integers fall into 'int' range
11076 when the callers expect that.
11077 (image_ascent): Redo ascent calculation to avoid int overflow.
11078 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11079 (lookup_image): Remove unnecessary tests.
11080 (xbm_image_p): Locals are now of int, not EMACS_INT,
11081 since parse_image_check makes sure they fit into int.
11082 (png_load, gif_load, svg_load_image):
11083 Prefer int to unsigned where either will do.
11084 (tiff_handler): New function, combining the cores of the
11085 old tiff_error_handler and tiff_warning_handler.
11086 This function is rewritten to use vsnprintf and thereby avoid
11087 stack buffer overflows. It uses only the features of vsnprintf
11088 that are common to both POSIX and native Microsoft.
11089 (tiff_error_handler, tiff_warning_handler): Use it.
11090 (tiff_load, gif_load, imagemagick_load_image):
11091 Don't assume :index value fits in 'int'.
11092 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11093 (imagemagick_load_image): Check that crop parameters fit into
11094 the integer types that MagickCropImage accepts. Don't assume
11095 Vimagemagick_render_type has a nonnegative value. Don't assume
11096 size_t fits in 'long'.
11097 (gs_load): Use printmax_t to print the widest integers possible.
11098 Check for integer overflow when computing image height and width.
11099
11100 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11101
11102 * xdisp.c (redisplay_window): Don't force window start if point
11103 will be invisible in the resulting window. (Bug#9324)
11104
11105 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11106
11107 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11108 the display spec is of the form `(space ...)'.
11109 (handle_display_spec): Return the value returned by
11110 handle_single_display_spec, not just 1 or zero.
11111 (handle_single_display_spec): If the display spec is of the form
11112 `(space ...)', and specifies display in the text area, return 2
11113 rather than 1.
11114 (try_cursor_movement): Check for the need to scroll more
11115 accurately, and prefer exact match for point under bidi.
11116 Don't advance `row' beyond the last row of the window.
11117
11118 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11119 into disp_prop; all users changed.
11120
11121 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11122 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11123 for the text covered by the display property.
11124
11125 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11126
11127 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11128 Change return value to nil.
11129 (Frecord_buffer): Delete unused function.
11130
11131 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11132
11133 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11134 buffers, return left-to-right.
11135 (set_cursor_from_row): Consider candidate row a win if its glyph
11136 represents a newline and point is on that newline. Fixes cursor
11137 positioning on the newline at EOL of R2L text within L2R
11138 paragraph, and vice versa.
11139 (try_cursor_movement): Check continued rows, in addition to
11140 continuation rows. Fixes unwarranted scroll when point enters a
11141 continued line of R2L text within an L2R paragraph, or vice versa.
11142 (cursor_row_p): Consider the case of point being equal to
11143 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11144 from the end of a short line to the beginning of a continued line
11145 of R2L text within L2R paragraph.
11146 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11147 composed characters.
11148
11149 * bidi.c (bidi_check_type): Use xassert.
11150 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11151 members.
11152
11153 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11154
11155 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11156 a character.
11157
11158 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11159
11160 * nsfont.m (ns_otf_to_script): Fix typo.
11161
11162 2011-08-22 Kenichi Handa <handa@m17n.org>
11163
11164 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11165 extra slot even if the purpose is char-code-property-table.
11166
11167 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11168
11169 * xdisp.c (redisplay_window): When computing centering_position,
11170 account for the height of the header line. (Bug#8874)
11171
11172 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11173 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11174 candidate is selected by the mouse, and that candidate has a
11175 composed character under the mouse.
11176
11177 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11178 coordinates reported by pos-visible-in-window-p for a composed
11179 character in column zero.
11180
11181 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11182
11183 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11184
11185 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11186
11187 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11188 consider it a hit if to_charpos is anywhere in the range of the
11189 composed buffer positions.
11190
11191 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11192
11193 * image.c (gif_load): Don't assume that each subimage has the same
11194 dimensions as the base image. Handle disposal method that is
11195 "undefined" by the gif spec (Bug#9335).
11196
11197 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11198
11199 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11200 (Fcondition_case): Document `debug' symbol in error handler.
11201
11202 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11203
11204 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11205 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11206 from an Org mode buffer to a Speedbar frame.
11207
11208 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11209 a composition, take its buffer position from IT->cmp_it.charpos.
11210 Fixes cursor positioning at the beginning of a line that begins
11211 with a composed character.
11212
11213 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11214
11215 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11216 character bidirectional type, use STRONG_L instead. Fixes crashes
11217 in a buffer produced by `describe-categories'.
11218
11219 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11220 members before the level stack, so they would be saved and
11221 restored when copying iterator state. Fixes incorrect reordering
11222 around TABs covered by display properties.
11223
11224 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11225
11226 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11227
11228 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11229
11230 * eval.c (internal_condition_case, internal_condition_case_1)
11231 (internal_condition_case_2, internal_condition_case_n):
11232 Remove unnecessary aborts (Bug#9081).
11233
11234 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11235
11236 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11237 has no `load' handler, try opening the file locally. (Bug#9311)
11238
11239 2011-08-16 Ken Brown <kbrown@cornell.edu>
11240
11241 * gmalloc.c: Expand comment.
11242
11243 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11244
11245 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11246 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11247
11248 2011-08-16 Ken Brown <kbrown@cornell.edu>
11249
11250 Fix memory allocation problems in Cygwin build (Bug#9273).
11251
11252 * unexcw.c ( __malloc_initialized): Declare external variable.
11253 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11254
11255 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11256 New variables.
11257 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11258 dumped emacs.
11259 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11260 in the static heap.
11261 [CYGWIN] (special_realloc): New function.
11262 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11263 requests to realloc storage in the static heap.
11264
11265 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11266
11267 * bidi.c (bidi_initialize): Remove unused local.
11268
11269 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11270
11271 * bidimirror.h:
11272 * biditype.h: Remove file.
11273 * makefile.w32-in ($(BLD)/bidi.$(O)):
11274 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11275
11276 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11277
11278 * chartab.c: Improve commentary for the uniprop_table API.
11279
11280 * bidi.c (bidi_paragraph_init): Support zero value of
11281 bidi_ignore_explicit_marks_for_paragraph_level.
11282 (bidi_initialize): Use uniprop_table instead of including
11283 biditype.h and bidimirror.h.
11284
11285 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11286 coordinates of the iterator when restoring from ppos_it.
11287 (Bug#9296)
11288
11289 2011-08-14 Kenichi Handa <handa@m17n.org>
11290
11291 * process.c (create_process): Call setup_process_coding_systems
11292 after the pid of the process is set to -1 (Bug#8162).
11293
11294 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11295
11296 * xdisp.c (move_it_in_display_line_to): Don't invoke
11297 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11298 ppos_it. Fixes vertical cursor motion when line beginning is
11299 covered by an image. (Bug#9296)
11300
11301 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11302
11303 * nsterm.h (ns_run_ascript): Declare.
11304 (NSAPP_DATA2_RUNASSCRIPT): Define.
11305
11306 * nsfns.m (as_script, as_result, as_status): New static variables.
11307 (ns_run_ascript): New function.
11308 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11309 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11310 the event loop. Get status from as_status (Bug#7276).
11311
11312 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11313 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11314 the event loop (Bug#7276).
11315
11316 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11317
11318 * gnutls.c (QCgnutls_bootprop_priority)
11319 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11320 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11321 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11322 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11323 (QCgnutls_bootprop_verify_hostname_error)
11324 (QCgnutls_bootprop_callbacks_verify): Rename from
11325 Qgnutls_bootprop_..., all uses changed.
11326
11327 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11328 uses changed.
11329
11330 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11331
11332 * xfaces.c (Qframe_set_background_mode): Now static.
11333 * dispextern.h (Qframe_set_background_mode): Remove decl.
11334
11335 * process.c (Fnetwork_interface_info): Declare local only if needed.
11336
11337 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11338
11339 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11340 (Fnetwork_interface_list): Allocate in increments of bytes instead
11341 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11342 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11343 sockaddr.
11344 (struct ifflag_def): notrailers is smart on OSX.
11345 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11346 Get hardware address with getifaddrs if available.
11347
11348 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11349
11350 * xdisp.c (iterate_out_of_display_property): xassert that
11351 IT->position is set to within IT->object's boundaries. Break from
11352 the loop as soon as EOB is reached; avoids infloops in redisplay
11353 when IT->position is set up wrongly due to some bug.
11354 Set IT->current to match the bidi iterator unconditionally.
11355 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11356 entry. Force push_it to save on the stack the current
11357 buffer/string position, to be restored by pop_it. Fix flags in
11358 the iterator structure wrt the object coming from a display
11359 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11360 properties. (Bug#9284)
11361
11362 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11363
11364 * fontset.c (fontset_get_font_group): Add proper type checks.
11365 (Bug#9172)
11366
11367 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11368
11369 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11370 and LC_VERSION_MIN_MACOSX.
11371 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11372 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11373
11374 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11375
11376 * xdisp.c (forward_to_next_line_start): Allow to use the
11377 no-display-properties-and-no-overlays under bidi display.
11378 Set disp_pos in the bidi iterator to avoid searches for display
11379 properties and overlays.
11380
11381 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11382
11383 * editfns.c (Fset_time_zone_rule): Document relationship with the
11384 setenv function.
11385
11386 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11387 the font entity extracted from the cache (Bug#8109).
11388
11389 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11390
11391 * composite.c (autocmp_chars): Don't reset point. That is done by
11392 restore_point_unwind (Bug#5984).
11393
11394 2011-08-07 Juri Linkov <juri@jurta.org>
11395
11396 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11397 to show the arg `TIME' instead of `TIMEVAL'.
11398
11399 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11400
11401 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11402 display property strides EOL and includes a newline, as in
11403 longlines-mode. (Bug#9254)
11404 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11405 word-wrap under bidirectional display. (Bug#9224)
11406
11407 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11408 is non-zero, even if the data buffer is NULL. Fixes a crash in
11409 vertical-motion with longlines-mode. (Bug#9254)
11410
11411 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11412
11413 * bidi.c <bidi_cache_total_alloc>: Now static.
11414 (bidi_initialize): Initialize bidi_cache_total_alloc.
11415
11416 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11417 cache. (Bug#9221)
11418
11419 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11420 amount allocated this far in `bidi_cache_total_alloc'.
11421 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11422 non-zero, only free the data buffer without restoring the cache
11423 contents. All callers changed.
11424
11425 * dispextern.h (bidi_unshelve_cache): Update prototype.
11426
11427 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11428 (move_it_in_display_line, move_it_to)
11429 (move_it_vertically_backward, move_it_by_lines): Replace the call
11430 to xfree to an equivalent call to bidi_unshelve_cache.
11431 (move_it_in_display_line_to): Fix logic of returning
11432 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11433
11434 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11435
11436 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11437 came from a string character with a `cursor' property. (Bug#9229)
11438
11439 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11440
11441 * Makefile.in (LIB_PTHREAD): New variable.
11442 (LIBES): Add LIB_PTHREAD (Bug#9216).
11443
11444 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11445 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11446
11447 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11448
11449 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11450
11451 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11452
11453 * xterm.c (x_find_topmost_parent): New function.
11454 (x_set_frame_alpha): Find topmost parent window with
11455 x_find_topmost_parent and set the property there also (bug#9181).
11456 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11457
11458 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11459
11460 * callproc.c (Fcall_process): Avoid vfork clobbering
11461 the local vars buffer, coding_systems, current_dir.
11462
11463 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11464
11465 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11466
11467 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11468
11469 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11470 so that it is not optimized away.
11471
11472 * xdisp.c (compute_display_string_pos): Remove unused local.
11473
11474 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11475
11476 Fix slow cursor motion and scrolling in large buffers with
11477 selective display, like Org Mode buffers. (Bug#9218)
11478
11479 * dispextern.h (struct bidi_it): New member disp_prop_p.
11480
11481 * xdisp.c: Remove one-slot cache of display string positions.
11482 (compute_display_string_pos): Accept an additional argument
11483 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11484 for a display string or property. If found, set DISP_PROP_P
11485 non-zero.
11486
11487 * bidi.c (bidi_fetch_char): Accept an additional argument
11488 DISP_PROP_P, and pass it to compute_display_string_pos.
11489 Only handle text covered by a display string if DISP_PROP_P is returned
11490 non-zero. All callers of bidi_fetch_char changed.
11491
11492 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11493
11494 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11495
11496 2010-12-03 Don March <don@ohspite.net>
11497
11498 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11499 last character M-[char] is translated to ESC [char] (bug#7541).
11500
11501 2011-08-02 Kenichi Handa <handa@m17n.org>
11502
11503 * lisp.h (uniprop_table): Extern it.
11504
11505 * chartab.c (uniprop_table): Make it non-static.
11506
11507 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11508
11509 * xdisp.c (forward_to_next_line_start): Accept additional argument
11510 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11511 on the newline.
11512 (reseat_at_next_visible_line_start): Use the bidi iterator state
11513 returned by forward_to_next_line_start to restore the state of
11514 it->bidi_it after backing up to previous newline. (Bug#9212)
11515
11516 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11517
11518 * regex.c (re_comp): Protoize.
11519 (re_exec): Fix return type.
11520 (regexec): Fix type of `ret'. (Bug#9203)
11521
11522 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11523
11524 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11525 This is needed if max-image-size is a floating-point number.
11526
11527 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11528
11529 * print.c (print_object): Print empty symbol as ##.
11530
11531 * lread.c (read1): Read ## as empty symbol.
11532
11533 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11534
11535 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11536 setting frame foreground color (Bug#9175).
11537 (x_set_background_color): Likewise.
11538
11539 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11540 contents (Bug#9176).
11541 (EmacsTooltip -init): Remove bezels and add shadows to
11542 tooltip windows.
11543
11544 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11545 or scroll bar (Bug#8470).
11546
11547 * nsfont.m (nsfont_open): Remove assignment to voffset and
11548 unnecessary vars hshink, expand, hd, full_height, min_height.
11549 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11550
11551 * nsterm.h (nsfont_info): Remove voffset field.
11552
11553 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11554
11555 Implement strike-through and overline on NextStep (Bug#8863).
11556
11557 * nsfont.m (nsfont_open): Use underline position provided by font,
11558 instead of hard-coded value of 2.
11559 (nsfont_draw): Call ns_draw_text_decoration instead.
11560
11561 * nsterm.h: Add declaration for ns_draw_text_decoration.
11562
11563 * nsterm.m (ns_draw_text_decoration): New function for drawing
11564 underline, overline, and strike-through.
11565 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11566 ns_draw_text_decoration. Change treatment of cursor drawing to
11567 accommodate underlining, etc.
11568
11569 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11570
11571 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11572 default.
11573
11574 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11575
11576 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11577 Without this fix, if a signal arrives just after memory fills up,
11578 'malloc' might be invoked reentrantly.
11579
11580 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11581 In other words, assume that every image size is allowed, on non-X
11582 hosts. This assumption is probably wrong, but it lets Emacs compile.
11583
11584 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11585
11586 * regex.c (re_iswctype): Convert return values to boolean.
11587
11588 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11589
11590 * xdisp.c (compute_display_string_pos): Don't use cached display
11591 string position if the buffer had its restriction changed.
11592 (Bug#9184)
11593
11594 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11595
11596 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11597
11598 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11599
11600 Integer signedness and overflow and related fixes. (Bug#9079)
11601
11602 * bidi.c: Integer size and overflow fixes.
11603 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11604 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11605 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11606 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11607 (bidi_find_other_level_edge):
11608 Use ptrdiff_t instead of EMACS_INT where either will do.
11609 This works better on 32-bit hosts configured --with-wide-int.
11610 (bidi_cache_ensure_space): Check for size-calculation overflow.
11611 Use % rather than repeated addition, for better worst-case speed.
11612 Don't set bidi_cache_size until after xrealloc returns, because it
11613 might not return.
11614 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11615 (bidi_cache_ensure_space): Also check that the bidi cache size
11616 does not exceed that of the largest Lisp string or buffer. See Eli
11617 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11618
11619 * alloc.c (__malloc_size_t): Remove.
11620 All uses replaced by size_t. See Andreas Schwab's note
11621 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11622
11623 * image.c: Improve checking for integer overflow.
11624 (check_image_size): Assume that f is nonnull, since
11625 it is always nonnull in practice. This is one less thing to
11626 worry about when checking for integer overflow later.
11627 (x_check_image_size): New function, which checks for integer
11628 overflow issues inside X.
11629 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11630 This removes the need for a memory_full check.
11631 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11632 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11633 (xbm_read_bitmap_data): Change locals back to 'int', since
11634 their values must fit in 'int'.
11635 (xpm_load_image, png_load, tiff_load):
11636 Invoke x_create_x_image_and_pixmap earlier,
11637 to avoid much needless work if the image is too large.
11638 (tiff_load): Treat overly large images as if
11639 x_create_x_image_and_pixmap failed, not as malloc failures.
11640 (gs_load): Use x_check_image_size.
11641
11642 * gtkutil.c: Omit integer casts.
11643 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11644 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11645
11646 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11647
11648 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11649 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11650 would wrongly return t on a 64-bit host.
11651
11652 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11653 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11654 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11655 and therefore cause GCC to emit a bogus diagnostic in some cases.
11656
11657 * image.c: Integer signedness and overflow and related fixes.
11658 This is not an exhaustive set of fixes, but it's time to
11659 record what I've got.
11660 (lookup_pixel_color, check_image_size): Remove redundant decls.
11661 (check_image_size): Don't assume that arbitrary EMACS_INT values
11662 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11663 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11664 (tiff_load, imagemagick_load_image):
11665 Check for overflow in size calculations.
11666 (x_create_x_image_and_pixmap): Remove unnecessary test for
11667 xmalloc returning NULL; that can't happen.
11668 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11669 (xpm_color_bucket): Use better integer hashing function.
11670 (xpm_cache_color): Don't possibly over-allocate memory.
11671 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11672 (gif_memory_source):
11673 Use ptrdiff_t, not int or size_t, to record sizes.
11674 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11675 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11676 either works, as we prefer signed integers.
11677 (tiff_read_from_memory, tiff_write_from_memory):
11678 Return tsize_t, not size_t, since that's what the TIFF API wants.
11679 (tiff_read_from_memory): Don't fail simply because the read would
11680 go past EOF; instead, return a short read.
11681 (tiff_load): Omit no-longer-needed casts.
11682 (Fimagemagick_types): Don't assume size fits into 'int'.
11683
11684 Improve hashing quality when configured --with-wide-int.
11685 * fns.c (hash_string): New function, taken from sxhash_string.
11686 Do not discard information about ASCII character case; this
11687 discarding is no longer needed.
11688 (sxhash-string): Use it. Change sig to match it. Caller changed.
11689 * lisp.h: Declare it.
11690 * lread.c (hash_string): Remove, since we now use fns.c's version.
11691 The fns.c version returns a wider integer if --with-wide-int is
11692 specified, so this should help the quality of the hashing a bit.
11693
11694 * emacs.c: Integer overflow minor fix.
11695 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11696 Define only if GNU_LINUX.
11697 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11698
11699 * dispnew.c: Integer signedness and overflow fixes.
11700 Remove unnecessary forward decls, that were a maintenance hassle.
11701 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11702 All uses changed.
11703 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11704 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11705 (prepare_desired_row, line_draw_cost):
11706 Use int, not unsigned, where either works.
11707 (save_current_matrix, restore_current_matrix):
11708 Use ptrdiff_t, not size_t, where either works.
11709 (init_display): Check for overflow more accurately, and without
11710 relying on undefined behavior.
11711
11712 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11713 Remove, replacing with the new symbols in lisp.h. All uses changed.
11714 * fileio.c (make_temp_name):
11715 * filelock.c (lock_file_1, lock_file):
11716 * xdisp.c (message_dolog):
11717 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11718 Use pMd etc. instead.
11719 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11720 replacing the pWIDE etc. symbols removed from editfns.c.
11721
11722 * keyboard.h (num_input_events): Now uintmax_t.
11723 This is (very slightly) less likely to mess up due to wraparound.
11724 All uses changed.
11725
11726 * buffer.c: Integer signedness fixes.
11727 (alloc_buffer_text, enlarge_buffer_text):
11728 Use ptrdiff_t rather than size_t when either will do, as we prefer
11729 signed integers.
11730
11731 * alloc.c: Integer signedness and overflow fixes.
11732 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11733 (__malloc_size_t): Default to size_t, not to int.
11734 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11735 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11736 Prefer ptrdiff_t to size_t when either would do, as we prefer
11737 signed integers.
11738 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11739 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11740 Now const. Initialize with values that are in range even if char
11741 is signed.
11742 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11743 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11744 These functions do the right thing with sizes > 2**32.
11745 (check_depth): Now ptrdiff_t, not int.
11746 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11747 Adjust to new way of storing sizes. Check for size overflow bugs
11748 in rest of code.
11749 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11750 slightly wrong anyway, as it missed one instance of
11751 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11752 (refill_memory_reserve): Omit needless cast to size_t.
11753 (mark_object_loop_halt): Mark as externally visible.
11754
11755 * xselect.c: Integer signedness and overflow fixes.
11756 (Fx_register_dnd_atom, x_handle_dnd_message):
11757 Use ptrdiff_t, not size_t, since we prefer signed.
11758 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11759 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11760 x_dnd_atoms_size and x_dnd_atoms_length.
11761
11762 * doprnt.c: Prefer signed to unsigned when either works.
11763 * eval.c (verror):
11764 * doprnt.c (doprnt):
11765 * lisp.h (doprnt):
11766 * xdisp.c (vmessage):
11767 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11768 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11769 prefer signed arithmetic to avoid comparison confusion.
11770 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11771 but is a bit tricky.
11772
11773 Assume freestanding C89 headers, string.h, stdlib.h.
11774 * data.c, doprnt.c, floatfns.c, print.c:
11775 Include float.h unconditionally.
11776 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11777 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11778 * regex.c: Likewise for stddef.h, string.h.
11779 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11780 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11781 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11782 (STDC_HEADERS): Remove obsolete defines.
11783 * sysdep.c: Include limits.h unconditionally.
11784
11785 Assume support for memcmp, memcpy, memmove, memset.
11786 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11787 * regex.c (memcmp, memcpy):
11788 Remove; we assume C89 now.
11789
11790 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11791 (__malloc_safe_bcopy): Remove; no longer needed.
11792
11793 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11794 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11795 well either way, and we prefer signed to unsigned.
11796
11797 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11798
11799 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11800 closes the connection while we're reading (bug#9182).
11801
11802 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11803
11804 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11805 are specified (Bug#9168).
11806
11807 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11808
11809 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11810 Found by GCC static checking and --with-wide-int on a 32-bit host.
11811
11812 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11813
11814 * xdisp.c (compute_display_string_pos): Fix logic of caching
11815 previous display string position. Initialize cached_prev_pos to
11816 -1. Fixes slow-down at the beginning of a buffer.
11817
11818 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11819
11820 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11821 for attrs[LFACE_FONTSET_INDEX].
11822
11823 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11824
11825 * xml.c (parse_region): Remove unused local
11826 that was recently introduced.
11827
11828 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11829
11830 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11831 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11832
11833 * xdisp.c (move_it_in_display_line_to): Record the best matching
11834 position for TO_CHARPOS while scanning the line, and restore it on
11835 exit if none of the characters scanned was an exact match.
11836 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11837 when exact match is impossible due to invisible text, and the
11838 lines are truncated.
11839
11840 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11841
11842 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11843 for OSX >= 10.7.
11844
11845 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11846
11847 Fix a significant slow-down of cursor motion with C-n, C-p,
11848 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11849 auto-repeat under bidi redisplay in fontified buffers.
11850 * xdisp.c (compute_stop_pos_backwards): New function.
11851 (next_element_from_buffer): Call compute_stop_pos_backwards to
11852 find a suitable prev_stop when we find ourselves before
11853 base_level_stop.
11854 (reseat): Don't look for prev_stop, as that could mean a very long
11855 run.
11856 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11857 <cached_disp_overlay_modiff>: Cache for last found display string
11858 position.
11859 (compute_display_string_pos): Return the cached position if asked
11860 about the same buffer in the same area of character positions, and
11861 the buffer wasn't changed since the time the display string
11862 position was cached.
11863
11864 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11865
11866 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11867 is an integer, which is important for empty lines. (Bug#9149)
11868
11869 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11870
11871 * frame.c (Fmodify_frame_parameters): In tty case, update the
11872 default face if necessary (Bug#4238).
11873
11874 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11875
11876 * editfns.c (Fstring_to_char): No need to explain what a character
11877 is in the docstring (Bug#6576).
11878
11879 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11880
11881 * xml.c (parse_region): Make sure we always return a tree.
11882
11883 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11884
11885 * xml.c (parse_region): If a document contains only comments,
11886 return that, too.
11887
11888 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11889
11890 * xml.c (make_dom): Return comments, too.
11891
11892 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11893
11894 Port to OpenBSD.
11895 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11896 and the surrounding thread.
11897 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11898 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11899 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11900 timer goes off.
11901 * s/openbsd.h (BROKEN_SIGIO): Define.
11902 * unexelf.c (unexec) [__OpenBSD__]:
11903 Don't update the .mdebug section of the Alpha COFF symbol table.
11904
11905 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11906
11907 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11908 (bug#8460).
11909
11910 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11911
11912 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11913 This fixes some race conditions on the permissions of any newly
11914 created file.
11915
11916 * alloc.c (valid_pointer_p): Use pipe, not open.
11917 This fixes some permissions issues when debugging.
11918
11919 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11920 If fchown fails to set both uid and gid, try to set just gid,
11921 as that is sometimes allowed. Adjust the file's mode to eliminate
11922 setuid or setgid bits that are inappropriate if fchown fails.
11923
11924 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11925
11926 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11927 to compare Lisp_Objects.
11928 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11929 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11930 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11931
11932 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11933
11934 * lread.c (read_integer): Unread even EOF character.
11935 (read1): Likewise. Properly record start position of symbol.
11936
11937 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11938 symbol character follows.
11939
11940 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11941
11942 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11943 This works around a problem with the previous change to Fcopy_file.
11944 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11945 and without this change, GCC might complain about discarding
11946 fchown's return value.
11947
11948 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11949
11950 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11951
11952 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11953
11954 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11955
11956 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11957
11958 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11959 it's used from the C level.
11960
11961 * process.c: Use the same condition for POLL_FOR_INPUT in both
11962 keyboard.c and process.c (bug#1858).
11963
11964 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11965
11966 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11967 (Fgnutls_boot): Use it.
11968
11969 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11970
11971 * doc.c (Fsubstitute_command_keys): Revert last change.
11972
11973 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11974
11975 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11976 quotes the next character, and doesn't affect other longer
11977 sequences (bug#8935).
11978
11979 * lread.c (syms_of_lread): Clarify that is isn't only
11980 `eval-buffer' and `eval-defun' that's affected by
11981 `lexical-binding' (bug#8460).
11982
11983 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11984
11985 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11986 bidi redisplay when a line includes both an image and is truncated.
11987
11988 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11989
11990 Fix minor problems found by static checking.
11991 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11992 (elsz): Now a signed constant, not a size_t var. We prefer signed
11993 types to unsigned, to avoid integer comparison confusion. Without
11994 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11995 "cannot optimize loop, the loop counter may overflow", a symptom
11996 of the confusion.
11997 * indent.c (Fvertical_motion): Mark locals as initialized.
11998 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11999
12000 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12001
12002 * search.c (Fre_search_backward): Mention `case-fold-search' in
12003 all the re_search_* functions (bug#8138).
12004
12005 * keyboard.c (Fopen_dribble_file): Document when the file is
12006 closed (bug#8056).
12007
12008 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12009
12010 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12011 bidi_cache_idx.
12012
12013 Support bidi reordering of display and overlay strings.
12014 * xdisp.c (compute_display_string_pos)
12015 (compute_display_string_end): Accept additional argument STRING.
12016 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12017 (reseat_to_string): Initialize bidi_it->string.s and
12018 bidi_it->string.schars.
12019 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12020 NULL (avoids a crash in bidi_paragraph_init).
12021 Initialize itb.string.lstring.
12022 (init_iterator): Call bidi_init_it only of a valid
12023 buffer position was specified. Initialize paragraph_embedding to
12024 L2R.
12025 (reseat_to_string): Initialize the bidi iterator.
12026 (display_string): If we need to ignore text properties of
12027 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12028 original value of -1 will not work with bidi.)
12029 (compute_display_string_pos): First arg is now struct
12030 `text_pos *'; all callers changed. Support display properties on
12031 Lisp strings.
12032 (compute_display_string_end): Support display properties on Lisp
12033 strings.
12034 (init_iterator, reseat_1, reseat_to_string): Initialize the
12035 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12036 when iterating on a string not from display properties).
12037 (compute_display_string_pos, compute_display_string_end):
12038 Fix calculation of the object to scan. Fixes an error when using
12039 arrow keys.
12040 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12041 base_level_stop; instead, set base_level_stop to BEGV.
12042 Fixes crashes in vertical-motion.
12043 (next_element_from_buffer): Improve commentary for when
12044 the iterator is before prev_stop.
12045 (init_iterator): Initialize bidi_p from the default value of
12046 bidi-display-reordering, not from buffer-local value. Use the
12047 buffer-local value only if initializing for buffer iteration.
12048 (handle_invisible_prop): Support invisible properties on strings
12049 that are being bidi-reordered.
12050 (set_iterator_to_next): Support bidi reordering of C strings and
12051 Lisp strings.
12052 (next_element_from_string): Support bidi reordering of Lisp
12053 strings.
12054 (handle_stop_backwards): Support Lisp strings as well.
12055 (display_string): Support display of R2L glyph rows.
12056 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12057 (init_iterator): Don't initialize it->bidi_p for strings
12058 here.
12059 (reseat_to_string): Initialize it->bidi_p for strings here.
12060 (next_element_from_string, next_element_from_c_string)
12061 (next_element_from_buffer): Add xassert's for correspondence
12062 between IT's object being iterated and it->bidi_it.string
12063 structure.
12064 (face_before_or_after_it_pos): Support bidi iteration.
12065 (next_element_from_c_string): Handle the case of the first string
12066 character that is not the first one in the visual order.
12067 (get_visually_first_element): New function, refactored from common
12068 parts of next_element_from_buffer, next_element_from_string, and
12069 next_element_from_c_string.
12070 (tool_bar_lines_needed, redisplay_tool_bar)
12071 (display_menu_bar): Force left-to-right direction. Add a FIXME
12072 comment for making that be controlled by a user option.
12073 (push_it, pop_it): Save and restore the state of the
12074 bidi iterator. Save and restore the bidi_p flag.
12075 (pop_it): Iterate out of display property for string iteration as
12076 well.
12077 (iterate_out_of_display_property): Support iteration over strings.
12078 (handle_single_display_spec): Set up it->bidi_it for iteration
12079 over a display string, and call bidi_init_it.
12080 (handle_single_display_spec, next_overlay_string)
12081 (get_overlay_strings_1, push_display_prop): Set up the bidi
12082 iterator for displaying display or overlay strings.
12083 (forward_to_next_line_start): Don't use the shortcut if
12084 bidi-iterating.
12085 (back_to_previous_visible_line_start): If handle_display_prop
12086 pushed the iterator stack, restore the internal state of the bidi
12087 iterator by calling bidi_pop_it same number of times.
12088 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12089 and we are bidi-iterating, don't decrement the iterator position;
12090 instead, set the first_elt flag in the bidi iterator, to produce
12091 the same effect.
12092 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12093 (push_display_prop): xassert that we are iterating a buffer.
12094 (push_it, pop_it): Save and restore paragraph_embedding member.
12095 (handle_single_display_spec, next_overlay_string)
12096 (get_overlay_strings_1, reseat_1, reseat_to_string)
12097 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12098 correctly. Don't assume unibyte strings are not bidi-reordered.
12099 (compute_display_string_pos)
12100 (compute_display_string_end): Fix handling the case of C string.
12101 (push_it, pop_it): Save and restore from_disp_prop_p.
12102 (handle_single_display_spec, push_display_prop): Set the
12103 from_disp_prop_p flag.
12104 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12105 (pop_it): Call iterate_out_of_display_property only if we are
12106 popping after iteration over a string that came from a display
12107 property. Fix a typo in popping stretch info. Add an assertion
12108 for verifying that the iterator position is in sync with the bidi
12109 iterator.
12110 (handle_single_display_spec, get_overlay_strings_1)
12111 (push_display_prop): Fix initialization of paragraph direction for
12112 string when that of the parent object is not yet determined.
12113 (reseat_1): Call bidi_init_it to resync the bidi
12114 iterator with IT's position. (Bug#7616)
12115 (find_row_edges): If ROW->start.pos gives position
12116 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12117 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12118 Reset the from_disp_prop_p flag.
12119 (SAVE_IT, RESTORE_IT): New macros.
12120 (pos_visible_p, face_before_or_after_it_pos)
12121 (back_to_previous_visible_line_start)
12122 (move_it_in_display_line_to, move_it_in_display_line)
12123 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12124 (try_scrolling, redisplay_window, display_line): Use them when
12125 saving a temporary copy of the iterator and restoring it back.
12126 (back_to_previous_visible_line_start, reseat_1)
12127 (init_iterator): Empty the bidi cache "stack".
12128 (move_it_in_display_line_to): If iterator ended up at
12129 EOL, but we never saw any buffer positions smaller than
12130 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12131 motion in bidi-reordered lines.
12132 (move_it_in_display_line_to): Record prev_method and prev_pos
12133 immediately before the call to set_iterator_to_next. Fixes cursor
12134 motion in bidi-reordered lines with stretch glyphs and strings
12135 displayed in margins. (Bug#8133) (Bug#8867)
12136 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12137 TO_CHARPOS.
12138 (pos_visible_p): Support positions in bidi-reordered lines.
12139 Save and restore bidi cache.
12140
12141 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12142 (bidi_paragraph_info): Delete unused struct.
12143 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12144 (bidi_cache_start): New variable.
12145 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12146 to zero.
12147 (bidi_cache_fetch_state, bidi_cache_search)
12148 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12149 (bidi_cache_find, bidi_peek_at_next_level)
12150 (bidi_level_of_next_char, bidi_find_other_level_edge)
12151 (bidi_move_to_visually_next): Compare cache index with
12152 bidi_cache_start rather than with zero.
12153 (bidi_fetch_char): Accept new argument STRING; all callers
12154 changed. Support iteration over a string. Support strings with
12155 display properties. Support unibyte strings. Fix the type of
12156 `len' according to what STRING_CHAR_AND_LENGTH expects.
12157 (bidi_paragraph_init, bidi_resolve_explicit_1)
12158 (bidi_resolve_explicit, bidi_resolve_weak)
12159 (bidi_level_of_next_char, bidi_move_to_visually_next):
12160 Support iteration over a string.
12161 (bidi_set_sor_type, bidi_resolve_explicit_1)
12162 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12163 can now be zero (for strings); special values 0 and -1 were
12164 changed to -1 and -2, respectively.
12165 (bidi_char_at_pos): New function.
12166 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12167 Call it instead of FETCH_MULTIBYTE_CHAR.
12168 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12169 initialized to valid values.
12170 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12171 values.
12172 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12173 the test for valid cached positions. Fix the logic for looking up
12174 the sentinel state in the cache. GCPRO the Lisp string we are
12175 iterating.
12176 (bidi_push_it, bidi_pop_it): New functions.
12177 (bidi_initialize): Initialize the bidi cache start stack pointer.
12178 (bidi_cache_ensure_space): New function, refactored from part of
12179 bidi_cache_iterator_state. Don't assume the required size is just
12180 one BIDI_CACHE_CHUNK away.
12181 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12182 (bidi_count_bytes, bidi_char_at_pos): New functions.
12183 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12184 always valid if bidi_cache_idx is valid.
12185 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12186 is valid if it's going to be used.
12187 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12188 (bidi_cache_fetch_state, bidi_cache_search)
12189 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12190 (bidi_cache_iterator_state, bidi_cache_find)
12191 (bidi_find_other_level_edge, bidi_cache_start_stack):
12192 All variables related to cache indices are now EMACS_INT.
12193
12194 * dispextern.h (struct bidi_string_data): New structure.
12195 (struct bidi_it): New member `string'. Make flag members be 1-bit
12196 fields, and put them last in the struct.
12197 (compute_display_string_pos, compute_display_string_end):
12198 Update prototypes.
12199 (bidi_push_it, bidi_pop_it): Add prototypes.
12200 (struct iterator_stack_entry): New members bidi_p,
12201 paragraph_embedding, and from_disp_prop_p.
12202 (struct it): Member bidi_p is now a bit field 1 bit wide.
12203 (bidi_shelve_cache, bidi_unshelve_cache):
12204 Declare prototypes.
12205
12206 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12207 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12208 and vector-like objects.
12209
12210 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12211 cache around display iteration.
12212
12213 * window.c (Fwindow_end, window_scroll_pixel_based)
12214 (displayed_window_lines, Frecenter): Save and restore the bidi
12215 cache around display iteration.
12216
12217 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12218
12219 * editfns.c (Fdelete_region): Clarify the use of the named
12220 parameters (bug#6788).
12221
12222 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12223
12224 * indent.c (Fvertical_motion): Set and restore w->pointm when
12225 saving and restoring the window's buffer (Bug#9006).
12226
12227 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12228
12229 * editfns.c (Fstring_to_char): Clarify just what is returned
12230 (bug#6576). Text by Eli Zaretskii.
12231
12232 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12233
12234 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12235
12236 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12237
12238 * buffer.c (mmap_find): Fix a typo.
12239
12240 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12241
12242 Fix execution of x selection hooks.
12243 * xselect.c (Qx_lost_selection_functions)
12244 (Qx_sent_selection_functions): New vars.
12245 (syms_of_xselect): DEFSYM them.
12246 (x_handle_selection_request): Pass Qx_sent_selection_functions
12247 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12248 (x_handle_selection_clear,x_clear_frame_selections):
12249 Pass Qx_lost_selection_functions rather than
12250 Vx_lost_selection_functions to Frun_hook_with_args.
12251
12252 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12253
12254 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12255 The old code sometimes used this field without initializing it.
12256
12257 * alloc.c (gc_sweep): Don't read past end of array.
12258 In theory, the old code could also have corrupted Emacs internals,
12259 though it'd be very unlikely.
12260
12261 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12262
12263 * character.c (Fcharacterp): Don't advertise optional ignored
12264 argument. (Bug#4026)
12265
12266 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12267
12268 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12269 key" (bug#4257).
12270
12271 * window.c (Fset_window_start): Doc fix (bug#4199).
12272 (Fset_window_hscroll): Ditto.
12273
12274 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12275
12276 Fix minor new problems caught by GCC 4.6.1.
12277 * term.c (init_tty): Remove unused local.
12278 * xsettings.c (store_monospaced_changed): Define this function only
12279 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12280 not used otherwise.
12281
12282 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12283
12284 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12285
12286 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12287
12288 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12289 are the mini-buffer and the echo area (bug#3320).
12290
12291 * term.c (init_tty): Remove support for supdup, c10 and perq
12292 terminals, which are no longer supported (bug#1482).
12293
12294 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12295
12296 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12297
12298 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12299
12300 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12301 for non-popups (Bug#3642).
12302
12303 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12304
12305 * alloc.c (reset_malloc_hooks): Protoize.
12306 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12307 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12308 * cm.c (losecursor): Likewise.
12309 * data.c (fmod): Likewise.
12310 * dispnew.c (swap_glyphs_in_rows): Likewise.
12311 * emacs.c (memory_warning_signal): Likewise.
12312 * floatfns.c (float_error): Likewise.
12313 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12314 (otf_open, font_otf_capability, generate_otf_features)
12315 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12316 Likewise.
12317 * image.c (pbm_read_file): Likewise.
12318 * indent.c (string_display_width): Likewise.
12319 * intervals.c (check_for_interval, search_for_interval)
12320 (inc_interval_count, count_intervals, root_interval)
12321 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12322 * lread.c (defalias): Likewise.
12323 * ralloc.c (r_alloc_check): Likewise.
12324 * regex.c (set_image_of_range_1, set_image_of_range)
12325 (regex_grow_registers): Likewise.
12326 * sysdep.c (strerror): Likewise.
12327 * termcap.c (valid_filename_p, tprint, main): Likewise.
12328 * tparam.c (main): Likewise.
12329 * unexhp9k800.c (run_time_remap, save_data_space)
12330 (update_file_ptrs, read_header, write_header, calculate_checksum)
12331 (copy_file, copy_rest, display_header): Likewise.
12332 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12333 Likewise.
12334 * xdisp.c (check_it): Likewise.
12335 * xfaces.c (register_color, unregister_color, unregister_colors):
12336 Likewise.
12337 * xfns.c (print_fontset_result): Likewise.
12338 * xrdb.c (member, fatal, main): Likewise.
12339
12340 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12341
12342 Fix minor problems found by static checking (Bug#9031).
12343 * chartab.c (char_table_set_range, map_sub_char_table):
12344 Remove unused locals.
12345 (uniprop_table): Now static.
12346 * composite.c (_work_char): Remove unused static var.
12347
12348 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12349
12350 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12351
12352 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12353
12354 * gtkutil.c (qttip_cb): Remove code without function.
12355
12356 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12357
12358 * w32.c (pthread_sigmask): New stub.
12359
12360 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12361
12362 Use pthread_sigmask, not sigprocmask (Bug#9010).
12363 sigprocmask is portable only for single-threaded applications, and
12364 Emacs can be multi-threaded when it uses GTK.
12365 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12366 (LIBES): Use it.
12367 * callproc.c (Fcall_process):
12368 * process.c (create_process):
12369 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12370 Use pthread_sigmask, not sigprocmask.
12371
12372 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12373
12374 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12375 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12376 wrong (Bug#8591).
12377
12378 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12379
12380 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12381 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12382 (xg_hide_tooltip): Fix comment.
12383
12384 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12385 in registerServicesMenuSendTypes.
12386 (validRequestorForSendType): Don't check ns_return_types.
12387
12388 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12389 ns_return_type.
12390
12391 2011-07-08 Jason Rumney <jasonr@gnu.org>
12392
12393 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12394 SH_SHOW for hidden windows (Bug#5482).
12395
12396 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12397 frame struct members of non-existent frames (Bug#6284).
12398
12399 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12400
12401 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12402 variable firstTime not needed on OSX >= 10.6.
12403 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12404 >= 10.5. Use setKnobProportion, setDoubleValue.
12405
12406 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12407 (MAC_OS_X_VERSION_10_5): Define if not defined.
12408 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12409 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12410 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12411
12412 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12413 cString and lossyCString on OSX >= 10.4.
12414
12415 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12416 sizeToFit on OSX >= 10.2.
12417
12418 * nsimage.m (allocInitFromFile): Don't use deprecated method
12419 bestRepresentationForDevice on OSX >= 10.6.
12420
12421 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12422 to avoid warning.
12423
12424 * emacs.c: Declare unexec_init_emacs_zone.
12425
12426 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12427
12428 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12429
12430 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12431 on svcsMenu (Bug#8842).
12432
12433 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12434 ns_return_types.
12435 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12436
12437 * nsterm.m (QUTF8_STRING): Declare.
12438 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12439 (validRequestorForSendType): Return type is (id).
12440 Change indexOfObjectIdenticalTo to indexOfObject.
12441 Check if we have local selection before returning self (Bug#8842).
12442 (writeSelectionToPasteboard): Put local selection into paste board
12443 if we have a local selection (Bug#8842).
12444 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12445
12446 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12447 (ns_get_local_selection): Declare.
12448
12449 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12450
12451 * keymap.c (describe_map_tree): Don't insert a double newline at
12452 the end of the buffer (bug#1169) and return whether we inserted
12453 something.
12454
12455 * callint.c (Fcall_interactively): Change "reading args" to
12456 "providing args" to try to clarify what it does (bug#1010).
12457
12458 2011-07-07 Kenichi Handa <handa@m17n.org>
12459
12460 * composite.c (composition_compute_stop_pos): Ignore a static
12461 composition starting before CHARPOS (Bug#8915).
12462
12463 * xdisp.c (handle_composition_prop): Likewise.
12464
12465 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12466
12467 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12468 (Bug#9015)
12469
12470 2011-07-07 Kenichi Handa <handa@m17n.org>
12471
12472 * character.h (unicode_category_t): New enum type.
12473
12474 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12475 (Qchar_code_property_table): New variable.
12476 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12477 (UNIPROP_COMPRESSED_FORM_P): New macros.
12478 (char_table_ascii): Uncompress the compressed values.
12479 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12480 Uncompress the compressed values.
12481 (sub_char_table_ref_and_range): Likewise.
12482 (char_table_ref_and_range): Uncompress the compressed values.
12483 (sub_char_table_set): New arg is_uniprop. Callers changed.
12484 Uncompress the compressed values.
12485 (sub_char_table_set_range): Args changed. Callers changed.
12486 (char_table_set_range): Adjuted for the above change.
12487 (map_sub_char_table): Delete args default_val and parent. Add arg
12488 top. Give decoded values to a Lisp function.
12489 (map_char_table): Adjust for the above change. Give decoded
12490 values to a Lisp function. Gcpro more variables.
12491 (uniprop_table_uncompress)
12492 (uniprop_decode_value_run_length): New functions.
12493 (uniprop_decoder, uniprop_decoder_count): New variables.
12494 (uniprop_get_decoder, uniprop_encode_value_character)
12495 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12496 New functions.
12497 (uniprop_encoder, uniprop_encoder_count): New variables.
12498 (uniprop_get_encoder, uniprop_table)
12499 (Funicode_property_table_internal, Fget_unicode_property_internal)
12500 (Fput_unicode_property_internal): New functions.
12501 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12502 Sunicode_property_table_internal, Sget_unicode_property_internal,
12503 and Sput_unicode_property_internal. Defvar_lisp
12504 char-code-property-alist.
12505
12506 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12507 Vunicode_category_table.
12508
12509 * font.c (font_range): Adjust for the change of
12510 Vunicode_category_table.
12511
12512 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12513
12514 * m/iris4d.h: Remove file, move contents ...
12515 * s/irix6-5.h: ... here.
12516
12517 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12518
12519 Remove unportable assumption about struct layout (Bug#8884).
12520 * alloc.c (mark_buffer):
12521 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12522 (clone_per_buffer_values): Don't assume that
12523 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12524 This isn't true in general, and it's particularly not true
12525 if Emacs is configured with --with-wide-int.
12526 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12527 New macros, used in the buffer.c change.
12528
12529 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12530
12531 * xsettings.c: Use both GConf and GSettings if both are available.
12532 (store_config_changed_event): Add comment.
12533 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12534 (store_tool_bar_style_changed): New functions.
12535 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12536 (struct xsettings): Move font inside HAVE_XFT.
12537 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12538 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12539 Move inside HAVE_XFT.
12540 (something_changed_gsettingsCB): Rename from something_changedCB.
12541 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12542 also.
12543 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12544 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12545 (something_changed_gconfCB): Rename from something_changedCB.
12546 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12547 (parse_settings): Move check for font inside HAVE_XFT.
12548 (read_settings, apply_xft_settings): Add comment.
12549 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12550 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12551 call store_font_name_changed.
12552 (xft_settings_event): Add comment.
12553 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12554 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12555 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12556 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12557 (xsettings_initialize): Call init_gsettings last.
12558 (xsettings_get_system_font, xsettings_get_system_normal_font):
12559 Add comment.
12560
12561 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12562
12563 Random fixes. E.g., (random) never returned negative values.
12564 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12565 subseconds part to the entropy, as that's a bit more random.
12566 Prefer signed to unsigned, since the signedness doesn't matter and
12567 in general we prefer signed. When given a limit, use a
12568 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12569 latter isn't right if USE_2_TAGS_FOR_INTS.
12570 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12571 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12572
12573 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12574
12575 * textprop.c (text_property_stickiness):
12576 Obey Vtext_property_default_nonsticky.
12577 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12578 * w32fns.c (syms_of_w32fns):
12579 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12580
12581 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12582
12583 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12584 This is more efficient than Ffile_directory_p and avoids a minor race.
12585
12586 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12587
12588 * buffer.c (Foverlay_put): Say what the return value is
12589 (bug#7835).
12590
12591 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12592 is a directory before asking whether to use the file name
12593 (bug#7564).
12594 (barf_or_query_if_file_exists): Make the "File is a directory"
12595 error be more correct.
12596
12597 * fns.c (Frequire): Remove the mention of the .gz files, since
12598 that's installation-specific, but keep the mention of
12599 `get-load-suffixes'.
12600
12601 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12602
12603 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12604 Report string overflow if the output is too long.
12605
12606 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12607
12608 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12609 (syms_of_gnutls): Remove duplicate DEFSYM for
12610 Qgnutls_bootprop_verify_hostname_error, an error for
12611 Qgnutls_bootprop_verify_error (which is no longer used).
12612
12613 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12614 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12615 Also (re)move comments that are misplaced or no longer relevant.
12616
12617 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12618
12619 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12620
12621 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12622
12623 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12624 and background color parameters if they have been changed.
12625
12626 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12627
12628 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12629
12630 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12631
12632 * xsettings.c (SYSTEM_FONT): Define only when used.
12633 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12634
12635 * keymap.c (access_keymap_1): Now static.
12636
12637 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12638
12639 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12640 leave any prefix arg for the up event (Bug#1586).
12641
12642 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12643
12644 * lread.c (syms_of_lread): Mention single symbols defined by
12645 `defvar' or `defconst' (bug#7154).
12646
12647 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12648 (Frequire): Mention get-load-suffixes.
12649
12650 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12651
12652 * window.h (window): Remove clone_number slot.
12653 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12654 Remove.
12655 (make_parent_window, make_window, saved_window)
12656 (Fset_window_configuration, save_window_save): Don't deal with
12657 clone numbers.
12658 * buffer.c (Qclone_number): Remove declaration.
12659 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12660
12661 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12662
12663 Add multiple inheritance to keymaps.
12664 * keymap.c (Fmake_composed_keymap): New function.
12665 (Fset_keymap_parent): Simplify.
12666 (fix_submap_inheritance): Remove.
12667 (access_keymap_1): New function extracted from access_keymap to handle
12668 embedded parents and handle lists of maps.
12669 (access_keymap): Use it.
12670 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12671 (Fcopy_keymap): Handle embedded parents.
12672 (Fcommand_remapping, define_as_prefix): Simplify.
12673 (Fkey_binding): Simplify.
12674 (syms_of_keymap): Move minibuffer-local-completion-map,
12675 minibuffer-local-filename-completion-map,
12676 minibuffer-local-must-match-map, and
12677 minibuffer-local-filename-must-match-map to Elisp.
12678 (syms_of_keymap): Defsubr make-composed-keymap.
12679 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12680 (parse_menu_item): Trivial simplification.
12681
12682 2011-07-01 Glenn Morris <rgm@gnu.org>
12683
12684 * Makefile.in (SETTINGS_LIBS): Fix typo.
12685
12686 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12687
12688 * coding.c (Fencode_coding_string): Record the last coding system
12689 used, as the function doc string says (bug#8738).
12690
12691 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12692
12693 * xsettings.c (store_monospaced_changed): Take new font as arg and
12694 check for change against current_mono_font.
12695 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12696 (emacs_settings_constructor, emacs_settings_get_property)
12697 (emacs_settings_set_property, emacs_settings_class_init)
12698 (emacs_settings_init, gsettings_obj): Remove.
12699 (something_changedCB): New function for HAVE_GSETTINGS.
12700 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12701 with value as argument.
12702 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12703 g_settings_new (Bug#8967). Do not create gsettings_obj.
12704 Remove calls to g_settings_bind. Connect something_changedCB to
12705 "changed".
12706
12707 * xgselect.c: Add defined (HAVE_GSETTINGS).
12708 (xgselect_initialize): Ditto.
12709
12710 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12711 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12712 xg_select.
12713
12714 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12715
12716 * eval.c (struct backtrace): Simplify and port the data structure.
12717 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12718 signed bit field, as this assumption is not portable and it makes
12719 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12720 "char debug_on_exit : 1" as this is not portable either; instead,
12721 use the portable "unsigned int debug_on_exit : 1". Remove unused
12722 member evalargs. Remove obsolete comments about cc bombing out.
12723
12724 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12725
12726 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12727 Let HAVE_GSETTINGS override HAVE_GCONF.
12728 (store_monospaced_changed): New function.
12729 (EMACS_SETTINGS): A new type derived from GObject to handle
12730 GSettings notifications.
12731 (emacs_settings_constructor, emacs_settings_get_property)
12732 (emacs_settings_set_property, emacs_settings_class_init):
12733 New functions.
12734 (gsettings_client, gsettings_obj): New variables.
12735 (GSETTINGS_SCHEMA): New define.
12736 (something_changedCB): Call store_monospaced_changed.
12737 (init_gsettings): New function.
12738 (xsettings_initialize): Call init_gsettings.
12739 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12740 to NULL.
12741
12742 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12743 GCONF_CFLAGS/LIBS.
12744
12745 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12746
12747 * window.c (resize_root_window, grow_mini_window)
12748 (shrink_mini_window): Rename Qresize_root_window to
12749 Qwindow_resize_root_window and Qresize_root_window_vertically to
12750 Qwindow_resize_root_window_vertically.
12751
12752 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12753
12754 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12755
12756 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12757
12758 * makefile.w32-in: Redesign dependencies so they reflect more
12759 clearly which files are directly included by each source file,
12760 and not through other includes.
12761
12762 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12763
12764 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12765 (sort_overlays, overlay_strings): When an overlay's clone number
12766 matches the window's clone number process the overlay even if
12767 the overlay's window property doesn't match the current window.
12768
12769 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12770 (Fwindow_hchild): Rename to Fwindow_left_child.
12771 (Fwindow_next): Rename to Fwindow_next_sibling.
12772 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12773 (resize_window_check): Rename to window_resize_check.
12774 (resize_window_apply): Rename to window_resize_apply.
12775 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12776 (Fdelete_other_windows_internal, resize_frame_windows)
12777 (Fsplit_window_internal, Fdelete_window_internal)
12778 (grow_mini_window, shrink_mini_window)
12779 (Fresize_mini_window_internal): Fix callers accordingly.
12780
12781 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12782
12783 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12784 (emacs_fixed_set_min_size): Remove.
12785 (emacs_fixed_new): Take frame as argument.
12786
12787 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12788 (_EmacsFixedPrivate): Remove minwidth/height.
12789 Add struct frame *f.
12790 (emacs_fixed_init): Initialize priv->f.
12791 (get_parent_class, emacs_fixed_set_min_size): Remove.
12792 (emacs_fixed_new): Set priv->f to argument.
12793 (emacs_fixed_get_preferred_width)
12794 (emacs_fixed_get_preferred_height): Use min_width/height from
12795 frames size_hint to set minimum and natural (Bug#8919).
12796 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12797 and use min_width/height from frames size_hint to set
12798 min_width/height (Bug#8919).
12799
12800 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12801 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12802 Fix indentation.
12803
12804 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12805
12806 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12807 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12808 called at ZV.
12809
12810 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12811
12812 * process.c (wait_reading_process_output): Bypass select if
12813 waiting for a cell while ignoring keyboard input, and input is
12814 pending. Suggested by Jan Djärv (Bug#8869).
12815
12816 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12817
12818 Use gnulib's dup2 module instead of rolling our own.
12819 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12820
12821 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12822
12823 * dispnew.c (scrolling_window): Before scrolling, turn off a
12824 mouse-highlight in the window being scrolled.
12825
12826 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12827
12828 Move DEFSYM to lisp.h and use everywhere.
12829
12830 * character.h (DEFSYM): Move declaration...
12831 * lisp.h (DEFSYM): ...here.
12832
12833 * gnutls.c:
12834 * minibuf.c:
12835 * w32menu.c:
12836 * w32proc.c:
12837 * w32select.c: Don't include character.h.
12838
12839 * alloc.c (syms_of_alloc):
12840 * buffer.c (syms_of_buffer):
12841 * bytecode.c (syms_of_bytecode):
12842 * callint.c (syms_of_callint):
12843 * casefiddle.c (syms_of_casefiddle):
12844 * casetab.c (init_casetab_once):
12845 * category.c (init_category_once, syms_of_category):
12846 * ccl.c (syms_of_ccl):
12847 * cmds.c (syms_of_cmds):
12848 * composite.c (syms_of_composite):
12849 * dbusbind.c (syms_of_dbusbind):
12850 * dired.c (syms_of_dired):
12851 * dispnew.c (syms_of_display):
12852 * doc.c (syms_of_doc):
12853 * editfns.c (syms_of_editfns):
12854 * emacs.c (syms_of_emacs):
12855 * eval.c (syms_of_eval):
12856 * fileio.c (syms_of_fileio):
12857 * fns.c (syms_of_fns):
12858 * frame.c (syms_of_frame):
12859 * fringe.c (syms_of_fringe):
12860 * insdel.c (syms_of_insdel):
12861 * keymap.c (syms_of_keymap):
12862 * lread.c (init_obarray, syms_of_lread):
12863 * macros.c (syms_of_macros):
12864 * msdos.c (syms_of_msdos):
12865 * print.c (syms_of_print):
12866 * process.c (syms_of_process):
12867 * search.c (syms_of_search):
12868 * sound.c (syms_of_sound):
12869 * syntax.c (init_syntax_once, syms_of_syntax):
12870 * terminal.c (syms_of_terminal):
12871 * textprop.c (syms_of_textprop):
12872 * undo.c (syms_of_undo):
12873 * w32.c (globals_of_w32):
12874 * window.c (syms_of_window):
12875 * xdisp.c (syms_of_xdisp):
12876 * xfaces.c (syms_of_xfaces):
12877 * xfns.c (syms_of_xfns):
12878 * xmenu.c (syms_of_xmenu):
12879 * xsettings.c (syms_of_xsettings):
12880 * xterm.c (syms_of_xterm): Use DEFSYM.
12881
12882 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12883
12884 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12885
12886 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12887
12888 Integer and buffer overflow fixes (Bug#8873).
12889
12890 * print.c (printchar, strout): Check for string overflow.
12891 (PRINTPREPARE, printchar, strout):
12892 Don't set size unless allocation succeeds.
12893
12894 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12895 for sizes. Check for string overflow more accurately.
12896 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12897
12898 * macros.c: Integer and buffer overflow fixes.
12899 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12900 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12901 Use ptrdiff_t, not int, for sizes.
12902 Don't increment bufsize until after realloc succeeds.
12903 Check for size-calculation overflow.
12904 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12905
12906 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12907
12908 * lread.c: Integer overflow fixes.
12909 (read_integer): Radix is now EMACS_INT, not int,
12910 to improve quality of diagnostics for out-of-range radices.
12911 Calculate buffer size correctly for out-of-range radices.
12912 (read1): Check for integer overflow in radices, and in
12913 read-circle numbers.
12914 (read_escape): Avoid int overflow.
12915 (Fload, openp, read_buffer_size, read1)
12916 (substitute_object_recurse, read_vector, read_list, map_obarray):
12917 Use ptrdiff_t, not int, for sizes.
12918 (read1): Use EMACS_INT, not int, for sizes.
12919 Check for size overflow.
12920
12921 * image.c (cache_image): Check for size arithmetic overflow.
12922
12923 * lread.c: Integer overflow issues.
12924 (saved_doc_string_size, saved_doc_string_length)
12925 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12926 Now ptrdiff_t, not int.
12927 (read1): Don't assume doc string length fits in int. Check for
12928 out-of-range doc string lengths.
12929 (read_list): Don't assume file position fits in int.
12930 (read_escape): Check for hex character overflow.
12931
12932 2011-06-22 Leo Liu <sdl.web@gmail.com>
12933
12934 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12935 Move to minibuffer.el.
12936
12937 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12938
12939 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12940 The following patches are for when GLYPH_DEBUG && !XASSERT.
12941 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12942 * dispnew.c (flush_stdout):
12943 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12944 Mark as externally visible.
12945 * dispnew.c (check_window_matrix_pointers): Now static.
12946 * dispnew.c (window_to_frame_vpos):
12947 * xfns.c (unwind_create_frame):
12948 * xterm.c (x_check_font): Remove unused local.
12949 * scroll.c (CHECK_BOUNDS):
12950 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12951 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12952 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12953 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12954 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12955 Now static.
12956 (debug_method_add): Use va_list and vsprintf rather than relying
12957 on undefined behavior with wrong number of arguments.
12958 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12959 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12960 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12961 since we're not interested in debugging glyphs with old libraries.
12962 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12963 GCC 4.6.0's static checking.
12964
12965 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12966
12967 Integer overflow and signedness fixes (Bug#8873).
12968 A few related buffer overrun fixes, too.
12969
12970 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12971
12972 * dispextern.h (struct face.stipple):
12973 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12974 (x_bitmap_mask, x_allocate_bitmap_record)
12975 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12976 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12977 (x_create_bitmap_from_xpm_data):
12978 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12979 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12980 (.bitmaps_last):
12981 * xfaces.c (load_pixmap):
12982 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12983 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12984 (.bitmaps_last, struct x_output.icon_bitmap):
12985 Use ptrdiff_t, not int, for bitmap indexes.
12986 (x_allocate_bitmap_record): Check for size overflow.
12987 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12988
12989 Use ptrdiff_t, not int, for overlay counts.
12990 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12991 * editfns.c (overlays_around, get_pos_property):
12992 * textprop.c (get_char_property_and_overlay):
12993 * xdisp.c (next_overlay_change, note_mouse_highlight):
12994 * xfaces.c (face_at_buffer_position):
12995 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12996 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12997 (Fnext_overlay_change, Fprevious_overlay_change)
12998 (mouse_face_overlay_overlaps, Foverlays_in):
12999 Use ptrdiff_t, not int, for sizes.
13000 (overlays_at, overlays_in): Check for size-calculation overflow.
13001
13002 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13003
13004 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13005 (x_session_initialize): Do not assume string length fits in int.
13006
13007 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13008 This is unlikely, but can occur if DPI is outlandish.
13009
13010 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13011 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13012
13013 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13014 * xrdb.c (magic_file_p, search_magic_path):
13015 Omit last arg SUFFIX; it was always 0. All callers changed.
13016 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13017
13018 * xfont.c (xfont_match): Avoid need for strlen.
13019
13020 * xfns.c: Don't assume strlen fits in int.
13021 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13022
13023 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13024 not unsigned long, as we prefer signed integers. All callers changed.
13025 Detect integer overflow in repeat count.
13026 (message_dolog): Don't assume print length fits in 39 bytes.
13027 (display_mode_element): Don't assume strlen fits in int.
13028
13029 * termcap.c: Don't assume sizes fit in int and never overflow.
13030 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13031 (gobble_line): Check for size-calculation overflow.
13032
13033 * minibuf.c (Fread_buffer):
13034 * lread.c (intern, intern_c_string):
13035 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13036 Don't assume string length fits in int.
13037
13038 * keyboard.c (parse_tool_bar_item):
13039 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13040
13041 * font.c: Don't assume string length fits in int.
13042 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13043 Use ptrdiff_t, not int.
13044 (font_intern_prop): Don't assume string length fits in int.
13045 Don't assume integer property fits in fixnum.
13046 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13047
13048 * filelock.c: Fix some buffer overrun and integer overflow issues.
13049 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13050 Reformulate so as not to need the command string.
13051 Invoke gzip -cd rather than gunzip, as it's more portable.
13052 (lock_info_type, lock_file_1, lock_file):
13053 Don't assume pid_t and time_t fit in unsigned long.
13054 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13055 (current_lock_owner): Prefer signed type for sizes.
13056 Use memcpy, not strncpy, where memcpy is what is really wanted.
13057 Don't assume (via atoi) that time_t and pid_t fit in int.
13058 Check for time_t and/or pid_t out of range, e.g., via a network share.
13059 Don't alloca where an auto var works fine.
13060
13061 * fileio.c: Fix some integer overflow issues.
13062 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13063 Don't assume string length fits in int.
13064 (directory_file_name): Don't assume string length fits in long.
13065 (make_temp_name): Don't assume pid fits in int, or that its print
13066 length is less than 20.
13067
13068 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13069
13070 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13071
13072 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13073
13074 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13075 We prefer signed integers, even for size calculations.
13076
13077 * emacs.c: Don't assume string length fits in 'int'.
13078 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13079 (main): Don't invoke strlen when not needed.
13080
13081 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13082 (XD_DEBUG_MESSAGE): Don't waste a byte.
13083
13084 * callproc.c (getenv_internal_1, getenv_internal)
13085 (Fgetenv_internal):
13086 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13087
13088 * lread.c (invalid_syntax): Omit length argument.
13089 All uses changed. This doesn't fix a bug, but it simplifies the
13090 code away from its former Hollerith-constant appearance, and it's
13091 one less 'int' to worry about when looking at integer-overflow issues.
13092 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13093
13094 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13095 This didn't break anything, but it didn't help either.
13096 It's confusing to put a bogus integer in a place where the actual
13097 value does not matter.
13098 (LIST_END_P): Remove unused macro and its bogus comment.
13099 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13100
13101 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13102 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13103 implementation.
13104 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13105 We prefer signed types, and the value cannot exceed the EMACS_INT
13106 range anyway (because otherwise the length would not be representable).
13107 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13108 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13109 This avoids a GCC warning when WIDE_EMACS_INT.
13110
13111 * indent.c (sane_tab_width): New function.
13112 (current_column, scan_for_column, Findent_to, position_indentation)
13113 (compute_motion): Use it. This is just for clarity.
13114 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13115
13116 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13117
13118 * lisp.h (lint_assume): New macro.
13119 * composite.c (composition_gstring_put_cache):
13120 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13121
13122 * editfns.c, insdel.c:
13123 Omit unnecessary forward decls, to simplify future changes.
13124
13125 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13126
13127 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13128
13129 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13130 Use much-faster test for byte-length change.
13131 Don't assume string byte-length fits in 'int'.
13132 Check that character arg fits in 'int'.
13133 (mapcar1): Declare byte as byte, for clarity.
13134
13135 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13136
13137 * fns.c (concat): Catch string overflow earlier.
13138 Do not rely on integer wraparound.
13139
13140 * dispextern.h (struct it.overlay_strings_charpos)
13141 (struct it.selective): Now EMACS_INT, not int.
13142 * xdisp.c (forward_to_next_line_start)
13143 (back_to_previous_visible_line_start)
13144 (reseat_at_next_visible_line_start, next_element_from_buffer):
13145 Don't arbitrarily truncate the value of 'selective' to int.
13146
13147 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13148
13149 * composite.c: Don't truncate sizes to 'int'.
13150 (composition_gstring_p, composition_reseat_it)
13151 (composition_adjust_point): Use EMACS_INT, not int.
13152 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13153 not EMACS_UINT, for indexes.
13154
13155 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13156
13157 * buffer.c: Include <verify.h>.
13158 (struct sortvec.priority, struct sortstr.priority):
13159 Now EMACS_INT, not int.
13160 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13161 (struct sortstr.size, record_overlay_string)
13162 (struct sortstrlist.size, struct sortlist.used):
13163 Don't truncate size to int.
13164 (record_overlay_string): Check for size-calculation overflow.
13165 (init_buffer_once): Check at compile-time, not run-time.
13166
13167 2011-06-22 Jim Meyering <meyering@redhat.com>
13168
13169 Don't leak an XBM-image-sized buffer
13170 * image.c (xbm_load): Free the image buffer after using it.
13171
13172 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13173
13174 Port to Sun C.
13175 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13176 that Sun C diagnosed.
13177 * fns.c (secure_hash): Fix pointer signedness issue.
13178 * intervals.c (static_offset_intervals): New function.
13179 (offset_intervals): Use it.
13180
13181 2011-06-21 Leo Liu <sdl.web@gmail.com>
13182
13183 * deps.mk (fns.o):
13184 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13185 sha512.h.
13186
13187 * fns.c (secure_hash): Rename from crypto_hash_function and change
13188 the first arg to accept symbols.
13189 (Fsecure_hash): New primitive.
13190 (syms_of_fns): New symbols.
13191
13192 2011-06-20 Deniz Dogan <deniz@dogan.se>
13193
13194 * process.c (Fset_process_buffer): Clarify return value in
13195 docstring.
13196
13197 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13198
13199 * dispnew.c (add_window_display_history): Use BVAR.
13200
13201 * xdisp.c (debug_method_add): Use BVAR.
13202 (check_window_end, dump_glyph_matrix, dump_glyph)
13203 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13204
13205 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13206 Likewise.
13207
13208 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13209 check till after the cache is created in init_frame_faces.
13210
13211 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13212
13213 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13214
13215 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13216
13217 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13218 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13219 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13220
13221 Improve buffer-overflow checking (Bug#8873).
13222 * fileio.c (Finsert_file_contents):
13223 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13224 Remove the old (too-loose) buffer overflow checks.
13225 They weren't needed, since make_gap checks for buffer overflow.
13226 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13227 The old code merely checked for Emacs fixnum overflow, and relied
13228 on undefined (wraparound) behavior. The new code avoids undefined
13229 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13230
13231 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13232 Tune. Don't use wider integers than needed. Don't use alloca.
13233 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13234
13235 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13236
13237 * insdel.c, lisp.h (buffer_overflow): New function.
13238 (insert_from_buffer_1, replace_range, replace_range_2):
13239 * insdel.c (make_gap_larger):
13240 * editfns.c (Finsert_char):
13241 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13242
13243 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13244
13245 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13246
13247 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13248
13249 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13250 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13251
13252 * fileio.c: Don't assume EMACS_INT fits in off_t.
13253 (emacs_lseek): New static function.
13254 (Finsert_file_contents, Fwrite_region): Use it.
13255 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13256
13257 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13258
13259 * fns.c: Don't overflow int when computing a list length.
13260 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13261 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13262 truncation on 64-bit hosts. Check for QUIT every
13263 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13264 faster and is responsive enough.
13265 (Flength): Report an error instead of overflowing an integer.
13266 (Fsafe_length): Return a float if the value is not representable
13267 as a fixnum. This shouldn't happen except in contrived situations.
13268 (Fnthcdr, Fsort): Don't assume list length fits in int.
13269 (Fcopy_sequence): Don't assume vector length fits in int.
13270
13271 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13272 (header_size, word_size): New constants.
13273 (allocate_vectorlike): Don't check size overflow here.
13274 (allocate_vector): Check it here instead, since this is the only
13275 caller of allocate_vectorlike that could cause overflow.
13276 Check that the new vector's length is representable as a fixnum.
13277
13278 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13279 The previous code was bogus. For example, next_almost_prime (32)
13280 returned 39, which is undesirable as it is a multiple of 3; and
13281 next_almost_prime (24) returned 25, which is a multiple of 5 so
13282 why was the code bothering to check for multiples of 7?
13283
13284 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13285
13286 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13287
13288 Variadic C functions now count arguments with ptrdiff_t.
13289 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13290 Back then I didn't know that the Emacs coding style prefers signed int.
13291 Also, in the meantime I found a few more instances where arguments
13292 were being counted with int, which may truncate counts on 64-bit
13293 machines, or EMACS_INT, which may be unnecessarily wide.
13294 * lisp.h (struct Lisp_Subr.function.aMANY)
13295 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13296 Arg counts are now ptrdiff_t, not size_t.
13297 All variadic functions and their callers changed accordingly.
13298 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13299 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13300 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13301 * callint.c (Fcall_interactively): Check arg count for overflow,
13302 to avoid potential buffer overrun. Use signed char, not 'int',
13303 for 'varies' array, so that we needn't bother to check its size
13304 calculation for overflow.
13305 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13306 * eval.c (apply_lambda):
13307 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13308 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13309 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13310
13311 * callint.c (Fcall_interactively): Don't use index var as event count.
13312
13313 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13314 * mem-limits.h (SIZE): Remove; no longer used.
13315
13316 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13317
13318 Remove unnecessary casts.
13319 * xterm.c (x_term_init):
13320 * xfns.c (x_set_border_pixel):
13321 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13322 These aren't needed now that we assume ANSI C.
13323
13324 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13325 It's more likely to cause problems (due to unsigned overflow)
13326 than to cure them.
13327
13328 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13329
13330 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13331
13332 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13333
13334 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13335
13336 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13337
13338 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13339
13340 GLYPH_CODE_FACE returns EMACS_INT, not int.
13341 * dispextern.h (merge_faces):
13342 * xfaces.c (merge_faces):
13343 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13344 Don't assume EMACS_INT fits in int.
13345
13346 * character.h (CHAR_VALID_P): Remove unused parameter.
13347 * fontset.c, lisp.h, xdisp.c: All uses changed.
13348
13349 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13350
13351 * fns.c (concat): Minor tuning based on overflow analysis.
13352 This doesn't fix any bugs. Use int to hold character, instead
13353 of constantly refetching from Emacs object. Use XFASTINT, not
13354 XINT, for value known to be a character. Don't bother comparing
13355 a single byte to 0400, as it's always less.
13356
13357 * floatfns.c (Fexpt):
13358 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13359
13360 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13361 for characters.
13362
13363 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13364
13365 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13366 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13367 incorrectly succeed when S was a string, because 4294967386 was
13368 truncated before it was used.
13369
13370 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13371 Otherwise, an out-of-range integer could cause undefined behavior
13372 on a 64-bit host.
13373
13374 * composite.c: Use int, not EMACS_INT, for characters.
13375 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13376 EMACS_INT, for values that are known to be in character range.
13377 This doesn't fix any bugs but is the usual style inside Emacs and
13378 may generate better code on 32-bit machines.
13379
13380 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13381 This is for reasons similar to the recent CHAR_STRING fix.
13382 * charset.c (Fencode_char): Check that character arg is actually
13383 a character. Pass an int to ENCODE_CHAR.
13384 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13385 wider than 'int', as a compile-time check to prevent future regressions
13386 in this area.
13387
13388 * character.c (char_string): Remove unnecessary casts.
13389
13390 Make sure a 64-bit char is never passed to CHAR_STRING.
13391 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13392 by silently ignoring the top 32 bits, allowing some values
13393 that were far too large to be valid characters.
13394 * character.h: Include <verify.h>.
13395 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13396 arguments are no wider than unsigned, as a compile-time check
13397 to prevent future regressions in this area.
13398 * data.c (Faset):
13399 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13400 (Fsubst_char_in_region):
13401 * fns.c (concat):
13402 * xdisp.c (decode_mode_spec_coding):
13403 Adjust to CHAR_STRING's new requirement.
13404 * editfns.c (Finsert_char, Fsubst_char_in_region):
13405 * fns.c (concat): Check that character args are actually
13406 characters. Without this test, these functions did the wrong
13407 thing with wildly out-of-range values on 64-bit hosts.
13408
13409 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13410 These casts should not be needed on 32-bit hosts, either.
13411 * keyboard.c (read_char):
13412 * lread.c (Fload): Remove casts to unsigned.
13413
13414 * lisp.h (UNSIGNED_CMP): New macro.
13415 This fixes comparison bugs on 64-bit hosts.
13416 (ASCII_CHAR_P): Use it.
13417 * casefiddle.c (casify_object):
13418 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13419 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13420 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13421 * dispextern.h (FACE_FROM_ID):
13422 * keyboard.c (read_char): Use UNSIGNED_CMP.
13423
13424 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13425 not to EMACS_INT, to avoid GCC warning.
13426
13427 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13428
13429 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13430 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13431 isn't needed on 32-bit machines.
13432
13433 * buffer.c (Fgenerate_new_buffer_name):
13434 Use EMACS_INT for count, not int.
13435 (advance_to_char_boundary): Return EMACS_INT, not int.
13436
13437 * data.c (Qcompiled_function): Now static.
13438
13439 * window.c (window_body_lines): Now static.
13440
13441 * image.c (gif_load): Rename local to avoid shadowing.
13442
13443 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13444 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13445 * alloc.c (make_save_value): Integer argument is now of type
13446 ptrdiff_t, not int.
13447 (mark_object): Use ptrdiff_t, not int.
13448 * lisp.h (pD): New macro.
13449 * print.c (print_object): Use it.
13450
13451 * alloc.c: Use EMACS_INT, not int, to count objects.
13452 (total_conses, total_markers, total_symbols, total_vector_size)
13453 (total_free_conses, total_free_markers, total_free_symbols)
13454 (total_free_floats, total_floats, total_free_intervals)
13455 (total_intervals, total_strings, total_free_strings):
13456 Now EMACS_INT, not int. All uses changed.
13457 (Fgarbage_collect): Compute overall total using a double, so that
13458 integer overflow is less likely to be a problem. Check for overflow
13459 when converting back to an integer.
13460 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13461 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13462 These were 'int' variables that could overflow on 64-bit hosts;
13463 they were never used, so remove them instead of repairing them.
13464 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13465 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13466 Previously, this ceilinged at INT_MAX, but that doesn't work on
13467 64-bit machines.
13468 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13469
13470 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13471 (allocate_vectorlike): Check for ptrdiff_t overflow.
13472 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13473 when a (possibly-narrower) signed value would do just as well.
13474 We prefer using signed arithmetic, to avoid comparison confusion.
13475
13476 * alloc.c: Catch some string size overflows that we were missing.
13477 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13478 for convenience in STRING_BYTES_MAX.
13479 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13480 The definition here is exact; the one in lisp.h was approximate.
13481 (allocate_string_data): Check for string overflow. This catches
13482 some instances we weren't catching before. Also, it catches
13483 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13484 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13485 and ptrdiff_t and EMACS_INT are both 64 bits.
13486
13487 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13488 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13489 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13490
13491 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13492
13493 * alloc.c (Fmake_string): Check for out-of-range init.
13494
13495 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13496
13497 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13498
13499 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13500
13501 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13502 xg_get_default_scrollbar_width.
13503
13504 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13505 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13506 (style_changed_cb): Call update_theme_scrollbar_width and call
13507 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13508 all frames (Bug#8505).
13509 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13510 Call gtk_window_set_resizable if HAVE_GTK3.
13511 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13512 and height if HAVE_GTK3 (Bug#8505).
13513 (scroll_bar_width_for_theme): New variable.
13514 (update_theme_scrollbar_width): New function.
13515 (xg_get_default_scrollbar_width): Move code to
13516 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13517 (xg_initialize): Call update_theme_scrollbar_width.
13518
13519 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13520
13521 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13522
13523 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13524
13525 * frame.c (make_frame): Call other_buffer_safely instead of
13526 other_buffer.
13527
13528 * window.c (temp_output_buffer_show): Call display_buffer with
13529 second argument Vtemp_buffer_show_specifiers and reset latter
13530 immediately after the call.
13531 (Vtemp_buffer_show_specifiers): New variable.
13532 (auto_window_vscroll_p, next_screen_context_lines)
13533 (Vscroll_preserve_screen_position): Remove leading asterisks from
13534 doc-strings.
13535
13536 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13537
13538 Fix minor problems found by GCC 4.6.0 static checking.
13539 * buffer.c (Qclone_number): Remove for now, as it's unused.
13540 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13541 (record_buffer): Remove unused local.
13542 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13543 (set_frame_buffer_list): Remove; unused.
13544 * frame.h (other_visible_frames): Remove decl.
13545 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13546 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13547 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13548 if HAVE_GPM.
13549 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13550 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13551 Define only if HAVE_GPM.
13552 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13553 (update_hints_inhibit): Remove; never set. All uses removed.
13554 * widgetprv.h (emacsFrameClassRec): Remove decl.
13555 * window.c (delete_deletable_window): Now returns void, since it
13556 wasn't returning anything.
13557 (compare_window_configurations): Remove unused locals.
13558 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13559 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13560 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13561 the same widths as pointers. This follows up on the 2011-05-06 patch.
13562 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13563 * xterm.h: Likewise.
13564 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13565
13566 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13567
13568 * makefile.w32-in: Update dependencies.
13569 (LISP_H): Add lib/intprops.h.
13570
13571 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13572
13573 * image.c (gif_load): Add animation frame delay to the metadata.
13574 (syms_of_image): Use DEFSYM. New symbol `delay'.
13575
13576 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13577
13578 * window.c (delete_deletable_window): Re-add.
13579 (Fset_window_configuration): Rewrite to handle dead buffers and
13580 consequently deletable windows.
13581 (window_tree, Fwindow_tree): Remove. Supply functionality in
13582 window.el.
13583 (compare_window_configurations): Simplify code.
13584
13585 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13586
13587 * image.c (imagemagick_load_image): Fix type mismatch.
13588 (Fimagemagick_types): Likewise.
13589
13590 * window.h (replace_buffer_in_windows): Declare.
13591
13592 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13593
13594 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13595 Qclone_number. Remove external declaration of Qdelete_window.
13596 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13597 code.
13598 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13599 Run Qbuffer_list_update_hook if allowed.
13600 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13601 buffer list implementation.
13602 (other_buffer_safely): New function.
13603 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13604 calls to replace_buffer_in_windows and
13605 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13606 if allowed.
13607 (record_buffer): Inhibit quitting and rewrite using quittable
13608 functions. Run Qbuffer_list_update_hook if allowed.
13609 (Frecord_buffer, Funrecord_buffer): New functions.
13610 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13611 Move switch-to-buffer to window.el.
13612 (bury-buffer): Move to window.el.
13613 (Vbuffer_list_update_hook): New variable.
13614
13615 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13616 section.
13617
13618 * window.h (resize_frame_windows): Move up in code.
13619 (Fwindow_frame): Remove EXFUN.
13620 (replace_buffer_in_all_windows): Remove prototype.
13621 (replace_buffer_in_windows_safely): Add prototype.
13622
13623 * window.c: Declare Qdelete_window static again. Move down
13624 declaration of select_count.
13625 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13626 (Fother_window): Move to window.el.
13627 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13628 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13629 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13630 window.el.
13631 (replace_buffer_in_windows): Implement by calling
13632 Qreplace_buffer_in_windows.
13633 (replace_buffer_in_all_windows): Remove with some functionality
13634 moved into replace_buffer_in_windows_safely.
13635 (replace_buffer_in_windows_safely): New function.
13636 (select_window_norecord, select_frame_norecord): Move in front
13637 of run_window_configuration_change_hook. Remove now obsolete
13638 declarations.
13639 (Fset_window_buffer): Rewrite doc-string.
13640 Call Qrecord_window_buffer.
13641 (keys_of_window): Move binding for other-window to window.el.
13642
13643 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13644
13645 * dispextern.h (struct image): Replace data member, whose int_val
13646 and ptr_val fields were not used by anything, with a single
13647 lisp_val object.
13648
13649 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13650 (gif_clear_image, gif_load, imagemagick_load_image)
13651 (gs_clear_image, gs_load): Callers changed.
13652
13653 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13654
13655 * buffer.h: Include <time.h>, for time_t.
13656 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13657
13658 Fix minor problems found by static checking.
13659
13660 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13661
13662 Make identifiers static if they are not used in other modules.
13663 * data.c (Qcompiled_function, Qframe, Qvector):
13664 * image.c (QimageMagick, Qsvg):
13665 * minibuf.c (Qmetadata):
13666 * window.c (resize_window_check, resize_root_window): Now static.
13667 * window.h (resize_window_check, resize_root_window): Remove decls.
13668
13669 * window.c (window_deletion_count, delete_deletable_window):
13670 Remove; unused.
13671 (window_body_lines): Now static.
13672 (Fdelete_other_windows_internal): Mark vars as initialized.
13673 Make sure 'resize_failed' is initialized.
13674 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13675 (resize_window_apply): Remove unused local.
13676 * window.h (delete_deletable_window): Remove decl.
13677
13678 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13679 (imagemagick_load_image): Fix pointer signedness problem by changing
13680 last arg from unsigned char * to char *. All uses changed.
13681 Also, fix a local for similar reasons.
13682 Remove unused locals. Remove locals to avoid shadowing.
13683 (fn_rsvg_handle_free): Remove; unused.
13684 (svg_load, svg_load_image): Fix pointer signedness problem.
13685 (imagemagick_load_image): Don't use garbage pointer image_wand.
13686
13687 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13688
13689 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13690
13691 * image.c (gif_load): Fix omitted cast error introduced by
13692 2011-06-06 change.
13693
13694 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13695
13696 * window.h (resize_proportionally, orig_total_lines)
13697 (orig_top_line): Remove from window structure.
13698 (set_window_height, set_window_width, change_window_heights)
13699 (Fdelete_window): Remove prototypes.
13700 (resize_frame_windows): Remove duplicate declaration.
13701
13702 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13703
13704 * window.h (resize_frame_windows, resize_window_check)
13705 (delete_deletable_window, resize_root_window)
13706 (resize_frame_windows): Declare prototypes.
13707
13708 * window.c (resize_window_apply): Make definition be "static" to
13709 match the prototype.
13710
13711 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13712
13713 * window.c: Remove declarations of Qwindow_size_fixed,
13714 window_min_size_1, window_min_size_2, window_min_size,
13715 size_window, window_fixed_size_p, enlarge_window, delete_window.
13716 Remove static from declaration of Qdelete_window, it's
13717 temporarily needed by Fbury_buffer.
13718 (replace_window): Don't assign orig_top_line and
13719 orig_total_lines.
13720 (Fdelete_window, delete_window): Remove. Window deletion is
13721 handled by window.el.
13722 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13723 Replace Fdelete_window calls with calls to Qdelete_window.
13724 (Fdelete_other_windows): Remove. Deleting other windows is
13725 handled by window.el.
13726 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13727 handled in window.el.
13728 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13729 Window minimum sizes are handled in window.el.
13730 (shrink_windows, size_window, set_window_height)
13731 (set_window_width, change_window_heights, window_height)
13732 (window_width, CURBEG, CURSIZE, enlarge_window)
13733 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13734 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13735 handled in window.el.
13736 (make_dummy_parent): Rename to make_parent_window and give it a
13737 second argument horflag.
13738 (make_window): Don't set resize_proportionally any more.
13739 (Fsplit_window): Remove. Windows are split in window.el.
13740 (save_restore_action, save_restore_orig_size)
13741 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13742 Resize mini windows in window.el.
13743 (grow_mini_window, shrink_mini_window): Implement by calling
13744 Qresize_root_window_vertically, resize_window_check and
13745 resize_window_apply.
13746 (saved_window, Fset_window_configuration, save_window_save):
13747 Do not handle orig_top_line, orig_total_lines, and
13748 resize_proportionally.
13749 (window_min_height, window_min_width): Move to window.el.
13750 (keys_of_window): Move bindings for delete-other-windows,
13751 split-window, delete-window and enlarge-window to window.el.
13752
13753 * buffer.c: Temporarily extern Qdelete_window.
13754 (Fbury_buffer): Temporarily call Qdelete_window instead of
13755 Fdelete_window (Fbury_buffer will move to window.el soon).
13756
13757 * frame.c (set_menu_bar_lines_1): Remove code handling
13758 orig_top_line and orig_total_lines.
13759
13760 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13761 set_window_height but set heights directly.
13762 (change_frame_size_1): Use resize_frame_windows.
13763
13764 * xdisp.c (init_xdisp): Don't use set_window_height but set
13765 heights directly.
13766
13767 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13768 Use resize_frame_windows instead of change_window_heights and run
13769 run_window_configuration_change_hook.
13770
13771 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13772 instead of change_window_heights and run
13773 run_window_configuration_change_hook.
13774
13775 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13776
13777 * window.c (replace_window): Rename second argument REPLACEMENT to
13778 NEW. New third argument SETFLAG. Rewrite.
13779 (delete_window, make_dummy_parent): Call replace_window with
13780 third argument 1.
13781 (window_list_1): Move down in code.
13782 (run_window_configuration_change_hook): Move set_buffer part
13783 before select_frame_norecord part in order to unwind correctly.
13784 Rename count1 to count.
13785 (recombine_windows, delete_deletable_window, resize_root_window)
13786 (Fdelete_other_windows_internal)
13787 (Frun_window_configuration_change_hook, make_parent_window)
13788 (resize_window_check, resize_window_apply, Fresize_window_apply)
13789 (resize_frame_windows, Fsplit_window_internal)
13790 (Fdelete_window_internal, Fresize_mini_window_internal):
13791 New functions.
13792 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13793
13794 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13795
13796 * window.h (window): Add some new members to window structure -
13797 normal_lines, normal_cols, new_total, new_normal, clone_number,
13798 splits, nest, prev_buffers, next_buffers.
13799 (WINDOW_TOTAL_SIZE): Move here from window.c.
13800 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13801
13802 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13803 Remove.
13804 (make_dummy_parent): Set new members of windows structure.
13805 (make_window): Move down in code. Handle new members of window
13806 structure.
13807 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13808 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13809 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13810 (Fset_window_prev_buffers, Fwindow_next_buffers)
13811 (Fset_window_next_buffers, Fset_window_clone_number):
13812 New functions.
13813 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13814 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13815 Doc-string fixes.
13816 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13817 Argument WINDOW can be now internal window too.
13818 (Fwindow_use_time): Move up in code.
13819 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13820 Rewrite doc-string.
13821 (Fset_window_configuration, saved_window)
13822 (Fcurrent_window_configuration, save_window_save): Handle new
13823 members of window structure.
13824 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13825 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13826 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13827 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13828 Qget_mru_window, Qresize_root_window,
13829 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13830 Qauto_buffer_name; staticpro them.
13831
13832 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13833
13834 * window.c (Fwindow_total_size, Fwindow_left_column)
13835 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13836 (Fwindow_list_1): New functions.
13837 (window_box_text_cols): Replace with window_body_cols.
13838 (Fwindow_width, Fscroll_left, Fscroll_right):
13839 Use window_body_cols instead of window_box_text_cols.
13840 (delete_window, Fset_window_configuration):
13841 Call delete_all_subwindows with window as argument.
13842 (delete_all_subwindows): Take a window as argument and not a
13843 structure. Rewrite.
13844 (window_loop): Remove handling of GET_LRU_WINDOW and
13845 GET_LARGEST_WINDOW.
13846 (Fget_lru_window, Fget_largest_window): Move to window.el.
13847
13848 * window.h: Extern window_body_cols instead of
13849 window_box_text_cols. delete_all_subwindows now takes a
13850 Lisp_Object as argument.
13851
13852 * indent.c (compute_motion, Fcompute_motion):
13853 Use window_body_cols instead of window_box_text_cols.
13854
13855 * frame.c (delete_frame): Call delete_all_subwindows with root
13856 window as argument.
13857
13858 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13859
13860 * fns.c (Fputhash): Document return value.
13861
13862 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13863
13864 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13865
13866 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13867
13868 Cons<->int and similar integer overflow fixes (Bug#8794).
13869
13870 Check for overflow when converting integer to cons and back.
13871 * charset.c (Fdefine_charset_internal, Fdecode_char):
13872 Use cons_to_unsigned to catch overflow.
13873 (Fencode_char): Use INTEGER_TO_CONS.
13874 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13875 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13876 * data.c (long_to_cons, cons_to_long): Remove.
13877 (cons_to_unsigned, cons_to_signed): New functions.
13878 These signal an error for invalid or out-of-range values.
13879 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13880 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13881 * font.c (Ffont_variation_glyphs):
13882 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13883 * lisp.h: Include <intprops.h>.
13884 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13885 (cons_to_signed, cons_to_unsigned): New decls.
13886 (long_to_cons, cons_to_long): Remove decls.
13887 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13888 (Fprimitive_undo): Use CONS_TO_INTEGER.
13889 * xfns.c (Fx_window_property): Likewise.
13890 * xselect.c: Include <limits.h>.
13891 (x_own_selection, selection_data_to_lisp_data):
13892 Use INTEGER_TO_CONS.
13893 (x_handle_selection_request, x_handle_selection_clear)
13894 (x_get_foreign_selection, Fx_disown_selection_internal)
13895 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13896 (lisp_data_to_selection_data): Use cons_to_unsigned.
13897 (x_fill_property_data): Use cons_to_signed.
13898 Report values out of range.
13899
13900 Check for buffer and string overflow more precisely.
13901 * buffer.h (BUF_BYTES_MAX): New macro.
13902 * lisp.h (STRING_BYTES_MAX): New macro.
13903 * alloc.c (Fmake_string):
13904 * character.c (string_escape_byte8):
13905 * coding.c (coding_alloc_by_realloc):
13906 * doprnt.c (doprnt):
13907 * editfns.c (Fformat):
13908 * eval.c (verror):
13909 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13910 since they may not be the same number.
13911 * editfns.c (Finsert_char):
13912 * fileio.c (Finsert_file_contents):
13913 Likewise for BUF_BYTES_MAX.
13914
13915 * image.c: Use ptrdiff_t, not int, for sizes.
13916 (slurp_file): Switch from int to ptrdiff_t.
13917 All uses changed.
13918 (slurp_file): Check that file size fits in both size_t (for
13919 malloc) and ptrdiff_t (for sanity and safety).
13920
13921 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13922 if b->modtime has its maximal value.
13923
13924 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13925
13926 Don't assume time_t can fit into int.
13927 * buffer.h (struct buffer.modtime): Now time_t, not int.
13928 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13929 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13930
13931 Minor fixes for signed vs unsigned integers.
13932 * character.h (MAYBE_UNIFY_CHAR):
13933 * charset.c (maybe_unify_char):
13934 * keyboard.c (read_char, reorder_modifiers):
13935 XINT -> XFASTINT, since the integer must be nonnegative.
13936 * ftfont.c (ftfont_spec_pattern):
13937 * keymap.c (access_keymap, silly_event_symbol_error):
13938 XUINT -> XFASTINT, since the integer must be nonnegative.
13939 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13940 since it makes no difference and we prefer signed.
13941 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13942 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13943 nonnegative.
13944
13945 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13946
13947 * window.h (Fwindow_frame): Declare.
13948
13949 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13950
13951 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13952 (SPARE_MEMORY): Always define.
13953 (LARGE_REQUEST): Remove.
13954 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13955
13956 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13957
13958 * lisp.h: Move EXFUNS for Fframe_root_window,
13959 Fframe_first_window and Fset_frame_selected_window to window.h.
13960
13961 * window.h: Move EXFUNS for Fframe_root_window,
13962 Fframe_first_window and Fset_frame_selected_window here from
13963 lisp.h.
13964
13965 * frame.c (Fwindow_frame, Fframe_first_window)
13966 (Fframe_root_window, Fframe_selected_window)
13967 (Fset_frame_selected_window): Move to window.c.
13968 (Factive_minibuffer_window): Move to minibuf.c.
13969 (Fother_visible_frames_p): New function.
13970
13971 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13972
13973 * window.c (decode_window, decode_any_window): Move up in code.
13974 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13975 (inhibit_frame_unsplittable): Remove unused variable.
13976 (Fwindow_buffer): Move up and rewrite doc-string.
13977 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13978 (Fwindow_prev): New functions.
13979 (Fwindow_frame): Move here from frame.c. Accept any window as
13980 argument.
13981 (Fframe_root_window, Fframe_first_window)
13982 (Fframe_selected_window): Move here from frame.c. Accept frame
13983 or arbitrary window as argument. Update doc-strings.
13984 (Fminibuffer_window): Move up in code.
13985 (Fwindow_minibuffer_p): Move up in code and simplify.
13986 (Fset_frame_selected_window): Move here from frame.c.
13987 Marginal rewrite.
13988 (Fselected_window, select_window, Fselect_window): Move up in
13989 code. Minor doc-string fixes.
13990
13991 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13992
13993 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13994 Do not assume that spare memory exists; that assumption is valid
13995 only if SYSTEM_MALLOC.
13996 (LARGE_REQUEST): New macro, so that the issue of large requests
13997 is separated from the issue of spare memory.
13998
13999 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14000
14001 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14002 format. (Bug#8806)
14003
14004 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14005
14006 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14007 before statements.
14008
14009 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14010
14011 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14012
14013 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14014
14015 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14016 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14017
14018 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14019
14020 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14021
14022 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14023
14024 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14025 (x_clipboard_manager_save): Add return value.
14026 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14027 New error handlers.
14028 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14029 Obey Vx_select_enable_clipboard_manager. Catch errors in
14030 x_clipboard_manager_save (Bug#8779).
14031 (Vx_select_enable_clipboard_manager): New variable.
14032 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14033
14034 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14035
14036 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14037
14038 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14039
14040 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14041 in the current matrix if keep_current_p is non-zero.
14042
14043 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14044
14045 * bidi.c (bidi_level_of_next_char): Fix last change.
14046
14047 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14048
14049 Support bidi reordering of text covered by display properties.
14050
14051 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14052 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14053 (bidi_cache_search, bidi_cache_iterator_state)
14054 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14055 (bidi_level_of_next_char, bidi_move_to_visually_next):
14056 Support character positions inside a run of characters covered by a
14057 display string.
14058 (bidi_paragraph_init, bidi_resolve_explicit_1)
14059 (bidi_level_of_next_char): Call bidi_fetch_char and
14060 bidi_fetch_char_advance instead of FETCH_CHAR and
14061 FETCH_CHAR_ADVANCE.
14062 (bidi_init_it): Initialize new members.
14063 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14064 definitions.
14065 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14066 instead of using explicit *_CHAR codes.
14067 (bidi_resolve_explicit, bidi_resolve_weak):
14068 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14069 bidirectional text is supported only in multibyte buffers.
14070 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14071 it to initialize the frame_window_p member of struct bidi_it.
14072 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14073 (bidi_resolve_explicit, bidi_resolve_weak)
14074 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14075 bidi_it->nchars is non-positive.
14076 (bidi_level_of_next_char): Don't try to lookup the cache for the
14077 next/previous character if nothing is cached there yet, or if we
14078 were just reseat()'ed to a new position.
14079
14080 * xdisp.c (set_cursor_from_row): Set start and stop points
14081 according to the row's direction when priming the loop that looks
14082 for the glyph on which to display cursor.
14083 (single_display_spec_intangible_p): Function deleted.
14084 (display_prop_intangible_p): Reimplement to call
14085 handle_display_spec instead of single_display_spec_intangible_p.
14086 Accept 3 additional arguments needed by handle_display_spec.
14087 This fixes incorrect cursor motion across display property with complex
14088 values: lists, `(when COND...)' forms, etc.
14089 (single_display_spec_string_p): Support property values that are
14090 lists with the argument STRING its top-level element.
14091 (display_prop_string_p): Fix the condition for processing a
14092 property that is a list to be consistent with handle_display_spec.
14093 (handle_display_spec): New function, refactored from the
14094 last portion of handle_display_prop.
14095 (compute_display_string_pos): Accept additional argument
14096 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14097 value of a `display' property is a "replacing spec".
14098 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14099 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14100 the display property, but just return a value indicating whether
14101 the display property will replace the characters it covers.
14102 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14103 frame_window_p members of struct bidi_it.
14104 (compute_display_string_pos, compute_display_string_end):
14105 New functions.
14106 (push_it): Accept second argument POSITION, where pop_it should
14107 jump to continue iteration.
14108 (reseat_1): Initialize bidi_it.disp_pos.
14109
14110 * keyboard.c (adjust_point_for_property): Adjust the call to
14111 display_prop_intangible_p to its new signature.
14112
14113 * dispextern.h (struct bidi_it): New member frame_window_p.
14114 (bidi_init_it): Update prototypes.
14115 (display_prop_intangible_p): Update prototype.
14116 (compute_display_string_pos, compute_display_string_end):
14117 Declare prototypes.
14118 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14119 EMACS_INT.
14120
14121 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14122
14123 Malloc failure behavior now depends on size of allocation.
14124 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14125 * lisp.h: Change signatures accordingly.
14126 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14127 All callers changed. (Bug#8762)
14128
14129 * gnutls.c: Use Emacs's memory allocators.
14130 Without this change, the gnutls library would invoke malloc etc.
14131 directly, which causes problems on non-SYNC_INPUT hosts, and which
14132 runs afoul of improving memory_full behavior. (Bug#8761)
14133 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14134 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14135 xfree instead of the default malloc, realloc, free.
14136 (Fgnutls_boot): No need to check for memory allocation failure,
14137 since xmalloc does that for us.
14138
14139 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14140 * category.c (hash_get_category_set):
14141 * ccl.c (ccl_driver):
14142 * charset.c (Fdefine_charset_internal):
14143 * charset.h (struct charset.hash_index):
14144 * composite.c (get_composition_id, gstring_lookup_cache)
14145 (composition_gstring_put_cache):
14146 * composite.h (struct composition.hash_index):
14147 * dispextern.h (struct image.hash):
14148 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14149 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14150 (hashfn_equal, hashfn_user_defined, make_hash_table)
14151 (maybe_resize_hash_table, hash_lookup, hash_put)
14152 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14153 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14154 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14155 * image.c (make_image, search_image_cache, lookup_image)
14156 (xpm_put_color_table_h):
14157 * lisp.h (struct Lisp_Hash_Table):
14158 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14159 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14160 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14161 * alloc.c (allocate_vectorlike):
14162 Check for overflow in vector size calculations.
14163 * ccl.c (ccl_driver):
14164 Check for overflow when converting EMACS_INT to int.
14165 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14166 need to be updated by these changes.
14167 * fns.c (make_hash_table, maybe_resize_hash_table):
14168 Check for integer overflow with large hash tables.
14169 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14170 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14171 (SXHASH_REDUCE): New macro.
14172 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14173 Use it instead of discarding useful hash info with large hash values.
14174 (sxhash_float): New function.
14175 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14176 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14177 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14178 Rewrite to use FIXNUM_BITS, as this simplifies things.
14179 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14180 Adjust signatures to match updated version of code.
14181 (consing_since_gc): Now EMACS_INT, since a single hash table can
14182 use more than INT_MAX bytes.
14183
14184 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14185
14186 Make it possible to build with GCC-4.6+ -O2 -flto.
14187
14188 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14189
14190 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14191
14192 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14193 Call minibuffer-inactive-mode.
14194
14195 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14196
14197 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14198 Update dependencies.
14199
14200 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14201
14202 * data.c (init_data): Remove code for UTS, this system is not
14203 supported anymore.
14204
14205 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14206
14207 Don't force ./temacs to start in terminal mode.
14208
14209 * frame.c (make_initial_frame): Initialize faces in all cases, not
14210 only when CANNOT_DUMP is defined.
14211 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14212
14213 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14214
14215 * dispnew.c (add_window_display_history): Use const for the string
14216 pointer. Remove declaration, not needed.
14217
14218 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14219
14220 Use 'inline', not 'INLINE'.
14221 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14222 * alloc.c, fontset.c (INLINE): Remove.
14223 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14224 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14225 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14226 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14227 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14228
14229 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14230
14231 Make it possible to run ./temacs.
14232
14233 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14234 syms_of_callproc does the same thing. Remove test for
14235 "initialized", do it in the caller.
14236 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14237
14238 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14239
14240 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14241 (read_minibuf): Use get_minibuffer.
14242 (syms_of_minibuf): Use DEFSYM.
14243 (Qmetadata): New var.
14244 * data.c (Qbuffer): Don't make it static.
14245 (syms_of_data): Use DEFSYM.
14246
14247 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14248
14249 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14250 (CCL_CODE_MIN): New macro.
14251
14252 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14253
14254 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14255
14256 * eval.c (Qdebug): Now static.
14257 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14258 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14259 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14260
14261 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14262
14263 * image.c: Various fixes to ImageMagick code comments.
14264 (Fimagemagick_types): Doc fix.
14265
14266 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14267
14268 Minor fixes prompted by GCC 4.6.0 warnings.
14269
14270 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14271
14272 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14273 (x_clipboard_manager_save_all): Move extern decl to ...
14274 * xterm.h: ... here, so that it can be checked for consistency.
14275
14276 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14277
14278 * xselect.c (x_clipboard_manager_save_frame)
14279 (x_clipboard_manager_save_all): New functions.
14280 (Fx_clipboard_manager_save): Lisp function deleted.
14281
14282 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14283 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14284
14285 * xterm.h: Update prototype.
14286
14287 2011-05-28 William Xu <william.xwl@gmail.com>
14288
14289 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14290 exiting (Bug#8239).
14291
14292 2011-05-28 Jim Meyering <meyering@redhat.com>
14293
14294 Avoid a sign-extension bug in crypto_hash_function.
14295 * fns.c (to_uchar): Define.
14296 (crypto_hash_function): Use it to convert some newly-signed
14297 variables to unsigned, to avoid sign-extension bugs. For example,
14298 without this change, (md5 "truc") would evaluate to
14299 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14300 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14301 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14302
14303 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14304
14305 Integer overflow fixes.
14306
14307 * dbusbind.c: Serial number integer overflow fixes.
14308 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14309 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14310 to hold a serial number that is too large for a fixnum.
14311 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14312 Check for serial numbers out of range. Decode any serial number
14313 that was so large that it became a float. (Bug#8722)
14314
14315 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14316 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14317 Use XFASTINT rather than XUINT when numbers are nonnegative.
14318 (xd_append_arg, Fdbus_method_return_internal):
14319 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14320 arguments, check that Lisp number is nonnegative, rather than
14321 silently wrapping negative numbers around. (Bug#8722)
14322 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14323 (Bug#8722)
14324
14325 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14326
14327 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14328
14329 ccl: Add integer overflow checks.
14330 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14331 (IN_INT_RANGE): New macros.
14332 (ccl_driver): Use them to check for integer overflow when
14333 decoding a CCL program. Many of the new checks are whether XINT (x)
14334 fits in int; it doesn't always, on 64-bit hosts. The new version
14335 doesn't catch all possible integer overflows, but it's an
14336 improvement. (Bug#8719)
14337
14338 * alloc.c (make_event_array): Use XINT, not XUINT.
14339 There's no need for unsigned here.
14340
14341 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14342 This follows up to the 2011-05-06 change that substituted uintptr_t
14343 for EMACS_INT. This case wasn't caught back then.
14344
14345 Rework Fformat to avoid integer overflow issues.
14346 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14347 now (part of C89). Include <verify.h>.
14348 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14349 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14350 (Fformat): Avoid the prepass trying to compute sizes; it was only
14351 approximate and thus did not catch overflow reliably. Instead, walk
14352 through the format just once, formatting and computing sizes as we go,
14353 checking for integer overflow at every step, and allocating a larger
14354 buffer as needed. Keep track separately whether the format is
14355 multibyte. Keep only the most-recently calculated precision, rather
14356 than them all. Record whether each argument has been converted to
14357 string. Use EMACS_INT, not int, for byte and char and arg counts.
14358 Support field widths and precisions larger than INT_MAX. Avoid
14359 sprintf's undefined behavior with conversion specifications such as %#d
14360 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14361 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14362 formatting out-of-range floating point numbers with int
14363 formats. (Bug#8668)
14364
14365 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14366
14367 * data.c: Avoid integer truncation in expressions involving floats.
14368 * data.c: Include <intprops.h>.
14369 (arith_driver): When there's an integer overflow in an expression
14370 involving floating point, convert the integers to floating point
14371 so that the resulting value does not suffer from catastrophic
14372 integer truncation. For example, on a 64-bit host (* 4
14373 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14374 Do not rely on undefined behavior after integer overflow.
14375
14376 merge count_size_as_multibyte, parse_str_to_multibyte
14377 * character.c, character.h (count_size_as_multibyte):
14378 Rename from parse_str_to_multibyte; all uses changed.
14379 Check for integer overflow.
14380 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14381 since it's now a duplicate of the other. This is more of
14382 a character than a buffer op, so better that it's in character.c.
14383 * fns.c, print.c: Adjust to above changes.
14384
14385 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14386
14387 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14388
14389 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14390
14391 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14392 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14393 (x_clipboard_manager_save): Now static.
14394 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14395
14396 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14397 (crypto_hash_function): Now static.
14398 Fix pointer signedness problems. Avoid unnecessary initializations.
14399
14400 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14401
14402 * termhooks.h (Vselection_alist): Make it terminal-local.
14403
14404 * terminal.c (create_terminal): Initialize it.
14405
14406 * xselect.c: Support for clipboard managers.
14407 (Vselection_alist): Move to termhooks.h as terminal-local var.
14408 (LOCAL_SELECTION): New macro.
14409 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14410 (symbol_to_x_atom): Remove gratuitous arg.
14411 (x_handle_selection_request, lisp_data_to_selection_data)
14412 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14413 (x_own_selection, x_get_local_selection, x_convert_selection):
14414 New arg, specifying work frame. Use terminal-local Vselection_alist.
14415 (some_frame_on_display): Delete unused function.
14416 (Fx_own_selection_internal, Fx_get_selection_internal)
14417 (Fx_disown_selection_internal, Fx_selection_owner_p)
14418 (Fx_selection_exists_p): New optional frame arg.
14419 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14420 (x_handle_selection_clear): Don't treat other terminals with the
14421 same keyboard specially. Use the terminal-local Vselection_alist.
14422 (x_clear_frame_selections): Use Frun_hook_with_args.
14423
14424 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14425
14426 * xterm.h: Add support for those atoms.
14427
14428 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14429
14430 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14431 (converted_selections, conversion_fail_tag): New global variables.
14432 (x_selection_request_lisp_error): Free the above.
14433 (x_get_local_selection): Remove unnecessary code.
14434 (x_reply_selection_request): Args changed; handle arbitrary array
14435 of converted selections stored in converted_selections.
14436 Separate the XChangeProperty and SelectionNotify steps.
14437 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14438 (x_convert_selection): New function.
14439 (x_handle_selection_event): Simplify.
14440 (x_get_foreign_selection): Don't ignore incoming requests while
14441 waiting for an answer; this will fail when we implement
14442 SAVE_TARGETS, and seems unnecessary anyway.
14443 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14444 (Vx_sent_selection_functions): Doc fix.
14445
14446 2011-05-26 Leo Liu <sdl.web@gmail.com>
14447
14448 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14449
14450 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14451
14452 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14453
14454 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14455 for fringe update if it has periodic bitmap.
14456 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14457 and fringe_bitmap_periodic_p.
14458
14459 * fringe.c (get_fringe_bitmap_data): New function.
14460 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14461 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14462 row. Mark glyph row for fringe update if periodicity changed.
14463
14464 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14465 for fringe update unless it has periodic bitmap.
14466
14467 2011-05-25 Kenichi Handa <handa@m17n.org>
14468
14469 * xdisp.c (get_next_display_element): Set correct it->face_id for
14470 a static composition.
14471
14472 2011-05-24 Leo Liu <sdl.web@gmail.com>
14473
14474 * deps.mk (fns.o):
14475 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14476
14477 * fns.c (crypto_hash_function, Fsha1): New function.
14478 (Fmd5): Use crypto_hash_function.
14479 (syms_of_fns): Add Ssha1.
14480
14481 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14482
14483 * gnutls.c: Remove unused macros.
14484 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14485 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14486 Remove macros that are defined and never used.
14487 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14488
14489 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14490
14491 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14492 (Fx_get_selection_internal): Minor cleanup.
14493 (Fx_own_selection_internal): Rename arguments for consistency with
14494 select.el.
14495
14496 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14497
14498 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14499
14500 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14501
14502 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14503
14504 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14505
14506 * dispnew.c (scrolling_window): Don't exclude the case that the
14507 last enabled row in the desired matrix touches the bottom boundary.
14508
14509 2011-05-21 Glenn Morris <rgm@gnu.org>
14510
14511 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14512 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14513 and add some more files.
14514
14515 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14516
14517 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14518 report_file_error introduced by the change from 2011-05-07.
14519
14520 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14521
14522 * systime.h (Time): Define only if emacs is defined.
14523 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14524 where the include path doesn't have X11/X.h by default. See
14525 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14526
14527 2011-05-20 Kenichi Handa <handa@m17n.org>
14528
14529 * composite.c (find_automatic_composition): Fix previous change.
14530
14531 2011-05-20 Glenn Morris <rgm@gnu.org>
14532
14533 * lisp.mk: New file, split from Makefile.in.
14534 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14535 (shortlisp): Remove.
14536 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14537
14538 2011-05-19 Glenn Morris <rgm@gnu.org>
14539
14540 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14541 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14542 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14543 (lisp): Set the order to that of loadup.el.
14544 (shortlisp): Make it a copy of $lisp.
14545 (SOME_MACHINE_LISP): Remove.
14546 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14547 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14548
14549 2011-05-18 Kenichi Handa <handa@m17n.org>
14550
14551 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14552 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14553 (find_automatic_composition): Mostly rewrite for efficiency.
14554
14555 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14556
14557 * makefile.w32-in: Update dependencies.
14558
14559 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14560
14561 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14562 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14563
14564 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14565
14566 Fix some integer overflow issues, such as string length overflow.
14567
14568 * insdel.c (count_size_as_multibyte): Check for string overflow.
14569
14570 * character.c (lisp_string_width): Check for string overflow.
14571 Use EMACS_INT, not int, for string indexes and lengths; in
14572 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14573 the resulting string length overflows an EMACS_INT; instead,
14574 report a string overflow if no precision given. When checking for
14575 precision exhaustion, use a check that cannot possibly have
14576 integer overflow. (Bug#8675)
14577 * character.h (lisp_string_width): Adjust to new signature.
14578
14579 * alloc.c (string_overflow): New function.
14580 (Fmake_string): Use it. This doesn't change behavior, but saves
14581 a few bytes and will simplify future changes.
14582 * character.c (string_escape_byte8): Likewise.
14583 * lisp.h (string_overflow): New decl.
14584
14585 Fixups, following up to the user-interface timestamp change.
14586 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14587 for UI timestamps, instead of unsigned long.
14588 * msdos.c (mouse_get_pos): Likewise.
14589 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14590 * w32gui.h (Time): Define by including "systime.h" rather than by
14591 declaring it ourselves. (Bug#8664)
14592
14593 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14594 * image.c (clear_image_cache): Likewise.
14595
14596 * term.c (term_mouse_position): Don't assume time_t wraparound.
14597
14598 Be more systematic about user-interface timestamps.
14599 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14600 and sometimes 'EMACS_UINT', to represent these timestamps.
14601 This change causes it to use 'Time' uniformly, as that's what X uses.
14602 This makes the code easier to follow, and makes it easier to catch
14603 integer overflow bugs such as Bug#8664.
14604 * frame.c (Fmouse_position, Fmouse_pixel_position):
14605 Use Time, not unsigned long, for user-interface timestamps.
14606 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14607 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14608 * keyboard.h (last_event_timestamp): Likewise.
14609 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14610 * menu.h (xmenu_show): Likewise.
14611 * term.c (term_mouse_position): Likewise.
14612 * termhooks.h (struct input_event.timestamp): Likewise.
14613 (struct terminal.mouse_position_hook): Likewise.
14614 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14615 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14616 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14617 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14618 what it was before.
14619 * menu.h, termhooks.h: Include "systime.h", for Time.
14620
14621 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14622 Don't assume that the difference between two unsigned long values
14623 can fit into an integer. At this point, we know button_down_time
14624 <= event->timestamp, so the difference must be nonnegative, so
14625 there's no need to cast the result if double-click-time is
14626 nonnegative, as it should be; check that it's nonnegative, just in
14627 case. This bug is triggered when events are more than 2**31 ms
14628 apart (about 25 days). (Bug#8664)
14629
14630 * xselect.c (last_event_timestamp): Remove duplicate decl.
14631 (x_own_selection): Remove needless cast to unsigned long.
14632
14633 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14634 that always fit in int. Use a sentinel instead of a counter, to
14635 avoid a temp and to allay GCC's concerns about possible int overflow.
14636 * frame.h (struct frame): Use int for menu_bar_items_used
14637 instead of EMACS_INT, since it always fits in int.
14638
14639 * menu.c (grow_menu_items): Check for int overflow.
14640
14641 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14642
14643 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14644 Before, the code was not consistent. These values cannot exceed
14645 2**31 - 1 so there's no need to make them unsigned.
14646 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14647 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14648 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14649 as modifiers.
14650 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14651
14652 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14653 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14654 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14655 presumably because the widths might not match.
14656
14657 * window.c (size_window): Avoid needless test at loop start.
14658
14659 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14660
14661 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14662
14663 2011-05-12 Drew Adams <drew.adams@oracle.com>
14664
14665 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14666
14667 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14668
14669 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14670 `width' to `bar_area_x' and `bar_area_width', respectively.
14671 (x_scroll_run): Take account of fringe background extension.
14672
14673 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14674 Rename local vars `left' and `width' to `bar_area_x' and
14675 `bar_area_width', respectively.
14676 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14677 background extension.
14678
14679 2011-05-10 Jim Meyering <meyering@redhat.com>
14680
14681 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14682
14683 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14684
14685 * image.c (Finit_image_library): Return t for built-in image types,
14686 like pbm and xbm. (Bug#8640)
14687
14688 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14689
14690 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14691
14692 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14693
14694 * w32console.c (Fset_screen_color): Doc fix.
14695 (Fget_screen_color): New function.
14696 (syms_of_ntterm): Defsubr it.
14697
14698 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14699 unlink the temporary file if Fcall_process didn't create it in the
14700 first place.
14701 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14702 child process will be redirected to a file specified with `:file'.
14703 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14704 cue to call_process_cleanup not to close that handle.
14705
14706 2011-05-07 Ben Key <bkey76@gmail.com>
14707
14708 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14709 one of two shell specific rules, either bootstrap-temacs-CMD or
14710 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14711 to the previous implementation of the bootstrap-temacs rule.
14712 The bootstrap-temacs-CMD rule is similar to the previous
14713 implementation of the bootstrap-temacs rule except that it
14714 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14715 variable.
14716
14717 These changes, along with some changes to nt/configure.bat,
14718 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14719 earlier fix to add support for --cflags and --ldflags options
14720 that include quotes so that it works whether make uses cmd or
14721 sh as the shell.
14722
14723 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14724
14725 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14726 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14727 is a constant.
14728 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14729 a string. Handle both cases.
14730 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14731 (Fdbus_register_method): Use Qinvalid_function.
14732
14733 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14734
14735 * makefile.w32-in: Update dependencies.
14736 (LISP_H): Add inttypes.h and stdin.h.
14737 (PROCESS_H): Add unistd.h.
14738
14739 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14740
14741 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14742 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14743
14744 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14745
14746 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14747
14748 * term.c (vfatal): Remove stray call to va_end.
14749 It's not needed and the C Standard doesn't allow it here anyway.
14750
14751 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14752 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14753
14754 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14755 bytes.
14756
14757 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14758
14759 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14760
14761 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14762
14763 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14764
14765 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14766
14767 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14768 * charset.c (Fdefine_charset_internal): Don't initialize
14769 charset.code_space[15]. The value was garbage, on hosts with
14770 32-bit int (Bug#8600).
14771
14772 * lread.c (read_integer): Be more consistent with string-to-number.
14773 Use string_to_number to do the actual conversion; this avoids
14774 rounding errors and fixes some other screwups. Without this fix,
14775 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14776 (digit_to_number): Move earlier, for benefit of read_integer.
14777 Return -1 if the digit is out of range for the base, -2 if it is
14778 not a digit in any supported base. (Bug#8602)
14779
14780 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14781
14782 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14783 to match comment at start of function. This also removes a
14784 GCC warning about overflow in a 32+64-bit port.
14785
14786 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14787
14788 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14789 Reported by Stefan Monnier in
14790 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14791 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14792 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14793
14794 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14795 (EMACS_UINTPTR): Likewise, with uintptr_t.
14796
14797 * lisp.h: Prefer 64-bit EMACS_INT if available.
14798 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14799 on 32-bit hosts that have 64-bit int, so that they can access
14800 large files.
14801 However, temporarily disable this change unless the temporary
14802 symbol WIDE_EMACS_INT is defined.
14803
14804 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14805
14806 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14807 This removes an assumption that EMACS_INT and long are the same
14808 width as pointers. The assumption is true for Emacs porting targets
14809 now, but we want to make other targets possible.
14810 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14811 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14812 In the rest of the code, change types of integers that hold casted
14813 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14814 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14815 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14816 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14817 No need to cast type when ORing.
14818 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14819 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14820 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14821 assume EMACS_INT is the same width as char *.
14822 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14823 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14824 Remove no-longer-needed casts.
14825 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14826 (xg_tool_bar_help_callback, xg_make_tool_item):
14827 Use EMACS_INTPTR to hold an integer
14828 that will be cast to void *; this can avoid a GCC warning
14829 if EMACS_INT is not the same width as void *.
14830 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14831 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14832 (current_message_1, set_message_1):
14833 Use a local to convert to proper width without a cast.
14834 * xmenu.c (dialog_selection_callback): Likewise.
14835
14836 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14837 Also, don't assume VALBITS / RAND_BITS is less than 5,
14838 and don't rely on undefined behavior when shifting a 1 left into
14839 the sign bit.
14840 * lisp.h (get_random): Change signature to match.
14841
14842 * lread.c (hash_string): Use size_t, not int, for hash computation.
14843 Normally we prefer signed values; but hashing is special, because
14844 it's better to use unsigned division on hash table sizes so that
14845 the remainder is nonnegative. Also, size_t is the natural width
14846 for hashing into memory. The previous code used 'int', which doesn't
14847 retain enough info to hash well into very large tables.
14848 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14849
14850 * dbusbind.c: Don't possibly lose pointer info when converting.
14851 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14852 Use XPNTR rather than XHASH, so that the high-order bits of
14853 the pointer aren't lost when converting through void *.
14854
14855 * eval.c (Fautoload): Don't double-shift a pointer.
14856
14857 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14858
14859 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14860
14861 * gnutls.c (DEF_GNUTLS_FN):
14862 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14863
14864 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14865
14866 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14867 marker. (Bug#8610)
14868
14869 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14870
14871 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14872 New version that can reserve upto 2GB of heap space.
14873
14874 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14875
14876 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14877
14878 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14879
14880 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14881 `gnutls_certificate_set_x509_key_file'.
14882
14883 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14884
14885 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14886 Update dependencies.
14887
14888 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14889
14890 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14891 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14892 Remove unused parameter `fildes'.
14893 * process.c (read_process_output, send_process): Don't pass it.
14894
14895 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14896
14897 Fix previous change: the library cache is defined in w32.c.
14898 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14899 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14900
14901 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14902
14903 Implement dynamic loading of GnuTLS on Windows.
14904
14905 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14906 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14907 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14908 Declare.
14909
14910 * gnutls.c (Qgnutls_dll): Define.
14911 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14912 (gnutls_*): Declare function pointers.
14913 (init_gnutls_functions): New function to initialize function pointers.
14914 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14915 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14916 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14917 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14918 (emacs_gnutls_write, emacs_gnutls_read)
14919 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14920 (Fgnutls_available_p): New function.
14921 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14922 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14923 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14924
14925 * image.c: Include w32.h.
14926 (Vimage_type_cache): Delete.
14927 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14928 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14929 (w32_delayed_load): Move to w32.c.
14930
14931 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14932
14933 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14934 (w32_delayed_load): Move from image.c. When loading a library, record
14935 its filename in the :loaded-from property of the library id.
14936 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14937 Initialize and staticpro them.
14938 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14939
14940 * process.c: Include lisp.h before w32.h, not after.
14941 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14942 instead of gnutls_record_check_pending.
14943
14944 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14945
14946 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14947
14948 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14949 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14950 as passed in.
14951
14952 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14953
14954 * xterm.c (x_set_frame_alpha): Do not set property on anything
14955 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14956
14957 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14958
14959 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14960
14961 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14962
14963 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14964 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14965 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14966 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14967 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14968 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14969 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14970 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14971 (Qgnutls_bootprop_callbacks_verify): Make static.
14972
14973 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14974
14975 * callproc.c: Indentation fixup.
14976
14977 * sysdep.c (wait_for_termination_1): Make static.
14978 (wait_for_termination, interruptible_wait_for_termination):
14979 Move after wait_for_termination_1.
14980
14981 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14982
14983 * sysdep.c (interruptible_wait_for_termination): New function
14984 which is like wait_for_termination, but allows keyboard
14985 interruptions.
14986
14987 * callproc.c (Fcall_process): Add (:file "file") as an option for
14988 the STDOUT buffer.
14989 (Fcall_process_region): Ditto.
14990
14991 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14992
14993 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14994 rather than `XVECTOR (FOO)->size'.
14995
14996 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14997 inttypes.h, as a gnulib replacement is used if it not available in
14998 system headers.
14999
15000 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15001
15002 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15003 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15004 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15005
15006 * coding.c (coding_alloc_by_realloc): Error out if destination
15007 will grow beyond MOST_POSITIVE_FIXNUM.
15008 (decode_coding_emacs_mule): Abort if there isn't enough place in
15009 charbuf for the composition carryover bytes. Reserve an extra
15010 space for up to 2 characters produced in a loop.
15011 (decode_coding_iso_2022): Abort if there isn't enough place in
15012 charbuf for the composition carryover bytes.
15013
15014 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15015
15016 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15017 aborting when %lld or %lll format is passed.
15018 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15019 %llo or %llx format is passed. (Bug#8545)
15020
15021 * window.c (window_scroll_line_based): Use a marker instead of
15022 simple variables to record original value of point. (Bug#7952)
15023
15024 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15025 produced by %s or %c overflows available buffer space. (Bug#8545)
15026
15027 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15028
15029 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15030 (SIZE_MAX): Move defn after all includes, as they might #define it.
15031
15032 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15033
15034 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15035
15036 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15037
15038 * keyboard.c (Qdelayed_warnings_hook): Define.
15039 (command_loop_1): Run `delayed-warnings-hook'
15040 if Vdelayed_warnings_list is non-nil.
15041 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15042 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15043
15044 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15045
15046 * doprnt.c (doprnt): Don't return value smaller than the buffer
15047 size if the message was truncated. (Bug#8545).
15048
15049 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15050
15051 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15052 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15053
15054 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15055
15056 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15057
15058 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15059
15060 * makefile.w32-in: Update dependencies.
15061
15062 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15063
15064 Improve `doprnt' and its usage. (Bug#8545)
15065 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15066 `format_end'. Remove support for %l as a conversion specifier.
15067 Don't use xrealloc. Improve diagnostics when the %l size modifier
15068 is used. Update the commentary.
15069
15070 * eval.c (verror): Simplify calculation of size_t.
15071
15072 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15073 messages.
15074
15075 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15076
15077 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15078 change.
15079
15080 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15081
15082 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15083 This makes this file independent of the recent pseudovector change.
15084
15085 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15086
15087 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15088
15089 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15090 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15091 Remove unused local.
15092 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15093
15094 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15095 GCC 4.6.0 optimizes based on type-based alias analysis.
15096 For example, if b is of type struct buffer * and v of type struct
15097 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15098 != &v->size, and therefore "v->size = 1; b->size = 2; return
15099 v->size;" must therefore return 1. This assumption is incorrect
15100 for Emacs, since it type-puns struct Lisp_Vector * with many other
15101 types. To fix this problem, this patch adds a new type struct
15102 vectorlike_header that documents the constraints on layout of vectors
15103 and pseudovectors, and helps optimizing compilers not get fooled
15104 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15105 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15106 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15107 the size member.
15108 (XSETPVECTYPE): Rewrite in terms of new macro.
15109 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15110 This is a bit clearer, and further avoids the possibility of
15111 undesirable aliasing.
15112 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15113 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15114 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15115 since Lisp_Subr is a special case (no "next" field).
15116 (ASIZE): Now uses header.size rather than size.
15117 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15118 to avoid the hassle of writing XVECTOR (foo)->header.size.
15119 (struct vectorlike_header): New type.
15120 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15121 object, to help avoid aliasing.
15122 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15123 (SUBRP): Likewise, since Lisp_Subr is a special case.
15124 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15125 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15126 (struct Lisp_Hash_Table): Combine first two members into a single
15127 struct vectorlike_header member. All uses of "size" and "next" members
15128 changed to be "header.size" and "header.next".
15129 * buffer.h (struct buffer): Likewise.
15130 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15131 * frame.h (struct frame): Likewise.
15132 * process.h (struct Lisp_Process): Likewise.
15133 * termhooks.h (struct terminal): Likewise.
15134 * window.c (struct save_window_data, struct saved_window): Likewise.
15135 * window.h (struct window): Likewise.
15136 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15137 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15138 * buffer.c (init_buffer_once): Likewise.
15139 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15140 special case.
15141 * process.c (Fformat_network_address): Use local var for size,
15142 for brevity.
15143
15144 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15145
15146 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15147 * data.c (atof): Remove decl; no longer used or needed.
15148 (digit_to_number): Move to lread.c.
15149 (Fstring_to_number): Use new string_to_number function, to be
15150 consistent with how the Lisp reader treats infinities and NaNs.
15151 Do not assume that floating-point numbers represent EMACS_INT
15152 without losing information; this is not true on most 64-bit hosts.
15153 Avoid double-rounding errors, by insisting on integers when
15154 parsing non-base-10 numbers, as the documentation specifies.
15155 * lisp.h (string_to_number): New decl, replacing ...
15156 (isfloat_string): Remove.
15157 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15158 (read1): Do not accept +. and -. as integers; this
15159 appears to have been a coding error. Similarly, do not accept
15160 strings like +-1e0 as floating point numbers. Do not report
15161 overflow for integer overflows unless the base is not 10 which
15162 means we have no simple and reliable way to continue.
15163 Break out the floating-point parsing into a new
15164 function string_to_number, so that Fstring_to_number parses
15165 floating point numbers consistently with the Lisp reader.
15166 (digit_to_number): Move here from data.c. Make it static inline.
15167 (E_CHAR, EXP_INT): Remove, replacing with ...
15168 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15169 (string_to_number): New function, replacing isfloat_string.
15170 This function checks for valid syntax and produces the resulting
15171 Lisp float number too. Rework it so that string-to-number
15172 no longer mishandles examples like "1.0e+". Use strtoumax,
15173 so that overflow for non-base-10 numbers is reported only when
15174 there's no portable and simple way to convert to floating point.
15175
15176 * textprop.c (set_text_properties_1): Rewrite for clarity,
15177 and to avoid GCC warning about integer overflow.
15178
15179 * intervals.h (struct interval): Use EMACS_INT for members
15180 where EMACS_UINT might cause problems. See
15181 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15182 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15183 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15184 All uses changed.
15185 (offset_intervals): Tell GCC not to worry about length overflow
15186 when negating a negative length.
15187
15188 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15189 (overrun_check_free): Likewise.
15190
15191 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15192 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15193 word size.
15194
15195 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15196 (gnutls_make_error): Rename local to avoid shadowing.
15197 (gnutls_emacs_global_deinit): ifdef out; not used.
15198 (Fgnutls_boot): Use const for pointer to readonly storage.
15199 Comment out unused local. Fix pointer signedness problems.
15200
15201 * lread.c (openp): Don't stuff size_t into an 'int'.
15202 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15203 about possible signed overflow.
15204
15205 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15206 (GDK_KEY_g): Don't define if already defined.
15207 (xg_prepare_tooltip): Avoid pointer signedness problem.
15208 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15209
15210 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15211 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15212
15213 * xfns.c (Fx_window_property): Simplify a bit,
15214 to make a bit faster and to avoid GCC 4.6.0 warning.
15215 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15216
15217 * fns.c (internal_equal): Don't assume size_t fits in int.
15218
15219 * alloc.c (compact_small_strings): Tighten assertion a little.
15220
15221 Replace pEd with more-general pI, and fix some printf arg casts.
15222 * lisp.h (pI): New macro, generalizing old pEd macro to other
15223 conversion specifiers. For example, use "...%"pI"d..." rather
15224 than "...%"pEd"...".
15225 (pEd): Remove. All uses replaced with similar uses of pI.
15226 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15227 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15228 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15229 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15230 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15231 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15232 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15233 64-bit hosts.
15234 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15235 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15236 * print.c (safe_debug_print, print_object): Likewise.
15237 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15238 to int.
15239 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15240 avoiding the 0 flag, which is not portable.
15241 * process.c (Fmake_network_process): Use pI to avoid cast.
15242 * region-cache.c (pp_cache): Likewise.
15243 * xdisp.c (decode_mode_spec): Likewise.
15244 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15245 behavior on 64-bit hosts with printf arg.
15246 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15247 (x_stop_queuing_selection_requests): Likewise.
15248 (x_get_window_property): Don't truncate byte count to an 'int'
15249 when tracing.
15250
15251 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15252 here, since it parses constructs like leading '-' and spaces,
15253 which are not wanted; and it overflows with large numbers.
15254 Instead, simply match F[0-9]+, which is what is wanted anyway.
15255
15256 * alloc.c: Remove unportable assumptions about struct layout.
15257 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15258 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15259 (allocate_vectorlike, make_pure_vector): Use the new macros,
15260 plus offsetof, to remove unportable assumptions about struct layout.
15261 These assumptions hold on all porting targets that I know of, but
15262 they are not guaranteed, they're easy to remove, and removing them
15263 makes further changes easier.
15264
15265 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15266 This doesn't fix a bug but makes the code clearer.
15267 (string_overrun_cookie): Now const. Use initializers that
15268 don't formally overflow signed char, to avoid warnings.
15269 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15270 can cause Emacs to crash when string overrun checking is enabled.
15271 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15272 multiple of sizeof (EMACS_INT); it need not be, if
15273 alignof(EMACS_INT) < sizeof (EMACS_INT).
15274 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15275
15276 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15277
15278 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15279
15280 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15281
15282 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15283 supposed to be handshaking. (Bug#8556)
15284 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15285
15286 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15287
15288 * lisp.h (Qdebug): List symbol.
15289 * eval.c (Qdebug): Restore global linkage.
15290 * keyboard.c (debug-on-event): New variable.
15291 (handle_user_signal): Break into debugger when debug-on-event
15292 matches the current signal symbol.
15293
15294 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15295
15296 * alloc.c (check_sblock, check_string_bytes)
15297 (check_string_free_list): Convert to standard C.
15298
15299 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15300
15301 * w32.c (emacs_gnutls_push): Fix typo.
15302
15303 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15304
15305 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15306 "cast to pointer from integer of different size".
15307
15308 Improve doprnt and its use in verror. (Bug#8545)
15309 * doprnt.c (doprnt): Document the set of format control sequences
15310 supported by the function. Use SAFE_ALLOCA instead of always
15311 using `alloca'.
15312
15313 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15314 is one byte too soon. Don't use xrealloc; instead xfree and
15315 xmalloc anew.
15316
15317 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15318
15319 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15320 callbacks stage.
15321
15322 * gnutls.c: Renamed global_initialized to
15323 gnutls_global_initialized. Added internals for the
15324 :verify-hostname-error, :verify-error, and :verify-flags
15325 parameters of `gnutls-boot' and documented those parameters in the
15326 docstring. Start callback support.
15327 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15328 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15329 on error. Return error code.
15330 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15331 (emacs_gnutls_read): Likewise.
15332 (Fgnutls_boot): Return handshake error code.
15333 (emacs_gnutls_handle_error): New function.
15334 (wsaerror_to_errno): Likewise.
15335
15336 * w32.h (emacs_gnutls_pull): Add prototype.
15337 (emacs_gnutls_push): Likewise.
15338
15339 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15340 (emacs_gnutls_push): Likewise.
15341
15342 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15343
15344 * process.c (wait_reading_process_output): Check if GnuTLS
15345 buffered some data internally if no FDs are set for TLS
15346 connections.
15347
15348 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15349 (LIBS): Link to USER_LIBS.
15350 ($(BLD)/gnutls.$(0)): New target.
15351
15352 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15353
15354 * xdisp.c (handle_single_display_spec): Rename the
15355 display_replaced_before_p argument into display_replaced_p, to
15356 make it consistent with the commentary. Fix typos in the
15357 commentary.
15358
15359 * textprop.c (syms_of_textprop): Remove dead code.
15360 (copy_text_properties): Delete obsolete commentary about an
15361 interface that was deleted long ago. Fix typos in the description
15362 of arguments.
15363
15364 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15365 to changes in oldXMenu/XMenu.h from 2011-04-16.
15366 <menu_help_message, prev_menu_help_message>: Constify.
15367 (IT_menu_make_room): menu->help_text is now `const char **';
15368 adjust.
15369
15370 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15371 to changes in oldXMenu/XMenu.h from 2011-04-16.
15372 (struct XMenu): Declare `help_text' `const char **'.
15373
15374 * xfaces.c <Qunspecified>: Make extern again.
15375
15376 * syntax.c: Include sys/types.h before including regex.h, as
15377 required by POSIX.
15378
15379 * doc.c (get_doc_string): Improve the format passed to `error'.
15380
15381 * doprnt.c (doprnt): Improve commentary.
15382
15383 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15384
15385 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15386 them with etags.
15387
15388 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15389 changes in globals.h immediately force recompilation.
15390 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15391 $(CURDIR)/s/ms-w32.h.
15392 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15393
15394 * character.c (Fchar_direction): Function deleted.
15395 (syms_of_character): Don't defsubr it.
15396 <char-direction-table>: Deleted.
15397
15398 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15399
15400 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15401 * doprnt.c: Include limits.h.
15402 (SIZE_MAX): New macro.
15403 (doprnt): Return a size_t value. 2nd arg is now size_t.
15404 Many local variables are now size_t instead of int or unsigned.
15405 Improve overflow protection. Support `l' modifier for integer
15406 conversions. Support %l conversion. Don't assume an EMACS_INT
15407 argument for integer conversions and for %c.
15408
15409 * lisp.h (doprnt): Restore prototype.
15410
15411 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15412 $(SRC)/character.h.
15413
15414 * Makefile.in (base_obj): Add back doprnt.o.
15415
15416 * deps.mk (doprnt.o): Add back prerequisites.
15417 (callint.o): Depend on character.h.
15418
15419 * eval.c (internal_lisp_condition_case): Include the handler
15420 representation in the error message.
15421 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15422 when breaking from the loop.
15423
15424 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15425
15426 * callint.c (Fcall_interactively): When displaying error message
15427 about invalid control letter, pass the character's codepoint, not
15428 a pointer to its multibyte form. Improve display of the character
15429 in octal and display also its hex code.
15430
15431 * character.c (char_string): Use %x to display the (unsigned)
15432 codepoint of an invalid character, to avoid displaying a bogus
15433 negative value.
15434
15435 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15436 `error', not SYMBOL_NAME itself.
15437
15438 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15439 character arguments to `error'.
15440
15441 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15442 to `error' in error message about FINAL_CHAR argument. Make sure
15443 FINAL_CHAR is a character, and use %c when it is passed as
15444 argument to `error'.
15445
15446 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15447
15448 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15449
15450 * w32.c: Include <time.h>.
15451 (sys_localtime): New function.
15452
15453 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15454
15455 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15456
15457 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15458
15459 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15460
15461 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15462 zombies (Bug#8467).
15463
15464 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15465
15466 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15467 gl_state.e_property when gl_state.object is Qt.
15468
15469 * insdel.c (make_gap_larger): Remove limitation of buffer size
15470 to <= INT_MAX.
15471
15472 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15473
15474 * xdisp.c (lookup_glyphless_char_display)
15475 (produce_glyphless_glyph): Handle cons cell entry in
15476 glyphless-char-display.
15477 (Vglyphless_char_display): Document it.
15478
15479 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15480 glyphless-char-display.
15481
15482 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15483
15484 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15485
15486 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15487
15488 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15489 definition for no-X builds.
15490
15491 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15492
15493 Static checks with GCC 4.6.0 and non-default toolkits.
15494
15495 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15496
15497 * process.c (keyboard_bit_set): Define only if SIGIO.
15498 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15499 (send_process): Repair possible setjmp clobbering.
15500
15501 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15502
15503 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15504
15505 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15506
15507 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15508 Define only if needed.
15509
15510 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15511 by pacifying GCC about it. Maybe it's time to retire it?
15512 * xfaces.c (USG, __TIMEVAL__): Likewise.
15513
15514 * dispextern.h (struct redisplay_interface): Rename param
15515 to avoid shadowing.
15516 * termhooks.h (struct terminal): Likewise.
15517 * xterm.c (xembed_send_message): Likewise.
15518
15519 * insdel.c (make_gap_smaller): Define only if
15520 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15521
15522 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15523 it.
15524
15525 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15526 so that we aren't warned about unused symbols.
15527
15528 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15529
15530 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15531
15532 * xfns.c (x_real_positions): Mark locals as initialized.
15533
15534 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15535
15536 * xterm.c: Fix problems found by static analysis with other toolkits.
15537 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15538 (x_dispatch_event): Declare static if USE_GTK, and
15539 define if USE_GTK || USE_X_TOOLKIT.
15540 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15541 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15542 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15543 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15544
15545 * xmenu.c (menu_help_callback): Pointer type fixes.
15546 Use const pointers when pointing at readonly data. Avoid pointer
15547 signedness clashes.
15548 (FALSE): Remove unused macro.
15549 (update_frame_menubar): Remove unused decl.
15550
15551 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15552
15553 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15554 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15555 (single_menu_item): Rename local to avoid shadowing.
15556
15557 * keyboard.c (make_lispy_event): Remove unused local var.
15558
15559 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15560 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15561
15562 * bitmaps: Change bitmaps from unsigned char back to the X11
15563 compatible char. Avoid the old compiler warnings about
15564 out-of-range initializers by using, for example, '\xab' rather
15565 than 0xab.
15566
15567 * xgselect.c (xgselect_initialize): Check vs interface
15568 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15569
15570 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15571
15572 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15573 to read-only memory.
15574
15575 * fns.c (vector): Remove; this old hack is no longer needed.
15576
15577 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15578 Remove unused var.
15579 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15580
15581 * xrdb.c (x_load_resources): Omit unused local.
15582
15583 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15584 (x_window): Rename locals to avoid shadowing.
15585 (USG): Use the kludged USG macro, to pacify gcc.
15586
15587 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15588 (x_term_init): Remove local to avoid shadowing.
15589
15590 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15591
15592 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15593 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15594
15595 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15596
15597 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15598
15599 Fix regex.c, syntax.c and friends for buffers > 2GB.
15600 * syntax.h (struct gl_state_s): Declare character position members
15601 EMACS_INT.
15602
15603 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15604
15605 * textprop.c (verify_interval_modification, interval_of):
15606 Declare arguments EMACS_INT.
15607
15608 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15609 EMACS_INT.
15610
15611 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15612
15613 * indent.c (Fvertical_motion): Local variable it_start is now
15614 EMACS_INT.
15615
15616 * regex.c (re_match, re_match_2, re_match_2_internal)
15617 (bcmp_translate, regcomp, regexec, print_double_string)
15618 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15619 (re_compile_pattern, re_exec): Declare arguments and local
15620 variables `size_t' and `ssize_t' and return values `regoff_t', as
15621 appropriate.
15622 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15623 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15624 <compile_stack_type>: `size' and `avail' are now `size_t'.
15625
15626 * regex.h <regoff_t>: Use ssize_t, not int.
15627 (re_search, re_search_2, re_match, re_match_2): Arguments that
15628 specify buffer/string position and length are now ssize_t and
15629 size_t. Return type is regoff_t.
15630
15631 2011-04-16 Ben Key <bkey76@gmail.com>
15632
15633 * nsfont.m: Fixed bugs in ns_get_family and
15634 ns_descriptor_to_entity that were caused by using free to
15635 deallocate memory blocks that were allocated by xmalloc (via
15636 xstrdup). This caused Emacs to crash when compiled with
15637 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15638 --enable-checking=xmallocoverrun). xfree is now used to
15639 deallocate these memory blocks.
15640
15641 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15642
15643 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15644
15645 emacs_write: Accept and return EMACS_INT for sizes.
15646 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15647 et seq.
15648 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15649 Accept and return EMACS_INT.
15650 (emacs_gnutls_write): Return the number of bytes written on
15651 partial writes.
15652 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15653 (emacs_read, emacs_write): Remove check for negative size, as the
15654 Emacs source code has been audited now.
15655 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15656 (emacs_read, emacs_write): Use it.
15657 * process.c (send_process): Adjust to the new signatures of
15658 emacs_write and emacs_gnutls_write. Do not attempt to store
15659 a byte offset into an 'int'; it might overflow.
15660 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15661
15662 * sound.c: Don't assume sizes fit in 'int'.
15663 (struct sound_device.period_size, alsa_period_size):
15664 Return EMACS_INT, not int.
15665 (struct sound_device.write, vox_write, alsa_write):
15666 Accept EMACS_INT, not int.
15667 (wav_play, au_play): Use EMACS_INT to store sizes and to
15668 record read return values.
15669
15670 2011-04-15 Ben Key <bkey76@gmail.com>
15671
15672 * keyboard.c (Qundefined): Don't declare static since it is used
15673 in nsfns.m.
15674 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15675 static since they are used in nsfont.m.
15676
15677 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15678
15679 * process.c (Qprocessp): Don't declare static.
15680 * lisp.h (Qprocessp): Declare again.
15681
15682 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15683
15684 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15685
15686 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15687
15688 Improve C-level modularity by making more things 'static'.
15689
15690 Don't publish debugger-only interfaces to other modules.
15691 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15692 (verify_bytepos, count_markers): Move decls to the only modules
15693 that need them.
15694 * region-cache.h (pp_cache): Likewise.
15695 * window.h (check_all_windows): Likewise.
15696 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15697
15698 * sysdep.c (croak): Now static, if
15699 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15700 * syssignal.h (croak): Declare only if not static.
15701
15702 * alloc.c (refill_memory_reserve): Now static if
15703 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15704 * lisp.h (refill_memory_reserve): Declare only if not static.
15705
15706 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15707 Define only if USE_LUCID.
15708
15709 * xrdb.c (x_customization_string, x_rm_string): Now static.
15710
15711 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15712 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15713
15714 * xdisp.c (draw_row_with_mouse_face): Now static.
15715 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15716
15717 * window.h (check_all_windows): Mark externally visible.
15718
15719 * window.c (window_deletion_count): Now static.
15720
15721 * undo.c: Make symbols static if they're not exported.
15722 (last_undo_buffer, last_boundary_position, pending_boundary):
15723 Now static.
15724
15725 * textprop.c (interval_insert_behind_hooks): Now static.
15726 (interval_insert_in_front_hooks): Likewise.
15727
15728 * term.c: Make symbols static if they're not exported.
15729 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15730 (max_frame_lines, tty_set_terminal_modes):
15731 (tty_reset_terminal_modes, tty_turn_off_highlight):
15732 (get_tty_terminal): Now static.
15733 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15734 * termhooks.h (term_mouse_moveto): Do not declare if
15735 HAVE_WINDOW_SYSTEM.
15736 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15737 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15738
15739 * sysdep.c: Make symbols static if they're not exported.
15740 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15741 Now static.
15742 (sigprocmask_set, full_mask): Remove; unused.
15743 (wait_debugging): Mark as visible.
15744 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15745 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15746
15747 * syntax.c (syntax_temp): Define only if !__GNUC__.
15748
15749 * sound.c (current_sound_device, current_sound): Now static.
15750
15751 * search.c (searchbufs, searchbuf_head): Now static.
15752
15753 * scroll.c (scroll_cost): Remove; unused.
15754 * dispextern.h (scroll_cost): Remove decl.
15755
15756 * region-cache.h (pp_cache): Mark as externally visible.
15757
15758 * process.c: Make symbols static if they're not exported.
15759 (process_tick, update_tick, create_process, chan_process):
15760 (Vprocess_alist, proc_buffered_char, datagram_access):
15761 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15762 (deactivate_process): Mark defn as static, as well as decl.
15763 * lisp.h (create_process): Remove decl.
15764 * process.h (chan_process, Vprocess_alist): Remove decls.
15765
15766 * print.c: Make symbols static if they're not exported.
15767 (print_depth, new_backquote_output, being_printed, print_buffer):
15768 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15769 (print_interval, print_number_index, initial_stderr_stream):
15770 Now static.
15771 * lisp.h (Fprinc): Remove decl.
15772 (debug_output_compilation_hack): Mark as externally visible.
15773
15774 * sysdep.c (croak): Move decl from here to syssignal.h.
15775 * syssignal.h (croak): Put it here, so the API can be checked when
15776 'croak' is called from dissociate_if_controlling_tty.
15777
15778 * minibuf.c: Make symbols static if they're not exported.
15779 (minibuf_save_list, choose_minibuf_frame): Now static.
15780 * lisp.h (choose_minibuf_frame): Remove decl.
15781
15782 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15783
15784 * lread.c: Make symbols static if they're not exported.
15785 (read_objects, initial_obarray, oblookup_last_bucket_number):
15786 Now static.
15787 (make_symbol): Remove; unused.
15788 * lisp.h (initial_obarray, make_symbol): Remove decls.
15789
15790 * keyboard.c: Make symbols static if they're not exported.
15791 (single_kboard, recent_keys_index, total_keys, recent_keys):
15792 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15793 (this_single_command_key_start, echoing, last_auto_save):
15794 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15795 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15796 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15797 (Vlispy_mouse_stem, double_click_count):
15798 Now static.
15799 (force_auto_save_soon): Define only if SIGDANGER.
15800 (ignore_mouse_drag_p): Now static if
15801 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15802 (print_help): Remove; unused.
15803 (stop_character, last_timer_event): Mark as externally visible.
15804 * keyboard.h (ignore_mouse_drag_p): Declare only if
15805 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15806 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15807 * lisp.h (echoing): Remove decl.
15808 (force_auto_save_soon): Declare only if SIGDANGER.
15809 * xdisp.c (redisplay_window): Simplify code, to make it more
15810 obvious that ignore_mouse_drag_p is not accessed if !defined
15811 USE_GTK && !defined HAVE_NS.
15812
15813 * intervals.c: Make symbols static if they're not exported.
15814 (merge_properties_sticky, merge_interval_right, delete_interval):
15815 Now static.
15816 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15817
15818 * insdel.c: Make symbols static if they're not exported.
15819 However, leave prepare_to_modify_buffer alone. It's never
15820 called from outside this function, but that appears to be a bug.
15821 (combine_after_change_list, combine_after_change_buffer):
15822 (adjust_after_replace, signal_before_change): Now static.
15823 (adjust_after_replace_noundo): Remove; unused.
15824 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15825 (signal_before_change): Remove decls.
15826
15827 * indent.c (val_compute_motion, val_vmotion): Now static.
15828
15829 * image.c: Make symbols static if they're not exported.
15830 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15831 if USE_GTK.
15832 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15833 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15834
15835 * fringe.c (standard_bitmaps): Now static.
15836 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15837
15838 * frame.c: Make symbols static if they're not exported.
15839 (x_report_frame_params, make_terminal_frame): Now static.
15840 (get_frame_param): Now static, unless HAVE_NS.
15841 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15842 (x_get_resource_string): Remove; not used.
15843 * frame.h (make_terminal_frame, x_report_frame_params):
15844 (x_get_resource_string); Remove decls.
15845 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15846 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15847
15848 * font.c, fontset.c: Make symbols static if they're not exported.
15849 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15850 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15851 * font.c (font_close_object): Now static.
15852 * font.h (font_close_object): Remove.
15853 * fontset.c (FONTSET_OBJLIST): Remove.
15854 (free_realized_fontset) #if-0 the body, which does nothing.
15855 (face_suitable_for_char_p): #if-0, as it's never called.
15856 * fontset.h (face_suitable_for_char_p): Remove decl.
15857 * xfaces.c (face_at_string_position):
15858 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15859 since 0 is always ASCII.
15860
15861 * fns.c (weak_hash_tables): Now static.
15862
15863 * fileio.c: Make symbols static if they're not exported.
15864 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15865 (Vwrite_region_annotation_buffers): Now static.
15866
15867 * eval.c: Make symbols static if they're not exported.
15868 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15869 * lisp.h (backtrace_list): Remove decl.
15870
15871 * emacs.c: Make symbols static if they're not exported.
15872 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15873 (fatal_error_code, fatal_error_signal_hook, standard_args):
15874 Now static.
15875 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15876 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15877 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15878 * lisp.h (fatal_error_signal_hook): Remove decl.
15879 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15880
15881 * editfns.c: Move a (normally-unused) function to its only use.
15882 * editfns.c, lisp.h (get_operating_system_release): Remove.
15883 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15884 worth the hassle of breaking this out.
15885
15886 * xterm.c: Make symbols static if they're not exported.
15887 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15888 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15889 (x_destroy_window, x_delete_display):
15890 Now static.
15891 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15892 (x_mouse_leave): Remove; unused.
15893 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15894 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15895 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15896 Remove decls.
15897 (x_mouse_leave): Declare only if WINDOWSNT.
15898 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15899 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15900 USE_X_TOOLKIT.
15901
15902 * ftxfont.c: Make symbols static if they're not exported.
15903 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15904 HAVE_FREETYPE.
15905 * font.h (ftxfont_driver): Likewise.
15906
15907 * xfns.c: Make symbols static if they're not exported.
15908 (x_last_font_name, x_display_info_for_name):
15909 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15910 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15911 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15912 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15913 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15914 (last_show_tip_args): Now static.
15915 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15916 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15917 (x_screen_planes): Remove; unused.
15918 * dispextern.h (x_screen_planes): Remove decl.
15919
15920 * dispnew.c: Make symbols static if they're not exported.
15921 * dispextern.h (redraw_garbaged_frames, scrolling):
15922 (increment_row_positions): Remove.
15923 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15924 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15925 Now static.
15926 (redraw_garbaged_frames): Remove; unused.
15927
15928 * xfaces.c: Make symbols static if they're not exported.
15929 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15930 Remove decls.
15931 * xterm.h (defined_color): Remove decls.
15932 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15933 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15934 (menu_face_changed_default, defined_color, free_realized_face):
15935 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15936 (ascii_face_of_lisp_face): Remove; unused.
15937
15938 * xdisp.c: Make symbols static if they're not exported.
15939 * dispextern.h (scratch_glyph_row, window_box_edges):
15940 (glyph_to_pixel_coords, set_cursor_from_row):
15941 (get_next_display_element, set_iterator_to_next):
15942 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15943 (show_mouse_face): Remove decls
15944 * frame.h (message_buf_print): Likewise.
15945 * lisp.h (pop_message, set_message, check_point_in_composition):
15946 Likewise.
15947 * xterm.h (set_vertical_scroll_bar): Likewise.
15948 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15949 (message_buf_print, scratch_glyph_row, displayed_buffer):
15950 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15951 (get_next_display_element, show_mouse_face, window_box_edges):
15952 (frame_to_window_pixel_xy, check_point_in_composition):
15953 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15954 (glyph_to_pixel_coords): Remove; unused.
15955
15956 * dired.c (file_name_completion): Now static.
15957
15958 * dbusbind.c (xd_in_read_queued_messages): Now static.
15959
15960 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15961 * data.c (circular_list_error): Remove.
15962
15963 * commands.h (last_point_position, last_point_position_buffer):
15964 (last_point_position_window): Remove decls.
15965 * keyboard.c: Make these variables static.
15966
15967 * coding.h (coding, code_convert_region, encode_coding_gap):
15968 Remove decls.
15969 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15970 (iso_code_class, detect_coding, code_convert_region): Now static.
15971 (encode_coding_gap): Remove; unused.
15972
15973 * chartab.c (chartab_chars, chartab_bits): Now static.
15974
15975 * charset.h (charset_iso_8859_1): Remove decl.
15976 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15977 Now static.
15978
15979 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15980 * ccl.c (Vccl_program_table): Now static.
15981 (check_ccl_update): Remove; unused.
15982
15983 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15984 * category.h: ... from here.
15985 * category.c (check_category_table, set_category_set): Now static.
15986
15987 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15988 * lisp.h: Remove these decls.
15989
15990 * buffer.c (buffer_count): Remove unused var.
15991
15992 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15993 so that it's not optimized away.
15994 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15995 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15996 exported only to the debugger.
15997
15998 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15999 * atimer.h (run_all_atimers): Remove; not exported.
16000
16001 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16002 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16003 was inaccessible from Lisp.
16004 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16005 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16006
16007 alloc.c: Import and export fewer symbols, and remove unused items.
16008 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16009 is defined.
16010 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16011 it's not optimized away by whole-program optimization.
16012 (message_enable_multibyte, free_misc): Remove.
16013 (catchlist, handlerlist, mark_backtrace):
16014 Declare only if BYTE_MARK_STACK.
16015 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16016 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16017 (message_enable_multibyte): Remove decl.
16018 (free_misc, interval_free_list, float_block, float_block_index):
16019 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16020 (cons_free_list, last_marked_index):
16021 Now static.
16022 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16023 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16024 (mark_backtrace): Define only if BYTE_MARK_STACK.
16025 * xdisp.c (message_enable_multibyte): Now static.
16026
16027 Declare Lisp_Object Q* variables to be 'static' if not exported.
16028 This makes it easier for human readers (and static analyzers)
16029 to see whether these variables are used from other modules.
16030 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16031 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16032 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16033 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16034 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16035 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16036 * xmenu.c, xselect.c:
16037 Declare Q* vars static if they are not used in other modules.
16038 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16039 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16040 Remove decls of unexported vars.
16041 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16042
16043 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16044
16045 Make Emacs functions such as Fatom 'static' by default.
16046 This makes it easier for human readers (and static analyzers)
16047 to see whether these functions can be called from other modules.
16048 DEFUN now defines a static function. To make the function external
16049 so that it can be used in other C modules, use the new macro DEFUE.
16050 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16051 (Finit_image_library):
16052 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16053 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16054 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16055 Remove decls, since these functions are now static.
16056 (Funintern, Fget_internal_run_time): New decls, since these functions
16057 were already external.
16058
16059 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16060 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16061 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16062 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16063 * keyboard.c, keymap.c, lread.c:
16064 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16065 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16066 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16067 Mark functions with DEFUE instead of DEFUN,
16068 if they are used in other modules.
16069 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16070 decls for now-static functions.
16071 * buffer.h (Fdelete_overlay): Remove decl.
16072 * callproc.c (Fgetenv_internal): Mark as internal.
16073 * composite.c (Fremove_list_of_text_properties): Remove decl.
16074 (Fcomposition_get_gstring): New forward static decl.
16075 * composite.h (Fcomposite_get_gstring): Remove decl.
16076 * dired.c (Ffile_attributes): New forward static decl.
16077 * doc.c (Fdocumntation_property): New forward static decl.
16078 * eval.c (Ffetch_bytecode): New forward static decl.
16079 (Funintern): Remove extern decl; now in .h file where it belongs.
16080 * fileio.c (Fmake_symbolic_link): New forward static decl.
16081 * image.c (Finit_image_library): New forward static decl.
16082 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16083 * intervals.h (Fprevious_property_change):
16084 (Fremove_list_of_text_properties): Remove decls.
16085 * keyboard.c (Fthis_command_keys): Remove decl.
16086 (Fcommand_execute): New forward static decl.
16087 * keymap.c (Flookup_key): New forward static decl.
16088 (Fcopy_keymap): Now static.
16089 * keymap.h (Flookup_key): Remove decl.
16090 * process.c (Fget_process): New forward static decl.
16091 (Fprocess_datagram_address): Mark as internal.
16092 * syntax.c (Fsyntax_table_p): New forward static decl.
16093 (skip_chars): Remove duplicate decl.
16094 * textprop.c (Fprevious_property_change): New forward static decl.
16095 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16096 Now internal.
16097 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16098 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16099
16100 * editfns.c (Fformat): Remove unreachable code.
16101
16102 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16103
16104 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16105 change. (Bug#8496)
16106
16107 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16108
16109 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16110 when at ZV. (Bug#8487)
16111
16112 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16113
16114 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16115 (Bug#8437)
16116 * keyboard.c (parse_tool_bar_item): Likewise.
16117 * sound.c (sound_cleanup, alsa_close): Likewise.
16118 * termcap.c (tgetent): Likewise.
16119 * xfns.c (x_default_font_parameter): Likewise.
16120 * xsettings.c (read_and_apply_settings): Likewise.
16121
16122 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16123 (overrun_check_free): Protoize.
16124
16125 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16126
16127 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16128 since callers should never pass a negative size.
16129 Change the signature to match that of plain 'read' and 'write'; see
16130 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16131 * lisp.h: Update prototypes of emacs_write and emacs_read.
16132
16133 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16134
16135 * xdisp.c (redisplay_window): Don't try to determine the character
16136 position of the scroll margin if the window start point w->startp
16137 is outside the buffer's accessible region. (Bug#8468)
16138
16139 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16140
16141 Fix write-region and its subroutines for buffers > 2GB.
16142 * fileio.c (a_write, e_write): Modify declaration of arguments and
16143 local variables to support buffers larger than 2GB.
16144 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16145
16146 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16147 argument, local variables, and return value.
16148
16149 * lisp.h: Update prototypes of emacs_write and emacs_read.
16150
16151 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16152
16153 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16154
16155 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16156
16157 Fix more problems found by GCC 4.6.0's static checks.
16158
16159 * xdisp.c (vmessage): Use a better test for character truncation.
16160
16161 * charset.c (load_charset_map): <, not <=, for optimization,
16162 and to avoid potential problems with integer overflow.
16163 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16164 * casetab.c (set_identity, shuffle): Likewise.
16165 * editfns.c (Fformat): Likewise.
16166 * syntax.c (skip_chars): Likewise.
16167
16168 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16169 This also lets GCC 4.6.0 generate slightly better loop code.
16170
16171 * callint.c (Fcall_interactively): <, not <=, for optimization.
16172 (Fcall_interactively): Count the number of arguments produced,
16173 not the number of arguments given. This is simpler and lets GCC
16174 4.6.0 generate slightly better code.
16175
16176 * ftfont.c: Distingish more carefully between FcChar8 and char.
16177 The previous code passed unsigned char * to a functions like
16178 strlen and xstrcasecmp that expect char *, which does not
16179 conform to the C standard.
16180 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16181 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16182 char * when the C standard requires it.
16183
16184 * keyboard.c (read_char): Remove unused var.
16185
16186 * eval.c: Port to Windows vsnprintf (Bug#8435).
16187 Include <limits.h>.
16188 (SIZE_MAX): Define if the headers do not.
16189 (verror): Do not give up if vsnprintf returns a negative count.
16190 Instead, grow the buffer. This ports to Windows vsnprintf, which
16191 does not conform to C99. Problem reported by Eli Zaretskii.
16192 Also, simplify the allocation scheme, by avoiding the need for
16193 calling realloc, and removing the ALLOCATED variable.
16194
16195 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16196
16197 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16198 But keep the doprint source code for now, as we might revamp it
16199 and use it again (Bug#8435).
16200 * lisp.h (doprnt): Remove.
16201 * Makefile.in (base_obj): Remove doprnt.o.
16202 * deps.mk (doprnt.o): Remove.
16203
16204 error: Print 32- and 64-bit integers portably (Bug#8435).
16205 Without this change, on typical 64-bit hosts error ("...%d...", N)
16206 was used to print both 32- and 64-bit integers N, which relied on
16207 undefined behavior.
16208 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16209 * lisp.h (error, verror): Mark as printf-like functions.
16210 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16211 Report overflow in size calculations when allocating printf buffer.
16212 Do not truncate output string at its first null byte.
16213 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16214 Truncate the output at a character boundary, since vsnprintf does not
16215 do that.
16216 * charset.c (check_iso_charset_parameter): Convert internal
16217 character to string before calling 'error', since %c now has the
16218 printf meaning.
16219 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16220 overflow when computing char to be passed to 'error'. Do not
16221 pass Lisp_Object to 'error'; pass the integer instead.
16222 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16223 formatted with plain %d.
16224
16225 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16226
16227 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16228
16229 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16230
16231 * xterm.c (x_catch_errors): Remove duplicate declaration.
16232
16233 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16234
16235 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16236
16237 2011-04-10 Jim Meyering <meyering@redhat.com>
16238
16239 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16240 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16241 return ssize_t not "int", and use size_t as the buffer length.
16242 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16243 * gnutls.h: Update declarations.
16244 * process.c (read_process_output): Use ssize_t, to match.
16245 (send_process): Likewise.
16246
16247 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16248
16249 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16250
16251 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16252
16253 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16254 Use unsigned char, to match FcChar8 type definition.
16255
16256 * xterm.c (handle_one_xevent):
16257 * xmenu.c (create_and_show_popup_menu):
16258 * xselect.c (x_decline_selection_request)
16259 (x_reply_selection_request): Avoid type-punned deref of X events.
16260
16261 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16262
16263 Fix some uses of `int' instead of EMACS_INT.
16264 * search.c (string_match_1, fast_string_match)
16265 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16266 (scan_buffer, find_next_newline_no_quit)
16267 (find_before_next_newline, search_command, Freplace_match)
16268 (Fmatch_data): Make some `int' variables be EMACS_INT.
16269
16270 * xdisp.c (display_count_lines): 3rd argument and return value now
16271 EMACS_INT. All callers changed.
16272 (pint2hrstr): Last argument is now EMACS_INT.
16273
16274 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16275 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16276 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16277 (decode_coding_utf_16, decode_coding_emacs_mule)
16278 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16279 (decode_coding_ccl, decode_coding_charset)
16280 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16281 (decode_coding_iso_2022, decode_coding_emacs_mule)
16282 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16283 <char_offset, last_offset>: Declare EMACS_INT.
16284 (encode_coding_utf_8, encode_coding_utf_16)
16285 (encode_coding_emacs_mule, encode_invocation_designation)
16286 (encode_designation_at_bol, encode_coding_iso_2022)
16287 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16288 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16289 Declare EMACS_INT.
16290 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16291 (encode_invocation_designation): Last argument P_NCHARS is now
16292 EMACS_INT.
16293 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16294 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16295
16296 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16297 All users changed.
16298
16299 * ccl.c (Fccl_execute_on_string): Declare some variables
16300 EMACS_INT.
16301
16302 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16303
16304 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16305
16306 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16307
16308 * process.c (Fformat_network_address): Doc fix.
16309
16310 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16311
16312 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16313
16314 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16315
16316 * keyboard.c (read_char): Call Lisp function help-form-show,
16317 instead of using internal_with_output_to_temp_buffer.
16318 (Qhelp_form_show): New var.
16319 (syms_of_keyboard): Use DEFSYM macro.
16320
16321 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16322
16323 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16324
16325 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16326
16327 * process.c (Flist_processes): Remove to Lisp.
16328 (list_processes_1): Delete.
16329
16330 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16331
16332 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16333
16334 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16335
16336 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16337
16338 Fix more problems found by GCC 4.6.0's static checks.
16339
16340 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16341
16342 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16343
16344 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16345
16346 * xdisp.c (vmessage): Mark as a printf-like function.
16347
16348 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16349
16350 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16351
16352 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16353 printf-like functions.
16354 (tiff_load): Add casts to remove these marks before passing them
16355 to system-supplied API.
16356
16357 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16358
16359 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16360 This avoids several warnings with gcc -Wstrict-overflow.
16361 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16362 directly, rather than having caller test rule sign. This avoids
16363 some unnecessary tests.
16364 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16365 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16366 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16367
16368 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16369 (xfont_open): Avoid unnecessary tests.
16370
16371 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16372
16373 * composite.h, composite.c (composition_gstring_put_cache):
16374 Use EMACS_INT, not int, for length.
16375
16376 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16377 breaking out part of COMPOSITION_DECODE_RULE.
16378 (COMPOSITION_DECODE_RULE): Use it.
16379 * composite.c (get_composition_id): Remove unused local vars,
16380 by using the new macro.
16381
16382 * textprop.c (set_text_properties_1): Change while to do-while,
16383 since the condition is always true at first.
16384
16385 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16386 (interval_deletion_adjustment): Return unsigned value.
16387 All uses changed.
16388
16389 * process.c (list_processes_1, create_pty, read_process_output):
16390 (exec_sentinel): Remove vars that were set but not used.
16391 (create_pty): Remove unnecessary "volatile"s.
16392 (Fnetwork_interface_info): Avoid possibility of int overflow.
16393 (read_process_output): Do adaptive read buffering even if carryover.
16394 (read_process_output): Simplify nbytes computation if buffered.
16395
16396 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16397
16398 * syntax.c (scan_words): Remove var that was set but not used.
16399 (update_syntax_table): Use unsigned instead of int.
16400
16401 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16402 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16403 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16404
16405 * print.c (print_error_message): Avoid int overflow.
16406
16407 * font.c (font_list_entities): Redo for clarity,
16408 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16409
16410 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16411 (font_score): Avoid potential overflow in diff calculation.
16412
16413 * fns.c (substring_both): Remove var that is set but not used.
16414 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16415
16416 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16417
16418 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16419 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16420 can always succeed if overflow has undefined behavior.
16421
16422 * search.c (boyer_moore, wordify): Remove vars set but not used.
16423 (wordify): Omit three unnecessary tests.
16424
16425 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16426 All callers changed. This avoids the need for an unused var.
16427
16428 * casefiddle.c (casify_region): Remove var that is set but not used.
16429
16430 * dired.c (file_name_completion): Remove var that is set but not used.
16431
16432 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16433
16434 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16435 (Finsert_file_contents): Remove unnecessary code checking fd.
16436
16437 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16438 Check for integer overflow on size calculations.
16439
16440 * buffer.c (Fprevious_overlay_change): Remove var that is set
16441 but not used.
16442
16443 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16444 Remove vars that are set but not used.
16445 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16446 (timer_check_2): Mark vars as initialized.
16447
16448 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16449
16450 * image.c (lookup_image): Remove var that is set but not used.
16451 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16452
16453 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16454 that are set but not used.
16455
16456 * xfns.c (make_invisible_cursor): Don't return garbage
16457 if XCreateBitmapFromData fails (Bug#8410).
16458
16459 * xselect.c (x_get_local_selection, x_handle_property_notify):
16460 Remove vars that are set but not used.
16461
16462 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16463 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16464
16465 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16466 Remove var that is set but not used.
16467 (scroll_bar_windows_size): Now size_t, not int.
16468 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16469 Check for overflow.
16470
16471 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16472 (map_tty_color) [!defined MSDOS]: Likewise.
16473
16474 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16475
16476 * coding.c: Remove vars that are set but not used.
16477 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16478 All callers changed.
16479 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16480 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16481 (decode_coding_charset): Remove vars that are set but not used.
16482
16483 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16484 that is set but not used.
16485
16486 * print.c (print_object): Remove var that is set but not used.
16487
16488 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16489 The gnulib version avoids calling malloc in the usual case,
16490 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16491 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16492 * filelock.c (current_lock_owner): Likewise.
16493 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16494 * sysdep.c: Include allocator.h, careadlinkat.h.
16495 (emacs_no_realloc_allocator): New static constant.
16496 (emacs_readlink): New function.
16497 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16498 ../lib/careadlinkat.h.
16499
16500 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16501
16502 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16503 first non-nil return value).
16504
16505 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16506
16507 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16508 if not defined (Bug#8403).
16509
16510 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16511
16512 * xdisp.c (display_count_lines): Remove parameter `start',
16513 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16514 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16515 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16516 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16517 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16518 and thereabouts. All callers changed.
16519 (get_per_char_metric): Remove parameter `f', unused since
16520 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16521
16522 2011-04-02 Jim Meyering <meyering@redhat.com>
16523
16524 do not dereference NULL upon failed strdup
16525 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16526 (ns_get_family): Likewise.
16527
16528 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16529
16530 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16531
16532 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16533
16534 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16535 later (Bug#8403).
16536
16537 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16538
16539 Add lexical binding.
16540
16541 * window.c (Ftemp_output_buffer_show): New fun.
16542 (Fsave_window_excursion):
16543 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16544
16545 * lread.c (lisp_file_lexically_bound_p): New function.
16546 (Fload): Bind Qlexical_binding.
16547 (readevalloop): Remove `evalfun' arg.
16548 Bind Qinternal_interpreter_environment.
16549 (Feval_buffer): Bind Qlexical_binding.
16550 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16551 Mark as dynamic.
16552 (syms_of_lread): Declare `lexical-binding'.
16553
16554 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16555
16556 * keyboard.c (eval_dyn): New fun.
16557 (menu_item_eval_property): Use it.
16558
16559 * image.c (parse_image_spec): Use Ffunctionp.
16560
16561 * fns.c (concat, mapcar1): Accept byte-code-functions.
16562
16563 * eval.c (Fsetq): Handle lexical vars.
16564 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16565 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16566 (FletX, Flet): Obey lexical binding.
16567 (Fcommandp): Handle closures.
16568 (Feval): New `lexical' arg.
16569 (eval_sub): New function extracted from Feval. Use it almost
16570 everywhere where Feval was used. Look up vars in lexical env.
16571 Handle closures.
16572 (Ffunctionp): Move from subr.el.
16573 (Ffuncall): Handle closures.
16574 (apply_lambda): Remove `eval_flags'.
16575 (funcall_lambda): Handle closures and new byte-code-functions.
16576 (Fspecial_variable_p): New function.
16577 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16578 but without exporting it to Lisp.
16579
16580 * doc.c (Fdocumentation, store_function_docstring):
16581 * data.c (Finteractive_form): Handle closures.
16582
16583 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16584 interactive spec.
16585
16586 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16587 New byte-codes.
16588 (exec_byte_code): New function extracted from Fbyte_code to handle new
16589 calling convention for byte-code-functions. Add new byte-codes.
16590
16591 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16592
16593 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16594
16595 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16596
16597 * xdisp.c (redisplay_internal): Fix prototype.
16598
16599 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16600
16601 * xdisp.c (SCROLL_LIMIT): New macro.
16602 (try_scrolling): Use it when setting scroll_limit.
16603 Limit scrolling to 100 screen lines.
16604 (redisplay_window): Even when falling back on "recentering",
16605 position point in the window according to scroll-conservatively,
16606 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16607
16608 (try_scrolling): When point is above the window, allow searching
16609 as far as scroll_max, or one screenful, to compute vertical
16610 distance from PT to the scroll margin position. This prevents
16611 try_scrolling from unnecessarily failing when
16612 scroll-conservatively is set to a value slightly larger than the
16613 window height. Clean up the case of PT below the margin at bottom
16614 of window: scroll_max can no longer be INT_MAX. When aggressive
16615 scrolling is in use, don't let point enter the opposite scroll
16616 margin as result of the scroll.
16617 (syms_of_xdisp) <scroll-conservatively>: Document the
16618 threshold of 100 lines for never-recentering scrolling.
16619
16620 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16621
16622 * dispextern.h (move_it_by_lines):
16623 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16624 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16625 (message_log_check_duplicate): Remove parameters `prev_bol' and
16626 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16627 (redisplay_internal): Remove parameter `preserve_echo_area',
16628 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16629
16630 * indent.c (Fvertical_motion):
16631 * window.c (window_scroll_pixel_based, Frecenter):
16632 Don't pass `need_y_p' to `move_it_by_lines'.
16633
16634 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16635
16636 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16637 steal a few bits to be more compact.
16638 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16639 Remove unneeded casts.
16640
16641 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16642
16643 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16644
16645 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16646 binding" message (bug#7967).
16647
16648 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16649
16650 Fix more problems found by GCC 4.6.0's static checks.
16651
16652 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16653 Remove unused local var.
16654
16655 * editfns.c (Fmessage_box): Remove unused local var.
16656
16657 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16658 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16659 Omit unused local vars.
16660 * window.c (shrink_windows): Omit unused local var.
16661 * menu.c (digest_single_submenu): Omit unused local var.
16662 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16663 Omit unused local var.
16664
16665 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16666 Don't assume string length fits in int.
16667 (keyremap_step, read_key_sequence): Use size_t for sizes.
16668 (read_key_sequence): Don't check last_real_key_start redundantly.
16669
16670 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16671 instead of alloca (Bug#8344).
16672
16673 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16674 (Fbacktrace_frame): Don't assume nframes fits in int.
16675
16676 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16677
16678 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16679 concerns.
16680
16681 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16682
16683 * cm.c (calccost): Turn while-do into do-while, for clarity.
16684
16685 * keyboard.c (syms_of_keyboard): Use the same style as later
16686 in this function when indexing through an array. This also
16687 works around GCC bug 48267.
16688
16689 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16690
16691 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16692
16693 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16694 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16695
16696 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16697 This avoids undefined behavior on integer overflow, and is a bit
16698 more convenient anyway since it is compared to a size_t variable.
16699
16700 Variadic C functions now count arguments with size_t, not int.
16701 This avoids an unnecessary limitation on 64-bit machines, which
16702 caused (substring ...) to crash on large vectors (Bug#8344).
16703 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16704 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16705 All variadic functions and their callers changed accordingly.
16706 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16707 * data.c (arith_driver, float_arith_driver): Likewise.
16708 * editfns.c (general_insert_function): Likewise.
16709 * eval.c (struct backtrace.nargs, interactive_p)
16710 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16711 (funcall_lambda, mark_backtrace): Likewise.
16712 * fns.c (concat): Likewise.
16713 * frame.c (x_set_frame_parameters): Likewise.
16714 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16715 0 if not found, not -1. All callers changed.
16716
16717 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16718 (stack_copy_size): Now size_t, not int.
16719 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16720
16721 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16722
16723 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16724 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16725 All callers changed.
16726
16727 * lisp.h (multibyte_char_to_unibyte):
16728 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16729 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16730 * character.h (CHAR_TO_BYTE8):
16731 * cmds.c (internal_self_insert):
16732 * editfns.c (general_insert_function):
16733 * keymap.c (push_key_description):
16734 * search.c (Freplace_match):
16735 * xdisp.c (message_dolog, set_message_1): All callers changed.
16736
16737 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16738
16739 * keyboard.c (safe_run_hook_funcall): New function.
16740 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16741 don't set the hook to nil, but remove the offending function instead.
16742 (Qcommand_hook_internal): Remove, unused.
16743 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16744 Vcommand_hook_internal.
16745
16746 * eval.c (enum run_hooks_condition): Remove.
16747 (funcall_nil, funcall_not): New functions.
16748 (run_hook_with_args): Call each function through a `funcall' argument.
16749 Remove `cond' argument, now redundant.
16750 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16751 (Frun_hook_with_args_until_failure): Adjust accordingly.
16752 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16753
16754 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16755
16756 * dispextern.h (string_buffer_position): Remove declaration.
16757
16758 * print.c (strout): Remove parameter `multibyte', unused since
16759 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16760
16761 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16762 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16763 All callers changed.
16764
16765 * w32.c (_wsa_errlist): Use braces for struct initializers.
16766
16767 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16768 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16769 All callers changed.
16770 (string_buffer_position): Likewise. Also, make static (it's never
16771 used outside xdisp.c).
16772 (cursor_row_p): Remove parameter `w', unused since
16773 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16774 (decode_mode_spec): Remove parameter `precision', introduced during
16775 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16776 All callers changed.
16777
16778 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16779
16780 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16781
16782 2011-03-27 Anders Lindgren <andlind@gmail.com>
16783
16784 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16785 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16786 (ns_update_auto_hide_menu_bar): New functions.
16787 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16788 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16789 ns_constrain_all_frames.
16790 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16791 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16792
16793 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16794
16795 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16796
16797 2011-03-27 Glenn Morris <rgm@gnu.org>
16798
16799 * syssignal.h: Replace RETSIGTYPE with void.
16800 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16801 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16802 Replace SIGTYPE with void everywhere.
16803 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16804 * s/template.h (SIGTYPE): Remove commented out definition.
16805
16806 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16807
16808 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16809 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16810
16811 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16812
16813 * w32.c (read_unc_volume): Use parameter `henum', instead of
16814 global variable `wget_enum_handle'.
16815
16816 * keymap.c (describe_vector): Remove parameters `indices' and
16817 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16818 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16819
16820 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16821
16822 * keyboard.c (timer_check): Remove parameter `do_it_now',
16823 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16824 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16825 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16826
16827 * keyboard.c (read_char):
16828 * w32menu.c (w32_menu_display_help):
16829 * xmenu.c (show_help_event, menu_help_callback):
16830 Adjust calls to `show_help_echo'.
16831
16832 * gtkutil.c (xg_maybe_add_timer):
16833 * keyboard.c (readable_events):
16834 * process.c (wait_reading_process_output):
16835 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16836
16837 * insdel.c (adjust_markers_gap_motion):
16838 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16839 (gap_left, gap_right): Don't call it.
16840
16841 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16842
16843 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16844 incurred during fontification.
16845
16846 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16847
16848 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16849 (DEFVAR_PER_BUFFER): Don't pass it.
16850
16851 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16852 (scrolling_window): Don't pass it.
16853
16854 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16855
16856 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16857
16858 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16859 and `suffix'.
16860 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16861 of variables specific to SELinux and computation of `encoded_absname'.
16862
16863 * image.c (XPutPixel): Remove unused variable `height'.
16864
16865 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16866
16867 * unexw32.c (get_section_info): Remove unused variable `section'.
16868
16869 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16870 (system_process_attributes): Remove unused variable `sess'.
16871 (sys_read): Remove unused variable `err'.
16872
16873 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16874 (w32_wnd_proc): Remove unused variable `isdead'.
16875 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16876 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16877 (x_create_tip_frame): Remove unused variable `tem'.
16878
16879 * w32inevt.c (w32_console_read_socket):
16880 Remove unused variable `no_events'.
16881
16882 * w32term.c (x_draw_composite_glyph_string_foreground):
16883 Remove unused variable `width'.
16884
16885 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16886
16887 * w32term.c (x_set_glyph_string_clipping):
16888 Don't pass uninitialized region to CombineRgn.
16889
16890 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16891
16892 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16893 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16894 (Fx_close_connection): Remove unused variable `i'.
16895
16896 * w32font.c (w32font_draw): Return number of glyphs.
16897 (w32font_open_internal): Remove unused variable `i'.
16898 (w32font_driver): Add missing initializer.
16899
16900 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16901 (fill_in_menu): Remove unused variable `items_added'.
16902
16903 * w32term.c (last_mouse_press_frame): Remove static global variable.
16904 (w32_clip_to_row): Remove unused variable `f'.
16905 (x_delete_terminal): Remove unused variable `i'.
16906
16907 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16908 (NOTHING): Remove unused static global variable.
16909 (uniscribe_check_otf): Remove unused variable `table'.
16910 (uniscribe_font_driver): Add missing initializers.
16911
16912 2011-03-23 Julien Danjou <julien@danjou.info>
16913
16914 * term.c (Fsuspend_tty, Fresume_tty):
16915 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16916 * window.c (temp_output_buffer_show):
16917 * insdel.c (signal_before_change):
16918 * frame.c (Fhandle_switch_frame):
16919 * fileio.c (Fdo_auto_save):
16920 * emacs.c (Fkill_emacs):
16921 * editfns.c (save_excursion_restore):
16922 * cmds.c (internal_self_insert):
16923 * callint.c (Fcall_interactively):
16924 * buffer.c (Fkill_all_local_variables):
16925 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16926 Use Frun_hooks.
16927 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16928 unconditionally since it does the check itself.
16929
16930 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16931
16932 Fix more problems found by GCC 4.5.2's static checks.
16933
16934 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16935 the first time through the loop, since we know p0 < p1 then.
16936 This also avoids a gcc -Wstrict-overflow warning.
16937
16938 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16939 leading to a memory leak, possible in functions like
16940 load_charset_map_from_file that can allocate an unbounded number
16941 of objects (Bug#8318).
16942
16943 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16944 that could (at least in theory) be that large.
16945
16946 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16947 This is less likely to overflow, and avoids undefined behavior if
16948 overflow does occur. All callers changed. Use strtoul to scan
16949 for the unsigned long integer.
16950 (pint2hrstr): Simplify and tune code slightly.
16951 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16952
16953 * scroll.c (do_scrolling): Work around GCC bug 48228.
16954 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16955
16956 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16957 This also avoids a warning with gcc -Wstrict-overflow.
16958 (validate_x_resource_name): Simplify count usage.
16959 This also avoids a warning with gcc -Wstrict-overflow.
16960
16961 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16962 fail (Bug#8306).
16963
16964 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16965
16966 * process.c (Fmake_network_process): Use socklen_t, not int,
16967 where POSIX says socklen_t is required in portable programs.
16968 This fixes a porting bug on hosts like 64-bit HP-UX, where
16969 socklen_t is wider than int (Bug#8277).
16970 (Fmake_network_process, server_accept_connection):
16971 (wait_reading_process_output, read_process_output):
16972 Likewise.
16973
16974 * process.c: Rename or move locals to avoid shadowing.
16975 (list_processes_1, Fmake_network_process):
16976 (read_process_output_error_handler, exec_sentinel_error_handler):
16977 Rename or move locals.
16978 (Fmake_network_process): Define label "retry_connect" only if needed.
16979 (Fnetwork_interface_info): Fix pointer signedness.
16980 (process_send_signal): Add cast to avoid pointer signedness problem.
16981 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16982 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16983
16984 Make tparam.h and terminfo.c consistent.
16985 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16986 Include tparam.h instead, since it declares them.
16987 * cm.h (PC): Remove extern decl; tparam.h now does this.
16988 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16989 * terminfo.c: Include tparam.h, to check interfaces.
16990 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16991 (tparam): Adjust signature to match interface in tparam.h;
16992 this removes some undefined behavior. Check that outstring and len
16993 are zero, which they always are with Emacs.
16994 * tparam.h (PC, BC, UP): New extern decls.
16995
16996 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16997 (xftfont_open): Rename locals to avoid shadowing.
16998
16999 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17000 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17001 (OTF_TAG_SYM): Omit macro if not needed.
17002 (ftfont_list): Remove unused local.
17003 (get_adstyle_property, ftfont_pattern_entity):
17004 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17005 Rename locals to avoid shadowing.
17006
17007 * xfont.c (xfont_list_family): Mark var as initialized.
17008
17009 * xml.c (make_dom): Now static.
17010
17011 * composite.c (composition_compute_stop_pos): Rename local to
17012 avoid shadowing.
17013 (composition_reseat_it): Remove unused locals.
17014 (find_automatic_composition, composition_adjust_point): Likewise.
17015 (composition_update_it): Mark var as initialized.
17016 (find_automatic_composition): Mark vars as initialized,
17017 with a FIXME (Bug#8290).
17018
17019 character.h: Rename locals to avoid shadowing.
17020 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17021 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17022 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17023 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17024 to avoid shadowing.
17025
17026 * textprop.c (property_change_between_p): Remove; unused.
17027
17028 * intervals.c (interval_start_pos): Now static.
17029
17030 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17031
17032 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17033 Rename locals to avoid shadowing.
17034
17035 * sound.c (wav_play, au_play, Fplay_sound_internal):
17036 Fix pointer signedness.
17037 (alsa_choose_format): Remove unused local var.
17038 (wav_play): Initialize a variable to 0, to prevent undefined
17039 behavior (Bug#8278).
17040
17041 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17042
17043 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17044
17045 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17046 clobbering (Bug#8298).
17047 * sysdep.c (sys_subshell): Likewise.
17048 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17049
17050 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17051 This should get cleaned up, so that child_setup has the
17052 same signature on all platforms.
17053
17054 * callproc.c (call_process_cleanup): Now static.
17055 (relocate_fd): Rename locals to avoid shadowing.
17056
17057 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17058
17059 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17060 not to be necessary, and produces flickering.
17061
17062 2011-03-20 Glenn Morris <rgm@gnu.org>
17063
17064 * config.in: Remove file.
17065
17066 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17067
17068 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17069 are now in src/globals.h.
17070 (syms_of_minibuf): Remove spurious & from previous change.
17071
17072 2011-03-20 Leo Liu <sdl.web@gmail.com>
17073
17074 * minibuf.c (completing-read-function): New variable.
17075 (completing-read-default): Rename from completing-read.
17076 (completing-read): Call completing-read-function.
17077
17078 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17079
17080 * xfaces.c (Fx_load_color_file):
17081 Read color file from absolute filename (bug#8250).
17082
17083 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17084
17085 * makefile.w32-in: Update dependencies.
17086
17087 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17088
17089 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17090
17091 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17092
17093 Fix more problems found by GCC 4.5.2's static checks.
17094
17095 * process.c (make_serial_process_unwind, send_process_trap):
17096 (sigchld_handler): Now static.
17097
17098 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17099 That way, the code declares only the vars that it needs.
17100 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17101 * s/cygwin.h (PTY_ITERATION): Likewise.
17102 * s/darwin.h (PTY_ITERATION): Likewise.
17103 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17104
17105 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17106 * process.c (allocate_pty): Don't declare stb unless it's needed.
17107
17108 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17109 (CONSTANTLIM): Remove; unused.
17110 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17111 Define only if needed.
17112
17113 * unexelf.c (unexec): Name an expression,
17114 to avoid gcc -Wbad-function-cast warning.
17115 Use a different way to cause a compilation error if anyone uses
17116 n rather than nn, a way that does not involve shadowing.
17117 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17118
17119 * deps.mk (unexalpha.o): Remove; unused.
17120
17121 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17122 * unexec.h: New file.
17123 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17124 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17125 Depend on unexec.h.
17126 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17127 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17128 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17129 Change as necessary to match prototype in unexec.h.
17130
17131 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17132 shadowing.
17133 (back_comment, skip_chars): Mark vars as initialized.
17134
17135 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17136 Rename locals to avoid shadowing.
17137
17138 * lread.c (read1): Rewrite so as not to use empty "else".
17139 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17140
17141 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17142
17143 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17144 warning when compiling print.c.
17145
17146 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17147 instead of using an uninitialized var.
17148 (font_sort_entities): Mark var as initialized.
17149
17150 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17151
17152 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17153 pointers to constants.
17154 (font_parse_fcname): Remove unused vars.
17155 (font_delete_unmatched): Now static.
17156 (font_get_spec): Remove; unused.
17157 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17158 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17159 Rename or move locals to avoid shadowing.
17160
17161 * fns.c (require_nesting_list, require_unwind): Now static.
17162 (Ffillarray): Rename locals to avoid shadowing.
17163
17164 * floatfns.c (domain_error2): Define only if needed.
17165 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17166
17167 * alloc.c (mark_backtrace): Move decl from here ...
17168 * lisp.h: ... to here, so that it can be checked.
17169
17170 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17171 (Fdefvar): Rewrite so as not to use empty "else".
17172 (lisp_indirect_variable): Name an expression,
17173 to avoid gcc -Wbad-function-cast warning.
17174 (Fdefvar): Rename locals to avoid shadowing.
17175
17176 * callint.c (quotify_arg, quotify_args): Now static.
17177 (Fcall_interactively): Rename locals to avoid shadowing.
17178 Use const pointer when appropriate.
17179
17180 * lisp.h (get_system_name, get_operating_system_release):
17181 Move decls here, to check interfaces.
17182 * process.c (get_operating_system_release): Move decl to lisp.h.
17183 * xrdb.c (get_system_name): Likewise.
17184 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17185 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17186 some of which prompt warnings from gcc -Wbad-function-cast.
17187 (Fformat_time_string, Fencode_time, Finsert_char):
17188 (Ftranslate_region_internal, Fformat):
17189 Rename or remove local vars to avoid shadowing.
17190 (Ftranslate_region_internal): Mark var as initialized.
17191
17192 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17193 avoid shadowing.
17194
17195 * lisp.h (eassert): Check that the argument compiles, even if
17196 ENABLE_CHECKING is not defined.
17197
17198 * data.c (Findirect_variable): Name an expression, to avoid
17199 gcc -Wbad-function-cast warning.
17200 (default_value, arithcompare, arith_driver, arith_error): Now static.
17201 (store_symval_forwarding): Rename local to avoid shadowing.
17202 (Fmake_variable_buffer_local, Fmake_local_variable):
17203 Mark variables as initialized.
17204 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17205
17206 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17207 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17208 Rename locals to avoid shadowing.
17209 (mark_stack): Move local variables into the #ifdef region where
17210 they're used.
17211 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17212 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17213 needed otherwise.
17214 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17215 (GC_STRING_CHARS): Remove; not used.
17216 (Fmemory_limit): Cast sbrk's returned value to char *.
17217
17218 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17219 avoids undefined behavior in theory.
17220
17221 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17222
17223 Use functions, not macros, for up- and down-casing (Bug#8254).
17224 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17225 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17226 to use the following functions instead of these macros.
17227 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17228 EMACS_INT, since callers assume the returned value fits in int.
17229 (upcase1): Likewise, for UPCASE_TABLE.
17230 (uppercasep, lowercasep, upcase): New static inline functions.
17231 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17232 the race-condition problem in the old DOWNCASE.
17233
17234 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17235 Rename locals to avoid shadowing.
17236 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17237 (regex_compile, re_search_2, re_match_2_internal):
17238 Remove unused local vars.
17239 (FREE_VAR): Rewrite so as not to use empty "else",
17240 which gcc can warn about.
17241 (regex_compile, re_match_2_internal): Mark locals as initialized.
17242 (RETALLOC_IF): Define only if needed.
17243 (WORDCHAR_P): Likewise. This one is never needed, but is used
17244 only in a comment talking about a compiler bug, so put inside
17245 the #if 0 of that comment.
17246 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17247 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17248 Remove; unused.
17249
17250 * search.c (boyer_moore): Rename locals to avoid shadowing.
17251 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17252 (PREV_CHAR_BOUNDARY): Likewise.
17253
17254 * search.c (simple_search): Remove unused var.
17255
17256 * dired.c (compile_pattern): Move decl from here ...
17257 * lisp.h: ... to here, so that it can be checked.
17258 (struct re_registers): New forward decl.
17259
17260 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17261
17262 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17263 All uses changed.
17264 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17265 Rename locals to avoid shadowing.
17266 (Fvertical_motion): Mark locals as initialized.
17267
17268 * casefiddle.c (casify_object, casify_region): Now static.
17269 (casify_region): Mark local as initialized.
17270
17271 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17272
17273 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17274 New macros, so that the caller can use some names other than
17275 gcpro1, gcpro2, etc.
17276 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17277 of the new macros.
17278 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17279 argument, for consistency with GCPRO2_VAR, etc: it is now the
17280 prefix of the variable, not the variable itself. All uses
17281 changed.
17282 * dired.c (directory_files_internal, file_name_completion):
17283 Rename locals to avoid shadowing.
17284
17285 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17286 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17287 dired.c's scmp function, had undefined behavior.
17288 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17289 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17290 * buffer.h: ... to here, because these macros use current_buffer,
17291 and the new implementation with inline functions needs to have
17292 current_buffer in scope now, rather than later when the macros
17293 are used.
17294 (downcase, upcase1): New static inline functions.
17295 (DOWNCASE, UPCASE1): Reimplement using these functions.
17296 This avoids undefined behavior in expressions like
17297 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17298 from race conditions in accessing the global variables
17299 case_temp1 and case_temp2.
17300 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17301 * lisp.h (case_temp1, case_temp2): Remove their decls.
17302 * character.h (ASCII_CHAR_P): Move from here ...
17303 * lisp.h: ... to here, so that the inline functions mentioned
17304 above can use them.
17305
17306 * dired.c (directory_files_internal_unwind): Now static.
17307
17308 * fileio.c (file_name_as_directory, directory_file_name):
17309 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17310 Now static.
17311 (file_name_as_directory): Use const pointers when appropriate.
17312 (Fexpand_file_name): Likewise. In particular, newdir might
17313 point at constant storage, so make it a const pointer.
17314 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17315 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17316 signedness issues.
17317 (Fset_file_times, Finsert_file_contents, auto_save_error):
17318 Rename locals to avoid shadowing.
17319
17320 * minibuf.c (choose_minibuf_frame_1): Now static.
17321 (Ftry_completion, Fall_completions): Rename or remove locals
17322 to avoid shadowing.
17323
17324 * marker.c (bytepos_to_charpos): Remove; unused.
17325
17326 * lisp.h (verify_bytepos, count_markers): New decls,
17327 so that gcc does not warn that these functions aren't declared.
17328
17329 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17330 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17331 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17332 (copy_text): Remove unused local var.
17333
17334 * filelock.c (within_one_second): Now static.
17335 (lock_file_1): Rename local to avoid shadowing.
17336
17337 * buffer.c (fix_overlays_before): Mark locals as initialized.
17338 (fix_start_end_in_overlays): Likewise. This function should be
17339 simplified by using pointers-to-pointers, but that's a different
17340 matter.
17341 (switch_to_buffer_1): Now static.
17342 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17343 (report_overlay_modification): Rename locals to avoid shadowing.
17344
17345 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17346 Fix pointer signedness issue.
17347 (sys_subshell): Mark local as volatile if checking for lint,
17348 to suppress a gcc -Wclobbered warning that does not seem to be right.
17349 (MAXPATHLEN): Define only if needed.
17350
17351 * process.c (serial_open, serial_configure): Move decls from here ...
17352 * systty.h: ... to here, so that they can be checked.
17353
17354 * fns.c (get_random, seed_random): Move extern decls from here ...
17355 * lisp.h: ... to here, so that they can be checked.
17356
17357 * sysdep.c (reset_io): Now static.
17358 (wait_for_termination_signal): Remove; unused.
17359
17360 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17361 (copy_keymap_item, append_key, push_text_char_description):
17362 Now static.
17363 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17364 (DENSE_TABLE_SIZE): Remove; unused.
17365 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17366 (describe_map_tree):
17367 Rename locals to avoid shadowing.
17368
17369 * keyboard.c: Declare functions static if they are not used elsewhere.
17370 (echo_char, echo_dash, cmd_error, top_level_2):
17371 (poll_for_input, handle_async_input): Now static.
17372 (read_char, kbd_buffer_get_event, make_lispy_position):
17373 (make_lispy_event, make_lispy_movement, apply_modifiers):
17374 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17375 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17376 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17377 (read_key_sequence, read_char): Mark locals as initialized.
17378 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17379
17380 * keyboard.h (make_ctrl_char): New decl.
17381 (mark_kboards): Move decl here ...
17382 * alloc.c (mark_kboards): ... from here.
17383
17384 * lisp.h (force_auto_save_soon): New decl.
17385
17386 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17387 (DEFINE_DUMMY_FUNCTION): New macro.
17388 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17389 Use it.
17390 (main): Add casts to avoid warnings
17391 if GCC considers string literals to be constants.
17392
17393 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17394
17395 * dbusbind.c: Pointer signedness fixes.
17396 (xd_signature, xd_append_arg, xd_initialize):
17397 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17398 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17399 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17400 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17401
17402 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17403 if GCC considers string literals to be constants.
17404 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17405
17406 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17407
17408 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17409 (print_preprocess, print_object): New macro to fix last change.
17410
17411 * print.c (print_preprocess): Don't forget font objects.
17412
17413 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17414
17415 * emacs.c (USAGE3): Doc fixes.
17416
17417 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17418
17419 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17420 structure.
17421
17422 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17423
17424 * lisp.h (VWindow_system, Qfile_name_history):
17425 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17426 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17427 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17428
17429 * w32select.c: Don't #include "keyboard.h".
17430 (run_protected): Add extern declaration for waiting_for_input.
17431
17432 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17433 * w32console.c (detect_input_pending, read_input_pending)
17434 (encode_terminal_code):
17435 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17436 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17437 (w32_system_caret_y, Qfile_name_history):
17438 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17439 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17440 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17441 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17442 * w32proc.c (Qlocal, report_file_error):
17443 * w32term.c (Vwindow_system, updating_frame):
17444 * w32uniscribe.c (initialized, uniscribe_font_driver):
17445 Remove unneeded extern declarations.
17446
17447 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17448
17449 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17450
17451 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17452
17453 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17454 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17455 These macros can no longer be used for assignment.
17456
17457 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17458 Assign struct members directly, instead of using BUF_BEGV etc.
17459 (record_buffer_markers, fetch_buffer_markers): New functions for
17460 recording and fetching special buffer markers.
17461 (set_buffer_internal_1, set_buffer_temp): Use them.
17462
17463 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17464
17465 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17466
17467 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17468 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17469
17470 * xdisp.c (hscroll_window_tree):
17471 (reconsider_clip_changes): Use PT instead of BUF_PT.
17472
17473 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17474
17475 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17476 $(EMACS_ROOT)/lib/intprops.h.
17477
17478 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17479
17480 Fix more problems found by GCC 4.5.2's static checks.
17481
17482 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17483 to unsigned char * to avoid compiler diagnostic.
17484 (xg_free_frame_widgets): Make it clear that a local variable is
17485 needed only if USE_GTK_TOOLTIP.
17486 (gdk_window_get_screen): Make it clear that this macro is needed
17487 only if USE_GTK_TOOLTIP.
17488 (int_gtk_range_get_value): New function, which avoids a diagnostic
17489 from gcc -Wbad-function-cast.
17490 (xg_set_toolkit_scroll_bar_thumb): Use it.
17491 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17492 diagnostic from gcc -Wbad-function-cast.
17493 (get_utf8_string, xg_get_file_with_chooser):
17494 Rename locals to avoid shadowing.
17495 (create_dialog): Move locals to avoid shadowing.
17496
17497 * xgselect.c (xg_select): Remove unused var.
17498
17499 * image.c (four_corners_best): Mark locals as initialized.
17500 (gif_load): Initialize transparent_p to zero (Bug#8238).
17501 Mark another local as initialized.
17502 (my_png_error, my_error_exit): Mark with NO_RETURN.
17503
17504 * image.c (clear_image_cache): Now static.
17505 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17506 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17507 (x_edge_detection): Remove unnecessary cast that
17508 gcc -Wbad-function-cast diagnoses.
17509 (gif_load): Fix pointer signedness.
17510 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17511 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17512
17513 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17514
17515 Improve quality of tests for time stamp overflow.
17516 For example, without this patch (encode-time 0 0 0 1 1
17517 1152921504606846976) returns the obviously-bogus value (-948597
17518 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17519 reports time overflow. See
17520 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17521 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17522 * editfns.c: Include limits.h and intprops.h.
17523 (TIME_T_MIN, TIME_T_MAX): New macros.
17524 (time_overflow): Move earlier, to before first use.
17525 (hi_time, lo_time): New functions, for an accurate test for
17526 out-of-range times.
17527 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17528 (Fget_internal_run_time): Don't assume time_t fits in int.
17529 (make_time): Use list2 instead of Fcons twice.
17530 (Fdecode_time): More accurate test for out-of-range times.
17531 (check_tm_member): New function.
17532 (Fencode_time): Use it, to test for out-of-range times.
17533 (lisp_time_argument): Don't rely on undefined left-shift and
17534 right-shift behavior when checking for time stamp overflow.
17535
17536 * editfns.c (time_overflow): New function, refactoring common code.
17537 (Fformat_time_string, Fdecode_time, Fencode_time):
17538 (Fcurrent_time_string): Use it.
17539
17540 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17541 * dired.c (make_time): Move to ...
17542 * editfns.c (make_time): ... here.
17543 * systime.h: Note the move.
17544
17545 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17546
17547 * fringe.c (update_window_fringes): Remove unused variables.
17548
17549 * unexmacosx.c (copy_data_segment): Also copy __got section.
17550 (Bug#8223)
17551
17552 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17553
17554 * termcap.c [MSDOS]: Include "msdos.h".
17555 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17556 Constify `char *' arguments and their references according to
17557 prototypes in tparam.h.
17558
17559 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17560
17561 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17562 Adapt all references accordingly.
17563
17564 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17565
17566 2011-03-11 Tom Tromey <tromey@redhat.com>
17567
17568 * buffer.c (syms_of_buffer): Remove obsolete comment.
17569
17570 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17571
17572 * termhooks.h (encode_terminal_code): Declare prototype.
17573
17574 * msdos.c (encode_terminal_code): Don't declare prototype.
17575
17576 * term.c (encode_terminal_code): Now external again, used by
17577 w32console.c and msdos.c.
17578
17579 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17580 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17581
17582 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17583
17584 Fix some minor problems found by GCC 4.5.2's static checks.
17585
17586 * fringe.c (update_window_fringes): Mark locals as initialized
17587 (Bug#8227).
17588 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17589
17590 * alloc.c (mark_fringe_data): Move decl from here ...
17591 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17592 to check its interface.
17593 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17594
17595 * fontset.c (free_realized_fontset): Now static.
17596 (Fset_fontset_font): Rename local to avoid shadowing.
17597 (fontset_font): Mark local as initialized.
17598 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17599
17600 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17601
17602 * xselect.c (x_disown_buffer_selections): Remove; not used.
17603 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17604 (x_own_selection, Fx_disown_selection_internal): Rename locals
17605 to avoid shadowing.
17606 (x_handle_dnd_message): Remove local to avoid shadowing.
17607
17608 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17609 so that the caller can use some name other than gcpro1.
17610 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17611 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17612 (Fx_backspace_delete_keys_p):
17613 Use them to avoid shadowing, and rename vars to avoid shadowing.
17614 (x_decode_color, x_set_name, x_window): Now static.
17615 (Fx_create_frame): Add braces to silence GCC warning.
17616 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17617 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17618 Remove unused locals.
17619 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17620 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17621 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17622 macros.
17623
17624 * xterm.h (x_mouse_leave): New decl.
17625
17626 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17627 Remove unused functions.
17628 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17629 (x_calc_absolute_position): Now static.
17630 (XTread_socket): Don't define label "out" unless it's used.
17631 Don't declare local "event" unless it's used.
17632 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17633 unless they are used.
17634 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17635 (x_fatal_error_signal): Remove; not used.
17636 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17637 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17638 (x_error_catcher, x_connection_closed, x_error_handler):
17639 (x_error_quitter, xembed_send_message, x_iconify_frame):
17640 (my_log_handler): Rename locals to avoid shadowing.
17641 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17642 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17643
17644 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17645 Rename or move locals to avoid shadowing.
17646 (tty_defined_color, merge_face_heights): Now static.
17647 (free_realized_faces_for_fontset): Remove; not used.
17648 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17649 does not deduce is never used uninitialized.
17650 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17651 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17652
17653 * terminal.c (store_terminal_param): Now static.
17654
17655 * xmenu.c (menu_highlight_callback): Now static.
17656 (set_frame_menubar): Remove unused local.
17657 (xmenu_show): Rename parameter to avoid shadowing.
17658 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17659 since they might point to immutable storage.
17660 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17661 since it's unused otherwise.
17662
17663 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17664 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17665 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17666 avoids a gcc -Wuninitialized diagnostic.
17667 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17668 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17669 does not deduce are never used uninitialized.
17670
17671 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17672
17673 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17674 * window.c (window_loop, size_window):
17675 (run_window_configuration_change_hook, enlarge_window): Likewise.
17676
17677 * window.c (display_buffer): Now static.
17678 (size_window): Mark variables that gcc -Wuninitialized
17679 does not deduce are never used uninitialized.
17680 * window.h (check_all_windows): New decl, to forestall
17681 gcc -Wmissing-prototypes diagnostic.
17682 * dispextern.h (bidi_dump_cached_states): Likewise.
17683
17684 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17685 shadowing.
17686 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17687 Include <limits.h>.
17688 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17689 and to avoid gcc -Wuninitialized warning.
17690 (load_charset_map): Mark variables that gcc -Wuninitialized
17691 does not deduce are never used uninitialized.
17692 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17693
17694 * coding.c (coding_set_source, coding_set_destination):
17695 Use "else { /* comment */ }" rather than "else /* comment */;"
17696 for clarity, and to avoid gcc -Wempty-body warning.
17697 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17698 a block, when the outer 'i' will do.
17699 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17700 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17701 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17702 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17703 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17704 Rename locals to avoid shadowing.
17705 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17706 * coding.c (emacs_mule_char, encode_invocation_designation):
17707 Now static, since they're not used elsewhere.
17708 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17709 (decode_coding_object, encode_coding_object, detect_coding_system):
17710 (decode_coding_emacs_mule): Mark variables that gcc
17711 -Wuninitialized does not deduce are never used uninitialized.
17712 (detect_coding_iso_2022): Initialize a local variable that might
17713 be used uninitialized. Leave a FIXME because it's not clear that
17714 this initialization is needed. (Bug#8211)
17715 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17716 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17717 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17718 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17719 Remove unused macros.
17720
17721 * category.c (hash_get_category_set): Remove unused local var.
17722 (copy_category_table): Now static, since it's not used elsewhere.
17723 * character.c (string_count_byte8): Likewise.
17724
17725 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17726 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17727
17728 * chartab.c (copy_sub_char_table): Now static, since it's not used
17729 elsewhere.
17730 (sub_char_table_ref_and_range, char_table_ref_and_range):
17731 Rename locals to avoid shadowing.
17732 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17733
17734 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17735 (BIDI_BOB): Remove unused macro.
17736
17737 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17738 deduce are never used uninitialized.
17739 * term.c (encode_terminal_code): Likewise.
17740
17741 * term.c (encode_terminal_code): Now static. Remove unused local.
17742
17743 * tparam.h: New file.
17744 * term.c, tparam.h: Include it.
17745 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17746 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17747 Move these decls to tparam.h, and make them agree with what
17748 is actually in tparam.c. The previous trick of using incompatible
17749 decls in different modules does not conform to the C standard.
17750 All callers of tparam changed to use tparam's actual API.
17751 * tparam.c (tparam1, tparam, tgoto):
17752 Use const pointers where appropriate.
17753
17754 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17755 * cm.h (struct cm): Likewise.
17756 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17757 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17758 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17759 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17760 (turn_on_face, init_tty): Likewise.
17761 * termchar.h (struct tty_display_info): Likewise.
17762
17763 * term.c (term_mouse_position): Rename local to avoid shadowing.
17764
17765 * alloc.c (mark_ttys): Move decl from here ...
17766 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17767
17768 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17769
17770 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17771
17772 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17773
17774 * search.c (compile_pattern_1): Remove argument regp, unused since
17775 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17776 (compile_pattern): Don't pass it.
17777
17778 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17779
17780 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17781 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17782 for ! HAVE_GTK3.
17783 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17784
17785 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17786
17787 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17788 gdk_window_get_screen, gdk_window_get_geometry,
17789 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17790 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17791 (xg_get_pixbuf_from_pixmap): New function.
17792 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17793 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17794 Call xg_get_pixbuf_from_pixmap instead of
17795 gdk_pixbuf_get_from_drawable.
17796 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17797 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17798 (xg_check_special_colors): Use GtkStyleContext and its functions
17799 for HAVE_GTK3.
17800 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17801 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17802 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17803 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17804 Call gtk_widget_get_preferred_size.
17805 (xg_frame_resized): gdk_window_get_geometry only takes 5
17806 parameters.
17807 (xg_win_to_widget, xg_event_is_for_menubar):
17808 Call gdk_x11_window_lookup_for_display.
17809 (xg_set_widget_bg): New function.
17810 (delete_cb): New function.
17811 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17812 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17813 (xg_set_background_color): Call xg_set_widget_bg.
17814 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17815 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17816 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17817 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17818 if ! HAVE_GTK3.
17819 (update_frame_tool_bar): Call gtk_widget_hide.
17820 (xg_initialize): Use GDK_KEY_g.
17821
17822 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17823 if ! HAVE_GTK3
17824 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17825
17826 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17827 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17828 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17829
17830 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17831
17832 * w32xfns.c (select_palette): Check success of RealizePalette against
17833 GDI_ERROR, not zero.
17834
17835 See ChangeLog.11 for earlier changes.
17836
17837 ;; Local Variables:
17838 ;; coding: utf-8
17839 ;; End:
17840
17841 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17842
17843 This file is part of GNU Emacs.
17844
17845 GNU Emacs is free software: you can redistribute it and/or modify
17846 it under the terms of the GNU General Public License as published by
17847 the Free Software Foundation, either version 3 of the License, or
17848 (at your option) any later version.
17849
17850 GNU Emacs is distributed in the hope that it will be useful,
17851 but WITHOUT ANY WARRANTY; without even the implied warranty of
17852 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17853 GNU General Public License for more details.
17854
17855 You should have received a copy of the GNU General Public License
17856 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.