]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Handle window-height and window-width alist entries in `display-buffer'.
[gnu-emacs] / src / ChangeLog
1 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (Vwindow_combination_limit): New default value.
4 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5
6 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
7
8 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
9 Suggested by Eli Zaretskii in
10 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
11
12 2012-09-30 Eli Zaretskii <eliz@gnu.org>
13
14 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
15 HAVE_TIMER_SETTIME is defined.
16
17 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
18
19 Profiler improvements: more-accurate timers, overflow checks.
20 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
21 signal.h, setjmp.h. Include systime.h instead.
22 (saturated_add): New function.
23 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
24 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
25 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
26 New static vars.
27 (enum profiler_cpu_running): New enum.
28 (profiler_cpu_running): Now of that enum type, not bool.
29 All uses changed to store the new value.
30 (handle_profiler_signal): Rename from sigprof_handler_1,
31 for consistency with other handlers. Do not check whether
32 cpu_log is a hash-table if garbage collecting, since it
33 doesn't matter in that case.
34 (deliver_profiler_signal): Rename from sigprof_handler,
35 for consistency with other handlers.
36 (setup_cpu_timer): New function, with much of what used to be in
37 Fprofiler_cpu_start. Check for out-of-range argument.
38 Prefer timer_settime if available, and prefer
39 thread cputime clocks, then process cputime clocks, then
40 monotonic clocks, to the old realtime clock. Use make_timeval
41 to round more-correctly when falling back to setitimer.
42 (Fprofiler_cpu_start): Use it.
43 (Fprofiler_cpu_stop): Prefer timer_settime if available.
44 Don't assume that passing NULL as the 2nd argument of setitimer
45 is the same as passing a pointer to all-zero storage.
46 Ignore SIGPROF afterwards.
47 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
48 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
49 non-fatal signal handlers. Ignore SIGPROF on startup.
50 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
51 in profiler.c, since sysdep.c now uses it.
52
53 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
54 Suggested by Eli Zaretskii in
55 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
56
57 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
58
59 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
60
61 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
62
63 * lisp.h (struct backtrace): Remove indirection for `function' field.
64 * xdisp.c (redisplay_internal):
65 * profiler.c (record_backtrace, sigprof_handler_1):
66 * alloc.c (Fgarbage_collect):
67 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
68 (Fbacktrace_frame): Adjust accordingly.
69
70 2012-09-28 Glenn Morris <rgm@gnu.org>
71
72 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
73 (Frun_hook_with_args_until_failure): Doc fixes.
74
75 2012-09-28 Eli Zaretskii <eliz@gnu.org>
76
77 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
78 Qautomatic_redisplay and change the symbol name. All users changed.
79
80 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
81
82 * profiler.c (sigprof_handler): Fix race condition.
83
84 2012-09-28 Glenn Morris <rgm@gnu.org>
85
86 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
87
88 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
89
90 Check more robustly for timer_settime.
91 * Makefile.in (LIB_TIMER_TIME): New macro.
92 (LIBES): Add it.
93 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
94 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
95 call timer_settime.
96
97 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
98
99 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
100
101 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
102
103 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
104
105 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
106
107 * character.h (MAYBE_UNIFY_CHAR): Remove.
108 * charset.c, charset.h (maybe_unify_char): Now static.
109 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
110 Since this stuff is now private to charset.c, there's no need for
111 a public macro and no need to inline by hand.
112
113 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
114 Stefan Monnier <monnier@iro.umontreal.ca>
115 Juanma Barranquero <lekktu@gmail.com>
116
117 * profiler.c: New file.
118 * Makefile.in (base_obj): Add profiler.o.
119 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
120 ($(BLD)/profiler.$(O)): New target.
121 * emacs.c (main): Call syms_of_profiler.
122 * alloc.c (Qautomatic_gc): New constant.
123 (MALLOC_PROBE): New macro.
124 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
125 (total_bytes_of_live_objects): New function.
126 (Fgarbage_collect): Use it. Record itself in backtrace_list.
127 Call malloc_probe for the memory profiler.
128 (syms_of_alloc): Define Qautomatic_gc.
129 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
130 race condition.
131 (struct backtrace): Move definition...
132 * lisp.h (struct backtrace): ..here.
133 (Qautomatic_gc, profiler_memory_running): Declare vars.
134 (malloc_probe, syms_of_profiler): Declare functions.
135 * xdisp.c (Qautomatic_redisplay): New constant.
136 (redisplay_internal): Record itself in backtrace_list.
137 (syms_of_xdisp): Define Qautomatic_redisplay.
138
139 2012-09-25 Eli Zaretskii <eliz@gnu.org>
140 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
141
142 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
143
144 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
145
146 Prefer POSIX timers if available.
147 They avoid a race if the timer is too close to the current time.
148 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
149 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
150 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
151
152 2012-09-25 Eli Zaretskii <eliz@gnu.org>
153
154 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
155 CHAR_STRING_ADVANCE.
156 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
157 STRING_CHAR_ADVANCE.
158
159 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
160
161 Move Vlibrary_cache to emacs.c and reset before dumping.
162
163 * lisp.h (reset_image_types): Declare.
164 [WINDOWSNT] (Vlibrary_cache): Declare.
165
166 * image.c (reset_image_types): New function.
167
168 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
169 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
170 (Fdump_emacs): Reset Vlibrary_cache and image_types.
171
172 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
173 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
174
175 * w32.h (Vlibrary_cache): Do not declare.
176
177 2012-09-25 Eli Zaretskii <eliz@gnu.org>
178
179 * w32proc.c (sys_signal): Handle all signals defined by the
180 MS-Windows runtime, not just SIGCHLD. Actually install the signal
181 handlers for signals supported by Windows. Don't override
182 term_ntproc as the handler for SIGABRT.
183 (sigaction): Rewrite to call sys_signal instead of duplicating its
184 code.
185 (sys_kill): Improve commentary.
186
187 * w32.c (term_ntproc): Accept (and ignore) one argument, for
188 consistency with a signature of a signal handler. All callers
189 changed.
190 (init_ntproc): Accept an argument DUMPING. If dumping, don't
191 install term_ntproc as a signal handler for SIGABRT, as that
192 should be done by the dumped Emacs.
193
194 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
195
196 * w32select.c (term_w32select): Protect against repeated
197 invocation by setting clipboard_owner to NULL after calling
198 DestroyWindow.
199
200 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
201 and term_ntproc to their modified signatures.
202
203 * character.c (char_string, string_char): Remove calls to
204 MAYBE_UNIFY_CHAR. See the discussion starting at
205 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
206 for the details.
207
208 2012-09-25 Chong Yidong <cyd@gnu.org>
209
210 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
211
212 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
213
214 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
215 when encountering an unknown bytecode.
216
217 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
218
219 image.c, indent.c: Use bool for booleans.
220 * dispextern.h (struct image_type): Members valid_p, load, init
221 now return bool, not int. All uses changed.
222 * image.c: Omit unnecessary static decls.
223 (x_create_bitmap_mask, x_build_heuristic_mask):
224 Return void, not int, since callers don't care about the return value.
225 (x_create_bitmap_mask, define_image_type, valid_image_p)
226 (struct image_keyword, parse_image_spec, image_spec_value)
227 (check_image_size, image_background)
228 (image_background_transparent, x_clear_image_1)
229 (postprocess_image, lookup_image, x_check_image_size)
230 (x_create_x_image_and_pixmap, xbm_image_p)
231 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
232 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
233 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
234 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
235 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
236 (png_image_p, init_png_functions, png_load_body, png_load)
237 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
238 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
239 (init_gif_functions, gif_load, imagemagick_image_p)
240 (imagemagick_load_image, imagemagick_load, svg_image_p)
241 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
242 (gs_load):
243 * nsimage.m (ns_load_image):
244 * nsterm.m (ns_defined_color):
245 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
246 * xfns.c (x_defined_color):
247 * xterm.c (x_alloc_lighter_color_for_widget)
248 (x_alloc_nearest_color_1, x_alloc_nearest_color)
249 (x_alloc_lighter_color):
250 * indent.c (disptab_matches_widthtab, current_column)
251 (scan_for_column, string_display_width, indented_beyond_p)
252 (compute_motion, vmotion, Fvertical_motion):
253 Use bool for booleans.
254
255 2012-09-24 Chong Yidong <cyd@gnu.org>
256
257 * chartab.c (Fset_char_table_default): Obsolete function removed.
258
259 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
260
261 Move pid_t related decls out of lisp.h.
262 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
263 (interruptible_wait_for_termination):
264 Move these decls from lisp.h to syswait.h, since they use pid_t.
265 Needed on FreeBSD; see Herbert J. Skuhra in
266 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
267 * callproc.c: Include syswait.h.
268
269 gnutls.c, gtkutil.c: Use bool for boolean.
270 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
271 (emacs_gnutls_handle_error):
272 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
273 (xg_hide_tooltip, xg_create_frame_widgets)
274 (create_dialog, xg_uses_old_file_dialog)
275 (xg_get_file_with_chooser, xg_get_file_with_selection)
276 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
277 (xg_item_label_same_p, xg_update_menubar)
278 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
279 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
280 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
281 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
282 (update_frame_tool_bar, free_frame_tool_bar):
283 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
284 * nsmenu.m (ns_update_menubar):
285 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
286 * xfns.c (Fx_show_tip) [USE_GTK]:
287 Use bool for boolean.
288 * gtkutil.c (xg_update_frame_menubar):
289 * xmenu.c (update_frame_menubar):
290 Return void, not int, since caller ignores return value.
291 * gtkutil.c (xg_change_toolbar_position):
292 Return void, not 1.
293
294 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
295
296 * makefile.w32-in (BLOCKINPUT_H): Remove.
297 (SYSSIGNAL_H): New macro.
298 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
299 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
300 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
301 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
302 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
303 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
304 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
305 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
306 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
307 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
308 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
309 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
310 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
311 ($(BLD)/w32xfns.$(O)): Update dependencies.
312
313 2012-09-23 Eli Zaretskii <eliz@gnu.org>
314
315 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
316 fatal_error_backtrace.
317
318 * w32proc.c (sys_kill): Undo last change: don't do anything when
319 invoked to deliver SIGABRT to our own process. This is now
320 handled by emacs_raise.
321
322 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
323
324 * w32term.c (w32_read_socket): Remove leftover reference to
325 interrupt_input_pending.
326
327 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
328
329 Do not use SA_NODEFER.
330 Problem reported by Dani Moncayo in
331 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
332 * alloc.c (die):
333 * sysdep.c (emacs_abort): Do not reset signal handler.
334 * emacs.c (terminate_due_to_signal): Reset signal handler here.
335 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
336 wanted even on POSIXish hosts, and it doesn't work on Windows.
337
338 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
339
340 * xterm.c (x_term_init): Call fixup_locale before and after calling
341 gtk_init (Bug#12392).
342
343 2012-09-23 Chong Yidong <cyd@gnu.org>
344
345 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
346 Vdynamic_library_alist.
347
348 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
349 (Fgnutls_available_p): Caller changed.
350
351 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
352 (Flibxml_parse_xml_region): Likewise.
353
354 * dispextern.h (struct image_type): Remove arg from init function.
355
356 * image.c (Finit_image_library, lookup_image_type)
357 (define_image_type): Remove now-unneeded second arg.
358 (init_xpm_functions, init_png_functions, init_jpeg_functions)
359 (init_tiff_functions, init_gif_functions, init_svg_functions):
360 Arglist and w32_delayed_load calling convention changed.
361 (gs_type): Remove init_gs_functions; there is no such function.
362 (valid_image_p, make_image): Fix caller to lookup_image_type.
363
364 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
365
366 Simplify and avoid signal-handling races (Bug#12471).
367 * alloc.c (die):
368 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
369 Avoid recursive loop if there's a fatal error in the function itself.
370 * atimer.c (pending_atimers):
371 * blockinput.h: Don't include "atimer.h"; no longer needed.
372 (interrupt_input_pending): Remove. All uses removed.
373 pending_signals now counts both atimers and ordinary interrupts.
374 This is less racy than having three separate pending-signal flags.
375 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
376 (input_blocked_p):
377 Rename from their upper-case counterparts BLOCK_INPUT,
378 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
379 INPUT_BLOCKED_P, and turn into functions. All uses changed.
380 This makes it easier to access volatile variables more accurately.
381 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
382 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
383 that's more reliable if the code is buggy and sets
384 interrupt_input_blocked to a negative value. All uses changed.
385 * atimer.c (deliver_alarm_signal):
386 Remove. No need to deliver this to the parent; any thread can
387 handle this signal now. All uses replaced by underlying handler.
388 * atimer.c (turn_on_atimers):
389 * dispnew.c (handle_window_change_signal):
390 * emacs.c (handle_danger_signal):
391 * keyboard.c (kbd_buffer_get_event):
392 Don't reestablish signal handler; not needed with sigaction.
393 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
394 (UNBLOCK_INPUT_TO):
395 Rework to avoid unnecessary accesses to volatile variables.
396 (UNBLOCK_INPUT_TO): Now a function.
397 (totally_unblock_input, unblock_input): New decls.
398 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
399 (init_data): Remove. Necessary stuff now done in init_signal.
400 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
401 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
402 (fatal_error_code): Remove; no longer needed.
403 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
404 it doesn't always backtrace. All uses changed. No need to reset
405 signal to default, since sigaction and/or die does that for us now.
406 Use emacs_raise (FOO), not kill (getpid (), FOO).
407 (main): Check more-accurately whether we're dumping.
408 Move fatal-error setup to sysdep.c
409 * floatfns.c: Do not include "syssignal.h"; no longer needed.
410 * gtkutil.c (xg_get_file_name, xg_get_font):
411 Remove no-longer-needed signal-mask manipulation.
412 * keyboard.c, process.c (POLL_FOR_INPUT):
413 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
414 * keyboard.c (read_avail_input): Remove.
415 All uses replaced by gobble_input.
416 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
417 (kbd_buffer_store_event_hold, gobble_input):
418 (record_asynch_buffer_change) [USABLE_SIGIO]:
419 (store_user_signal_events):
420 No need to mess with signal mask.
421 (gobble_input): If blocking input and there are terminals, simply
422 set pending_signals to 1 and return. All hooks changed to not
423 worry about whether input is blocked.
424 (process_pending_signals): Clear pending_signals before processing
425 them, in case a signal comes in while we're processing.
426 By convention callers now test pending_signals before calling us.
427 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
428 New functions, to support changes to blockinput.h.
429 (handle_input_available_signal): Now extern.
430 (reinvoke_input_signal): Remove. All uses replaced by
431 handle_async_input.
432 (quit_count): Now volatile, since a signal handler uses it.
433 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
434 All callers changed. Block SIGINT only if not already blocked.
435 Clear sigmask reliably, even if Fsignal returns, which it can.
436 Omit unnecessary accesses to volatile var.
437 (quit_throw_to_read_char): No need to restore sigmask.
438 * keyboard.c (gobble_input, handle_user_signal):
439 * process.c (wait_reading_process_output):
440 Call signal-handling code rather than killing ourselves.
441 * lisp.h: Include <float.h>, for...
442 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
443 (pending_signals): Now volatile.
444 (syms_of_data): Now const if IEEE floating point.
445 (handle_input_available_signal) [USABLE_SIGIO]:
446 (terminate_due_to_signal, record_child_status_change): New decls.
447 * process.c (create_process): Avoid disaster if memory is exhausted
448 while we're processing a vfork, by tightening the critical section
449 around the vfork.
450 (send_process_frame, process_sent_to, handle_pipe_signal)
451 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
452 ignores SIGPIPE.
453 (send_process): No need for setjmp/longjmp any more, since the
454 SIGPIPE stuff is now gone. Instead, report an error if errno
455 is EPIPE.
456 (record_child_status_change): Now extern. PID and W are now args.
457 Return void, not bool. All callers changed.
458 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
459 Remove. All uses removed. This bug should be fixed now in a
460 different way.
461 (wait_for_termination_1): Use waitpid rather than sigsuspend,
462 and record the child status change directly. This avoids the
463 need to futz with the signal mask.
464 (process_fatal_action): Move here from emacs.c.
465 (emacs_sigaction_flags): New function, containing
466 much of what used to be in emacs_sigaction_init.
467 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
468 caught by emacs, to make races less likely.
469 (deliver_process_signal): Rename from handle_on_main_thread.
470 All uses changed.
471 (BACKTRACE_LIMIT_MAX): Now at top level.
472 (thread_backtrace_buffer, threadback_backtrace_pointers):
473 New static vars.
474 (deliver_thread_signal, deliver_fatal_thread_signal):
475 New functions, for more-accurate delivery of thread-specific signals.
476 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
477 (deliver_arith_signal): Handle in this thread, not
478 in the main thread, since it's triggered by this thread.
479 (maybe_fatal_sig): New function.
480 (init_signals): New arg DUMPING so that we can be more accurate
481 about whether we're dumping. Caller changed.
482 Treat thread-specific signals differently from process-general signals.
483 Block all signals while handling fatal error; that's safer.
484 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
485 on IEEE hosts.
486 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
487 Ignore SIGPIPE unless batch.
488 (emacs_backtrace): Output backtrace for the appropriate thread,
489 which is not necessarily the main thread.
490 * syssignal.h: Include <stdbool.h>.
491 (emacs_raise): New macro.
492 * xterm.c (x_connection_signal): Remove; no longer needed
493 now that we use sigaction.
494 (x_connection_closed): No need to mess with sigmask now.
495 (x_initialize): No need to reset SIGPIPE handler here, since
496 init_signals does this for us now.
497
498 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
499
500 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
501 background rect may be larger (Bug#12245).
502
503 2012-09-23 Chong Yidong <cyd@gnu.org>
504
505 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
506
507 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
508
509 * .gdbinit: Just stop at fatal_error_backtrace.
510 See Stefan Monnier's request in
511 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
512 Remove no-longer-used query of system type.
513
514 2012-09-22 Chong Yidong <cyd@gnu.org>
515
516 * search.c (Freplace_match): Doc fix (Bug#12325).
517
518 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
519
520 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
521 (Fline_end_position): Doc fix.
522
523 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
524
525 2012-09-22 Chong Yidong <cyd@gnu.org>
526
527 * dispextern.h (struct image_type): Add new slot, storing a type
528 initialization function.
529
530 * image.c (define_image_type): Call the image initializer function
531 if it is defined. Arguments and return value changed.
532 (valid_image_p, make_image): Callers changed.
533 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
534 (gif_type, imagemagick_type, svg_type, gs_type):
535 Add initialization functions.
536 (Finit_image_library): Call lookup_image_type.
537 (CHECK_LIB_AVAILABLE): Macro deleted.
538 (lookup_image_type): Call define_image_type here, rather than via
539 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
540 (syms_of_image): Move define_image_type calls for xbm_type and
541 pbm_type to lookup_image_type.
542
543 2012-09-22 Eli Zaretskii <eliz@gnu.org>
544
545 * keyboard.c (timer_check_2): Move calculation of 'timers' and
546 'idle_timers' from here ...
547 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
548 lists, to avoid infloops when the timer does something stupid,
549 like reinvoke itself with the same or smaller time-out.
550 (Bug#12447)
551
552 2012-09-22 Martin Rudalics <rudalics@gmx.at>
553
554 * window.c (Fsplit_window_internal): Handle only Qt value of
555 Vwindow_combination_limit separately.
556 (Qtemp_buffer_resize): New symbol.
557 (Vwindow_combination_limit): New default value.
558 Rewrite doc-string.
559
560 2012-09-22 Eli Zaretskii <eliz@gnu.org>
561
562 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
563 the new overlay string. (Bug#10159)
564
565 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
566
567 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
568 or that fprintf is async-signal-safe. POSIX doesn't require
569 either assumption.
570
571 2012-09-22 Chong Yidong <cyd@gnu.org>
572
573 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
574 (Bug#8207).
575
576 2012-09-22 Kenichi Handa <handa@gnu.org>
577
578 * composite.c (composition_reseat_it): Handle the case that a
579 grapheme cluster is not covered by a single font (Bug#12352).
580
581 2012-09-21 Chong Yidong <cyd@gnu.org>
582
583 * image.c (define_image_type): Avoid adding duplicate types to
584 image_types (Bug#12463). Suggested by Jörg Walter.
585
586 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
587
588 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
589 (print_load_command_name): Add case LC_DATA_IN_CODE.
590 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
591
592 2012-09-21 Glenn Morris <rgm@gnu.org>
593
594 * eval.c (Frun_hook_with_args_until_success)
595 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
596
597 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
598
599 * fileio.c (Ffile_selinux_context): Only call freecon when
600 lgetfilecon succeeded.
601 (Fset_file_selinux_context): Likewise. (Bug#12444)
602
603 2012-09-21 Eli Zaretskii <eliz@gnu.org>
604
605 * xdisp.c (try_window_reusing_current_matrix): Under bidi
606 reordering, locate the cursor by calling set_cursor_from_row; if
607 that fails, clear the desired glyph matrix before returning a
608 failure indication to the caller. Fixes leaving garbled display
609 when fast scrolling with a down-key. (Bug#12403)
610 (compute_stop_pos_backwards): Fix a typo that caused crashes while
611 scrolling through multibyte text.
612
613 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
614
615 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
616 calling mark_vectorlike since that's the one that marks the window.
617 (mark_discard_killed_buffers): Mark the final cdr.
618 * window.h (struct window): Move prev/next_buffers to the
619 non-standard fields.
620 * window.c (make_window): Initialize prev/next_buffers manually.
621
622 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
623
624 Omit unused arg EXPECTED from socket hooks.
625 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
626 * nsterm.m (ns_term_init):
627 * termhooks.h (struct terminal.read_socket_hook):
628 * w32inevt.c (w32_console_read_socket):
629 * w32term.c (w32_read_socket):
630 * xterm.c (XTread_socket):
631 Omit unused arg EXPECTED. All callers changed.
632 (store_user_signal_events): Return void, not int, since callers no
633 longer care about the return value. All uses changed.
634
635 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
636
637 * w32gui.h (XParseGeometry): Do not declare.
638
639 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
640
641 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
642 Ignore 'expected'. See Eli Zaretskii in
643 <http://bugs.gnu.org/12471#8> (last line).
644
645 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
646 (XParseGeometry): Now static. Substitute extremal values for
647 values that are out of range.
648
649 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
650
651 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
652
653 * nsfns.m (XParseGeometry): Remove.
654 (Fx_create_frame): Call x_set_offset to correctly interpret
655 top_pos in geometry.
656
657 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
658 (Fx_parse_geometry): If there is a space in string, call
659 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
660
661 2012-09-17 Eli Zaretskii <eliz@gnu.org>
662
663 * search.c (scan_buffer): Use character positions in calls to
664 region_cache_forward and region_cache_backward, not byte
665 positions. (Bug#12196)
666
667 * w32term.c (w32_read_socket): Set pending_signals to 1, like
668 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
669
670 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
671 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
672 emacs_blocked_malloc, now deleted.
673
674 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
675
676 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
677 The workaround was for improving performance on Solaris 2.4, but
678 is getting in the way now. Emacs will still work if someone is
679 still running Solaris 2.4 in a museum somewhere; Sun dropped
680 support for Solaris 2.4 in 2003.
681 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
682 * process.c (create_process) [HAVE_WORKING_VFORK]:
683 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
684 since Emacs no longer uses vfork on that platform.
685
686 2012-09-17 Glenn Morris <rgm@gnu.org>
687
688 * emacs.c: Use COPYRIGHT.
689
690 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
691
692 Remove configure's --without-sync-input option (Bug#12450).
693 When auditing signal-handling in preparation for cleaning it up,
694 I found that SYNC_INPUT has race conditions and would be a real
695 pain to fix. Since it's an undocumented and deprecated
696 configure-time option, now seems like a good time to remove it.
697 Also see <http://bugs.gnu.org/11080#16>.
698 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
699 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
700 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
701 (malloc_hysteresis):
702 (check_depth) [XMALLOC_OVERRUN_CHECK]:
703 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
704 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
705 (dont_register_blocks, bytes_used_when_reconsidered)
706 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
707 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
708 [!SYSTEM_MALLOC && !SYNC_INPUT]:
709 Remove. All uses removed.
710 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
711 implementation, one that depends on whether the new macro
712 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
713 is defined.
714 * atimer.c (run_timers, handle_alarm_signal):
715 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
716 (handle_async_input, process_pending_signals)
717 (handle_input_available_signal, init_keyboard):
718 * nsterm.m (ns_read_socket):
719 * process.c (wait_reading_process_output):
720 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
721 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
722 (emacs_write):
723 * xterm.c (XTread_socket):
724 Assume SYNC_INPUT.
725 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
726 * eval.c (handling_signal): Remove. All uses removed.
727 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
728 All uses replaced with the SYNC_INPUT version.
729 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
730 Remove decls.
731 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
732 Now static.
733
734 * font.c (Ffont_shape_gstring): Remove unused local.
735
736 2012-09-16 Glenn Morris <rgm@gnu.org>
737
738 * Makefile.in (clean): No longer run nextstep's clean.
739
740 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
741 (ns_frag): Remove.
742 (ns-app): Move here from ns.mk, and simplify.
743 (clean): Simplify nextstep entry.
744 * ns.mk: Remove file.
745
746 2012-09-17 Kenichi Handa <handa@gnu.org>
747
748 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
749 not covert the last few charactes.
750
751 2012-09-16 Kenichi Handa <handa@gnu.org>
752
753 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
754 here, but just check the validity of glyphs in the glyph-string.
755
756 2012-09-16 Martin Rudalics <rudalics@gmx.at>
757
758 * window.c (Fwindow_parameter, Fset_window_parameter):
759 Accept any window as argument (Bug#12452).
760
761 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
762
763 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
764 to ns_term_init to avoid memory leak.
765
766 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
767 explicit retain/release.
768 (ns_term_init): Only allow one display. Initialize outerpool and
769 ns_*_types.
770
771 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
772
773 Port _setjmp fix to POSIXish hosts as well as Microsoft.
774 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
775 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
776 the Microsoft problem in a different way, by altering ../nt/config.nt.
777
778 2012-09-15 Eli Zaretskii <eliz@gnu.org>
779
780 * w32xfns.c:
781 * w32uniscribe.c:
782 * w32term.c:
783 * w32select.c:
784 * w32reg.c:
785 * w32proc.c:
786 * w32menu.c:
787 * w32inevt.c:
788 * w32heap.c:
789 * w32font.c:
790 * w32fns.c:
791 * w32console.c:
792 * w32.c:
793 * w16select.c: Remove inclusion of setjmp.h, as it is now included
794 by lisp.h. This completes removal of setjmp.h inclusion
795 erroneously announced in the previous commit. (Bug#12446)
796
797 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
798 more accurate.
799
800 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
801 not defined as a macro. The latter happens on MS-Windows.
802 (Bug#12446)
803
804 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
805
806 Port better to POSIX hosts lacking _setjmp (Bug#12446).
807 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
808 Some instances of '#include <setjmp.h>' removed, if the
809 only reason for the instance was because "lisp.h" was included.
810 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
811 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
812 and _longjmp with the new symbols. Emacs already uses _setjmp if
813 available, so this change affects only POSIXish hosts that have
814 sigsetjmp but not _setjmp, such as some versions of Solaris and
815 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
816 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
817 (png_load_body) [HAVE_PNG]:
818 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
819 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
820 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
821 since PNG requires jmp_buf. This is the only exception to the
822 general rule that we now use sys_setjmp and sys_longjmp.
823 This exception is OK since this code does not change the signal
824 mask or longjmp out of a signal handler.
825
826 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
827
828 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
829 Include "syssignal.h", for 'main_thread'.
830
831 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
832
833 Avoid out-of-range marker position (Bug#12426).
834 * insdel.c (replace_range, replace_range_2):
835 Adjust markers before overlays, as suggested by comments.
836 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
837 Remove redundant check before calling offset_intervals.
838
839 2012-09-14 Martin Rudalics <rudalics@gmx.at>
840
841 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
842 current buffer (Bug#12387).
843
844 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
845
846 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
847
848 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
849
850 Use a more backwards-compatible timer format (Bug#12430).
851 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
852 vector element, not from the 4th, since PSECS is now at the end.
853 (Fcurrent_idle_time): Doc fix.
854
855 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
856
857 Function to mark objects and remove killed buffers at once.
858 * alloc.c (discard_killed_buffers): Rename to ...
859 (mark_discard_killed buffers) ... new name. Add marking
860 of remaining objects. Fix comment. Adjust users.
861 (mark_object): Do not touch frame buffer lists here.
862 * frame.c (delete_frame): Reset frame buffer lists here.
863
864 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
865
866 Better workaround for GNOME bug when --enable-gcc-warnings.
867 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
868 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
869 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
870
871 Simplify SIGIO usage (Bug#12408).
872 The code that dealt with SIGIO was crufty and confusing, e.g., it
873 played tricks like "#undef SIGIO" but these tricks were not used
874 consistently. Simplify mostly by not #undeffing standard symbols,
875 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
876 or not as we please) rather than "defined SIGIO" (standard symbol
877 that we probably shouldn't #undef).
878 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
879 Modules that need it can include it.
880 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
881 * dispextern.h (ignore_sigio): New decl.
882 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
883 unconditionally, since it's now a no-op if !USABLE_SIGIO.
884 * emacs.c (shut_down_emacs):
885 * keyboard.c (kbd_buffer_store_event_hold):
886 Use ignore_sigio rather than invoking 'signal' directly.
887 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
888 for FIONREAD.
889 (FIONREAD, SIGIO): Do not #undef.
890 (tty_read_avail_input): Use #error rather than a syntax error.
891 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
892 for I_PIPE, used by SETUP_SLAVE_PTY.
893 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
894 * sysdep.c (croak): Remove; no longer needed. This bit of
895 temporary code, with Fred N. Fish's comment that it's temporary,
896 has been in Emacs since at least 1992!
897 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
898 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
899 * syssignal.h (croak): Remove decl.
900 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
901 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
902 now that we're termios-only.
903 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
904 * term.c (dissociate_if_controlling_tty): Use #error rather than
905 a run-time error.
906
907 Work around GCC and GNOME bugs when --enable-gcc-warnings.
908 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
909 to work around GNOME bug 683906.
910 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
911 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
912 This works around GCC bug 54561.
913
914 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
915
916 More fixes for 'volatile' and setjmp/longjmp.
917 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
918 * image.c (struct png_load_context) [HAVE_PNG]: New type.
919 (png_load_body) [HAVE_PNG]:
920 (jpeg_load_body) [HAVE_JPEG]:
921 New function, with most of the old parent function's body.
922 (png_load) [HAVE_PNG]:
923 (jpeg_load) [HAVE_JPEG]:
924 Invoke the new function, to avoid longjmp munging our locals.
925 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
926 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
927 longjmp is passed 2, as the C standard doesn't guarantee this.
928 Instead, store the failure code into mgr->failure_code.
929
930 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
931
932 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
933 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
934 (syms_of_keyboard): Remove support for unread-command-char.
935
936 2012-09-12 Eli Zaretskii <eliz@gnu.org>
937
938 * w32proc.c (sys_kill): If PID is our process ID and the signal is
939 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
940 violation. (Bug#12426)
941
942 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
943
944 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
945
946 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
947
948 * eval.c: Add `inhibit-debugger'.
949 (Qinhibit_debugger): New symbol.
950 (call_debugger): Bind it instead of Qdebug_on_error.
951 (maybe_call_debugger): Test Vinhibit_debugger.
952 (syms_of_eval): Define inhibit-debugger.
953 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
954 (syms_of_xdisp): Remove inhibit-debug-on-message.
955
956 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
957
958 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
959 If a nonvolatile local variable is written before a _longjmp to
960 the frame containing the variable, and is read after the _longjmp,
961 the value read is indeterminate. Some local variables of type
962 'struct handler' and 'struct catchtag' are used in this way, so
963 mark each of their slots as volatile if the slot can be set before
964 _longjmp and read afterwards.
965 * lisp.h (struct handler): var and chosen_clause are now volatile.
966 (struct catchtag): val, next, and pdlcount are now volatile.
967
968 * bidi.c (bidi_push_it, bidi_pop_it):
969 * fns.c (copy_hash_table):
970 * image.c (define_image_type):
971 * keyboard.c (kbd_buffer_store_event_hold):
972 * process.c (Fprocess_send_eof):
973 * xfaces.c (x_create_gc) [HAVE_NS]:
974 * xgselect.c (xg_select):
975 Prefer assignment to memcpy when either will do.
976
977 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
978 Use pointer-to-a-pointer to simplify and avoid a NILP check each
979 time an item is removed. No need to mark this function 'inline';
980 the compiler knows better than we do.
981
982 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
983
984 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
985 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
986 to change_frame_size (Bug#12388).
987 (windowDidResize:): Pass YES to updateFrameSize.
988
989 * nsterm.h: Add delay parameter to updateFrameSize.
990
991 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
992
993 Discard killed buffers from deleted window and frame objects.
994 This reduces an amount of references to killed buffers and
995 helps GC to reclaim them faster.
996 * alloc.c (discard_killed_buffers): New function.
997 (mark_object): Use it for deleted windows and frames.
998 (mark_object): If symbol's value is set up for a killed buffer
999 or deleted frame, restore it's global binding.
1000 * data.c (swap_in_global_binding): Add GC notice.
1001 (swap_in_symval_forwarding): Use convenient set_blv_where.
1002 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1003 * window.h: ... to here.
1004
1005 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1006
1007 Convenient macro to check whether the buffer is live.
1008 * buffer.h (BUFFER_LIVE_P): New macro.
1009 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1010 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1011
1012 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1013
1014 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1015 composition cases (Bug#12364).
1016
1017 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1018 overhang of succeeding glyphs overlapping box cursor.
1019
1020 * w32term.c (x_draw_glyph_string): Likewise.
1021
1022 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1023
1024 Simplify, document, and port floating-point (Bug#12381).
1025 The porting part of this patch fixes bugs on non-IEEE platforms
1026 with frexp, ldexp, logb.
1027 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1028 Now static.
1029 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1030 support, by removing commented-out code and briefly listing the
1031 C89 functions excluded. The commented-out stuff was confusing
1032 maintenance, e.g., we thought we needed cbrt but it was commented out.
1033 (logb): Remove decl; no longer needed.
1034 (isfinite): New macro, if not already supplied.
1035 (isnan): Don't replace any existing macro.
1036 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1037 are present on all C89 platforms.
1038 (Ffrexp): Do not special-case zero, as frexp does the right thing
1039 for that case.
1040 (Flogb): Do not use logb, as it doesn't have the desired meaning
1041 on hosts that use non-base-2 floating point. Instead, stick with
1042 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1043 frexp, to avoid getting an unspecified result.
1044
1045 * xdisp.c (Qinhibit_debug_on_message): Now static.
1046
1047 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1048
1049 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1050 NSBezierPath (Bug#12131).
1051
1052 2012-09-10 Chong Yidong <cyd@gnu.org>
1053
1054 * fns.c (Fdelq, Fdelete): Doc fix.
1055
1056 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1057
1058 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1059 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1060
1061 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1062
1063 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1064 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1065 Use it.
1066
1067 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1068
1069 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1070 left fringe if the window has a left margin. This avoids leaving
1071 traces of the cursor because its leftmost pixel is not drawn over.
1072
1073 * dispnew.c (update_window_line): When the left margin area of a
1074 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1075 that screen line. (Bug#12277)
1076
1077 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1078
1079 Assume C89 or later for math functions (Bug#12381).
1080 This simplifies the code, and makes it a bit smaller and faster,
1081 and (most important) makes it easier to clean up signal handling
1082 since we can stop worring about floating-point exceptions in
1083 library code. That was a problem before C89, but the problem
1084 went away many years ago on all practical Emacs targets.
1085 * data.c, image.c, lread.c, print.c:
1086 Don't include <math.h>; no longer needed.
1087 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1088 might be autoconfigured, as that never happens.
1089 * data.c (fmod):
1090 * doprnt.c (DBL_MAX_10_EXP):
1091 * print.c (DBL_DIG):
1092 Remove. C89 or later always defines these.
1093 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1094 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1095 (arith_error, domain_error, domain_error2):
1096 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1097 no longer needed -- we simply return what C returns. All uses removed.
1098 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1099 the wrapped code.
1100 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1101 Remove. All uses expanded, as these macros are no longer used
1102 more than once and are now more trouble than they're worth.
1103 (Ftan): Use tan, not sin / cos.
1104 (Flogb): Assume C89 frexp.
1105 (fmod_float): Assume C89 fmod.
1106 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1107 (init_floatfns): Remove. All uses removed.
1108
1109 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1110
1111 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1112 compositeToPoint for OSX < 10.6 (Bug#12390).
1113
1114 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1115
1116 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1117 This produces more-accurate results.
1118
1119 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1120
1121 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1122 changes (Bug#12088).
1123
1124 2012-09-08 Chong Yidong <cyd@gnu.org>
1125
1126 * syntax.c (Fstring_to_syntax): Doc fix.
1127
1128 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1129
1130 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1131 in the internal border.
1132 (x_set_window_size): Remove static variables and their usage.
1133 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1134 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1135 Remove fringe/internal border adjustment (Bug#11052).
1136 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1137 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1138 (ns_fix_rect_ibw): Remove.
1139 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1140 (ns_dumpglyphs_box_or_relief): Ditto.
1141 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1142 adjustment.
1143 (ns_dumpglyphs_image): Ditto.
1144 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1145 border adjustment.
1146 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1147 their usage. Add fringe_extended_p and its use as in other terms.
1148 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1149 scroll bar was removed.
1150 (updateFrameSize): New function.
1151 (windowDidResize): Move code to updateFrameSize and call it.
1152
1153 * nsterm.h (EmacsView): Add updateFrameSize.
1154
1155 2012-09-07 Chong Yidong <cyd@gnu.org>
1156
1157 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1158
1159 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1160
1161 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1162
1163 More signal-handler cleanup (Bug#12327).
1164 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1165 Problem introduced when merging patches. Noted by Eli Zaretskii in
1166 <http://bugs.gnu.org/12327#67>.
1167 * floatfns.c: Comment fix.
1168 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1169 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1170 and anyway the declaration is harmless even if SIGDANGER is not defined.
1171 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1172 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1173 source files not surprisingly expected syssignal.h to define, or
1174 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1175 Include <sys/ioctl.h>, for FIONREAD.
1176 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1177 This eliminates a problem whereby other files mysteriously had
1178 to include "syssignal.h" before including "systty.h" if they
1179 wanted to use "#ifdef SIGIO".
1180
1181 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1182
1183 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1184
1185 * w32.c (sigemptyset): Empty the set.
1186 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1187
1188 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1189
1190 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1191
1192 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1193 (mark_object): Likewise for frame objects.
1194
1195 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1196
1197 * syssignal.h (handle_on_main_thread): Always declare,
1198 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1199 This ports to platforms without HAVE_PTHREAD.
1200
1201 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1202
1203 Signal-handler cleanup (Bug#12327).
1204 Emacs's signal handlers were written in the old 4.2BSD style with
1205 sigblock and sigmask and so forth, and this led to some
1206 inefficiencies and confusion. Rewrite these to use
1207 pthread_sigmask etc. without copying signal sets around. Also,
1208 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1209 'signal', and instead use functions that do not attempt to take
1210 over the system name space. This patch causes Emacs's text
1211 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1212 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1213 Do not include <signal.h> or "syssignal.h", as these
1214 modules do not use signals.
1215 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1216 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1217 Do not include <signal.h>, as "syssignal.h" does that for us now.
1218 * atimer.c (sigmask_atimers): New function.
1219 (block_atimers, unblock_atimers): New functions,
1220 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1221 All uses replaced.
1222 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1223 no longer needed here.
1224 * emacs.c (main): Inspect existing signal handler with sigaction,
1225 so that there's no need to block and unblock SIGHUP.
1226 * sysdep.c (struct save_signal): New member 'action', replacing
1227 old member 'handler'.
1228 (save_signal_handlers, restore_signal_handlers):
1229 Use sigaction instead of 'signal' to save and restore.
1230 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1231 New function. All users of 'signal' modified to use set_sighandler
1232 if they're writeonly, and to use sys_signal if they're read+write.
1233 (emacs_sigaction_init, forwarded_signal): New functions.
1234 (sys_signal): Remove. All uses replaced by calls to sigaction
1235 and emacs_sigaction_init, or by direct calls to 'signal'.
1236 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1237 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1238 all uses replaced by pthread_sigmask etc. calls.
1239 * syssignal.h: Include <signal.h>.
1240 (emacs_sigaction_init, forwarded_signal): New decls.
1241 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1242 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1243 (sigmask, sys_sigmask): Remove; no longer needed.
1244 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1245 (sigblock, sigunblock, sigfree):
1246 (sigsetmask) [!defined sigsetmask]:
1247 Remove. All uses replaced by pthread_sigmask.
1248 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1249 no longer need to be replaced, and its typical old uses
1250 are now done via emacs_sigaction_init and sigaction.
1251 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1252 (sys_sigdel): Remove; unused.
1253 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1254
1255 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1256
1257 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1258 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1259
1260 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1261
1262 Explicitly mark buffer_defaults and buffer_local_symbols.
1263 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1264 mark_local_symbols here.
1265 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1266 since special buffers aren't marked here any more.
1267 (allocate_buffer): Chain new buffer with all_buffers here...
1268 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1269 not here.
1270 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1271 (syms_of_buffer): Remove staticpro of the above.
1272 (init_buffer_once): Set names for buffer_defaults and
1273 buffer_local_symbols.
1274
1275 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1276
1277 Use bool for booleans in font-related modules.
1278 * font.c (font_intern_prop, font_style_to_value)
1279 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1280 (generate_otf_features, font_check_otf_features, font_check_otf)
1281 (font_match_p, font_list_entities, font_at):
1282 * fontset.c (fontset_id_valid_p, reorder_font_vector
1283 (fontset_find_font, Fset_fontset_font)
1284 (face_suitable_for_char_p) [0]:
1285 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1286 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1287 (m17n_flt_initialized, ftfont_shape_by_flt):
1288 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1289 * nsfont.m (nsfont_draw):
1290 * w32font.c (w32font_draw):
1291 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1292 Use bool for booleans.
1293 * font.h: Adjust to above API changes.
1294 (struct font, struct font_driver, struct font_driver_list):
1295 Use bool for booleans.
1296 (struct font): Remove useless member encoding_type.
1297 All users removed.
1298 * fontset.c, xftfont.c: Omit unnecessary static decls.
1299
1300 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1301
1302 * alloc.c (mark_object): Revert window marking code
1303 since it's unsafe for the Fset_window_configuration.
1304
1305 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1306
1307 Fix race conditions with signal handlers and errno (Bug#12327).
1308 Be more systematic about preserving errno whenever a signal
1309 handler returns, even if it's not in the main thread. Do this by
1310 renaming signal handlers to distinguish between signal delivery
1311 and signal handling. All uses changed.
1312 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1313 * data.c (deliver_arith_signal): Rename from arith_error.
1314 * dispnew.c (deliver_window_change_signal): Rename from
1315 window_change_signal.
1316 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1317 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1318 * keyboard.c (deliver_input_available_signal): Rename from
1319 input_available_signal.
1320 (deliver_user_signal): Rename from handle_user_signal.
1321 (deliver_interrupt_signal): Rename from interrupt_signal.
1322 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1323 (deliver_child_signal): Rename from sigchld_handler.
1324 * atimer.c (handle_alarm_signal):
1325 * data.c (handle_arith_signal):
1326 * dispnew.c (handle_window_change_signal):
1327 * emacs.c (handle_fatal_signal, handle_danger_signal):
1328 * keyboard.c (handle_input_available_signal):
1329 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1330 * process.c (handle_pipe_signal, handle_child_signal):
1331 New functions, with the actual signal-handling code taken from the
1332 original respective signal handlers, sans the sporadic attempts to
1333 preserve errno, since that's now done by handle_on_main_thread.
1334 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1335 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1336 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1337 Move to sysdep.c.
1338 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1339 Move initialization of main_thread to sysdep.c's init_signals.
1340 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1341 our usage, and simplifies the mainline code.
1342 (record_child_status_change): New static function, as a helper
1343 for handle_child_signal, and with most of the old child handler's
1344 contents.
1345 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1346 (handle_child_signal): Use the above.
1347 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1348 Moved here from emacs.c.
1349 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1350 code moved here from emacs.c's main function.
1351 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1352 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1353 This lets callers save and restore errno properly.
1354
1355 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1356
1357 Remove redundant or unused things here and there.
1358 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1359 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1360 * editfns.c (Fcompare_buffer_substrings): Likewise.
1361 * frame.h (struct terminal, struct font_driver_list):
1362 Remove redundant declarations.
1363 * window.h (Qleft, Qright): Likewise.
1364
1365 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1366
1367 Do not mark objects from deleted buffers, windows and frames.
1368 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1369 (mark_object): Likewise for windows and frames.
1370
1371 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1372
1373 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1374 buffer_defaults and buffer_local_symbols as valid objects.
1375 Return special value to denote them.
1376
1377 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1378
1379 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1380 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1381 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1382 (file_name_absolute_p, Fsubstitute_in_file_name):
1383 (check_executable, check_writable, Ffile_accessible_directory_p)
1384 (Fset_file_selinux_context, Fdefault_file_modes)
1385 (Finsert_file_contents, choose_write_coding_system)
1386 (Fwrite_region, build_annotations, a_write, e_write)
1387 (Fdo_auto_save):
1388 * filelock.c (boot_time_initialized, get_boot_time)
1389 (get_boot_time_1, lock_file_1, within_one_second):
1390 * floatfns.c (in_float):
1391 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1392 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1393 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1394 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1395 * window.c (compare_window_configurations):
1396 Use bool for booleans.
1397 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1398 (Fdefault_file_modes): Now mode_t, not int, for modes.
1399 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1400 (internal_delete_file): Now returns void, not a (boolean) int,
1401 since nobody was looking at the return value.
1402 * lisp.h, window.h: Adjust to above API changes.
1403
1404 * xdisp.c (set_message): Simplify and reindent last change.
1405
1406 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1407
1408 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1409
1410 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1411
1412 * eval.c (call_debugger): Make the function non-static so that we
1413 can call it from set_message.
1414
1415 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1416 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1417
1418 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1419
1420 Give more-useful info on a fatal error (Bug#12328).
1421 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1422 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1423 of doing the work ourselves.
1424 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1425 do most of the work.
1426 (fatal_error_backtrace): New function, taken from the guts
1427 of the old fatal_error_signal, but with a new option to output
1428 a backtrace.
1429 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1430 info about the signal than just its number.
1431 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1432 * sysdep.c: Include <execinfo.h>
1433 (emacs_backtrace): New function, taken partly from the previous
1434 code of the 'die' function.
1435 (emacs_abort): Call fatal_error_backtrace rather than abort.
1436
1437 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1438
1439 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1440 eager (load-time) macro-expansion.
1441 * lisp.mk (lisp): Add macroexp.
1442
1443 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1444
1445 Simplify redefinition of 'abort' (Bug#12316).
1446 Do not try to redefine the 'abort' function. Instead, redo
1447 the code so that it calls 'emacs_abort' rather than 'abort'.
1448 This removes the need for the NO_ABORT configure-time macro
1449 and makes it easier to change the abort code to do a backtrace.
1450 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1451 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1452 Remove; sysdep.c's emacs_abort now takes its place.
1453 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1454 'abort' changed to use 'emacs_abort'.
1455 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1456 (abort) [!defined abort]: Rename to ...
1457 (emacs_abort): ... new name.
1458 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1459 the place of the old 'abort' in emacs.c.
1460 * w32.c, w32fns.c (abort): Do not #undef.
1461 * w32.c (emacs_abort): Rename from w32_abort.
1462
1463 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1464
1465 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1466 offsets[j].dv, since the y axis of the screen coordinates points
1467 down, while the y axis of the font definition coordinates points
1468 up. This fixes display of Arabic diacritics such as KASRA and
1469 KASRATAN. (Bug#11860)
1470
1471 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1472
1473 Be more systematic about _setjmp vs setjmp.
1474 * alloc.c (test_setjmp, mark_stack):
1475 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1476 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1477 (png_load, my_error_exit, jpeg_load):
1478 * process.c (send_process_trap, send_process):
1479 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1480 The underscored versions are up to 30x faster on some hosts.
1481 Formerly, the code used setjmp+longjmp sometimes and
1482 _setjmp+_longjmp at other times, with no particular reason to
1483 prefer setjmp+longjmp.
1484
1485 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1486
1487 Fix minor problem found by static checking.
1488 * buffer.c (Fdelete_all_overlays): Return nil.
1489
1490 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1491
1492 * buffer.c (Fdelete_all_overlays): New function.
1493
1494 2012-09-03 Chong Yidong <cyd@gnu.org>
1495
1496 * gtkutil.c: Add extern decl for Qxft.
1497
1498 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1499
1500 * emacs.c, eval.c: Use bool for boolean.
1501 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1502 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1503 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1504 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1505 (main, decode_env_path, Fdaemon_initialized):
1506 * eval.c (call_debugger, Finteractive_p, interactive_p):
1507 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1508 (maybe_call_debugger, Fbacktrace):
1509 * process.c (read_process_output, exec_sentinel):
1510 Use bool for booleans.
1511 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1512 All callers changed.
1513 * eval.c (interactive_p): Omit always-true boolean argument
1514 EXCLUDE_SUBRS_P. All callers changed.
1515 * dispextern.h, lisp.h: Reflect above API changes.
1516 * firstfile.c (dummy): Use the address of 'main', whose signature
1517 won't change, instead of the address of 'initialize', whose
1518 signature just changed from int to bool.
1519 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1520 * msdos.c (fatal_error_in_progress): ... from here.
1521 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1522 of incrementing it.
1523 (redisplay_internal, unwind_redisplay): Simply clear
1524 REDISPLAYING_P when unwinding, instead of saving its previous,
1525 always-false value and then restoring it.
1526
1527 Clean up some extern decls.
1528 Mostly, this hoists extern decls out of .c files and into .h files.
1529 That way, we're more likely to catch errors if the interfaces change.
1530 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1531 declare xg_mark_data.
1532 * dispextern.h (x_frame_parm_handlers):
1533 * font.h (Qxft):
1534 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1535 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1536 (Qultra_bold, Qoblique, Qitalic):
1537 Move extern decl here from .c file.
1538 * alloc.c (xg_mark_data) [USE_GTK]:
1539 * doc.c (Qclosure):
1540 * eval.c (Qlexical_binding):
1541 * fns.c (time) [!HAVE_UNISTD_H]:
1542 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1543 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1544 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1545 * lread.c (Qinternal_interpreter_environment):
1546 * minibuf.c (Qbuffer):
1547 * process.c (QCfamily, QCfilter):
1548 * widget.c (free_frame_faces):
1549 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1550 * xfont.c (x_clear_errors):
1551 * xterm.c (x_frame_parm_handlers):
1552 Remove now-redundant extern decls.
1553 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1554 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1555 Now static.
1556 * xfaces.c: Remove unnecessary static decls.
1557 * xterm.c (updating_frame): Remove decl of nonexistent object.
1558
1559 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1560 when building globals.h, as the objects that are not built on
1561 this host are not needed to compile C files on this host.
1562
1563 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1564
1565 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1566
1567 * frame.h: Add missing prototype for x_wm_set_size_hint.
1568
1569 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1570
1571 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1572 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1573 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1574 (Fsubstitute_command_keys):
1575 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1576 (save_excursion_save, save_excursion_restore)
1577 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1578 (format_time_string, general_insert_function)
1579 (make_buffer_string, make_buffer_string_both)
1580 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1581 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1582 (copy_text, insert_1, insert_1_both, insert_from_string)
1583 (insert_from_string_before_markers, insert_from_string_1)
1584 (insert_from_buffer, insert_from_buffer_1, replace_range)
1585 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1586 (del_range_2, modify_region):
1587 * intervals.c (intervals_equal, balance_possible_root_interval)
1588 (adjust_intervals_for_insertion, merge_properties_sticky)
1589 (graft_intervals_into_buffer, lookup_char_property)
1590 (adjust_for_invis_intang, set_point_both)
1591 (get_property_and_range, compare_string_intervals)
1592 (set_intervals_multibyte_1, set_intervals_multibyte):
1593 * keyboard.c (decode_timer):
1594 Use bool for boolean.
1595 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1596 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1597
1598 2012-09-02 Chong Yidong <cyd@gnu.org>
1599
1600 * keymap.c (push_key_description): Print M-TAB as C-M-i
1601 (Bug#11758).
1602
1603 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1604
1605 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1606 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1607 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1608 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1609 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1610 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1611 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1612
1613 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1614
1615 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1616 more than one grapheme cluster passed to the shaper: compute the
1617 offset adjustment values separately for each cluster. (Bug#11860)
1618
1619 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1620 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1621 about implicit conversions from integer to pointer.
1622
1623 2012-09-01 Daniel Colascione <dancol@dancol.org>
1624
1625 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1626 system used too early.
1627
1628 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1629
1630 Better seed support for (random).
1631 * emacs.c (main): Call init_random.
1632 * fns.c (Frandom): Set the seed from a string argument, if given.
1633 Remove long-obsolete Gentzel cruft.
1634 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1635 (init_random): New function.
1636
1637 2012-09-01 Daniel Colascione <dancol@dancol.org>
1638
1639 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1640 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1641 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1642 x_wm_set_size_hint, x_query_colors, x_real_positions,
1643 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1644 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1645 all of which have been moved to common code.
1646
1647 * xfaces.c: Include TERM_HEADER instead of listing all possible
1648 window-system headers.
1649
1650 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1651 to match header.
1652
1653 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1654 directly accessing frame internals.
1655
1656 * w32font.h: Include font.h. Define syms_of_w32font and
1657 globals_of_w32font.
1658
1659 * process.c: Include TERM_HEADER instead of listing all possible
1660 window-system headers.
1661
1662 * nsterm.h: Remove declarations now in frame.h.
1663 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1664
1665 * menu.c: Include TERM_HEADER instead of listing all possible
1666 window-system headers.
1667
1668 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1669 window system.
1670
1671 * keyboard.c: Include TERM_HEADER instead of listing all possible
1672 window-system headers.
1673
1674 * image.c: Include TERM_HEADER instead of listing all possible
1675 window-system headers. Declare Vlibrary_cache when compiling for
1676 Windows.
1677
1678 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1679 window system declarations.
1680
1681 * frame.h: Move common functions here: set_frame_menubar,
1682 x_set_window_size, x_sync, x_get_focus_frame,
1683 x_set_mouse_position, x_set_mouse_pixel_position,
1684 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1685 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1686 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1687 x_activate_menubar, x_real_positions, x_bitmap_icon,
1688 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1689 and x_query_colors.
1690
1691 * frame.c: Include TERM_HEADER instead of listing all possible
1692 window-system headers.
1693
1694 * font.c: Include TERM_HEADER instead of listing all possible
1695 window-system headers.
1696
1697 * emacs.c: Include TERM_HEADER.
1698
1699 * dispnew.c: Include TERM_HEADER instead of listing all possible
1700 window-system headers.
1701
1702 * ccl.h: Include character.h.
1703
1704 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1705 the current window system; include in list of objects to link into
1706 Emacs.
1707
1708 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1709
1710 Remove mark_ttys function and fix tty_display_info initialization.
1711 * lisp.h (mark_ttys): Remove prototype.
1712 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1713 to mark_ttys because all possible values of 'top_frame' slot are
1714 the frames which are reachable from Vframe_list.
1715 * term.c (mark_ttys): Remove.
1716 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1717
1718 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1719
1720 Change struct frame bitfields from unsigned char to unsigned.
1721 * frame.h (struct frame): Change type of 'display_preempted',
1722 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1723 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1724 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1725 bitfields from unsigned char to unsigned.
1726
1727 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1728
1729 Remove unused member of struct x_output and struct w32_output.
1730 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1731 * w32term.h (struct w32_output): Likewise.
1732
1733 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1734
1735 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1736 does not become zero (Bug#12234).
1737
1738 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1739
1740 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1741 for GCC 4.7.1 x86-64.
1742
1743 2012-08-30 Glenn Morris <rgm@gnu.org>
1744
1745 * lread.c (init_lread): For out-of-tree builds, only add the
1746 source directory's site-lisp dir to the load-path if it exists,
1747 consistent with in-tree builds. (Bug#12302)
1748
1749 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1750
1751 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1752 button_values to NULL. Call setStykeMask so dialogs get a close button.
1753 (windowShouldClose:): Set window_closed.
1754 (dealloc): New member, free button_values.
1755 (process_dialog:): Make member function. Remove window argument,
1756 replace window with self. Count buttons and allocate and store values
1757 in button_values.
1758 (addButton:value:row:): value is int with the name tag. Call setTag
1759 with tag. Remove return self, declare return value as void.
1760 (addString:row:): Remove return self, declare return value as void.
1761 (addSplit): Remove return self, declare return value as void.
1762 (clicked:): Remove return self, declare return value as void.
1763 Set dialog_return to button_values[seltag]. Code formatting change.
1764 (initFromContents:isQuestion:): Adjust call to process_dialog.
1765 Code formatting change.
1766 (timeout_handler:): Set timer_fired to YES.
1767 (runDialogAt:): Set timer_fired to NO.
1768 Handle click on close button as quit.
1769
1770 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1771 Add window_closed and button_values. Add void as return value for
1772 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1773 Add process_dialog as new member.
1774
1775 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1776
1777 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1778 is not one of the heaps we manage. (Bug#12242)
1779
1780 2012-08-28 Glenn Morris <rgm@gnu.org>
1781
1782 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1783
1784 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1785
1786 * window.c (Fset_window_configuration): Remove handling of
1787 auto-buffer-name window parameter. Install revision of reverted
1788 fix.
1789
1790 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1791
1792 Do not allow to set major mode for a dead buffer.
1793 * buffer.c (Fset_buffer_major_mode): Signal an error
1794 if the buffer is dead.
1795 (Fother_buffer, other_buffer_safely): Remove redundant
1796 nested declaration.
1797
1798 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1799
1800 Always use set_buffer_if_live to restore original buffer at unwind.
1801 * buffer.h (record_unwind_current_buffer): New function.
1802 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1803 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1804 * undo.c, window.c: Adjust users.
1805 * buffer.c (set_buffer_if_live): Fix comment.
1806
1807 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1808
1809 Fix usage of set_buffer_internal.
1810 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1811 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1812 * coding.c (decode_coding): Omit redundant test.
1813 * fileio.c (decide_coding_unwind): Likewise.
1814 * fns.c (secure_hash): Likewise.
1815 * insdel.c (modify_region): Likewise.
1816 * keyboard.c (command_loop_1): Likewise.
1817 * print.c (PRINTFINISH): Likewise.
1818 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1819
1820 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1821
1822 * dispnew.c: Use bool for boolean.
1823 (frame_garbaged, display_completed, delayed_size_change)
1824 (fonts_changed_p, add_window_display_history)
1825 (add_frame_display_history, verify_row_hash)
1826 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1827 (row_equal_p, realloc_glyph_pool)
1828 (allocate_matrices_for_frame_redisplay)
1829 (showing_window_margins_p)
1830 (adjust_frame_glyphs_for_frame_redisplay)
1831 (build_frame_matrix_from_leaf_window, make_current)
1832 (mirrored_line_dance, mirror_line_dance, update_frame)
1833 (update_window_tree, update_single_window)
1834 (check_current_matrix_flags, update_window, update_text_area)
1835 (update_window_line, set_window_update_flags, scrolling_window)
1836 (update_frame_1, scrolling, buffer_posn_from_coords)
1837 (do_pending_window_change, change_frame_size)
1838 (change_frame_size_1, sit_for):
1839 Use bool for boolean.
1840 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1841 and remove last int (actually boolean) argument, which was always 0.
1842 All callers changed.
1843 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1844 * dispextern.h (struct composition_it): Use bool for boolean.
1845 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1846 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1847 * dired.c (file_name_completion):
1848 Use bool for boolean. (This was missed in an earlier change.)
1849
1850 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1851
1852 * window.c (Fset_window_configuration): Revert first part of
1853 last change.
1854
1855 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1856
1857 * nsterm.h (NSPanel): New class variable dialog_return.
1858
1859 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1860 Initialize dialog_return.
1861 (windowShouldClose:): Use stop instead of stopModalWithCode.
1862 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1863 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1864 event.
1865 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1866 modal loop returns.
1867
1868 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1869
1870 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1871 * composite.c (find_composition, composition_gstring_p)
1872 (composition_reseat_it, find_automatic_composition):
1873 * data.c (let_shadows_buffer_binding_p)
1874 (let_shadows_global_binding_p, set_internal, make_blv)
1875 (Fmake_variable_buffer_local, Fmake_local_variable)
1876 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1877 (cons_to_signed, arith_driver):
1878 * dbusbind.c (xd_in_read_queued_messages):
1879 * dired.c (directory_files_internal, file_name_completion):
1880 Use bool for booleans.
1881 * dired.c (file_name_completion):
1882 * process.h (fd_callback):
1883 Omit int (actually boolean) argument. It wasn't being used.
1884 All uses changed.
1885 * composite.h, lisp.h: Reflect above API changes.
1886
1887 * cmds.c, coding.c: Use bool for booleans.
1888 * cmds.c (move_point, Fself_insert_command):
1889 * coding.h (struct composition status, struct coding_system):
1890 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1891 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1892 (emacs_mule_char, decode_coding_emacs_mule)
1893 (encode_coding_emacs_mule, detect_coding_iso_2022)
1894 (decode_coding_iso_2022, encode_invocation_designation)
1895 (encode_designation_at_bol, encode_coding_iso_2022)
1896 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1897 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1898 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1899 (encode_coding_raw_text, detect_coding_charset)
1900 (decode_coding_charset, encode_coding_charset, detect_eol)
1901 (detect_coding, get_translation_table, produce_chars)
1902 (consume_chars, reused_workbuf_in_use)
1903 (make_conversion_work_buffer, code_conversion_save)
1904 (decode_coding_object, encode_coding_object)
1905 (detect_coding_system, char_encodable_p)
1906 (Funencodable_char_position, code_convert_region)
1907 (code_convert_string, code_convert_string_norecord)
1908 (Fset_coding_system_priority):
1909 * fileio.c (Finsert_file_contents):
1910 Use bool for booleans.
1911 * coding.h, lisp.h: Reflect above API changes.
1912 * coding.c: Remove unnecessary static function decls.
1913 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1914 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1915 not a boolean 'int', since callers never look at the return value.
1916 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1917 * coding.h (decoding_buffer_size, encoding_buffer_size)
1918 (emacs_mule_string_char): Remove unused extern decls.
1919 (struct iso_2022_spec, struct coding_system):
1920 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1921 (struct emacs_mule_spec): Remove unused field 'full_support'.
1922 All initializations removed.
1923 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1924
1925 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1926
1927 Fix spare memory change (Bug#12286).
1928 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1929 (valid_lisp_object_p): Likewise.
1930
1931 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1932
1933 * window.c (Fset_window_configuration): Record any window's old
1934 buffer if it's replaced (see Bug#8789). If the new current
1935 buffer doesn't appear in the selected window, go to its old
1936 point (Bug#12208).
1937
1938 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1939
1940 Special MEM_TYPE_SPARE to denote reserved memory.
1941 * alloc.c (enum mem_type): New memory type.
1942 (refill_memory_reserve): Use new type for spare memory.
1943 This prevents live_cons_p and live_string_p from incorrect
1944 detection of uninitialized objects from spare memory as live.
1945
1946 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1947
1948 Spelling fixes.
1949 * Makefile.in (.PHONY): versioclean -> versionclean.
1950
1951 Remove unused external symbols.
1952 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1953 * window.c (Qwindow_valid_p, decode_valid_window):
1954 Now static, not extern.
1955 * data.c (Qinterval): Remove; unused.
1956 (syms_of_data): Do not define 'interval'.
1957 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1958 * window.h (decode_valid_window):
1959 Remove decls.
1960
1961 * character.c, charset.c, chartab.c: Use bool for booleans.
1962 * character.c (lisp_string_width, string_count_byte8)
1963 (string_escape_byte8):
1964 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1965 (load_charset_map_from_file, map_charset_chars)
1966 (Fdefine_charset_internal, define_charset_internal)
1967 (Fdeclare_equiv_charset, find_charsets_in_text)
1968 (Ffind_charset_region, char_charset, Fiso_charset):
1969 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1970 (sub_char_table_set, sub_char_table_set_range)
1971 (char_table_set_range, optimize_sub_char_table)
1972 (map_sub_char_table):
1973 Use bool for boolean.
1974 * character.c (str_to_unibyte): Omit last boolean argument; it was
1975 always 0. All callers changed.
1976 * character.h, charset.h: Adjust to match previous changes.
1977 * character.h (char_printable_p): Remove decl of nonexistent function.
1978 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1979 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1980 are all boolean, so make them single-bit bitfields.
1981
1982 * lisp.h (ASET): Remove attempt to detect side effects.
1983 It was meant to be temporary and it often doesn't work,
1984 because when IDX has side effects the behavior of IDX==IDX
1985 is undefined. See Stefan Monnier in
1986 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1987
1988 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1989
1990 * lisp.h (functionp): New function (extracted from Ffunctionp).
1991 (FUNCTIONP): Use it.
1992 * eval.c (Ffunctionp): Use it.
1993
1994 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1995
1996 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1997 as that's faster and simpler than static storage. Don't bother
1998 with the g_main_context_query overhead if g_main_context_pending
1999 says no events are pending.
2000 (gfds, gfds_size): Remove these static vars.
2001 (xgselect_initialize): Remove; no longer needed.
2002 All uses and decls removed.
2003
2004 * emacs.c (fatal_error_signal_hook): Remove.
2005 All uses removed. This leftover from old code was always 0.
2006
2007 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2008 * casefiddle.c (casify_object, casify_region):
2009 * casetab.c (set_case_table):
2010 * category.c, category.h (word_boundary_p):
2011 * category.h (CHAR_HAS_CATEGORY):
2012 Use bool for booleans, instead of int.
2013
2014 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2015
2016 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2017
2018 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2019
2020 On assertion failure, print backtrace if available.
2021 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2022 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2023 * Makefile.in (LIB_EXECINFO): New macro.
2024 (LIBES): Use it.
2025
2026 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2027 * bytecode.c (exec_byte_code):
2028 * callint.c (check_mark, Fcall_interactively):
2029 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2030 (getenv_internal, sync_process_alive, call_process_exited):
2031 * lisp.h (USE_SAFE_ALLOCA):
2032 Use bool for booleans, instead of int.
2033 * lisp.h, process.h: Adjust prototypes to match above changes.
2034 * callint.c (Fcall_interactively): Don't assume the mark's
2035 offset fits in 'int'.
2036
2037 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2038
2039 * buffer.c, buffer.h: Use bool for boolean.
2040 * buffer.c (reset_buffer_local_variables)
2041 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2042 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2043 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2044 (overlay_touches_p, overlay_strings, Foverlay_put)
2045 (report_overlay_modification, call_overlay_mod_hooks):
2046 (mmap_enlarge, mmap_set_vars):
2047 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2048 Use bool for booleans, instead of int.
2049 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2050 since the 1-or-0 return value is always ignored anyway.
2051 (mmap_initialized_p):
2052 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2053 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2054
2055 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2056
2057 * bidi.c: Use bool for boolean.
2058 This is a bit more readable, and makes the text segment of bidi.o
2059 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2060 Presumably it's faster too.
2061 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2062 Now bool.
2063 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2064 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2065 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2066 (bidi_explicit_dir_char, bidi_level_of_next_char)
2067 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2068 Use bool for booleans, instead of int.
2069 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2070 (bidi_unshelve_cache): Adjust decls to match code.
2071
2072 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2073
2074 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2075 argument.
2076
2077 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2078
2079 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2080 * atimer.h: Include <stdbool.h>.
2081
2082 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2083
2084 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2085 compile time tests instead of run time tests on systems that do
2086 not use them.
2087 (FRAME_MAC_P): Remove leftover from deleted code.
2088 * frame.c (syms_of_frame): Remove leftover from deleted code.
2089
2090 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2091
2092 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2093
2094 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2095
2096 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2097 Otherwise, the compiler complains about (A?B:C) where B is void
2098 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2099 (fontset_add): Return void, for FONTSET_ADD.
2100
2101 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2102
2103 * alloc.c: Use bool for booleans.
2104 (gc_in_progress, abort_on_gc)
2105 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2106 (dont_register_blocks) [GC_MALLOC_CHECK]:
2107 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2108 (check_string_bytes, make_specified_string, memory_full)
2109 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2110 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2111 (mark_stack, valid_pointer_p, make_pure_string)
2112 (Fgarbage_collect, survives_gc_p, gc_sweep):
2113 Use bool for booleans, instead of int.
2114 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2115 Remove unused local.
2116 * alloc.c (PURE_POINTER_P):
2117 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2118 * editfns.c (Fformat):
2119 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2120 (Fdo_auto_save):
2121 * fns.c (sweep_weak_table):
2122 * lisp.h (suppress_checking, push_message, survives_gc_p)
2123 (make_pure_string, gc_in_progress, abort_on_gc):
2124 * lread.c (readchar, read1):
2125 * print.c (Fprin1_to_string):
2126 * xdisp.c (push_message):
2127 Use bool for booleans affected directly or indirectly by
2128 alloc.c's changes.
2129
2130 Make recently-introduced setters macros.
2131 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2132 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2133 (set_fontset_default, set_fontset_fallback): Rename from their
2134 upper-case counterparts, and make them functions rather than macros.
2135 This is more consistent with the other recently-introduced setters.
2136 These don't need to be inline, since they're local.
2137
2138 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2139
2140 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2141 the loop (Bug#12247).
2142
2143 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2144
2145 * lisp.h (vcopy): Use memcpy rather than our own loop.
2146 This fixes a performance regression introduced by the recent
2147 addition of vcopy. This means 'vcopy' will need to be modified
2148 for a copying collector, but that's OK. Also, tighten the
2149 checking in the assertion.
2150
2151 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2152
2153 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2154 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2155 non-base glyph for the width of the base character, according to
2156 what x_draw_composite_glyph_string_foreground expects.
2157 Generate WADJUST value according to composition_gstring_width's
2158 expectations, to produce correct width of the composed character.
2159 Reverse the sign of the DU offset produced by ScriptPlace.
2160
2161 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2162
2163 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2164
2165 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2166
2167 Avoid direct writes to contents member of struct Lisp_Vector.
2168 * lisp.h (vcopy): New function to copy data into vector.
2169 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2170 * fns.c (Ffillarray): Use ASET.
2171 * keyboard.c (timer_check_2): Use AREF and ASET.
2172 (append_tool_bar_item, Frecent_keys): Use vcopy.
2173 * lread.c (read_vector): Use ASET.
2174 * msdos.c (Frecent_doskeys): Use vcopy.
2175 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2176 (Finternal_merge_in_global_face): Use ASET and vcopy.
2177 * xfont.c (xfont_list_pattern): Likewise.
2178
2179 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2180
2181 * window.c (Fwindow_point): For the selected window always return
2182 the position of its buffer's point.
2183 (Fset_window_point): For the selected window always go in its
2184 buffer to the specified position.
2185
2186 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2187
2188 Setter macros for fontsets.
2189 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2190 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2191 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2192 Adjust users.
2193
2194 2012-08-20 Glenn Morris <rgm@gnu.org>
2195
2196 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2197 Don't assume that `ln -f' works.
2198
2199 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2200
2201 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2202 and later about non-assignments with no effect. See discussion at
2203 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2204 details.
2205
2206 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2207
2208 Inline setter functions for Lisp_Objects slots of struct specbinding.
2209 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2210 Adjust users.
2211
2212 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2213
2214 * window.c (select_window): Always make selected window's buffer
2215 current.
2216
2217 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2218
2219 Use AREF and ASET for docstrings of category tables.
2220 * category.h (CATEGORY_DOCSTRING): Use AREF.
2221 (SET_CATEGORY_DOCSTRING): Use ASET.
2222 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2223
2224 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 Inline setter functions for hash table members.
2227 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2228 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2229 (set_hash_key_and_value, set_hash_index, set_hash_next)
2230 (set_hash_hash): New functions.
2231 * charset.c, fns.c: Adjust users.
2232
2233 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2234
2235 Inline getter and setter functions for per-buffer values.
2236 * buffer.h (per_buffer_default, set_per_buffer_default)
2237 (per_buffer_value, set_per_buffer_value): New functions.
2238 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2239 * buffer.c, data.c: Adjust users.
2240
2241 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2242
2243 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2244
2245 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2246
2247 Rely on <config.h> + <unistd.h> to declare 'environ',
2248 as gnulib does this if the system doesn't.
2249 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2250 Remove declaration. MS-Windows declares it on stdlib.h which is
2251 included by conf_post.h.
2252 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2253 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2254 * vm-limit.c: Include <unistd.h>, for 'environ'.
2255
2256 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2257 (start_of_data): Remove decl; mem-limits.h provides it.
2258
2259 * xdisp.c (handle_invisible_prop): Make it a bit faster
2260 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2261
2262 2012-08-19 Chong Yidong <cyd@gnu.org>
2263
2264 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2265 ends (Bug#3874).
2266
2267 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2268
2269 * .gdbinit: Use call instead of set when calling a function in the
2270 inferior.
2271
2272 * data.c (set_internal): Don't use set_blv_found.
2273 (Fkill_local_variable): Likewise.
2274
2275 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2276
2277 * nsfont.m (ns_ascii_average_width): Ensure the string
2278 ascii_printable is initialized with a null-terminated character
2279 array. Otherwise, it can contain undesired extra characters.
2280
2281 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2282
2283 port new setting code to Sun C 5.8 2005/10/13
2284 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2285 Return void, not Lisp_Object. Otherwise, the compiler
2286 complains about (A?B:C) where B is void and C is Lisp_Object
2287 when compiling CHAR_TABLE_SET, due to the recent change to
2288 the API of sub_char_table_set_contents.
2289
2290 2012-08-18 Chong Yidong <cyd@gnu.org>
2291
2292 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2293 for the string case (Bug#3874).
2294
2295 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2296
2297 * buffer.h (BSET): Remove (Bug#12215).
2298 Replace all uses with calls to new setter functions.
2299 (bset_bidi_paragraph_direction, bset_case_canon_table)
2300 (bset_case_eqv_table, bset_directory, bset_display_count)
2301 (bset_display_time, bset_downcase_table)
2302 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2303 (bset_last_selected_window, bset_local_var_alist)
2304 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2305 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2306 (bset_width_table):
2307 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2308 (bset_auto_fill_function, bset_auto_save_file_format)
2309 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2310 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2311 (bset_cache_long_line_scans, bset_case_fold_search)
2312 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2313 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2314 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2315 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2316 (bset_header_line_format, bset_indicate_buffer_boundaries)
2317 (bset_indicate_empty_lines, bset_invisibility_spec)
2318 (bset_left_fringe_width, bset_major_mode, bset_mark)
2319 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2320 (bset_name, bset_overwrite_mode, bset_pt_marker)
2321 (bset_right_fringe_width, bset_save_length)
2322 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2323 (bset_scroll_up_aggressively, bset_selective_display)
2324 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2325 (bset_word_wrap, bset_zv_marker):
2326 * category.c (bset_category_table):
2327 * syntax.c (bset_syntax_table):
2328 New setter functions.
2329
2330 * process.h (PSET): Remove (Bug#12215).
2331 Replace all uses with calls to new setter functions.
2332 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2333 (PROCESS_INLINE): New macro.
2334 (pset_childp): New setter function.
2335 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2336 * process.c (PROCESS_INLINE):
2337 Define to EXTERN_INLINE, so that the corresponding functions
2338 are compiled into code.
2339 (pset_buffer, pset_command, pset_decode_coding_system)
2340 (pset_decoding_buf, pset_encode_coding_system)
2341 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2342 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2343 (pset_type, pset_write_queue): New setter functions.
2344
2345 * window.h (WSET): Remove (Bug#12215).
2346 Replace all uses with calls to new setter functions.
2347 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2348 (WINDOW_INLINE): New macro.
2349 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2350 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2351 (wset_total_lines, wset_vertical_scroll_bar)
2352 (wset_window_end_pos, wset_window_end_valid)
2353 (wset_window_end_vpos): New setter functions.
2354 * window.c (WINDOW_INLINE):
2355 Define to EXTERN_INLINE, so that the corresponding functions
2356 are compiled into code.
2357 (wset_combination_limit, wset_dedicated, wset_display_table)
2358 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2359 (wset_new_normal, wset_new_total, wset_next_buffers)
2360 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2361 (wset_prev_buffers, wset_right_fringe_width)
2362 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2363 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2364 (wset_window_parameters):
2365 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2366 (wset_column_number_displayed, wset_region_showing):
2367 New setter functions.
2368
2369 * termhooks.h (TSET): Remove (Bug#12215).
2370 Replace all uses with calls to new setter functions.
2371 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2372 (TERMHOOKS_INLINE): New macro.
2373 (tset_charset_list, tset_selection_alist): New setter functions.
2374 * terminal.c (TERMHOOKS_INLINE):
2375 Define to EXTERN_INLINE, so that the corresponding functions
2376 are compiled into code.
2377 (tset_param_alist): New setter function.
2378
2379 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2380
2381 * keyboard.h (KSET): Remove (Bug#12215).
2382 Replace all uses with calls to new setter functions.
2383 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2384 (KEYBOARD_INLINE): New macro.
2385 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2386 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2387 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2388 New setter functions.
2389 * keyboard.c (KEYBOARD_INLINE):
2390 Define to EXTERN_INLINE, so that the corresponding functions
2391 are compiled into code.
2392 (kset_echo_string, kset_kbd_queue)
2393 (kset_keyboard_translate_table, kset_last_prefix_arg)
2394 (kset_last_repeatable_command, kset_local_function_key_map)
2395 (kset_overriding_terminal_local_map, kset_real_last_command)
2396 (kset_system_key_syms): New setter functions.
2397
2398 * frame.h (FSET): Remove (Bug#12215).
2399 Replace all uses with calls to new setter functions.
2400 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2401 (FRAME_INLINE): New macro.
2402 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2403 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2404 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2405 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2406 (fset_param_alist, fset_root_window, fset_scroll_bars)
2407 (fset_selected_window, fset_title, fset_tool_bar_items)
2408 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2409 * frame.c (FRAME_INLINE):
2410 Define to EXTERN_INLINE, so that the corresponding functions
2411 are compiled into code.
2412 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2413
2414 A few more naming-convention fixes for getters and setters.
2415 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2416 and rename from buffer_overlays_set_before.
2417 (set_buffer_overlays_after): Move here from buffer.h, and rename
2418 from buffer_overlays_set_after.
2419 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2420 All uses changed.
2421 (set_buffer_intervals): Rename from buffer_set_intervals.
2422 * intervals.c (set_interval_object): Move here from intervals.h,
2423 and rename from interval_set_object.
2424 (set_interval_left): Move here from intervals.h, and rename from
2425 interval_set_left.
2426 (set_interval_right): Move here from intervals.h, and rename from
2427 interval_set_right.
2428 (copy_interval_parent): Move here from intervals.h, and rename from
2429 interval_copy_parent.
2430 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2431 (set_interval_plist): Rename from interval_set_plist.
2432 Return void, not Lisp_Object, since no caller uses the result.
2433 * lisp.h (string_intervals): Rename from string_get_intervals.
2434 (set_string_intervals): Rename from string_set_intervals.
2435
2436 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2437 (set_char_table_contents): Rename from char_table_set_contents.
2438 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2439 All uses changed. See the end of
2440 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2441
2442 * lisp.h (CSET): Remove (Bug#12215).
2443 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2444 (set_char_table_purpose): New functions,
2445 replacing CSET. All uses changed. For example, replace
2446 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2447 "set_char_table_parent (char_table, parent);".
2448 The old version was confusing because it used the same name
2449 'parent' for two different things.
2450
2451 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2452
2453 Functions to get and set Lisp_Object fields of buffer-local variables.
2454 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2455 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2456 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2457 * data.c, eval.c, frame.c: Adjust users.
2458
2459 2012-08-17 Chong Yidong <cyd@gnu.org>
2460
2461 * xfaces.c (merge_face_vectors): If the target font specfies a
2462 font spec, make the font's attributes take precedence over
2463 directly-specified attributes.
2464 (merge_face_ref): Recognize :font.
2465
2466 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2467
2468 Do not use memcpy for copying intervals.
2469 * intervals.c (reproduce_interval): New function.
2470 (reproduce_tree, reproduce_tree_obj): Use it.
2471 (reproduce_tree_obj): Remove prototype.
2472
2473 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2474
2475 * lisp.h (duration_to_sec_usec): Remove unused decl.
2476
2477 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2478
2479 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2480 to an allocated instance of NSString, not to the class itself.
2481
2482 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2483
2484 * makefile.w32-in (C_CTYPE_H): New macro.
2485 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2486 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2487 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2488
2489 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2490
2491 Use ASCII tests for character types.
2492 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2493 * xfns.c, xterm.c:
2494 Don't include <ctype.h>; was not needed.
2495 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2496 * sysdep.c, xfaces.c:
2497 Include <c-ctype.h> instead of <ctype.h>.
2498 * nsterm.m: Include <c-ctype.h>.
2499 * charset.c (read_hex):
2500 * doc.c (Fsnarf_documentation):
2501 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2502 (DRIVE_LETTER) [DOS_NT]:
2503 (Ffile_name_directory, Fexpand_file_name)
2504 (Fsubstitute_in_file_name):
2505 * font.c (font_parse_xlfd, font_parse_fcname):
2506 * frame.c (x_set_font_backend):
2507 * gtkutil.c (xg_get_font):
2508 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2509 * nsimage.m (hexchar):
2510 * nsterm.m (ns_xlfd_to_fontname):
2511 * sysdep.c (system_process_attributes):
2512 * xfaces.c (hash_string_case_insensitive):
2513 Use C-locale tests instead of locale-specific tests for character
2514 types, since we want the ASCII interpretation here, not the
2515 interpretation suitable for whatever happens to be the current locale.
2516
2517 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2518
2519 Consistently check windows for validity/liveness
2520 (Bug#11984, Bug#12025, Bug#12026).
2521 * lisp.h (CHECK_VALID_WINDOW): New macro.
2522 * window.c (decode_window): Rename to decode_live_window.
2523 (decode_valid_window, Fwindow_valid_p): New functions.
2524 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2525 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2526 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2527 (Fwindow_prev_sibling, Fwindow_combination_limit)
2528 (Fset_window_combination_limit, Fwindow_use_time)
2529 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2530 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2531 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2532 (Fwindow_hscroll, Fset_window_hscroll)
2533 (Fwindow_redisplay_end_trigger)
2534 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2535 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2536 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2537 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2538 (Fwindow_end, Fset_window_point, Fset_window_start)
2539 (Fpos_visible_in_window_p, Fwindow_line_height)
2540 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2541 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2542 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2543 (Fset_window_parameter, Fwindow_display_table)
2544 (Fset_window_display_table, Fdelete_other_windows_internal)
2545 (Fset_window_buffer, Fset_window_new_total)
2546 (Fset_window_new_normal, Fdelete_window_internal)
2547 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2548 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2549 (Fwindow_scroll_bars): Check whether argument window is a valid or
2550 live window. Update doc-strings.
2551 (syms_of_window): New symbol Qwindow_valid_p.
2552 * keyboard.c (Fposn_at_x_y): Check whether argument
2553 frame_or_window denotes a valid window.
2554
2555 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2556
2557 Fix previous char table change.
2558 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2559 * chartab.c (optimize_sub_char_table): Likewise.
2560
2561 2012-08-16 Chong Yidong <cyd@gnu.org>
2562
2563 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2564
2565 * xfont.c (xfont_open):
2566 * xftfont.c (xftfont_open): Set the font's max_width field.
2567
2568 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2569 min_width to space_width and average_width to the average over
2570 printable ASCII characters.
2571 (ns_char_width): Code cleanup.
2572 (ns_ascii_average_width): New utility function.
2573
2574 * font.h (struct font): Update comments.
2575
2576 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2577
2578 Simple interface to set Lisp_Object fields of character tables.
2579 * lisp.h (CSET): New macro.
2580 (char_table_set_extras, char_table_set_contents)
2581 (sub_char_table_set_contents): New function.
2582 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2583 * syntax.c: Adjust users.
2584
2585 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2586
2587 * eval.c (eval_sub): Bind lexical-binding.
2588 * lread.c (Qlexical_binding): Make non-static.
2589
2590 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2591
2592 * nsmenu.m (popupSession): Remove.
2593 (pop_down_menu): Remove endModalSession.
2594 (timeout_handler:): New method.
2595 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2596 Call runModalForWindow. Check timer_fired when it returns.
2597 If not set, cancel timer and break out of loop.
2598 Otherwise loop again, with a new timeout.
2599
2600 * nsterm.m: Include fcntl.h if present.
2601 (fd_entry, t_readfds, inNsSelect): Remove.
2602 (select_writefds, select_valid, select_timeout, selfds)
2603 (select_mutex, apploopnr): Add.
2604 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2605 Otherwise call kbd_buffer_store_event.
2606 (ns_send_appdefined): Remove release of fd_entry.
2607 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2608 Increment and decrement apploopnr.
2609 (ns_select): If no file descriptors, just do a NSTimer.
2610 Otherwise copy read/write masks and start select thread (fd_handler).
2611 Start main loop and wait for application defined event.
2612 Inform select thread to stop selecting after main loop is exited.
2613 (ns_term_init): Create selfds pipe and set non-blocking.
2614 Initialize select_mutex. Start the select thread (fd_handler).
2615 (fd_handler:): Loop forever, wait for info from the main thread
2616 to either start or stop selecting. When select returns, send
2617 and appdefined event.
2618 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2619 If not call kbd_buffer_store_event.
2620
2621 * nsterm.h (EmacsApp): fd_handler takes id argument.
2622 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2623
2624 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2625
2626 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2627
2628 * region-cache.c (move_cache_gap): Update gap_len using the actual
2629 growth of the boundaries array. Do not change cache_len.
2630 (Bug#12196)
2631
2632 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2633
2634 Generalize and cleanup font subsystem checks.
2635 * font.h (FONT_DEBUG, font_assert): Remove.
2636 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2637 Change font_assert to eassert. Use eassert where appropriate.
2638
2639 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2640
2641 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2642
2643 2012-08-15 Chong Yidong <cyd@gnu.org>
2644
2645 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2646 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2647 extract the font descriptor instead of just the font name.
2648 In that case, return a font spec instead of a string.
2649 (x_last_font_name): Move to this file from xfns.c.
2650
2651 * xfns.c (Fx_select_font): The return value can also be a font
2652 spec. Move x_last_font_name management to gtkutil.c.
2653
2654 * xfaces.c: Make font weight and style symbols non-static.
2655
2656 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2657
2658 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2659 (bug#12117).
2660
2661 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2662
2663 * alloc.c (Fgarbage_collect): Use plural form consistently.
2664
2665 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2666
2667 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2668 iteration through the command loop. Fixes a problem whereby mouse
2669 movements are ignored until the first mouse click.
2670
2671 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2672
2673 Use bool, not int, for Lisp booleans.
2674 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2675 makes Emacs a bit smaller and presumably a bit faster.
2676 * lisp.h: Include <stdbool.h>.
2677 (struct Lisp_Boolfwd, defvar_bool):
2678 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2679 * regex.c [!emacs]: Include <stdbool.h>.
2680 (false, true): Remove; <stdbool.h> does this for us now.
2681
2682 2012-08-14 Chong Yidong <cyd@gnu.org>
2683
2684 * character.c (Fcharacterp): Doc fix (Bug#12076).
2685
2686 * data.c (Findirect_variable): Doc fix (Bug#11040).
2687
2688 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2689
2690 * editfns.c (Fformat): Doc fix (Bug#12059).
2691 (Fsave_current_buffer): Doc fix (Bug#11542).
2692
2693 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2694
2695 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2696 (bug#12022).
2697
2698 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2699
2700 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2701 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2702 * minibuf.c (choose_minibuf_frame, read_minibuf):
2703 * w32fns.c (x_create_tip_frame):
2704 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2705 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2706
2707 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2708
2709 * intervals.c (offset_intervals): Remove obsolete comment.
2710
2711 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2712
2713 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2714
2715 2012-08-14 Gergely Risko <gergely@risko.hu>
2716
2717 * coding.c (decode_coding): Record buffer modification before
2718 disabling undo_list (Bug#11773).
2719
2720 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2721
2722 Revert and cleanup some recent overlay changes.
2723 * buffer.h (enum overlay_type): Remove.
2724 (buffer_get_overlays, buffer_set_overlays): Likewise.
2725 (buffer_set_overlays_before, buffer_set_overlays_after):
2726 New function. Adjust users.
2727 (unchain_both): Add eassert.
2728
2729 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2730
2731 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2732
2733 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2734
2735 * gtkutil.c (xg_mark_data): Don't assume C99.
2736
2737 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2738
2739 * gtkutil.c (xg_frame_tb_info): New struct.
2740 (TB_INFO_KEY): New define.
2741 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2742 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2743 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2744 if not present.
2745 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2746 is up to date. Otherwise store new data.
2747 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2748
2749 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2750
2751 Use KSET for write access to Lisp_Object members of struct kboard.
2752 * keyboard.h (KSET): New macro.
2753 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2754 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2755 * xterm.c: Adjust users.
2756
2757 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2758
2759 Use BSET for write access to Lisp_Object members of struct buffer.
2760 * buffer.h (BSET): New macro.
2761 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2762 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2763 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2764 * window.c, xdisp.c, xfns.c: Adjust users.
2765
2766 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2767
2768 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2769
2770 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2771
2772 * nsterm.m (not_in_argv): New function.
2773 (application:openFile, application:openTempFile:):
2774 (application:openFileWithoutUI:, application:openFiles:): Open file
2775 if not_in_argv returns non-zero (bug#12171).
2776
2777 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2778 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2779 Define for Gtk+ versions less than 3.2.
2780 (xg_get_font_name): Use those functions/macros here.
2781 Reported by Frans Oilinki <moilinki@gmail.com>.
2782
2783 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2784
2785 * unexmacosx.c (copy_data_segment): Copy initialized data in
2786 statically linked libraries from input file rather than memory.
2787
2788 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2789 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2790 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2791
2792 2012-08-10 Glenn Morris <rgm@gnu.org>
2793
2794 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2795 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2796
2797 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2798
2799 Fix last change to allow compilation with low optimization levels.
2800 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2801 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2802
2803 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2804
2805 Use common inline syntax in intervals.h.
2806 * intervals.h (INTERVALS_INLINE): New macro.
2807 Change all users from LISP_INLINE.
2808
2809 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2810
2811 Define Qnone once for all platforms.
2812 * frame.c (Qnone): Define here.
2813 (syms_of_frame): DEFSYM it.
2814 * lisp.h (Qnone): New declaration.
2815 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2816 * xfns.c: Remove duplication. Adjust users.
2817
2818 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2819
2820 Remove unused macros from intervals.h.
2821 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2822 * intervals.c: Adjust comment.
2823
2824 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2825
2826 * w32fns.c <w32_unicode_gui>: New static variable.
2827 (globals_of_w32fns): Initialize it according to os_subtype.
2828 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2829 testing os_subtype.
2830
2831 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2832 Eli Zaretskii <eliz@gnu.org>
2833
2834 Fix bug #10299 with Unicode characters sent by customized
2835 keyboards created by MSKLC.
2836 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2837 (w32_init_class): Use it to initialize the Emacs class with either
2838 ANSI or Unicode API calls.
2839 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2840 later.
2841 (w32_wnd_proc): If the character code sent by WM_CHAR or
2842 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2843 original message. Call DefWindowProcW on NT and later.
2844
2845 2012-08-10 Glenn Morris <rgm@gnu.org>
2846
2847 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2848
2849 * lisp.h (DIRECTORY_SEP): Let configure set it.
2850
2851 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2852
2853 Use TSET for write access to Lisp_Object slots of struct terminal.
2854 * termhooks.h (TSET): New macro.
2855 * coding.c, terminal.c, xselect.c: Adjust users.
2856
2857 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2858
2859 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2860 the failing expression, include them in the error message.
2861 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2862 * lisp.h (internal_condition_case_n): Update declaration.
2863
2864 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2865
2866 Inline functions to examine and change buffer overlays.
2867 * buffer.c (unchain_both): New function.
2868 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2869 (buffer_has_overlays): New function.
2870 (enum overlay_type): New enum.
2871 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2872 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2873
2874 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2875
2876 Inline functions to examine and change buffer intervals.
2877 * alloc.c (mark_interval_tree): Remove.
2878 (MARK_INTERVAL_TREE): Simplify.
2879 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2880 * intervals.c (buffer_balance_intervals): New function.
2881 (graft_intervals_into_buffer): Adjust indentation.
2882 (set_intervals_multibyte): Simplify.
2883 * buffer.h (BUF_INTERVALS): Remove.
2884 (buffer_get_intervals, buffer_set_intervals): New function.
2885 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2886 * intervals.c, textprop.c: Adjust users.
2887
2888 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2889
2890 Inline functions to examine and change string intervals.
2891 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2892 (string_get_intervals, string_set_intervals): New function.
2893 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2894 * lread.c, print.c, textprop.c: Adjust users.
2895
2896 2012-08-08 Glenn Morris <rgm@gnu.org>
2897
2898 * lisp.mk (lisp): Remove language/persian.elc.
2899
2900 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2901
2902 Cleanup intervals.
2903 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2904 (NULL_INTERVAL_P): Likewise. Adjust users.
2905 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2906 Adjust comment. Move under #if 0.
2907 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2908 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2909
2910 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2911
2912 Check total length of intervals with eassert.
2913 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2914 * intervals.c: Change all users to eassert.
2915
2916 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2917
2918 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2919 Rename fields to match removal of FGET and WGET and disuse of
2920 INTERNAL_FIELD in Lisp_Cons.
2921
2922 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2923
2924 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2925 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2926 name since all xname users are fixed long time ago. Do not
2927 use INTERNAL_FIELD.
2928 (set_symbol_name, set_symbol_function, set_symbol_plist):
2929 (set_symbol_next, set_overlay_plist): New function.
2930 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2931 (struct Lisp_Overlay): Likewise.
2932 (CVAR, MVAR, SVAR): Remove.
2933 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2934 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2935 * xterm.c: Adjust users.
2936 * .gdbinit: Change to use name field of struct Lisp_Symbol
2937 where appropriate.
2938
2939 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2940
2941 Basic functions to set Lisp_Object and pointer slots of intervals.
2942 * intervals.h (interval_set_parent, interval_set_object):
2943 (interval_set_left, interval_set_right, interval_set_plist):
2944 (interval_copy_parent): New function.
2945 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2946 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2947 Adjust indentation.
2948 (INTERVAL_SIZE): Remove. Adjust users.
2949 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2950
2951 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2952
2953 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2954 * process.h (PGET): Remove.
2955 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2956 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2957
2958 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2959
2960 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2961 * window.h (WGET): Remove.
2962 (struct window): Do not use INTERNAL_FIELD.
2963 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2964 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2965 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2966 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2967 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2968 Adjust users.
2969
2970 2012-08-07 Chong Yidong <cyd@gnu.org>
2971
2972 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2973 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2974 (Fdelete_window_internal): Signal an error if the window is not on
2975 a live frame (Bug#12025).
2976
2977 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2978
2979 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2980 * frame.h (FGET): Remove.
2981 (struct frame): Do not use INTERNAL_FIELD.
2982 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2983 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2984 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2985 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2986
2987 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2988
2989 * w32.c: Silence compiler warnings.
2990 (map_w32_filename): Remove unused variable `is_fat'.
2991 (chase_symlinks): Add parentheses around expression.
2992
2993 2012-08-06 Glenn Morris <rgm@gnu.org>
2994
2995 * sysdep.c: Respect BROKEN_GETWD.
2996
2997 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2998 Let configure handle it.
2999 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3000
3001 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3002
3003 Use GCALIGNMENT where appropriate.
3004 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3005 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3006 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3007
3008 2012-08-06 Eli Zaretskii <eliz@gnu.org>
3009
3010 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3011 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3012
3013 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3014
3015 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3016 that should be sufficient for everyone.
3017
3018 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3019
3020 * keyboard.c (timer_check_2): Add break so timer_check returns next
3021 timeout.
3022
3023 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3024
3025 Fix Windows build errors introduced after converting to WGET and WSET.
3026 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3027 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3028
3029 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3030
3031 * nsterm.m (ns_frame_rehighlight): Use FSET.
3032
3033 * nsmenu.m (ns_update_menubar): Use FSET.
3034
3035 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3036
3037 Separate read and write access to Lisp_Object slots of Lisp_Process.
3038 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3039 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3040
3041 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3042
3043 Separate read and write access to Lisp_Object slots of struct window.
3044 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3045 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3046 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3047 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3048 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3049 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3050 Adjust users.
3051
3052 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3053
3054 Fix Windows build errors introduced after converting to FGET and FSET.
3055 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3056 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3057 (w32_judge_scroll_bars): Change to use FSET.
3058 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3059
3060 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3061
3062 Fix replacement typo.
3063 * window.c (replace_window): Set root_window instead of
3064 selected_window. This fixes a total window subsystem
3065 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3066
3067 2012-08-06 Glenn Morris <rgm@gnu.org>
3068
3069 * lisp.mk (lisp): Add language/persian.elc.
3070
3071 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3072
3073 Separate read and write access to Lisp_Object slots of struct frame.
3074 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3075 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3076 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3077 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3078 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3079
3080 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3081
3082 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3083
3084 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3085
3086 Generalize common compile-time constants.
3087 * lisp.h (header_size, bool_header_size, word_size): Now here.
3088 (struct Lisp_Vector): Add comment.
3089 (struct Lisp_Bool_Vector): Move up to define handy constants.
3090 (VECSIZE, PSEUDOVECSIZE): Simplify.
3091 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3092 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3093 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3094 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3095 * xfont.c, xmenu.c: Use word_size where appropriate.
3096
3097 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3098
3099 * search.c (Freplace_match): Treat \? in the replacement text
3100 literally (Bug#8161).
3101
3102 2012-08-05 Chong Yidong <cyd@gnu.org>
3103
3104 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3105 * frame.c (Vdelete_frame_functions):
3106 * emacs.c (Vkill_emacs_hook): Doc fix.
3107
3108 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3109
3110 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3111 --with-x-toolkit=no builds.
3112 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3113
3114 2012-08-04 Chong Yidong <cyd@gnu.org>
3115
3116 * syntax.c (Fmodify_syntax_entry): Doc fix.
3117
3118 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3119
3120 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3121 * w32.c (init_environment): Change the default values of many
3122 environment variables in dflt_envvars[] to NULL, to avoid pushing
3123 them into environment when they were not already defined.
3124 Remove the code that deletes site-lisp subdirectories from the default
3125 value of EMACSLOADPATH, as it is no longer needed.
3126 (check_windows_init_file): Now external, not static.
3127 Use Vload_path as is, without adding anything, as this function is now
3128 called when Vload_path is already set up.
3129
3130 * w32.h (check_windows_init_file): Add prototype.
3131
3132 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3133 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3134 compatibility with Posix platforms.
3135 (main): Move the call to check_windows_init_file to here from
3136 w32.c.
3137 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3138 any, in the DEFALT argument into the root of the Emacs build or
3139 installation tree, as appropriate.
3140
3141 * callproc.c (init_callproc_1): Call decode_env_path instead of
3142 doing its equivalent by hand.
3143 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3144 the code that sets Vexec_path run on MS-Windows.
3145
3146 * lread.c (init_lread): Add comments to #ifdef's.
3147
3148 * msdos.c (dos_set_window_size, IT_update_begin)
3149 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3150 instead of direct references.
3151
3152 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3153
3154 Export DEFAULT_REHASH_* to GDB.
3155 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3156 Now constants, not macros.
3157
3158 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3159
3160 Remove unnecessary casts involving pointers.
3161 These casts are no longer needed now that we assume C89 or later,
3162 since they involve casting to or from void *.
3163 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3164 (make_pure_float, make_pure_vector):
3165 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3166 * macros.c (Fstart_kbd_macro):
3167 * menu.c (find_and_return_menu_selection):
3168 * minibuf.c (read_minibuf_noninteractive):
3169 * sysdep.c (closedir):
3170 * xdisp.c (x_produce_glyphs):
3171 * xfaces.c (compare_fonts_by_sort_order):
3172 * xfns.c (x_real_positions, select_visual):
3173 * xselect.c (x_stop_queuing_selection_requests)
3174 (x_get_window_property, x_get_window_property_as_lisp_data):
3175 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3176 Remove unnecessary pointer casts.
3177 * alloc.c (record_xmalloc): New function.
3178 * lisp.h (record_xmalloc): New decl.
3179 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3180 more like a function. This is because the pointer cast is not
3181 needed. All uses changed.
3182 * print.c (print_string, print_error_message): Avoid length recalc.
3183
3184 Improve fix for macroexp crash with debugging (Bug#12118).
3185 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3186 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3187 not supposed to be invoked from the garbage collector.
3188 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3189 (gc_aset): New function, which is like ASET but can be
3190 used in the garbage collector.
3191 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3192 (set_hash_index): Use it instead of ASET.
3193
3194 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3195
3196 Support symlinks on latest versions of MS-Windows.
3197 * w32.c: Include winioctl.h and aclapi.h.
3198 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3199 (revert_to_self): Forward declarations of static functions.
3200 <static BOOL g_b_init_get_security_info>:
3201 <g_b_init_create_symbolic_link>: New static flags.
3202 (globals_of_w32): Initialize them to zero.
3203 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3204 (map_w32_filename): Improve commentary. Simplify switch.
3205 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3206 headers (most versions of MinGW w32api don't).
3207 (get_security_info, create_symbolic_link)
3208 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3209 New functions.
3210 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3211 in the argument file name.
3212 (sys_access): Call unc_volume_file_attributes only if
3213 GetFileAttributes fails with network-related error codes.
3214 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3215 have the required privileges.
3216 (get_file_security_desc_by_name): Rename from
3217 get_file_security_desc.
3218 (stat_worker): New function, with most of the guts of 'stat', and
3219 with addition of handling of symlinks and support for 'lstat'.
3220 If possible, get file's attributes and security information by
3221 handle, not by name. Produce S_IFLNK bit for symlinks, when
3222 called from 'lstat'.
3223 (stat, lstat): New functions, call 'stat_worker'.
3224 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3225 symlinks when the underlying filesystem supports them.
3226
3227 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3228
3229 Fix macroexp crash on Windows with debugging (Bug#12118).
3230 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3231 checking subscripts; problem introduced with the recent
3232 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3233 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3234 since it's used in non-static inline functions now.
3235
3236 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3237 Don't assume buffer size fits in 'int'. Remove unused local.
3238
3239 Use C99-style 'extern inline' if available.
3240 * buffer.h (BUFFER_INLINE):
3241 * category.h (CATEGORY_INLINE):
3242 * character.h (CHARACTER_INLINE):
3243 * charset.h (CHARSET_INLINE):
3244 * composite.h (COMPOSITE_INLINE):
3245 * dispextern.h (DISPEXTERN_INLINE):
3246 * lisp.h (LISP_INLINE):
3247 * systime.h (SYSTIME_INLINE):
3248 New macro, replacing 'static inline' in this header.
3249 * buffer.h, category.h, character.h, charset.h, composite.h:
3250 * dispextern.h, lisp.h, systime.h:
3251 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3252 * alloc.c (LISP_INLINE):
3253 * buffer.c (BUFFER_INLINE):
3254 * category.c (CATEGORY_INLINE):
3255 * character.c (CHARACTER_INLINE):
3256 * charset.c (CHARSET_INLINE):
3257 * composite.c (COMPOSITE_INLINE):
3258 * dispnew.c (DISPEXTERN_INLINE):
3259 * sysdep.c (SYSTIME_INLINE):
3260 Define to EXTERN_INLINE, so that the corresponding functions
3261 are compiled into code.
3262 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3263 (INLINE_HEADER_END): New macros.
3264 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3265 since it's used in non-static inline functions now.
3266 (VALMASK) [!USE_LSB_TAG]: Likewise.
3267
3268 2012-08-02 Glenn Morris <rgm@gnu.org>
3269
3270 * s/: Remove empty directory.
3271
3272 * s/ms-w32.h: Move to ../nt/inc.
3273 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3274 Update for new ms-w32.h location.
3275
3276 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3277
3278 Port to Solaris 8.
3279 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3280
3281 2012-08-02 Glenn Morris <rgm@gnu.org>
3282
3283 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3284 hard-coding the path separator.
3285
3286 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3287
3288 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3289 This how ASET and AREF are supposed to work, and makes
3290 it easier to think about future improvements. See
3291 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3292 * charset.h (set_charset_attr): New function.
3293 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3294 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3295 (aref_addr): New function. All uses of &AREF(...) changed.
3296 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3297 (set_hash_index): New functions. All lvalue-style uses of
3298 HASH_KEY etc. changed.
3299 * keyboard.c (set_prop): New function. All lvalue-style uses
3300 of PROP changed.
3301
3302 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3303
3304 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3305 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3306 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3307 * nsfns.m (ns_set_name_as_filename): Likewise.
3308 * nsmenu.m (ns_update_menubar): Likewise.
3309 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3310
3311 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3312
3313 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3314 Adapt to latest changes in field names of the corresponding Lisp
3315 objects.
3316
3317 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3318
3319 2012-08-01 Glenn Morris <rgm@gnu.org>
3320
3321 * s/msdos.h: Remove file.
3322 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3323 * Makefile.in (S_FILE): Remove.
3324 (config_h): Remove S_FILE.
3325
3326 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3327
3328 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3329 Remove; moved to nt/config.nt.
3330
3331 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3332
3333 Use INTERNAL_FIELD for conses and overlays.
3334 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3335 Remove obsolete comment.
3336 (MVAR): New macro.
3337 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3338 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3339
3340 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3341
3342 Use INTERNAL_FIELD for symbols.
3343 * lisp.h (SVAR): New macro. Adjust users.
3344 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3345 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3346
3347 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3348
3349 Use INTERNAL_FIELD for processes.
3350 * process.h (PVAR): New macro. Adjust style.
3351 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3352 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3353
3354 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3355
3356 Use INTERNAL_FIELD for windows.
3357 * window.h (WVAR): New macro.
3358 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3359 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3360 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3361 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3362 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3363 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3364
3365 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3366
3367 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3368
3369 2012-08-01 Glenn Morris <rgm@gnu.org>
3370
3371 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3372 Move to configure.ac.
3373
3374 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3375
3376 * makefile.w32-in (CONFIG_H): Update dependencies.
3377 (CONF_POST_H): New macro.
3378
3379 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3380
3381 2012-07-31 Glenn Morris <rgm@gnu.org>
3382
3383 * Makefile.in (S_FILE): No longer set by configure.
3384
3385 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3386 is available.
3387 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3388
3389 * process.h (NULL_DEVICE):
3390 * emacs.c (SEPCHAR):
3391 * editfns.c (USER_FULL_NAME): Let configure set them.
3392
3393 * s/README, s/template.h: Remove files.
3394
3395 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3396
3397 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3398 Move to configure.ac.
3399
3400 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3401
3402 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3403 resulting renaming of 'struct frame' members.
3404
3405 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3406
3407 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3408 after introduction of FVAR.
3409
3410 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3411
3412 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3413
3414 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3415 instead of compositeToPoint.
3416 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3417
3418 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3419
3420 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3421
3422 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3423 * lisp.h (INTERNAL_FIELD): New macro.
3424 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3425 (BVAR): Change to use INTERNAL_FIELD.
3426 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3427 (KVAR): Change to use INTERNAL_FIELD.
3428 * frame.h (FVAR): New macro.
3429 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3430 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3431 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3432 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3433 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3434
3435 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3436
3437 Miscellaneous fixes for non-default X toolkits.
3438 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3439 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3440 Move under #ifdef USE_LUCID.
3441 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3442 definition and usage to avoid warnings.
3443
3444 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3445
3446 * nsterm.m (openFiles): Fix previous checkin.
3447
3448 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3449
3450 * indent.c (compute_motion): Remove unused local.
3451
3452 2012-07-31 Glenn Morris <rgm@gnu.org>
3453
3454 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3455
3456 * conf_post.h [USG5_4]:
3457 Move remaining contents of s/usg5-4-common.h here.
3458 * s/usg5-4-common.h: Remove file.
3459
3460 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3461 * s/irix6-5.h: Remove file.
3462
3463 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3464 * s/darwin.h: Remove file.
3465
3466 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3467 * s/hpux10-20.h: Remove file, which is now empty.
3468
3469 2012-07-30 Glenn Morris <rgm@gnu.org>
3470
3471 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3472 * Makefile.in (config_h): Add conf_post.h.
3473 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3474
3475 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3476
3477 * nsterm.m (ns_do_open_file): New variable.
3478 (ns_term_init): Set ns_do_open_file to YES after run returns.
3479 (openFile, openTempFile, openFileWithoutUI, openFiles):
3480 Open files only if ns_do_open_file.
3481
3482 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3483
3484 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3485 This no-op macro hasn't been needed for many years.
3486 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3487
3488 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3489 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3490 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3491 gdb_make_enums_visible.
3492 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3493 (DIRECTORY_SEP): Now a constant, not a macro.
3494
3495 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3496
3497 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3498 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3499
3500 * w32term.c <w32_keyboard_codepage>: Renamed from
3501 keyboard_codepage and now external. All users changed.
3502
3503 * w32term.h: Add declaration of w32_keyboard_codepage.
3504
3505 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3506 the codepage to translate keys to Unicode. If this argument is
3507 -1, use the value returned by GetConsoleCP. All callers changed.
3508
3509 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3510
3511 Update .PHONY listings in makefiles.
3512 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3513 bootstrap-clean, distclean, maintainer-clean, versioclean,
3514 extraclean, frc.
3515
3516 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3517 This is a bit clearer. Fix some commentary typos.
3518
3519 2012-07-30 Glenn Morris <rgm@gnu.org>
3520
3521 * s/netbsd.h: Let configure include signal.h if needed.
3522 Remove file, which is now empty.
3523
3524 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3525 Let configure set them.
3526 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3527 No more need to undefine.
3528
3529 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3530
3531 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3532 non-single-byte char when adding meta modifier. (Bug#12090)
3533
3534 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3535
3536 Convert safe_call to use variable number of arguments.
3537 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3538 (safe_call2): Fix comment.
3539 * lisp.h (safe_call): Adjust prototype.
3540 * coding.c (encode_coding_object): Change to use safe_call2.
3541 * xfaces.c (merge_face_heights): Change to use safe_call1.
3542
3543 2012-07-30 Glenn Morris <rgm@gnu.org>
3544
3545 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3546 does that unconditionally. Remove file, which is now empty.
3547
3548 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3549 Remove empty files.
3550
3551 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3552
3553 Export to GDB most of lisp.h's remaining object-like macros.
3554 * lisp.h (min, max): Move earlier, because they're used earlier now.
3555 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3556 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3557 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3558 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3559 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3560 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3561 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3562 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3563 Now constants, for GDB. They need not be macros.
3564 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3565 Now constants, for GDB, as well as macros, for static initializers.
3566 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3567 Move to after the definition of struct Lisp_Char_Table,
3568 since the former now needs that type defined.
3569 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3570 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3571 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3572 New enums, for gdb_make_enums_visible.
3573 (GLYPH_MODE_LINE_FACE): Remove; unused.
3574 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3575 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3576 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3577 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3578 enum maxargs, enum MAX_ALLOCA.
3579 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3580 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3581 no longer needed, now that they are done in lisp.h.
3582
3583 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3584
3585 Cleanup string bytes checking.
3586 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3587 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3588 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3589 (check_sblock, compact_small_strings): Simplify.
3590
3591 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3592
3593 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3594 These macros are confusing and no longer need to be defined, as
3595 the enum values now suffice. All uses replaced with definiens.
3596 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3597
3598 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3599
3600 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3601 ($(BLD)/w32console.$(O)): Update dependencies.
3602
3603 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3604
3605 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3606 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3607 time. Adjust users.
3608 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3609
3610 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3611
3612 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3613 setting sitelisp (Bug#12010).
3614
3615 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3616
3617 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3618
3619 * w32heap.c (cache_system_info):
3620 * w32.c (sys_rename):
3621 * w32proc.c (find_child_console, sys_kill): All users changed.
3622
3623 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3624
3625 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3626
3627 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3628
3629 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3630
3631 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3632
3633 Cleanup statistics calculation in Fgarbage_collect.
3634 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3635 Fix zombies percentage calculation. Simplify elapsed time calculation.
3636
3637 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3638
3639 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3640 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3641 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3642 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3643 (replace_range, replace_range_2, del_range_2): Change to eassert.
3644 * marker.c (byte_char_debug_check): Adjust style.
3645
3646 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3647
3648 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3649 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3650 long-ago-commented-out code that talks about "WIN32".
3651 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3652 All uses changed.
3653
3654 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3655
3656 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3657 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3658 Simplify by using alignof.
3659 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3660 * lisp.h: Include <stdalign.h>.
3661 (GCALIGNMENT): New macro and constant.
3662 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3663 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3664 (stdalign): New macro, if not already defined.
3665
3666 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3667
3668 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3669 * w32inevt.c: Include w32inevt.h.
3670 (w32_read_console_input): New inline function, calls either
3671 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3672 w32_console_unicode_input.
3673 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3674 (w32_kbd_patch_key, key_event): Use the codepage returned by
3675 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3676 (key_event): use uChar.UnicodeChar only if
3677 w32_console_unicode_input is non-zero.
3678
3679 * w32console.c: Include w32heap.h.
3680 <w32_console_unicode_input>: New global variable.
3681 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3682 family of Windows, zero otherwise.
3683
3684 * w32inevt.h: Declare w32_console_unicode_input.
3685
3686 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3687 --without-x. (Bug#11742)
3688
3689 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3690
3691 Adjust GDB to reflect pvec_type changes (Bug#12036).
3692 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3693 2012-07-04 changes to pseudovector representation.
3694 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3695
3696 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3697
3698 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3699 bus address.
3700 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3701
3702 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3703
3704 * alloc.c (listn): Fix the order the arguments are consed onto the
3705 list.
3706
3707 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3708 enumeration constants, as PURE and HEAP are too general, and clash
3709 with other headers and sources, such as gmalloc.c and the
3710 MS-Windows system headers. All users changed.
3711
3712 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3713
3714 Revert last save_excursion_save and save_excursion_restore changes.
3715 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3716 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3717
3718 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3719
3720 Fix recently-introduced typos in Windows port.
3721 Reported by Martin Rudalics <rudalics@gmx.at>.
3722 * w32.c (init_environment): Replace comma with semicolon.
3723 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3724
3725 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3726
3727 Improve GDB symbol export (Bug#12036).
3728 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3729 arms of an 'if', not using conditional expressions; otherwise GDB
3730 complains about the types in the unevaluated arm when the argument
3731 is an integer literal.
3732 (xgetint): Simplify expression.
3733 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3734 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3735 Zaretskii in <http://bugs.gnu.org/12036#13>.
3736 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3737 needed now that we have gdb_make_enums_visible.
3738 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3739 (enum enum_USE_LSB_TAG):
3740 New enum types, packaging up enums that need to be exported to GDB.
3741
3742 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3743
3744 Utility function to make a list from specified amount of objects.
3745 * lisp.h (enum constype): New datatype.
3746 (listn): New prototype.
3747 * alloc.c (listn): New function.
3748 (Fmemory_use_count, syms_of_alloc): Use it.
3749 * buffer.c (syms_of_buffer): Likewise.
3750 * callint.c (syms_of_callint): Likewise.
3751 * charset.c (define_charset_internal): Likewise.
3752 * coding.c (syms_of_coding): Likewise.
3753 * keymap.c (syms_of_keymap): Likewise.
3754 * search.c (syms_of_search): Likewise.
3755 * syntax.c (syms_of_syntax): Likewise.
3756 * w32.c (init_environment): Likewise.
3757 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3758 * xdisp.c (syms_of_xdisp): Likewise.
3759 * xfns.c (syms_of_xfns): Likewise.
3760
3761 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3762
3763 Fast save_excursion_save and save_excursion_restore.
3764 * lisp.h (struct Lisp_Excursion): New data type.
3765 (PVEC_EXCURSION): New pseudovector type.
3766 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3767 to deal with it. Adjust comments.
3768 (init_marker, attach_marker): New prototype.
3769 (unchain_marker): Adjust prototype.
3770 * marker.c (attach_marker): Change to global.
3771 (init_marker): New function.
3772 * alloc.c (Fmake_marker, build_marker): Use it.
3773 (build_marker): More easserts.
3774 (mark_object): Handle struct Lisp_Excursion.
3775 * editfns.c (save_excursion_save, save_excursion_restore):
3776 Reimplement to use struct Lisp_Excursion. Add comments.
3777
3778 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3779
3780 Fix export of symbols to GDB (Bug#12036).
3781 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3782 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3783 emacs.c, as this is a more-suitable home. Had this been done earlier
3784 the fix for 12036 would have avoided some of the problems noted in
3785 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3786 would have been more obvious.
3787 * emacs.c: Do not include <verify.h>; no longer needed.
3788 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3789 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3790 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3791 Remove; now done in lisp.h.
3792 * lisp.h (PUBLISH_TO_GDB): New macro.
3793 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3794 (DATA_SEG_BITS): Use it.
3795 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3796 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3797 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3798 not be usable in #if. This simplifies things.
3799
3800 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3801
3802 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3803
3804 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 Simplify export of symbols to GDB (Bug#12036).
3807 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3808 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3809 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3810 Adjust to changes in lisp.h and emacs.c, by using
3811 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3812 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3813 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3814 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3815 instead of gdb_valbits.
3816 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3817 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3818 instead of gdb_array_mark_flag.
3819 (xboolvector): Get size from $->size, not $->header.size.
3820 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3821 (xreload, hook-run, hookpost-run): Remove.
3822 * emacs.c: Include <verify.h>.
3823 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3824 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3825 Remove.
3826 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3827 (gdb_USE_LSB_TAG): New enum constants.
3828 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3829 Also define these as enum constants, so they're visible to GDB.
3830 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3831 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3832 as constants, so they're visible to GDB.
3833 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3834 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3835 Now enum constants, not macros, so they're visible to GDB.
3836 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3837 more convenient now. All uses changed.
3838 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3839 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3840
3841 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3842
3843 Explicitly free restriction data that are not needed anymore.
3844 * editfns.c (save_restriction_restore): Free restriction data.
3845
3846 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3847
3848 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3849 add argument, tune behavior, and adjust all callers.
3850
3851 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3852
3853 Use typedef for EMACS_INT, EMACS_UINT.
3854 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3855 than macros. This simplifies debugging in the usual case, since
3856 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3857 and it allows expressions involving EMACS_INT casts.
3858 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3859
3860 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3861
3862 * nsterm.m (ns_read_socket): Return early if there is a modal
3863 window (Bug#12043).
3864
3865 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3866
3867 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3868 that FOCUS-FRAME can be omitted.
3869
3870 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3871
3872 Adjust buffer text indirection counters at the end of Fkill_buffer.
3873 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3874 buffer is definitely dead. This should really fix an issue reported
3875 by Christoph Scholtes again. (Bug#12007).
3876 (init_buffer_once): Initialize indirection counters of
3877 buffer_defaults and buffer_local_symbols (for sanity and safety).
3878
3879 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3880
3881 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3882 and continuation glyphs on tooltip frames, leave them at zero.
3883 Avoids continued lines in tooltips. (Bug#11832)
3884
3885 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3886
3887 Simplify copy_overlay.
3888 * buffer.c (copy_overlay): Simplify. Use build_marker.
3889 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3890
3891 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3892
3893 * print.c (print_object): Don't crash when a frame's name is nil
3894 or invalid. (Bug#12025)
3895
3896 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3897 it signals an error when a tooltip frame is being created.
3898
3899 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3900
3901 Cleanup miscellaneous objects allocation and initialization.
3902 * alloc.c (allocate_misc): Change to static. Add argument to
3903 specify the subtype. Adjust comment and users.
3904 (build_overlay): New function.
3905 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3906 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3907 (allocate_misc): Remove prototype.
3908 (build_overlay): Add prototype.
3909
3910 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3911
3912 Swap buffer text indirection counters in Fbuffer_swap_text.
3913 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3914 This avoids crash reported by Christoph Scholtes at
3915 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3916
3917 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3918
3919 * nsmenu.m (Popdown_data): New struct.
3920 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3921 free Popdown_data.
3922 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3923 (initWithContentRect): Make imgView and contentView non-static
3924 and autorelease them. Also autorelease img and matrix (Bug#12005).
3925 (dealloc): Remove (Bug#12005).
3926
3927 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3928
3929 Adjust consing_since_gc when objects are explicitly freed.
3930 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3931 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3932 (free_cons, free_misc): Subtract object size from consing_since_gc.
3933
3934 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3935
3936 Simplify and cleanup markers positioning code.
3937 * marker.c (attach_marker): More useful eassert.
3938 (live_buffer, set_marker_internal): New function.
3939 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3940 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3941
3942 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3943
3944 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3945 as it's limited by the amount of memory, not by INT_MAX.
3946
3947 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3948
3949 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3950 in special-event-map. See the discussion at
3951 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3952 for the reasons.
3953
3954 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3955 info.dwItemData. Fixes crashes on 64-bit Windows.
3956 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3957
3958 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3959
3960 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3961 (conversationIdentifier): Return value is NSInteger.
3962 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3963
3964 2012-07-21 Chong Yidong <cyd@gnu.org>
3965
3966 * window.c (decode_any_window): Signal an error if the window is
3967 on a dead frame (Bug#11984).
3968
3969 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3970
3971 Add indirection counting to speed up Fkill_buffer.
3972 * buffer.h (struct buffer): New member.
3973 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3974 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3975 base buffer indirection counter.
3976 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3977 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3978 through buffer list if indirection counter is 0.
3979
3980 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3981
3982 Extend the value returned by Fgarbage_collect with heap statistics.
3983 * alloc.c (Qheap): New symbol.
3984 (syms_of_alloc): DEFSYM it.
3985 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3986 (Fmemory_free): Remove.
3987 (syms_of_alloc): Don't defsubr it.
3988 * buffer.c (Fcompact_buffer): Remove.
3989 (syms_of_buffer): Don't defsubr it.
3990
3991 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3992
3993 Make maybe_gc inline.
3994 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3995 * lisp.h (consing_since_gc, gc_relative_threshold)
3996 (memory_full_cons_threshold): Revert declaration.
3997 (maybe_gc): Remove prototype, define as inline.
3998 * alloc.c: Remove old commented-out code.
3999 (consing_since_gc, gc_relative_threshold)
4000 (memory_full_cons_threshold): Revert to global.
4001 (maybe_gc): Remove.
4002
4003 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4004
4005 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4006 * lisp.h (build_unibyte_string): New function.
4007 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4008 * sysdep.c, w32fns.c, xfns.c: Use it.
4009 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4010 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4011 Adjust users accordingly.
4012 * font.h (font_open_by_name): Adjust prototype.
4013
4014 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4015
4016 Cleanup calls to Fgarbage_collect.
4017 * lisp.h (maybe_gc): New prototype.
4018 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4019 Remove declarations.
4020 * alloc.c (maybe_gc): New function.
4021 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4022 Make them static.
4023 * bytecode.c (MAYBE_GC): Use maybe_gc.
4024 * eval.c (eval_sub, Ffuncall): Likewise.
4025 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4026 to avoid dependency from auto-save feature.
4027
4028 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4029
4030 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4031 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4032 'for_each_per_buffer_object_at'.
4033 All uses changed. It's better to use upper-case for macros that
4034 cannot be implemented as functions, to give the reader a clue
4035 that they're special.
4036
4037 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4038
4039 * alloc.c (Fgarbage_collect): Tweak docstring.
4040
4041 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4042
4043 Tweak the value returned from Fgarbage_collect again.
4044 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4045 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4046 Adjust documentation.
4047 (total_vector_bytes): Rename to total_vector_slots, adjust
4048 accounting.
4049 (total_free_vector_bytes): Rename to total_free_vector_slots,
4050 adjust accounting.
4051 (Qstring_bytes, Qvector_slots): New symbols.
4052 (syms_of_alloc): DEFSYM them.
4053
4054 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4055
4056 Buffer compaction primitive which may be used from Lisp.
4057 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4058 (syms_of_buffer): Register Fcompact_buffer.
4059 * alloc.c (Fgarbage_collect): Use compact_buffer.
4060 * buffer.h (compact_buffer): New prototype.
4061 (struct buffer_text): New member.
4062
4063 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4064
4065 New macro to iterate over all buffers, miscellaneous cleanups.
4066 * lisp.h (all_buffers): Remove declaration.
4067 * buffer.h (all_buffers): Add declaration, with comment.
4068 (for_each_buffer): New macro.
4069 * alloc.c (Fgarbage_collect, mark_object): Use it.
4070 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4071 (init_buffer): Likewise.
4072 * data.c (Fset_default): Likewise.
4073 * coding.c (code_conversion_restore): Remove redundant check
4074 for dead buffer.
4075 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4076
4077 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4078
4079 Fix bug that created negative-length intervals.
4080 * intervals.c (merge_interval_right, merge_interval_left):
4081 Do not zero out this interval if it is absorbed by its children,
4082 as this interval's total length doesn't change in that case. See
4083 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4084
4085 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4086
4087 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4088 when invoking (make-bool-vector N t) and N is a positive
4089 multiple of 8 -- the last 8 bits were mistakenly cleared.
4090
4091 Remove some struct layout assumptions in bool vectors.
4092 * alloc.c (bool_header_size): New constant.
4093 (header_size, word_size): Move earlier, as they're now used earlier.
4094 Use 'word_size' in a few more places, where it's appropriate.
4095 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4096 padding before the data member of a bool vector.
4097 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4098 than doing the check by hand with an abort ().
4099
4100 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4101
4102 * eval.c (Fdefvar): Don't check constants since we only set the var if
4103 it's not yet defined anyway (bug#11904).
4104
4105 * lisp.h (last_undo_boundary): Declare new var.
4106 * keyboard.c (command_loop_1): Set it.
4107 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4108 were auto-added by the command loop (bug#11774).
4109
4110 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4111
4112 * w32font.c (Qsymbol): Remove local definition.
4113 (syms_of_w32font): Don't DEFSYM it.
4114
4115 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4116
4117 Fix sweep_vectors to handle large bool vectors correctly.
4118 * alloc.c (sweep_vectors): Account total_vector_bytes for
4119 bool vectors larger than VBLOCK_BYTES_MAX.
4120
4121 2012-07-18 Chong Yidong <cyd@gnu.org>
4122
4123 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4124 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4125
4126 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4127
4128 Return more descriptive data from Fgarbage_collect.
4129 Suggested by Stefan Monnier in
4130 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4131 * alloc.c (bounded_number): New function.
4132 (total_buffers, total_vectors): New variable.
4133 (total_string_size): Rename to total_string_bytes, adjust users.
4134 (total_vector_size): Rename to total_vector_bytes, adjust users.
4135 (sweep_vectors): Account total_vectors and total_vector_bytes.
4136 (Fgarbage_collect): New return value. Adjust documentation.
4137 (gc_sweep): Account total_buffers.
4138 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4139 (VECTOR_SIZE): Remove.
4140 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4141 (Qinterval, Qmisc): New symbols.
4142 (syms_of_data): Initialize them.
4143 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4144 (Qcons, Qbuffer): New declarations.
4145
4146 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4147
4148 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4149 Round up, not down. Improve doc.
4150
4151 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4152
4153 Restore old code in allocate_string_data to avoid Faset breakage.
4154 Reported by Julien Danjou <julien@danjou.info> in
4155 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4156 * alloc.c (allocate_string_data): Restore old code with minor
4157 adjustments, fix comment to explain this subtle issue.
4158
4159 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4160
4161 Remove FILE_SYSTEM_CASE.
4162 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4163
4164 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4165 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4166 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4167 call-process-region passes it through expand-file-name.
4168
4169 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4170
4171 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4172
4173 Fix crash when creating indirect buffer (Bug#11917)
4174 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4175 Don't handle unbound variables specially if non-zero.
4176 (Fbuffer_local_variables): Pass zero.
4177 (clone_per_buffer_values): Pass non-zero.
4178
4179 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4180
4181 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4182 to make the loop interruptible.
4183
4184 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4185
4186 * gnutls.c (emacs_gnutls_handshake): Only retry if
4187 GNUTLS_E_INTERRUPTED.
4188
4189 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4190
4191 Cleanup and convert miscellaneous checks to eassert.
4192 * alloc.c (mark_interval): Fix comment, partially rephrase
4193 old comment from intervals.h (see below).
4194 * intervals.c (find_interval, adjust_intervals_for_insertion)
4195 (delete_interval, adjust_intervals_for_deletion)
4196 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4197 Convert to eassert.
4198 (adjust_intervals_for_insertion, make_new_interval):
4199 Remove obsolete and unused code.
4200 * intervals.h (struct interval): Remove obsolete comment.
4201 * textprotp.c (erase_properties): Remove unused code.
4202 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4203 (Fremove_list_of_text_properties): Convert to eassert.
4204
4205 2012-07-17 Chong Yidong <cyd@gnu.org>
4206
4207 * editfns.c (Finsert_char): Doc fix.
4208
4209 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4210
4211 Fix previous change to make Fmemory_free always accurate.
4212 * alloc.c (make_interval): Update total_free_intervals.
4213 (make_float): Likewise for total_free_floats.
4214 (free_cons, Fcons): Likewise for total_free_conses.
4215 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4216 Likewise for total_free_vector_bytes.
4217 (Fmake_symbol): Likewise for total_free_symbols.
4218 (bytes_free): Remove.
4219
4220 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4221
4222 Simple free memory accounting feature.
4223 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4224 (sweep_vectors): Accumulate size of free vectors.
4225 (Fgarbage_collect): Setup bytes_free.
4226 (Fmemory_free): New function.
4227 (syms_of_alloc): Register it.
4228
4229 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4230
4231 Cleanup overlays checking.
4232 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4233 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4234 eassert and OVERLAYP.
4235 (sort_overlays): Change to use OVERLAYP.
4236
4237 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4238
4239 * editfns.c (Finsert_char): Make it interactive, and make the
4240 second arg optional. Copy interactive spec and docstring from
4241 ucs-insert.
4242
4243 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4244
4245 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4246 Unlike the other wrapped functions, fabs has an unspecified
4247 effect on errno.
4248
4249 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4250
4251 * nsterm.m (keyDown): Interpret flags without left/right bits
4252 as the left key (Bug#11670).
4253
4254 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4255
4256 Remove empty and useless init functions.
4257 * lisp.h (init_character_once, init_fns, init_image)
4258 (init_filelock, init_sound): Remove prototype.
4259 * character.c (init_character_once): Remove.
4260 * filelock.c (init_filelock): Likewise.
4261 * fns.c (init_fns): Likewise.
4262 * image.c (init_image): Likewise.
4263 * sound.c (init_sound): Likewise.
4264 * emacs.c (main): Adjust accordingly.
4265
4266 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4267
4268 * gtkutil.h: Tiny cleanups.
4269 (use_old_gtk_file_dialog): Remove useless declaration.
4270 (xg_uses_old_file_dialog): Add suggested const attribute.
4271
4272 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4273
4274 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4275 (bidi_paragraph_init): Use it to limit search forward for a strong
4276 directional character in abnormally large paragraphs full of
4277 neutral or weak characters. (Bug#11943)
4278
4279 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4280
4281 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4282 the toolbar (Bug#9451).
4283 (xg_make_tool_item): Give the widget event box a transparent
4284 background.
4285
4286 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4287
4288 Cleanup basic allocation variables and functions.
4289 * alloc.c (ignore_warnings, init_intervals, init_float)
4290 (init_cons, init_symbol, init_marker): Remove.
4291 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4292 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4293 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4294 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4295 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4296 (staticidx, init_alloc_once, init_strings, free_ablock):
4297 Remove redundant initialization.
4298 * fns.c (init_weak_hash_tables): Remove.
4299 * lisp.h (init_weak_hash_tables): Remove prototype.
4300
4301 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4302
4303 Use zero_vector where appropriate.
4304 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4305 accordingly.
4306 * lisp.h (zero_vector): New declaration.
4307 * font.c (null_vector): Remove.
4308 (syms_of_font): Remove initialization and staticpro.
4309 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4310 * keymap.c (Faccessible_keymaps): Likewise.
4311
4312 2012-07-15 Leo Liu <sdl.web@gmail.com>
4313
4314 * fringe.c: Fix typo in comments.
4315
4316 2012-07-14 Leo Liu <sdl.web@gmail.com>
4317
4318 * fringe.c: Add a new bitmap exclamation-mark.
4319
4320 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4321
4322 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4323
4324 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4325 (HAVE_MENUS): Don't define, defined by editing config.in with
4326 msdos/sed2v2.inp.
4327 (GMALLOC_INHIBIT_VALLOC): Don't define.
4328 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4329
4330 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4331
4332 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4333
4334 2012-07-14 Glenn Morris <rgm@gnu.org>
4335
4336 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4337 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4338 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4339
4340 2012-07-13 Glenn Morris <rgm@gnu.org>
4341
4342 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4343
4344 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4345 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4346
4347 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4348
4349 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4350 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4351 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4352 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4353 where appropriate.
4354 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4355 as boolean expression.
4356 (x_set_window_size): Remove unused variable toolbar.
4357 (ns_get_color_default, ns_mod_to_lisp): Remove.
4358 (ns_mouse_position): Remove unused variables xchar and ychar.
4359 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4360 (ns_set_vertical_scroll_bar): Remove unused variable count.
4361 (ns_delete_terminal): Remove unused variable i.
4362 (ns_term_init): Remove unused variables r, g and b.
4363 (mouseDown): Remove unused variable window.
4364 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4365 (initFrameFromEmacs): Remove unused variable vbextra.
4366 (mouseEntered): Remove unused variables p and dpyinfo.
4367 (mouseExited): Remove unused variables p and r.
4368 (ns_define_frame_cursor, ns_clear_frame_area)
4369 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4370 (menuDown): Assign [sender tag] to variable and cast the variable.
4371
4372 * nsterm.h (menuDown): Add id as type to argument sender.
4373 (ns_display_info_for_name): Add Lisp_Object argument.
4374 (ns_term_init): Add Lisp_Object argument.
4375 (ns_map_event_to_object): Add void argument.
4376 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4377 prototype with arguments and only declare if __OBJC__.
4378 (nxatoms_of_nsselect): Add void argument.
4379 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4380 (ns_alloc_autorelease_pool): Add void argument.
4381 (ns_release_autorelease_pool): Add void* argument.
4382 (ns_get_defaults_value): Add const char* argument.
4383
4384 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4385 (initFromContents): Use SSDATA where appropriate.
4386 (ns_update_menubar): Add braces to ambigous if-else.
4387 (initWithTitle): Put () around assignment in if statement.
4388 (ns_menu_show): Remove unused variables window and keymap.
4389 (update_frame_tool_bar): Remove unused variable selected_p.
4390 (initWithContentRect): Remove unused variable this_cmd_name.
4391
4392 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4393 appropriate.
4394 (setXBMColor): Remove unused variable len.
4395 (setPixmapData): Put () around assignment in loop statement.
4396
4397 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4398 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4399 where appropriate.
4400 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4401 around assignment in loop statement.
4402 (nsfont_open): Remove unused variable i.
4403 (nsfont_open): Remove unused variable len.
4404 (nsfont_draw): Remove unused variable cs.
4405
4406 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4407 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4408 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4409 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4410 (Fns_font_name, Fns_perform_service)
4411 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4412 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4413 (ns_set_name): Remove unused variable view.
4414 (x_set_menu_bar_lines): Remove unused variable olines.
4415 (x_set_tool_bar_lines): Remove unused variable root_window.
4416 (Fns_list_colors): Put () around assignment in while statement.
4417 (Fns_perform_service): Remove unused variable len.
4418 (Fns_display_usable_bounds): Remove unused variable top.
4419 (syms_of_nsfns): Remove unused variable i.
4420
4421 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4422 memcpy (Bug#11907).
4423
4424 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4425
4426 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4427 and free it with DestroyExceptionInfo (Bug#11558).
4428
4429 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4430
4431 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4432 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4433 Set here, not in nt/config.nt.
4434
4435 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4436
4437 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4438 cursor overflow into the last glyph on display line when the right
4439 fringe is off. (Bug#11832)
4440
4441 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4442
4443 * xdisp.c (produce_special_glyphs): Now static.
4444 * dispextern.h (produce_special_glyphs): Remove decl.
4445
4446 2012-07-13 Glenn Morris <rgm@gnu.org>
4447
4448 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4449 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4450
4451 * s/usg5-4-common.h (USG, USG5):
4452 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4453 * s/sol2-6.h (SOLARIS2):
4454 * s/irix6-5.h (IRIX6_5):
4455 * s/hpux10-20.h (USG, USG5, HPUX):
4456 * s/gnu-linux.h (USG, GNU_LINUX):
4457 * s/freebsd.h (BSD_SYSTEM):
4458 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4459 * s/cygwin.h (CYGWIN):
4460 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4461 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4462
4463 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4464
4465 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4466
4467 2012-07-13 Glenn Morris <rgm@gnu.org>
4468
4469 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4470
4471 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4472
4473 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4474 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4475
4476 2012-07-12 Glenn Morris <rgm@gnu.org>
4477
4478 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4479
4480 * process.c (init_process_emacs): Rename from init_process.
4481 The old name is also the name of a Mach system call.
4482 * lisp.h, emacs.c: Update for this name change.
4483 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4484 longer needed.
4485
4486 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4487
4488 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4489 memmove call that removes glyphs covered by the left truncation
4490 glyph. Improve commentary.
4491 (display_line): Fix display of continuation glyphs on GUI frames
4492 when the right fringe is turned off and variable-size fonts are
4493 used in the window. Move the code that appends a stretch glyph to
4494 produce_special_glyphs, so that it could be used for truncation
4495 and continuation glyphs alike.
4496 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4497 glyph of a suitably computed width, to align the special glyphs at
4498 the window margin. Code moved from display_line. (Bug#11832)
4499
4500 2012-07-12 Glenn Morris <rgm@gnu.org>
4501
4502 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4503
4504 * s/gnu-linux.h, s/hpux10-20.h:
4505 Do not unconditionally define HAVE_XRMSETDATABASE.
4506
4507 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4508
4509 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4510
4511 Fix typos that broke OS X build.
4512 Reported by Randal L. Schwartz in
4513 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4514 * nsterm.m (ns_timeout): Add missing local decl.
4515 (ns_get_color): snprintf -> sprintf, to fix typo.
4516
4517 2012-07-12 Glenn Morris <rgm@gnu.org>
4518
4519 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4520 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4521 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4522 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4523
4524 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4525 Move PTY_OPEN to configure.
4526
4527 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4528 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4529 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4530
4531 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4532
4533 Use empty_unibyte_string where applicable.
4534 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4535 * lread.c (read1): Likewise.
4536 * xsettings.c (syms_of_xsettings): Likewise.
4537
4538 2012-07-12 Glenn Morris <rgm@gnu.org>
4539
4540 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4541 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4542 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4543 * s/hpux10-20.h (RUN_TIME_REMAP):
4544 * s/bsd-common.h (TABDLY): Move to configure.
4545
4546 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4547
4548 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4549
4550 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4551 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4552
4553 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4554
4555 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4556 * s/template.h: Move NARROWPROTO to configure.
4557
4558 2012-07-11 Glenn Morris <rgm@gnu.org>
4559
4560 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4561 unused since 2011-01-17 change to systty.h.
4562
4563 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4564 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4565 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4566
4567 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4568
4569 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4570
4571 2012-07-11 Glenn Morris <rgm@gnu.org>
4572
4573 * s/darwin.h, s/gnu-linux.h, s/template.h:
4574 Move INTERRUPT_INPUT to configure.
4575
4576 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4577
4578 Minor adjustments to interning code.
4579 * lisp.h (intern, intern_c_string): Redefine as static inline
4580 wrappers for intern_1 and intern_c_string_1, respectively.
4581 (intern_1, intern_c_string_1): Rename prototypes.
4582 * lread.c (intern_1, intern_c_string_1, oblookup):
4583 Simplify Vobarray checking.
4584 * font.c (font_intern_prop): Likewise. Adjust comment.
4585 * w32font.c (intern_font_name): Likewise.
4586
4587 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4588
4589 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4590
4591 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4592 of Fcar/Fcdr if possible.
4593 * font.c (check_otf_features): Likewise.
4594 * fontset.c (Fnew_fontset): Likewise.
4595 * gnutls.c (Fgnutls_boot): Likewise.
4596 * minibuf.c (read_minibuf): Likewise.
4597 * msdos.c (IT_set_frame_parameters): Likewise.
4598 * xmenu.c (Fx_popup_dialog): Likewise.
4599 * w32menu.c (Fx_popup_dialog): Likewise.
4600
4601 2012-07-11 Glenn Morris <rgm@gnu.org>
4602
4603 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4604 since nothing has defined it on these platforms.
4605
4606 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4607 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4608
4609 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4610 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4611 Move CLASH_DETECTION to configure.
4612
4613 * s/gnu.h: Remove file, which is now empty.
4614
4615 * s/gnu.h, s/gnu-linux.h:
4616 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4617
4618 2012-07-11 John Wiegley <johnw@newartisans.com>
4619
4620 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4621 function attribute, so we only use it if it exists in the
4622 compiler.
4623
4624 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4625
4626 Avoid call to strlen in fast_c_string_match_ignore_case.
4627 * search.c (fast_c_string_match_ignore_case): Change to use
4628 length argument. Adjust users accordingly.
4629 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4630
4631 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4632
4633 Assume mkdir, rmdir.
4634 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4635 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4636
4637 Assume rename.
4638 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4639
4640 Assume perror.
4641 * s/hpux10-20.h (HAVE_PERROR): Remove.
4642 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4643 Remove dummy definition, as this problem was obsolete long ago.
4644
4645 Assume strerror.
4646 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4647
4648 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4649
4650 Avoid calls to strlen in font processing functions.
4651 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4652 (font_open_by_name): Change to use length argument.
4653 Adjust users accordingly.
4654 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4655 Adjust prototypes.
4656 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4657 Change to return ptrdiff_t.
4658 (xfont_list_pattern, xfont_match): Use length returned by
4659 xfont_decode_coding_xlfd.
4660 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4661
4662 2012-07-11 Glenn Morris <rgm@gnu.org>
4663
4664 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4665 Move DONT_REOPEN_PTY to configure.
4666
4667 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4668 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4669
4670 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4671
4672 Remove "#define unix" that is no longer needed (Bug#11905).
4673 * s/aix4-2.h (unix): Remove; no longer needed.
4674
4675 EMACS_TIME simplification (Bug#11875).
4676 This replaces macros (which typically do not work in GDB)
4677 with functions, typedefs and enums, making the code easier to debug.
4678 The functional style also makes code easier to read and maintain.
4679 * systime.h: Include <sys/time.h> on all hosts, not just if
4680 WINDOWSNT, since 'struct timeval' is needed in general.
4681 (EMACS_TIME): Now a typedef, not a macro.
4682 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4683 not macros.
4684 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4685 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4686 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4687 (EMACS_TIME_LE): Now functions, not macros.
4688 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4689 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4690 which are not functions. All uses rewritten to use:
4691 (make_emacs_time): New function.
4692 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4693 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4694 not functions. All uses rewritten to use the following, respectively:
4695 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4696 (add_emacs_time, sub_emacs_time): New functions.
4697 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4698 * fileio.c (Fcopy_file):
4699 * xterm.c (XTflash): Get the current time closer to when it's used.
4700 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4701
4702 * bytecode.c (targets): Suppress -Woverride-init warnings.
4703
4704 Simplify by avoiding confusing use of strncpy etc.
4705 * doc.c (Fsnarf_documentation):
4706 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4707 * frame.c (Fmake_terminal_frame):
4708 * gtkutil.c (get_utf8_string):
4709 * lread.c (openp):
4710 * nsmenu.m (ns_update_menubar):
4711 * regex.c (regerror):
4712 Prefer memcpy to strncpy and strncat when either will do.
4713 * fileio.c (Fsubstitute_in_file_name):
4714 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4715 (menu_separator_name_p):
4716 * nsmenu.m (ns_update_menubar):
4717 Prefer memcmp to strncmp when either will do.
4718 * nsterm.m: Include <ftoastr.h>.
4719 (ns_get_color):
4720 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4721 Prefer snprintf to strncpy.
4722 * nsterm.m (ns_term_init):
4723 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4724 * nsterm.m (ns_term_init):
4725 Avoid the need for strncpy, by using build_string or
4726 make_unibyte_string directly. Use dtoastr, not snprintf.
4727 * process.c (Fmake_network_process): Diagnose service names that
4728 are too long, rather than silently truncating them or creating
4729 non-null-terminated names.
4730 (Fnetwork_interface_info): Likewise, for interface names.
4731 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4732 Prefer sprintf to strncat.
4733 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4734 Prefer vsnprintf to vsprintf + strncpy.
4735
4736 2012-07-10 Glenn Morris <rgm@gnu.org>
4737
4738 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4739 Clarify fallback case.
4740
4741 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4742
4743 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4744 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4745 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4746 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4747 where argument type is known to be a Lisp_Cons.
4748
4749 2012-07-10 Tom Tromey <tromey@redhat.com>
4750
4751 * bytecode.c (BYTE_CODE_THREADED): New macro.
4752 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4753 (enum byte_code_op): New type.
4754 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4755 (exec_byte_code): Use them. Use token threading when applicable.
4756
4757 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4758
4759 Optimize pure C strings initialization.
4760 * lisp.h (make_pure_string): Fix prototype.
4761 (build_pure_c_string): New function, defined as static inline. This
4762 provides a better opportunity to optimize away calls to strlen when
4763 the function is called with compile-time constant argument.
4764 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4765 argument, adjust users accordingly. Use build_pure_c_string where
4766 appropriate.
4767 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4768 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4769 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4770
4771 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4772
4773 Avoid calls to strlen in miscellaneous functions.
4774 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4775 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4776 * lread.c (openp): Likewise.
4777
4778 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4779
4780 Avoid calls to strlen in path processing functions.
4781 * fileio.c (file_name_as_directory): Add comment. Change to add
4782 srclen argument and return the length of result. Adjust users
4783 accordingly.
4784 (directory_file_name): Fix comment. Change to add srclen argument,
4785 swap 1st and 2nd arguments to obey the common convention.
4786 Adjust users accordingly.
4787 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4788
4789 2012-07-10 Glenn Morris <rgm@gnu.org>
4790
4791 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4792 Move PENDING_OUTPUT_COUNT definition to configure.
4793
4794 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4795 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4796 * s/gnu.h (DATA_START): Move definitions to configure.
4797
4798 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4799 We include usg5-4-common.h, which defines them both.
4800
4801 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4802 O_RDONLY already includes it).
4803
4804 Stop ns builds setting the EMACSLOADPATH environment variable.
4805 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4806 Now it does not set EMACSLOADPATH, just returns the load-path string.
4807 * nsterm.h: Update accordingly.
4808 * lread.c [HAVE_NS]: Include nsterm.h.
4809 (init_lread) [HAVE_NS]: Use ns_load_path.
4810 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4811
4812 2012-07-09 Glenn Morris <rgm@gnu.org>
4813
4814 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4815 since the included bsd-common.h does so.
4816
4817 Stop ns builds setting the EMACSPATH environment variable.
4818 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4819 (ns_init_paths): Do not set EMACSPATH.
4820 * nsterm.h (ns_exec_path): Add it.
4821 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4822 Use ns_exec_path.
4823
4824 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4825
4826 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4827
4828 * process.c (wait_reading_process_output): 'waitchannels' was unset
4829 when read_kbd || !NILP (wait_for_cell); fix this.
4830
4831 Add GCC-style 'const' attribute to functions that can use it.
4832 * character.h (char_resolve_modifier_mask):
4833 * keyboard.h (make_ctrl_char):
4834 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4835 (init_character_once, next_almost_prime, init_fns, init_image)
4836 (flush_pending_output, init_sound):
4837 * mem-limits.h (start_of_data):
4838 * menu.h (finish_menu_items):
4839 Add ATTRIBUTE_CONST.
4840 * emacs.c (DEFINE_DUMMY_FUNCTION):
4841 Declare the dummy function with ATTRIBUTE_CONST.
4842 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4843 Add decls with ATTRIBUTE_CONST.
4844
4845 Minor improvements to make_formatted_string.
4846 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4847 where int is good enough, as vsprintf returns an int.
4848 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4849
4850 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4851
4852 Use make_formatted_string to avoid double length calculation.
4853 * lisp.h (make_formatted_string): New prototype.
4854 * alloc.c (make_formatted_string): New function.
4855 * buffer.c (Fgenerate_new_buffer_name): Use it.
4856 * dbus.c (syms_of_dbusbind): Likewise.
4857 * editfns.c (Fcurrent_time_zone): Likewise.
4858 * filelock.c (get_boot_time): Likewise.
4859 * frame.c (make_terminal_frame, set_term_frame_name)
4860 (x_report_frame_params): Likewise.
4861 * image.c (gs_load): Likewise.
4862 * minibuf.c (get_minibuffer): Likewise.
4863 * msdos.c (dos_set_window_size): Likewise.
4864 * process.c (make_process): Likewise.
4865 * xdisp.c (ensure_echo_area_buffers): Likewise.
4866 * xsettings.c (apply_xft_settings): Likewise.
4867
4868 2012-07-09 Glenn Morris <rgm@gnu.org>
4869
4870 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4871 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4872 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4873 * nsterm.h (ns_etc_directory): Add it.
4874 * callproc.c [HAVE_NS]: Include nsterm.h.
4875 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4876
4877 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4878
4879 Move marker debugging code under MARKER_DEBUG.
4880 * marker.c (MARKER_DEBUG): Move marker debugging code under
4881 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4882 for bootstrap with --enable-checking (~3x slowdown reported
4883 by Juanma Barranquero <lekktu@gmail.com>).
4884 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4885
4886 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4887
4888 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4889 See <http://bugs.gnu.org/11825#29>.
4890
4891 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4892
4893 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4894 has no font, use the frame's font. (Bug#11813)
4895 (display_line): Add commentary about displaying truncation glyphs
4896 on GUI frames.
4897 (produce_special_glyphs): Move here from term.c.
4898
4899 * term.c (produce_special_glyphs): Move to xdisp.c.
4900
4901 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4902 section.
4903
4904 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4905
4906 * xdisp.c (display_line): Avoid warning about implicit declaration
4907 of FRAME_FONT.
4908
4909 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4910
4911 * lisp.h: Remove empty conditional.
4912
4913 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4914
4915 * lread.c (load_path_check): Now static.
4916
4917 Fix some minor --with-ns problems found by static checking.
4918 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4919 (x_set_font) [!HAVE_X_WINDOWS]:
4920 * image.c (xpm_load_image) [HAVE_NS]:
4921 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4922 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4923 Remove unused local.
4924 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4925 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4926 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4927 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4928 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4929 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4930 Fix pointer signedness problem.
4931 * xfaces.c (FRAME_X_FONT_TABLE):
4932 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4933
4934 2012-07-07 Glenn Morris <rgm@gnu.org>
4935
4936 * lread.c (load_path_check): New function, split from init_lread.
4937 (init_lread): Reorganize. Motivation:
4938 If EMACSLOADPATH is set, check/warn about that rather than the
4939 defaults, which we are not going to use. Hence we can remove
4940 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4941 Don't warn if site-lisp directories are missing.
4942 If not installed, start from a blank load-path, since
4943 PATH_LOADSEARCH refers to the eventual installation directories.
4944
4945 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4946
4947 Support truncation and continuation glyphs on GUI frames, when
4948 fringes are disabled. (Bug#11832)
4949 * xdisp.c (init_iterator): Get dimensions of truncation and
4950 continuation glyphs even if on GUI frames.
4951 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4952 or both, are absent.
4953 (start_display, move_it_in_display_line_to): Handle the case of a
4954 GUI frame without a fringe to display continuation or truncation
4955 glyphs.
4956 (insert_left_trunc_glyphs): Support GUI frames: make sure
4957 truncation glyphs overwrite enough glyphs from the current line to
4958 have sufficient space in pixels.
4959 (display_line): Support truncation and continuation glyphs on GUI
4960 frames. If some spare pixels are left on the line after inserting
4961 the truncation glyphs, fill that space with a stretch glyph of a
4962 suitably computed width.
4963
4964 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4965 produce_glyphs, to support GUI sessions.
4966
4967 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4968
4969 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4970
4971 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4972
4973 Do not require float-time's arg to fit in time_t (Bug#11825).
4974 This works better on hosts where time_t is unsigned, and where
4975 float-time is applied to the (negative) difference between two times.
4976 * editfns.c (decode_time_components): Last arg is now double *,
4977 not int *, and means to store all the result as a double, without
4978 worrying about whether the seconds part fits in time_t.
4979 All callers changed.
4980 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4981 All callers changed.
4982 (Ffloat_time): Do not fail merely because the specified time falls
4983 outside of time_t range.
4984
4985 2012-07-07 Glenn Morris <rgm@gnu.org>
4986
4987 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4988 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4989 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4990
4991 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4992
4993 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4994 Update dependencies.
4995
4996 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4997
4998 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4999
5000 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5001 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5002 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5003 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5004 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5005 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5006
5007 * xfont.c (compare_font_names): Redo to omit the need for casts.
5008
5009 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5010
5011 * xfns.c (Fx_change_window_property): Doc fix.
5012 * w32fns.c (Fx_change_window_property): Doc fix.
5013
5014 * w32fns.c (Fx_window_property): Accept the same arguments as the
5015 X Windows version. Doc fix.
5016 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5017
5018 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5019 Eli Zaretskii <eliz@gnu.org>
5020
5021 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5022 Windows-specific code from nt/config.nt moved here.
5023 Obsolete settings removed.
5024
5025 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5026
5027 * process.c: Avoid unnecessary calls to gettime.
5028 (wait_reading_process_output): Don't get the time of day
5029 when gobbling data immediately and not waiting, as there's no need
5030 for it in that case. This removes a FIXME.
5031
5032 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5033
5034 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5035 is defined (Bug#11768).
5036
5037 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5038
5039 Fix marker debugging code.
5040 * marker.c (byte_char_debug_check): Do not perform the check
5041 if buffer is not multibyte.
5042 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5043 Call byte_char_debug_check with correct arguments.
5044
5045 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5046
5047 Compile marker debugging code only if ENABLE_CHECKING is defined.
5048 * marker.c (byte_char_debug_check, count_markers):
5049 Use only if ENABLE_CHECKING is defined.
5050 (byte_debug_flag): Remove.
5051 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5052 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5053
5054 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5055
5056 Avoid code repetition in marker-related functions.
5057 * marker.c (attach_marker): New function.
5058 (Fset_marker, set_marker_restricted, set_marker_both)
5059 (set_marker_restricted_both): Use it.
5060 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5061 Consistently rename charno to charpos.
5062 (marker_position): Add eassert.
5063 (marker_byte_position): Convert to eassert.
5064
5065 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5066
5067 Simplify list operations in unchain_overlay and unchain_marker.
5068 * buffer.c (unchain_overlay): Simplify. Add comment.
5069 * marker.c (unchain_marker): Simplify. Fix comments.
5070
5071 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5072
5073 Introduce fast path for the widely used marker operation.
5074 * alloc.c (build_marker): New function.
5075 * lisp.h (build_marker): New prototype.
5076 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5077 * composite.c (autocmp_chars): Likewise.
5078 * editfns.c (buildmark): Remove.
5079 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5080 (save_restriction_save): Use build_marker.
5081 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5082 * window.c (save_window_save): Likewise.
5083
5084 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5085
5086 Do not use Fdelete_overlay in delete_all_overlays
5087 to avoid redundant calls to unchain_overlay.
5088 * buffer.c (drop_overlay): New function.
5089 (delete_all_overlays, Fdelete_overlay): Use it.
5090 * minibuf.c (get_minibuffer): Fix comment.
5091
5092 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5093
5094 Port to OpenBSD 5.1 amd64.
5095 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5096 This is needed for OpenBSD, and should be harmless on all BSD systems.
5097 Also, include <sys/sysctl.h>, as it should be available on all
5098 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5099 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5100 use p_pid member, not kp_proc.pid.
5101
5102 2012-07-06 Glenn Morris <rgm@gnu.org>
5103
5104 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5105
5106 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5107
5108 More xmalloc and related cleanup.
5109 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5110 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5111 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5112 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5113 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5114 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5115 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5116 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5117 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5118 * xterm.c:
5119 Omit needless casts involving void * pointers and allocation.
5120 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5121 as the former is more robust if P's type is changed.
5122 Prefer xzalloc to xmalloc + memset 0.
5123 Simplify malloc-or-realloc to realloc.
5124 Don't worry about xmalloc returning a null pointer.
5125 Prefer xstrdup to xmalloc + strcpy.
5126 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5127 growing it.
5128 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5129 alloca of a constant.
5130
5131 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5132
5133 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5134 hscroll is larger than the line width. Fixes long and futile
5135 looping inside extend_face_to_end_of_line (on a TTY) producing
5136 glyphs that are not needed and thrown away.
5137
5138 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5139
5140 * marker.c (set_marker_restricted_both): Simplify by using
5141 clip_to_bounds.
5142
5143 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5144
5145 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5146
5147 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5148
5149 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5150 not defined (Bug#11768).
5151 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5152 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5153 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5154 followed by gtk_box_set_homogeneous (Bug#11768).
5155 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5156 (update_theme_scrollbar_width, xg_create_scroll_bar):
5157 Use gtk_scrollbar_new (Bug#11768).
5158 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5159 (is_box_type): New function (Bug#11768).
5160 (xg_tool_item_stale_p): Call is_box_type.
5161 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5162 with default display (Bug#11768).
5163
5164 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5165
5166 * xdisp.c (window_hscroll_limited): New function.
5167 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5168 coordinates when window's hscroll is set to insanely large
5169 values. (Bug#11857)
5170
5171 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5172
5173 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5174 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5175
5176 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5177
5178 Cleanup xmalloc.
5179 * lisp.h (xzalloc): New prototype. Omit needless casts.
5180 * alloc.c (xzalloc): New function. Omit needless casts.
5181 * charset.c: Omit needless casts. Convert all calls to
5182 xmalloc with following memset to xzalloc.
5183 * dispnew.c: Likewise.
5184 * fringe.c: Likewise.
5185 * image.c: Likewise.
5186 * sound.c: Likewise.
5187 * term.c: Likewise.
5188 * w32fns.c: Likewise.
5189 * w32font.c: Likewise.
5190 * w32term.c: Likewise.
5191 * xfaces.c: Likewise.
5192 * xfns.c: Likewise.
5193 * xterm.c: Likewise.
5194 * atimer.c: Omit needless casts.
5195 * buffer.c: Likewise.
5196 * callproc.c: Likewise.
5197 * ccl.c: Likewise.
5198 * coding.c: Likewise.
5199 * composite.c: Likewise.
5200 * doc.c: Likewise.
5201 * doprnt.c: Likewise.
5202 * editfns.c: Likewise.
5203 * emacs.c: Likewise.
5204 * eval.c: Likewise.
5205 * filelock.c: Likewise.
5206 * fns.c: Likewise.
5207 * gtkutil.c: Likewise.
5208 * keyboard.c: Likewise.
5209 * lisp.h: Likewise.
5210 * lread.c: Likewise.
5211 * minibuf.c: Likewise.
5212 * msdos.c: Likewise.
5213 * print.c: Likewise.
5214 * process.c: Likewise.
5215 * region-cache.c: Likewise.
5216 * search.c: Likewise.
5217 * sysdep.c: Likewise.
5218 * termcap.c: Likewise.
5219 * terminal.c: Likewise.
5220 * tparam.c: Likewise.
5221 * w16select.c: Likewise.
5222 * w32.c: Likewise.
5223 * w32reg.c: Likewise.
5224 * w32select.c: Likewise.
5225 * w32uniscribe.c: Likewise.
5226 * widget.c: Likewise.
5227 * xdisp.c: Likewise.
5228 * xmenu.c: Likewise.
5229 * xrdb.c: Likewise.
5230 * xselect.c: Likewise.
5231
5232 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5233
5234 * fileio.c (time_error_value): Check the right error number.
5235 Problem reported by Troels Nielsen in
5236 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5237
5238 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5239
5240 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5241 This should be fixed in a better way; see Eli Zaretskii in
5242 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5243 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5244
5245 * fileio.c (time_error_value): Rename from special_mtime.
5246 The old name's problems were noted by Eli Zaretskii in
5247 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5248
5249 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5250 This variable's comment says Emacs needs at least one GDB-visible
5251 symbol of type enum pvec_type, to work around GDB problems.
5252 The symbol's value doesn't matter.
5253
5254 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5255 that causes compilation to fail on pre-C99 compilers.
5256
5257 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5258
5259 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5260 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5261
5262 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5263
5264 * buffer.c (init_buffer_once): Fix initialization of
5265 headers for buffer_defaults and buffer_local_symbols.
5266 Reported by Juanma Barranquero <lekktu@gmail.com>.
5267
5268 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5269
5270 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5271 * lisp.h (enum pvec_type): Use fewer bits.
5272 (PSEUDOVECTOR_SIZE_BITS): New constant.
5273 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5274 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5275 change in pvec_type.
5276 (PSEUDOVECTOR_TYPEP): New macro.
5277 (TYPED_PSEUDOVECTORP): Use it.
5278 * fns.c (internal_equal): Adapt code to extract pvectype.
5279 * emacs.c (gdb_pvec_type): Update type.
5280 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5281 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5282 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5283 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5284 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5285 abusing vector->header.next.nbytes.
5286 (live_vector_p): Use PVEC_TYPE.
5287 (mark_object): Adapt code to extract pvectype. Use switch.
5288
5289 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5290
5291 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5292 Tighten new eassert a bit.
5293
5294 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5295
5296 Fix compilation with --enable-gcc-warnings and -O1
5297 optimization level.
5298 * doprnt.c (doprnt): Change type of tem to int, initialize
5299 to avoid compiler warning. Add eassert.
5300 * search.c (simple_search): Initialize match_byte to avoid
5301 compiler warning. Add eassert.
5302
5303 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5304
5305 Avoid weird behavior with large horizontal scrolls.
5306 Without this change, for example, large hscroll values would
5307 mess up Emacs's display on Fedora 15 x86, presumably due to
5308 overflows in int calculations in the display code.
5309 Also, if buffers had long lines, Emacs would freeze.
5310 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5311 (set_window_hscroll): New function, containing the old guts of
5312 Fset_window_hscroll. Return the clipped value.
5313 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5314 This avoids the need to check against PTRDIFF_MAX.
5315
5316 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5317
5318 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5319
5320 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5321
5322 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5323
5324 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5325 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5326 since GCC 4.4.6 issues a bogus warning for them.
5327
5328 Fix bugs in file timestamp newness comparisons.
5329 * fileio.c (Ffile_newer_than_file_p):
5330 * lread.c (Fload): Use full timestamp resolution of files,
5331 not just the 1-second resolution, so that files that are only
5332 slightly newer still count as newer.
5333 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5334 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5335
5336 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5337
5338 * fileio.c: Improve handling of file time marker. (Bug#11852)
5339 (special_mtime): New function.
5340 (Finsert_file_contents, Fverify_visited_file_modtime):
5341 Use it to set special mtime values consistently.
5342
5343 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5344
5345 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5346 marker for non-existing file. (Bug#11852)
5347
5348 2012-07-03 Glenn Morris <rgm@gnu.org>
5349
5350 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5351 and did not make it into globals.h).
5352
5353 2012-07-03 Tom Tromey <tromey@redhat.com>
5354
5355 * window.c (Fset_window_margins, Fset_window_fringes)
5356 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5357 * textprop.c (Fprevious_property_change): No longer static.
5358 * syntax.c (Fsyntax_table_p): No longer static.
5359 * process.c (Fget_process, Fprocess_datagram_address): No longer
5360 static.
5361 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5362 * keyboard.c (Fcommand_execute): No longer static.
5363 Remove EXFUN.
5364 * insdel.c (Fcombine_after_change_execute): No longer static.
5365 * image.c (Finit_image_library): No longer static.
5366 * fileio.c (Fmake_symbolic_link): No longer static.
5367 * eval.c (Ffetch_bytecode): No longer static.
5368 * editfns.c (Fuser_full_name): No longer static.
5369 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5370 No longer static.
5371 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5372 static.
5373 * dired.c (Ffile_attributes): No longer static.
5374 * composite.c (Fcomposition_get_gstring): No longer static.
5375 * callproc.c (Fgetenv_internal): No longer static.
5376
5377 * ccl.h: Remove EXFUNs.
5378 * buffer.h: Remove EXFUNs.
5379 * dispextern.h: Remove EXFUNs.
5380 * intervals.h: Remove EXFUNs.
5381 * fontset.h: Remove EXFUN.
5382 * font.h: Remove EXFUNs.
5383 * dosfns.c (system_process_attributes): Remove EXFUN.
5384 * keymap.h: Remove EXFUNs.
5385 * lisp.h: Remove EXFUNs.
5386 * w32term.h: Remove EXFUNs.
5387 * window.h: Remove EXFUNs.
5388 * xsettings.h: Remove EXFUN.
5389 * xterm.h: Remove EXFUN.
5390
5391 2012-07-03 Glenn Morris <rgm@gnu.org>
5392
5393 * lisp.h (Frandom): Make it visible to C.
5394 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5395 buffer for invisible buffers. (Bug#1229)
5396
5397 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5398
5399 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5400 values which aren't power of 2.
5401 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5402 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5403 accordingly.
5404
5405 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5406
5407 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5408
5409 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5410
5411 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5412
5413 * alloc.c (allocate_vector_block): Remove redundant
5414 calls to mallopt if DOUG_LEA_MALLOC is defined.
5415 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5416 avoid calls to mallopt if zero_vector is returned.
5417
5418 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5419
5420 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5421 is enabled, avoid dereferencing NULL current_sblock if
5422 running undumped.
5423
5424 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5425
5426 Cleanup basic buffer management.
5427 * buffer.h (struct buffer): Change layout to use generic vector
5428 marking code. Fix some comments. Change type of 'clip_changed'
5429 to bitfield. Remove unused #ifndef old.
5430 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5431 (GET_OVERLAYS_AT): Fix indentation.
5432 (for_each_per_buffer_object_at): New macro.
5433 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5434 (Fbuffer_local_variables): Use it.
5435 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5436 * alloc.c (allocate_buffer): Adjust to match new layout of
5437 struct buffer. Fix comment.
5438 (mark_overlay): New function.
5439 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5440 Lisp area of struct buffer.
5441 (mark_object): Use it. Adjust marking of misc objects
5442 and related comments.
5443
5444 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5445
5446 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5447 wrapper that is not needed because the wrapped code is a no-op (zero
5448 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5449 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5450
5451 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5452
5453 * alloc.c (mark_buffer): Simplify. Remove prototype.
5454 (mark_object): Add comment. Reorganize marking of vector-like
5455 objects. Use CHECK_LIVE for all vector-like objects except buffers
5456 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5457 Avoid redundant calls to mark_vectorlike for bool vectors.
5458
5459 2012-06-30 Glenn Morris <rgm@gnu.org>
5460
5461 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5462
5463 * epaths.in (PATH_SITELOADSEARCH): New.
5464 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5465 This is rather than relying on --enable-locallisppath elements
5466 having "site-lisp" in their names. (Bug#10208#25, 11658)
5467
5468 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5469
5470 * w32proc.c (sys_select): Accept and ignore one more argument.
5471
5472 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5473
5474 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5475 (pselect) [!MS_DOS]: Redirect to sys_select.
5476
5477 * sysdep.c: Don't include dos.h and dosfns.h.
5478
5479 * process.c (sys_select):
5480 * msdos.c (sys_select): Accept one more argument and ignore it.
5481
5482 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5483 adapt data types and code to that.
5484
5485 * dosfns.c:
5486 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5487 which clashes with the gnulib function of the same name.
5488
5489 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5490
5491 * font.c (font_style_to_value, font_style_symbolic)
5492 (font_prop_validate_style): Add type checks for values in
5493 font_style_table.
5494
5495 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5496 argument.
5497 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5498 uses.
5499
5500 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5501
5502 * xdisp.c (try_window_id): Undo last change.
5503
5504 * w32.c (getwd): Adjust commentary about startup_dir.
5505 (init_environment): Always call sys_access, even in non-MSVC
5506 builds. Don't chdir to the directory of the Emacs executable.
5507 This undoes code from 1997 which was justified by the need to
5508 "avoid conflicts when removing and renaming directories". But its
5509 downside was that every relative file name was being interpreted
5510 relative to the directory of the Emacs executable, which can never
5511 be TRT. In particular, it broke sys_access when called with
5512 relative file names.
5513 (sys_access): Map GetLastError to errno.
5514
5515 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5516
5517 * window.h (struct window): Change type of 'fringes_outside_margins'
5518 to bitfield. Fix comment. Adjust users accordingly.
5519 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5520 Adjust comment.
5521 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5522 to ptrdiff_t.
5523
5524 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5525
5526 * gnutls.c (emacs_gnutls_handshake):
5527 Add QUIT to make the loop interruptible.
5528
5529 2012-06-29 Glenn Morris <rgm@gnu.org>
5530
5531 * charset.c (init_charset): Make lack of etc/charsets fatal.
5532
5533 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5534
5535 * editfns.c (region_limit): Fix type mismatch.
5536
5537 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5538
5539 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5540 undefined. Convert from xassert to eassert.
5541 * nsmenu.m: Convert from xassert to eassert.
5542 * nsterm.m: Likewise.
5543
5544 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5545
5546 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5547
5548 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5549
5550 Avoid integer overflow on scroll-left and scroll-right.
5551 * window.c (HSCROLL_MAX): New macro.
5552 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5553 overflow when requested scroll falls outside ptrdiff_t range.
5554
5555 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5556
5557 * window.h (struct window): Change type of 'hscroll',
5558 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5559 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5560 Adjust users accordingly.
5561 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5562 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5563 from EMACS_INT to ptrdiff_t.
5564 (make_window): Omit redundant initialization.
5565
5566 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5567
5568 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5569
5570 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5571
5572 * window.h (struct window): Change type of 'use_time' and
5573 'sequence_number' from Lisp_Object to int.
5574 * frame.c (make_frame): Adjust users accordingly.
5575 * print.c (print_object): Likewise.
5576 * window.c (select_window, Fwindow_use_time, make_parent_window)
5577 (make_window): Likewise.
5578
5579 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5580
5581 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5582 enabled with --enable-checking=[all,glyphs] configure option.
5583 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5584 adjust comments accordingly.
5585 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5586 undefined, adjust comments accordingly.
5587 * image.c: Likewise.
5588 * scroll.c: Likewise.
5589 * w32fns.c: Likewise.
5590 * w32term.c: Likewise.
5591 * xdisp.c: Likewise.
5592 * xfaces.c: Likewise.
5593 * xfns.c: Likewise.
5594 * xterm.c: Likewise.
5595
5596 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5597
5598 Generalize run-time debugging checks.
5599 * dispextern.h (XASSERTS): Remove.
5600 * fontset.c (xassert): Remove.
5601 Convert from xassert to eassert.
5602 * alloc.c: Convert from xassert to eassert.
5603 * bidi.c: Likewise.
5604 * dispnew.c: Likewise.
5605 * fns.c: Likewise.
5606 * fringe.c: Likewise.
5607 * ftfont.c: Likewise.
5608 * gtkutil.c: Likewise.
5609 * image.c: Likewise.
5610 * keyboard.c: Likewise.
5611 * menu.c: Likewise.
5612 * process.c: Likewise.
5613 * scroll.c: Likewise.
5614 * sound.c: Likewise.
5615 * term.c: Likewise.
5616 * w32console.c: Likewise.
5617 * w32fns.c: Likewise.
5618 * w32term.c: Likewise.
5619 * window.c: Likewise.
5620 * xdisp.c: Likewise.
5621 * xfaces.c: Likewise.
5622 * xfns.c: Likewise.
5623 * xselect.c: Likewise.
5624 * xterm.c: Likewise.
5625
5626 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5627
5628 * fns.c (maybe_resize_hash_table): Output message when growing the
5629 purify-hashtable.
5630
5631 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5632
5633 * alloc.c (allocate_string_data): Remove dead code.
5634 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5635 avoid GCC warning about unused macro.
5636
5637 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5638
5639 * alloc.c (allocate_string): Omit intervals initialization.
5640 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5641 as in make_pure_string and make_pure_c_string.
5642
5643 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5644
5645 * alloc.c (allocate_string): Fix last change.
5646
5647 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5648
5649 * alloc.c (allocate_string): Remove two redundant calls
5650 to memset, add explicit initialization where appropriate.
5651
5652 2012-06-27 Glenn Morris <rgm@gnu.org>
5653
5654 * lisp.mk (lisp): Remove paths.elc.
5655
5656 2012-06-27 Chong Yidong <cyd@gnu.org>
5657
5658 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5659
5660 2012-06-26 John Wiegley <johnw@newartisans.com>
5661
5662 * unexmacosx.c (copy_data_segment): Add two section names used
5663 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5664
5665 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5666 when building with Clang.
5667
5668 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5669
5670 * eval.c (Fapply): Allow calling it with a single argument.
5671
5672 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5673
5674 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5675 _stricmp and _strnicmp.
5676 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5677
5678 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5679
5680 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5681 allocated window.
5682 (allocate_process): Likewise for new process.
5683 (allocate_terminal): Change to use offsetof.
5684 (allocate_frame): Likewise.
5685 * frame.c (make_frame): Omit redundant initialization.
5686 * window.c (make_parent_window): Use memset.
5687 (make_window): Omit redundant initialization.
5688 * process.c (make_process): Omit redundant initialization.
5689 * terminal.c (create_terminal): Likewise.
5690
5691 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5692
5693 * term.c (delete_tty): Remove redundant call to memset.
5694
5695 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5696
5697 * alloc.c: Remove build_string.
5698 * lisp.h: Define build_string as static inline. This provides
5699 a better opportunity to optimize away calls to strlen when the
5700 function is called with compile-time constant argument.
5701 * image.c (imagemagick_error): Convert to build_string.
5702 * w32proc.c (sys_spawnve): Likewise.
5703 * xterm.c (x_term_init): Likewise.
5704
5705 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5706
5707 Use sprintf return value instead of invoking strlen on result.
5708 In the old days this wasn't portable, since some sprintf
5709 implementations returned char *. But they died out years ago and
5710 Emacs already assumes sprintf returns int.
5711 Similarly for float_to_string.
5712 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5713 * ccl.c (ccl_driver):
5714 * character.c (string_escape_byte8):
5715 * data.c (Fnumber_to_string):
5716 * doprnt.c (doprnt):
5717 * print.c (print_object):
5718 * xdisp.c (message_dolog):
5719 * xfns.c (syms_of_xfns):
5720 Use sprintf or float_to_string result to avoid need to call strlen.
5721 * data.c (Fnumber_to_string):
5722 Use make_unibyte_string, since the string must be ASCII.
5723 * lisp.h, print.c (float_to_string): Now returns int length.
5724 * term.c (produce_glyphless_glyph):
5725 Use sprintf result rather than recomputing it.
5726
5727 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5728 * Makefile.in (ALL_CFLAGS):
5729 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5730 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5731
5732 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5733
5734 * dispextern.h (xstrcasecmp): Define to library function
5735 strcasecmp if available.
5736 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5737
5738 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5739
5740 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5741 Avoid comma operator.
5742 * menu.c (push_submenu_start, push_submenu_end)
5743 (push_left_right_boundary, push_menu_pane): Likewise.
5744 * msdos.c (dos_rawgetc): Likewise.
5745
5746 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5747
5748 * xfns.c (xic_create_fontsetname): Remove redundant calls
5749 to memset.
5750
5751 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5752
5753 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5754 sprintf already null-terminates its output.
5755
5756 * xfns.c (x_window): Remove redundant cast.
5757
5758 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5759
5760 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5761 `const char *' to `char *' to avoid compiler warning.
5762
5763 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5764
5765 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5766 instead of truncating it to 63 (admittedly a generous limit).
5767
5768 * process.c: Fix spelling and caps in comments.
5769
5770 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5771
5772 * emacs.c (setpgrp): Remove definition, unused.
5773 * sysdep.c (setpgrp): Remove definition, not used in this file.
5774
5775 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5776
5777 * makefile.w32-in: Update dependencies.
5778
5779 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5780
5781 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5782 (SYSTIME_H): Add nt/inc/sys/time.h.
5783
5784 * systime.h [WINDOWSNT]: Include sys/time.h.
5785
5786 * s/ms-w32.h (struct timespec): Definition moved from
5787 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5788
5789 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5790
5791 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5792 * buffer.h (buffer_slot_type_mismatch):
5793 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5794 * eval.c (unwind_to_catch):
5795 * image.c (my_png_error, my_error_exit):
5796 * keyboard.c (quit_throw_to_read_char, user_error)
5797 (Fexit_recursive_edit, Fabort_recursive_edit):
5798 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5799 (wrong_type_argument, buffer_overflow, __executable_start)
5800 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5801 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5802 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5803 (fatal):
5804 (child_setup) [!DOS_NT]:
5805 * lread.c (end_of_file_error, invalid_syntax):
5806 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5807 * puresize.h (pure_write_error):
5808 * search.c (matcher_overflow):
5809 * sound.c (sound_perror, alsa_sound_perror):
5810 * sysdep.c, syssignal.h (croak):
5811 * term.c (maybe_fatal, vfatal):
5812 * textprop.c (text_read_only):
5813 * undo.c (user_error):
5814 * unexmacosx.c (unexec_error):
5815 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5816 Use _Noreturn rather than NO_RETURN.
5817 No need for separate decl merely because of _Noreturn.
5818 * sound.c (sound_warning, parse_sound):
5819 Remove unnecessary forward decls.
5820
5821 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5822
5823 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5824 * lisp.h (WAIT_READING_MAX): New macro.
5825 * dispnew.c (Fsleep_for, sit_for):
5826 * keyboard.c (kbd_buffer_get_event):
5827 * process.c (Faccept_process_output):
5828 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5829 This improves on the previous patch, which introduced a bug
5830 when time_t is unsigned and as wide as intmax_t.
5831 See <http://bugs.gnu.org/9000#51>.
5832
5833 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5834
5835 * dispnew.c (sit_for, Fsleep_for):
5836 * keyboard.c (kbd_buffer_get_event):
5837 * process.c (Faccept_process_output): Avoid compiler warnings when
5838 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5839
5840 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5841
5842 * makefile.w32-in: Update dependencies.
5843
5844 * w32.c (ltime): Add return type and declare static.
5845 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5846
5847 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5848
5849 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5850 Privately reported by Herbert J. Skuhra.
5851 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5852 All uses changed.
5853 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5854 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5855
5856 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5857
5858 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5859 last argument of make_unibyte_string.
5860
5861 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5862 language ID in the event parameters.
5863
5864 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5865 event.code, not the obscure "character set ID".
5866
5867 2012-06-23 Chong Yidong <cyd@gnu.org>
5868
5869 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5870
5871 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5872
5873 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5874 * w32.c (fdutimens): New function.
5875
5876 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5877
5878 * s/ms-w32.h (pselect): Redirect to sys_select.
5879
5880 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5881
5882 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5883 in the logic of incrementing and decrementing the value of
5884 use_relocatable_buffers.
5885
5886 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5887
5888 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5889 Privately reported by Herbert J. Skuhra.
5890 [__FreeBSD__]: Remove "*/" typo after "#include".
5891 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5892 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5893 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5894 Don't assume EMACS_TIME and struct timeval are the same type.
5895
5896 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5897
5898 Support higher-resolution time stamps (Bug#9000).
5899 The time stamps are only nanosecond-resolution at the C level,
5900 since that's the best that any real-world system supports now.
5901 But they are picosecond-resolution at the Lisp level, as that's
5902 easy, and leaves room for future OS improvements.
5903
5904 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5905 (LIBES): Use it.
5906
5907 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5908 Don't get current time unless it's needed.
5909
5910 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5911 now provides it if it's absent.
5912 (start_atimer): Port to higher-res time stamps.
5913 Check for time stamp overflow. Don't get current time more
5914 often than is needed.
5915
5916 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5917 Include systime.h, not time.h.
5918 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5919
5920 * dired.c: Include stat-time.h.
5921 (Ffile-attributes): File times now have higher resolution.
5922
5923 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5924 (struct image): Timestamp now has higher resolution.
5925
5926 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5927 has at least microseconds now. All uses removed.
5928 (update_frame, update_single_window, update_window, update_frame_1)
5929 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5930 (duration_to_sec_usec): Remove; no longer needed.
5931
5932 * editfns.c (time_overflow): Now extern.
5933 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5934 (float-time, Fformat_time_string, Fcurrent_time_string)
5935 (Fcurrent_time_zone): Accept and generate higher-resolution
5936 time stamps.
5937 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5938 (decode_time_components, lisp_seconds_argument): New functions.
5939 (make_time): Now static.
5940 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5941 Report an error if the time is invalid, rather than having the caller
5942 do that.
5943
5944 * fileio.c: Include <stat-time.h>
5945 (Fcopy_file): Copy higher-resolution time stamps.
5946 Prefer to set the time stamp via a file descriptor if that works.
5947 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5948 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5949 (Fvisited_file_modtime, Fset_visited_file_modtime):
5950 Support higher-resolution time stamps.
5951
5952 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5953
5954 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5955
5956 * image.c (prepare_image_for_display, clear_image_cache)
5957 (lookup_image): Port to higer-resolution time stamps.
5958
5959 * keyboard.c (start_polling, bind_polling_period):
5960 Check for time stamp overflow.
5961 (read_char, kbd_buffer_get_event, timer_start_idle)
5962 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5963 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5964 Port to higher-resolution time stamps. Do not assume time_t is signed.
5965 (decode_timer): New function. Timers are now vectors of length 9,
5966 not 8, to accommodate the picosecond component.
5967 (timer_check_2): Use it.
5968
5969 * nsterm.m (select_timeout, timeval_subtract): Remove.
5970 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5971 as they're a bit more accurate and handle overflow better.
5972 (ns_select): Change prototype to be compatible with pselect.
5973 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5974 * nsterm.h (ns_select): Adjust prototype.
5975
5976 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5977 us-resolution time stamps.
5978 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5979
5980 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5981
5982 * lisp.h (time_overflow): New decl.
5983 (wait_reading_process_output): First arg is now intmax_t, not int,
5984 to accommodate larger waits.
5985
5986 * process.h (struct Lisp_Process.read_output_delay):
5987 Now counts nanoseconds, not microseconds.
5988 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5989 EMACS_HAS_USECS.
5990 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5991 (wait_reading_process_output):
5992 Port to ns-resolution time stamps.
5993 (Faccept_process_output, wait_reading_process_output):
5994 Check for time stamp overflow. Do not assume time_t is signed.
5995 (select_wrapper): Remove; we now use pselect.
5996 (Fprocess_attributes): Now generates ns-resolution time stamps.
5997
5998 * sysdep.c: Include utimens.h. Don't include utime.h
5999 or worry about struct utimbuf; gnulib does that for us now.
6000 (gettimeofday): Remove; gnulib provides a substitute.
6001 (make_timeval): New function.
6002 (set_file_times): Now sets ns-resolution time stamps.
6003 New arg FD; all uses changed.
6004 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6005 (system_process_attributes):
6006 Now returns ns-resolution time stamp. All uses changed.
6007 Check for time stamp overflow.
6008
6009 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6010 provides a substitute now.
6011
6012 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6013 since it guarantees struct timespec.
6014 (EMACS_TIME): Now struct timespec, so that we can support
6015 ns-resolution time stamps.
6016 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6017 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6018 (EMACS_USECS): Remove.
6019 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6020 so multiply the arg by 1000 before storing it.
6021 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6022 New macros.
6023 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6024 Port to ns-resolution time stamps.
6025 (EMACS_TIME_NEG_P): Remove; replaced by....
6026 (EMACS_TIME_SIGN): New macro.
6027 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6028 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6029 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6030 (make_timeval, make_lisp_time, decode_time_components): New decls.
6031 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6032 that it mishandled time_t overflow. You can't compare by subtracting!
6033 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6034 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6035
6036 * term.c: Include <sys/time.h>.
6037 (timeval_to_Time): New function, for proper overflow wraparound.
6038 (term_mouse_position, term_mouse_click): Use it.
6039
6040 * undo.c (record_first_change): Support higher-resolution time stamps
6041 in the undo buffer.
6042 (Fprimitive_undo): Use them when restoring time stamps.
6043
6044 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6045 (w32_get_internal_run_time):
6046 Port to higher-resolution Emacs time stamps.
6047 (ltime): Now accepts single 64-bit integer, as that's more convenient
6048 for callers.
6049
6050 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6051
6052 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6053 for compatibility with pselect. Support ns-resolution time stamps.
6054
6055 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6056
6057 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6058 Check for time stamp overflow, and support ns-resolution time stamps.
6059
6060 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6061 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6062 (timeval_subtract): Remove; no longer needed.
6063 (XTflash, XTring_bell, x_wait_for_event):
6064 Port to ns-resolution time stamps. Don't assume time_t is signed.
6065
6066 2012-06-22 Chong Yidong <cyd@gnu.org>
6067
6068 * xdisp.c (x_consider_frame_title): Revert last change.
6069
6070 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6071
6072 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6073 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6074 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6075 staticidx goes up to 1597 out of 1600 = 0x640.)
6076
6077 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6078
6079 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6080 Otherwise, the umask might be mistakenly 0 while handling input signals.
6081
6082 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6083
6084 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6085
6086 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6087
6088 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6089 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6090 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6091 access to `contents' member of Lisp_Vector objects with AREF and ASET
6092 where appropriate.
6093
6094 2012-06-19 Chong Yidong <cyd@gnu.org>
6095
6096 * frame.c (delete_frame): When selecting a frame on a different
6097 text terminal, do not alter the terminal's top-frame.
6098
6099 * xdisp.c (format_mode_line_unwind_data): Record the target
6100 frame's selected window and its terminal's top-frame.
6101 (unwind_format_mode_line): Restore them.
6102 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6103 Callers changed.
6104 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6105 since tty frames can be explicitly named.
6106 (prepare_menu_bars): Likewise.
6107
6108 * term.c (Ftty_top_frame): New function.
6109
6110 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6111
6112 Port byte-code-meter to modern targets.
6113 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6114 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6115 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6116 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6117 (METER_1, METER_2): Simplify.
6118
6119 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6120
6121 * data.c (Fdefalias): Return `symbol' (bug#11686).
6122
6123 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6124
6125 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6126 gets killed during executing of this function (Bug#11665).
6127 Try to always return Qt when the buffer has been actually killed.
6128 (Vkill_buffer_query_functions): In doc-string say that functions
6129 run by this hook should not change the current buffer.
6130
6131 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6132
6133 Fix recently-introduced process.c problems found by static checking.
6134 * process.c (write_queue_push, write_queue_pop, send_process):
6135 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6136 (write_queue_pop): Fix pointer signedness problem.
6137 (send_process): Remove unused local.
6138
6139 2012-06-17 Chong Yidong <cyd@gnu.org>
6140
6141 * xdisp.c (redisplay_internal): No need to redisplay terminal
6142 frames that are not on top.
6143
6144 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6145
6146 * process.c (make_process): Initialize write_queue.
6147 (write_queue_push, write_queue_pop): New functions.
6148 (send_process): Use them to maintain correct ordering of process
6149 writes (Bug#10815).
6150
6151 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6152
6153 * lisp.h (eassert): Assume C89 or later.
6154 This removes the need for CHECK.
6155 (CHECK): Remove. Its comments about always evaluating its
6156 argument were confusing, as 'eassert' typically does not evaluate
6157 its argument.
6158
6159 * coding.c (produce_chars): Use ptrdiff_t, not int.
6160
6161 * xterm.c (x_draw_underwave): Check for integer overflow.
6162 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6163
6164 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6165
6166 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6167 referenced (Bug#11583).
6168
6169 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6170
6171 Implement wave-style variant of underlining.
6172 * dispextern.h (face_underline_type): New enum.
6173 (face): Add field for underline type.
6174 * nsterm.m (ns_draw_underwave): New function.
6175 (ns_draw_text_decoration): Use it.
6176 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6177 New functions.
6178 (x_draw_glyph_string): Use them.
6179 * xfaces.c (Qline, Qwave): New Lisp objects.
6180 (check_lface_attrs, merge_face_ref)
6181 (Finternal_set_lisp_face_attribute, realize_x_face):
6182 Handle wave-style underline face attributes.
6183 * xterm.c (x_draw_underwave): New function.
6184 (x_draw_glyph_string): Use it.
6185
6186 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6187
6188 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6189 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6190 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6191 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6192 ($(BLD)/w32select.$(O)): Update dependencies.
6193
6194 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6195
6196 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6197 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6198 * character.c (_fetch_multibyte_char_p): Remove.
6199 * alloc.c: Include "character.h" before "buffer.h".
6200 * bidi.c: Likewise.
6201 * buffer.c: Likewise.
6202 * bytecode.c: Likewise.
6203 * callint.c: Likewise.
6204 * callproc.c: Likewise.
6205 * casefiddle.c: Likewise.
6206 * casetab.c: Likewise.
6207 * category.c: Likewise.
6208 * cmds.c: Likewise.
6209 * coding.c: Likewise.
6210 * composite.c: Likewise.
6211 * dired.c: Likewise.
6212 * dispnew.c: Likewise.
6213 * doc.c: Likewise.
6214 * dosfns.c: Likewise.
6215 * editfns.c: Likewise.
6216 * emacs.c: Likewise.
6217 * fileio.c: Likewise.
6218 * filelock.c: Likewise.
6219 * font.c: Likewise.
6220 * fontset.c: Likewise.
6221 * fringe.c: Likewise.
6222 * indent.c: Likewise.
6223 * insdel.c: Likewise.
6224 * intervals.c: Likewise.
6225 * keyboard.c: Likewise.
6226 * keymap.c: Likewise.
6227 * lread.c: Likewise.
6228 * macros.c: Likewise.
6229 * marker.c: Likewise.
6230 * minibuf.c: Likewise.
6231 * nsfns.m: Likewise.
6232 * nsmenu.m: Likewise.
6233 * print.c: Likewise.
6234 * process.c: Likewise.
6235 * regex.c: Likewise.
6236 * region-cache.c: Likewise.
6237 * search.c: Likewise.
6238 * syntax.c: Likewise.
6239 * term.c: Likewise.
6240 * textprop.c: Likewise.
6241 * undo.c: Likewise.
6242 * unexsol.c: Likewise.
6243 * w16select.c: Likewise.
6244 * w32fns.c: Likewise.
6245 * w32menu.c: Likewise.
6246 * window.c: Likewise.
6247 * xdisp.c: Likewise.
6248 * xfns.c: Likewise.
6249 * xmenu.c: Likewise.
6250 * xml.c: Likewise.
6251 * xselect.c: Likewise.
6252
6253 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6254
6255 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6256 If all the glyphs of the glyph row came from strings, and we have no
6257 cursor positioning clues, put the cursor on the first glyph of the
6258 row.
6259 (handle_face_prop): Use chunk-relative overlay string index when
6260 indexing into it->string_overlays array. (Bug#11653)
6261 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6262 the rightmost. (Bug#11720)
6263
6264 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6265
6266 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6267 (CATEGORY_MEMBER): Enforce 1/0 value.
6268 * category.c (_temp_category_set): Remove.
6269
6270 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6271
6272 * window.c (Fdelete_other_windows_internal)
6273 (Fdelete_window_internal): Don't access frame's mouse highlight
6274 info of the initial frame. (Bug#11677)
6275
6276 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6277
6278 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6279 Assume USE_2_TAGS_FOR_INTS.
6280 (xreload): Adjust $tagmask width to match recent lisp.h change.
6281
6282 Simplify lisp.h in minor ways that should not affect code.
6283 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6284 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6285 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6286 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6287 (INTTYPEBITS): New macro, for clarity.
6288 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6289 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6290 Simplify now that USE_LSB_TAG is always defined.
6291 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6292 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6293
6294 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6295
6296 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6297
6298 2012-06-13 Glenn Morris <rgm@gnu.org>
6299
6300 * s/bsd-common.h (BSD4_3):
6301 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6302
6303 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6304
6305 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6306 instead of union.
6307 (XLI, XIL): Define.
6308 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6309 Use them.
6310 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6311 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6312 * alloc.c (widen_to_Lisp_Object): Remove.
6313 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6314 * frame.c (delete_frame): Remove outdated comment.
6315 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6316 USE_LISP_UNION_TYPE.
6317 (Fw32_unregister_hot_key): Likewise.
6318 (Fw32_toggle_lock_key): Likewise.
6319 * w32menu.c (add_menu_item): Likewise.
6320 (w32_menu_display_help): Use XIL instead of checking
6321 USE_LISP_UNION_TYPE.
6322 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6323 (init_heap): Likewise.
6324 * w32term.c (w32_read_socket): Update comment.
6325
6326 2012-06-13 Glenn Morris <rgm@gnu.org>
6327
6328 * s/usg5-4-common.h, src/s/unixware.h:
6329 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6330
6331 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6332
6333 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6334
6335 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6336 * alloc.c (make_number) [!defined make_number]:
6337 Remove, as lisp.h always defines this now.
6338 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6339 (roundup_size): Verify that it is a power of 2.
6340 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6341 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6342 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6343 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6344 USE_LSB_TAG now is always defined to be either 0 or 1.
6345 All uses changed.
6346 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6347 code works fine either way, and efficiency is not a concern here,
6348 as the union type is for debugging, not for production.
6349 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6350 Use an inline function on all platforms when using the union type,
6351 since this is simpler and 'static inline' can be used portably
6352 within Emacs now.
6353 (LISP_INITIALLY_ZERO): New macro.
6354 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6355 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6356
6357 2012-06-12 Glenn Morris <rgm@gnu.org>
6358
6359 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6360
6361 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6362
6363 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6364 Move BROKEN_SIGIO to configure.
6365
6366 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6367 Move NO_TERMIO to configure.
6368
6369 2012-06-12 Chong Yidong <cyd@gnu.org>
6370
6371 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6372 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6373 MagickExportImagePixels is undefined.
6374
6375 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6376
6377 * image.c (imagemagick_load_image): Remove unused label.
6378
6379 2012-06-11 Glenn Morris <rgm@gnu.org>
6380
6381 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6382 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6383 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6384 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6385
6386 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6387
6388 * alloc.c (make_byte_code): New function.
6389 (Fmake_byte_code): Use it. Don't purify here.
6390 * lread.c (read1): Use it as well to avoid extra allocation.
6391
6392 2012-06-11 Chong Yidong <cyd@gnu.org>
6393
6394 * image.c (imagemagick_load_image): Implement transparency.
6395
6396 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6397
6398 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6399 account for preceding backslashes. (Bug#11663)
6400
6401 2012-06-09 Chong Yidong <cyd@gnu.org>
6402
6403 * term.c: Support italics in capable terminals (Bug#9652).
6404 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6405 (turn_on_face): Output using TS_enter_italic_mode if available.
6406 Don't handle unused blinking and alt-charset cases.
6407 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6408 and tty_alt_charset_p cases.
6409 (tty_capable_p, init_tty): Support italics.
6410
6411 * termchar.h (struct tty_display_info): Add field for italics.
6412 Remove unused blink field.
6413
6414 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6415 Handle slant.
6416
6417 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6418 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6419 tty_alt_charset_p. Add tty_italic_p.
6420
6421 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6422
6423 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6424 dbus_type_is_basic if available.
6425 (xd_extract_signed, xd_extract_unsigned): Rename from
6426 extract_signed and extract_unsigned, respectively. Adapt callers.
6427
6428 2012-06-09 Chong Yidong <cyd@gnu.org>
6429
6430 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6431
6432 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6433 case (Bug#9752).
6434
6435 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6436
6437 * xdisp.c (vmessage): Treat frame message as multibyte.
6438 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6439 would generate the diagnostic "Making \302\247 buffer-local while
6440 let-bound!".
6441
6442 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6443
6444 * dispnew.c (showing_window_margins_p): Undo last change, which
6445 was done due to an inadvertent commit.
6446 (adjust_frame_glyphs_for_frame_redisplay): Do call
6447 showing_window_margins_p.
6448
6449 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6450
6451 * eval.c (Fmake_var_non_special): New primitive.
6452 (syms_of_eval): Defsubr it.
6453 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6454
6455 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6456
6457 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6458 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6459
6460 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6461
6462 * alloc.c (allocate_vectorlike): Fix last change.
6463
6464 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6465
6466 Block-based vector allocation of small vectors.
6467 * lisp.h (struct vectorlike_header): New field `nbytes',
6468 adjust comment accordingly.
6469 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6470 to denote vector blocks. Adjust users (live_vector_p,
6471 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6472 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6473 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6474 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6475 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6476 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6477 (roundup_size): New constant.
6478 (struct vector_block): New data type.
6479 (vector_blocks, vector_free_lists, zero_vector): New variables.
6480 (all_vectors): Rename to `large_vectors'.
6481 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6482 (sweep_vectors): New functions.
6483 (allocate_vectorlike): Return `zero_vector' as the only vector of
6484 0 items. Allocate new vector from block if vector size is less than
6485 or equal to VBLOCK_BYTES_MAX.
6486 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6487 (init_alloc_once): Add call to init_vectors.
6488
6489 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6490
6491 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6492
6493 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6494
6495 * doprnt.c (doprnt): Truncate multibyte char correctly.
6496 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6497 would mishandle a string argument "Xc" if X was a multibyte
6498 character of length 2: it would truncate after X's first byte
6499 rather than including all of X.
6500
6501 2012-06-06 Chong Yidong <cyd@gnu.org>
6502
6503 * buffer.c (word_wrap): Doc fix.
6504
6505 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6506
6507 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6508
6509 2012-06-03 Glenn Morris <rgm@gnu.org>
6510
6511 * xdisp.c (tool-bar-style): Doc fix.
6512
6513 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6514
6515 * Makefile.in (PAXCTL): Define.
6516 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6517 binary via PaX flags if the paxctl utility is available.
6518 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6519 Restore PaX flags to their default. (Bug#11398)
6520
6521 2012-06-03 Chong Yidong <cyd@gnu.org>
6522
6523 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6524 buffer (Bug#11226).
6525
6526 2012-06-03 Chong Yidong <cyd@gnu.org>
6527
6528 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6529 (note_mode_line_or_margin_highlight): If there is no help echo,
6530 use mode-line-default-help-echo. Handle the case where the mouse
6531 position is past the end of the mode line string.
6532
6533 * buffer.c (buffer_local_value_1): New function, split from
6534 Fbuffer_local_value; can return Qunbound.
6535 (Fbuffer_local_value): Use it.
6536 (Vmode_line_format): Docstring tweaks.
6537
6538 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6539
6540 * sysdep.c (system_process_attributes): Improve comment.
6541
6542 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6543
6544 * keyboard.c: Export real-this-command to Elisp.
6545 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6546 and DEFVAR it. Update all users.
6547
6548 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6549
6550 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6551
6552 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6553 Convert pctcpu and pctmem to Lisp float properly.
6554 Let the compiler fold better, as 100.0/0x8000 is exact.
6555
6556 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6557
6558 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6559 cons_block.
6560
6561 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6562
6563 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6564
6565 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6566
6567 For a 'struct window', replace some Lisp_Object fields to
6568 bitfields where appropriate, remove unused fields.
6569 * window.h (struct window): Remove unused 'last_mark_x' and
6570 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6571 change it's type from Lisp_Object to bitfield.
6572 Change type of 'force_start', 'optional_new_start',
6573 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6574 fields from Lisp_Object to bitfield. Adjust users accordingly.
6575
6576 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6577
6578 Pacify gcc -Wdouble-precision when using Xaw.
6579 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6580 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6581 Use 'float' consistently, rather than 'float' in most places
6582 and 'double' in a couple of places.
6583
6584 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6585
6586 * xdisp.c (handle_stop): Detect whether we have overlay strings
6587 loaded by testing it->current.overlay_string_index to be
6588 non-negative, instead of checking whether n_overlay_strings is
6589 positive. (Bug#11587)
6590
6591 2012-05-31 Chong Yidong <cyd@gnu.org>
6592
6593 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6594
6595 * doc.c (Fsubstitute_command_keys): Doc fix.
6596
6597 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6598
6599 * search.c (search_buffer): Remove calls to
6600 r_alloc_inhibit_buffer_relocation, as it is now called by
6601 maybe_unify_char, which was the cause of relocation of buffer text
6602 in bug#11519.
6603
6604 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6605
6606 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6607 for the duration of call to load_charset, to avoid problems with
6608 callers of maybe_unify_char that access buffer text through C
6609 pointers.
6610
6611 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6612 decrement the inhibition flag, instead of just setting or
6613 resetting it.
6614
6615 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6616
6617 Remove obsolete '#define static' cruft.
6618 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6619 This #undef was "temporary" in 2000; it is no longer needed
6620 now that '#define static' has gone away.
6621 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6622 (gray_bitmap_bits): Remove; no longer needed.
6623 All uses replaced with definiens.
6624 * xterm.c: Include "bitmaps/gray.xbm".
6625
6626 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6627
6628 Clean up __executable_start, monstartup when --enable-profiling.
6629 The following changes affect the code only when profiling.
6630 * dispnew.c (__executable_start): Rename from safe_bcopy.
6631 Define only on platforms that need it.
6632 * emacs.c: Include <sys/gmon.h> when profiling.
6633 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6634 (__executable_start): Remove decl, since lisp.h does it now.
6635 (safe_bcopy): Remove decl; no longer has that name.
6636 (main): Coalesce #if into single bit of code, for simplicity.
6637 Cast pointers to uintptr_t, since standard libraries want integers
6638 and not pointers.
6639 * lisp.h (__executable_start): New decl.
6640
6641 2012-05-31 Glenn Morris <rgm@gnu.org>
6642
6643 * image.c (Fimagemagick_types): Doc fix.
6644
6645 2012-05-30 Jim Meyering <meyering@redhat.com>
6646
6647 * callproc.c (Fcall_process_region): Include directory component
6648 in mkstemp error message (Bug#11586).
6649
6650 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6651
6652 * alloc.c, lisp.h (make_pure_vector): Now static.
6653
6654 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6655
6656 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6657 Move to byte-run.el.
6658 (Fautoload): Do the hash-doc more carefully.
6659 * data.c (Fdefalias): Purify definition, except for keymaps.
6660 (Qdefun): Move from eval.c.
6661 * lisp.h (Qdefun): Remove.
6662 * lread.c (read1): Tiny simplification.
6663
6664 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6665
6666 Do not create empty overlays with the evaporate property (Bug#9642).
6667 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6668 Bug#9642, but explicitly check that the buffer the overlay would
6669 be moved to is live and rearrange lines to make sure that errors
6670 will not put the overlay in an inconsistent state.
6671 (Fdelete_overlay): Cosmetics.
6672
6673 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6674
6675 * w32term.c (my_bring_window_to_top): New function.
6676 (x_raise_frame): Use handle returned by DeferWindowPos, which
6677 could be different from the original one.
6678 Call my_bring_window_to_top instead of my_set_foreground_window.
6679 (Bug#11513)
6680
6681 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6682 by calling BringWindowToTop.
6683
6684 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6685 (WM_EMACS_END): Increase by one.
6686
6687 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6688
6689 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6690 This avoids undefined behavior that might cause the eassert
6691 to not catch an out-of-range value.
6692
6693 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6694
6695 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6696 Update dependencies.
6697
6698 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6699
6700 * bidi.c (bidi_mirror_char): Fix last change.
6701
6702 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6703
6704 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6705 when referring to sectname field in printf format.
6706
6707 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6708
6709 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6710 Only r_alloc_inhibit_buffer_relocation needed to be added;
6711 the others were already declared.
6712
6713 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6714 before checking whether it's out of range. Put the check inside
6715 eassert. See
6716 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6717
6718 2012-05-27 Ken Brown <kbrown@cornell.edu>
6719
6720 * callproc.c (Fcall_process): Restore a line that was accidentally
6721 commented out in the 2011-02-13 change (bug#11547).
6722
6723 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6724
6725 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6726 defined on ralloc.c.
6727
6728 * buffer.c [REL_ALLOC]: Remove prototypes of
6729 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6730 they are now on lisp.h.
6731
6732 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6733
6734 * search.c (search_buffer): Use it to inhibit relocation of buffer
6735 text while re_search_2 is doing its job, because re_search_2 is
6736 passed C pointers to buffer text. (Bug#11519)
6737
6738 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6739 Update value to 24.
6740
6741 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6742 state after an additional call to move_it_in_display_line_to, keep
6743 the values of it->max_ascent and it->max_descent found for the
6744 entire line.
6745 (pos_visible_p): Revert the comparison against bottom_y to what it
6746 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6747 (Bug#11464)
6748
6749 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6750
6751 Fix coding-related core dumps with gcc -ftrapv.
6752 The code was computing A - B, where A and B are pointers, and B is
6753 random garbage. This can lead to core dumps on platforms that
6754 have special pointer registers, and it also leads to core dumps on
6755 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6756 A - B only when B is initialized properly.
6757 * coding.c (coding_set_source, coding_set_destination): Return void.
6758 (coding_change_source, coding_change_destinations): New functions,
6759 with the old behaviors of coding_set_source and coding_set_destination.
6760 All callers that need an offset changed to use these new functions.
6761
6762 2012-05-26 Glenn Morris <rgm@gnu.org>
6763
6764 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6765
6766 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6767
6768 Extend mouse support on W32 text-mode console.
6769 * xdisp.c (draw_row_with_mouse_face):
6770 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6771
6772 * w32console.c: Include window.h.
6773 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6774 New functions.
6775 (initialize_w32_display): Initialize mouse-highlight data.
6776
6777 * w32inevt.c: Include termchar.h and window.h.
6778 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6779 moves, call note_mouse_highlight. If help_echo changed, call
6780 gen_help_event to produce help-echo message in the echo area.
6781 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6782 highlight info.
6783
6784 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6785
6786 * lread.c (read1): Simplify slightly to avoid an overflow warning
6787 with GCC 4.7.0 on x86-64.
6788
6789 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6790
6791 * bidi.c (bidi_mirror_char): Revert last change: an int is
6792 definitely wide enough here.
6793
6794 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6795
6796 Fix integer width and related bugs (Bug#9874).
6797 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6798 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6799 (string_bytes, check_sblock, allocate_string_data):
6800 (compact_small_strings, Fmake_bool_vector, make_string)
6801 (make_unibyte_string, make_multibyte_string)
6802 (make_string_from_bytes, make_specified_string)
6803 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6804 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6805 (mark_vectorlike):
6806 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6807 (allocate_pseudovector):
6808 Use int, not EMACS_INT, where int is wide enough.
6809 (inhibit_garbage_collection, Fgarbage_collect):
6810 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6811 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6812 int might not be wide enough.
6813 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6814 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6815 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6816 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6817 (bidi_level_of_next_char, bidi_move_to_visually_next):
6818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6819 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6820 (Fkill_buffer, Fset_buffer_major_mode)
6821 (advance_to_char_boundary, Fbuffer_swap_text)
6822 (Fset_buffer_multibyte, overlays_at, overlays_in)
6823 (overlay_touches_p, struct sortvec, record_overlay_string)
6824 (overlay_strings, recenter_overlay_lists)
6825 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6826 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6827 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6828 (Foverlay_recenter, last_overlay_modification_hooks_used)
6829 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6830 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6831 (validate_region): Omit unnecessary test for b <= e,
6832 since that's guaranteed by the previous test.
6833 (adjust_overlays_for_delete): Avoid pos + length overflow.
6834 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6835 (report_overlay_modification):
6836 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6837 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6838 Omit pointer cast, which isn't needed anyway, and doesn't work
6839 after the EMACS_INT -> ptrdiff_t change.
6840 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6841 * buffer.h: Adjust decls to match defn changes elsewhere.
6842 (struct buffer_text, struct buffer):
6843 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6844 Use EMACS_INT, not int, where int might not be wide enough.
6845 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6846 not int, to avoid needless 32-bit limit on 64-bit hosts.
6847 (exec_byte_code): Use tighter memory-full test, one that checks
6848 for alloca overflow. Don't compute the address of the object just
6849 before an array, as that's not portable. Use EMACS_INT, not
6850 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6851 * callint.c (Fcall_interactively):
6852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6853 * callproc.c (call_process_kill, Fcall_process):
6854 Don't assume pid_t fits into an Emacs fixnum.
6855 (call_process_cleanup, Fcall_process, child_setup):
6856 Don't assume pid_t fits into int.
6857 (call_process_cleanup, Fcall_process, delete_temp_file)
6858 (Fcall_process_region):
6859 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6860 (Fcall_process): Simplify handling of volatile integers.
6861 Use int, not EMACS_INT, where int will do.
6862 * casefiddle.c (casify_object, casify_region, operate_on_word)
6863 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6865 (casify_object): Avoid integer overflow when overallocating buffer.
6866 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6867 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6868 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6869 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6870 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6871 integers are now checked earlier. All uses replaced with XINT.
6872 (ccl_driver):
6873 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6874 For CCL_MapSingle, check that content and value are in int range.
6875 (ccl_driver, Fregister_code_conversion_map):
6876 Check that Vcode_version_map_vector is a vector.
6877 (resolve_symbol_ccl_program): Check that vector header is in range.
6878 Always copy the vector, so that we can check its contents reliably
6879 now rather than having to recheck each instruction as it's being
6880 executed. Check that vector words fit in 'int'.
6881 (ccl_get_compiled_code, Fregister_ccl_program)
6882 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6883 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6884 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6885 contents are in range.
6886 (Fccl_execute_on_string): Check that status is in range.
6887 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6888 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6889 Accept and return EMACS_INT, not int, because callers can pass values
6890 out of 'int' range.
6891 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6892 (multibyte_chars_in_text, parse_str_as_multibyte)
6893 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6894 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6895 (string_escape_byte8, Fget_byte):
6896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6897 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6898 avoid mishandling large integers.
6899 * character.h: Adjust decls to match defn changes elsewhere.
6900 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6901 (Ffind_charset_region):
6902 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6903 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6904 (load_charset_map_from_vector, Fdefine_charset_internal):
6905 Don't assume fixnum fits in int.
6906 (load_charset_map_from_vector, Fmap_charset_chars):
6907 Remove now-unnecessary CHECK_NATNUMs.
6908 (Fdefine_charset_internal): Check ranges here, more carefully.
6909 Don't rely on undefined behavior with signed left shift overflow.
6910 Don't assume unsigned int fits into fixnum, or that fixnum fits
6911 into unsigned int. Don't require max_code to be a valid fixnum;
6912 that's not true for gb10830 4-byte on a 32-bit host. Allow
6913 invalid_code to be a cons, for the same reason. Require code_offset
6914 to be a character. Avoid int overflow if max_char is close
6915 to INT_MAX.
6916 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6917 this is intended anyway and avoids some undefined behavior.
6918 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6919 INDEX_TO_CODE_POINT, as that's what it expects.
6920 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6921 * charset.h (DECODE_CHAR): Return int, not unsigned;
6922 this is what was intended anyway, and it avoids undefined behavior.
6923 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6924 integer-overflow issues.
6925 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6926 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6927 where the argument is EMACS_INT, and this behavior is not intended.
6928 * chartab.c (Fmake_char_table, Fset_char_table_range)
6929 (uniprop_get_decoder, uniprop_get_encoder):
6930 Don't assume fixnum fits in int.
6931 * cmds.c (move_point): New function, that does the gist of
6932 Fforward_char and Fbackward_char, but does so while checking
6933 for integer overflow more accurately.
6934 (Fforward_char, Fbackward_char): Use it.
6935 (Fforward_line, Fend_of_line, internal_self_insert)
6936 (internal_self_insert):
6937 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6938 Fix a FIXME, by checking for integer overflow when calculating
6939 target_clm and actual_clm.
6940 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6941 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6942 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6943 (coding_alloc_by_making_gap, alloc_destination)
6944 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6945 (encode_coding_utf_16, detect_coding_emacs_mule)
6946 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6947 (detect_coding_iso_2022, decode_coding_iso_2022)
6948 (encode_invocation_designation, encode_designation_at_bol)
6949 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6950 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6951 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6952 (encode_coding_ccl, encode_coding_raw_text)
6953 (detect_coding_charset, decode_coding_charset)
6954 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6955 (produce_composition, produce_charset, produce_annotation)
6956 (decode_coding, handle_composition_annotation)
6957 (handle_charset_annotation, consume_chars, decode_coding_gap)
6958 (decode_coding_object, encode_coding_object, detect_coding_system)
6959 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6960 (code_convert_region, code_convert_string)
6961 (Fdefine_coding_system_internal)
6962 (coding_set_source, coding_set_destination):
6963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6964 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6965 (Fdefine_coding_system_internal):
6966 Don't assume fixnums fit in int.
6967 (decode_coding_gap, decode_coding_object, encode_coding_object)
6968 (Fread_coding_system, Fdetect_coding_region)
6969 (Funencodable_char_position, Fcheck_coding_systems_region)
6970 (get_translation, handle_composition_annotation, consume_chars):
6971 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6972 (consume_chars): Rewrite to not calculate an address outside buffer.
6973 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6974 Don't access memory outside of the args array.
6975 (Fdefine_coding_system_internal): Check for charset-id overflow.
6976 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6977 result of ENCODE_CHAR.
6978 * coding.h: Adjust decls to match defn changes elsewhere.
6979 (struct coding_system):
6980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6981 * composite.c (get_composition_id, find_composition)
6982 (run_composition_function, update_compositions)
6983 (compose_text, composition_gstring_put_cache)
6984 (composition_gstring_p, composition_gstring_width)
6985 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6986 (composition_compute_stop_pos, composition_reseat_it)
6987 (composition_update_it, struct position_record)
6988 (find_automatic_composition, composition_adjust_point)
6989 (Fcomposition_get_gstring, Ffind_composition_internal):
6990 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6991 (update_compositions):
6992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6993 * composite.h: Adjust decls to match defn changes elsewhere.
6994 (struct composition):
6995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6996 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6997 Do not attempt to compute the address of the object just before a
6998 buffer; this is not portable.
6999 (Faref, Faset):
7000 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7001 (Faset): Use int, not EMACS_INT, where int is wide enough.
7002 (Fstring_to_number): Don't assume fixnums fit in int.
7003 (Frem): Don't assume arg is nonnegative.
7004 * dbusbind.c (xd_append_arg): Check for integers out of range.
7005 (Fdbus_call_method): Don't overflow the timeout int.
7006 (extract_signed, extract_unsigned): New functions.
7007 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7008 (xd_get_connection_references): Return ptrdiff_t, not int.
7009 All uses changed.
7010 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7011 (xd_read_message_1):
7012 Use int, not unsigned, where the dbus API uses int.
7013 (Fdbus_message_internal): Don't overflow mtype.
7014 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7015 * dired.c (directory_files_internal, file_name_completion, scmp)
7016 (file_name_completion_stat):
7017 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7018 (file_name_completion): Don't overflow matchcount.
7019 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7020 * dispextern.h: Adjust decls to match defn changes elsewhere.
7021 (struct text_pos, struct glyph, struct bidi_saved_info)
7022 (struct bidi_string_data, struct bidi_it, struct composition_it)
7023 (struct it):
7024 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7025 (struct display_pos, struct composition_it, struct it):
7026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7027 * dispnew.c (increment_matrix_positions)
7028 (increment_row_positions, mode_line_string)
7029 (marginal_area_string):
7030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7031 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7033 (duration_to_sec_usec): New function, to check for overflow better.
7034 (Fsleep_for, sit_for): Use it.
7035 * doc.c (get_doc_string, store_function_docstring):
7036 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7037 (get_doc_string, Fsnarf_documentation):
7038 Use int, not EMACS_INT, where int is wide enough.
7039 (get_doc_string):
7040 Use SAFE_ALLOCA, not alloca.
7041 Check for overflow when converting EMACS_INT to off_t.
7042 * doprnt.c (doprnt):
7043 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7044 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7045 Don't assume uid_t fits into fixnum.
7046 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7047 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7048 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7049 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7050 (general_insert_function)
7051 (Finsert_char, make_buffer_string, make_buffer_string_both)
7052 (update_buffer_properties, Fbuffer_substring)
7053 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7054 (Fsubst_char_in_region, check_translation)
7055 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7056 (transpose_markers, Ftranspose_regions):
7057 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7058 (clip_to_bounds): Move to lisp.h as an inline function).
7059 (Fconstrain_to_field): Don't assume integers are nonnegative.
7060 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7061 (Fsubst_char_in_region, Fsave_restriction):
7062 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7063 (Femacs_pid): Don't assume pid_t fits into fixnum.
7064 (lo_time): Use int, not EMACS_INT, when int suffices.
7065 (lisp_time_argument): Check for usec out of range.
7066 (Fencode_time): Don't assume fixnum fits in int.
7067 (Fuser_login_name, Fuser_full_name): Signal an error
7068 if a uid argument is out of range, rather than relying on
7069 undefined behavior.
7070 (Fformat_time_string): Remove now-unnecessary check.
7071 lisp_time_argument checks for out-of-range usec now.
7072 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7073 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7074 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7075 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7076 (init_cmdargs, Fdump_emacs):
7077 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7078 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7079 the bottom (typically) 32 bits of the fixnum.
7080 * eval.c (specpdl_size, call_debugger):
7081 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7082 (when_entered_debugger, Fbacktrace_debug):
7083 Don't assume fixnum can fit in int.
7084 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7085 the object just before a buffer; this is not portable.
7086 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7087 (grow_specpdl, unbind_to):
7088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7089 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7090 (grow_specpdl): Simplify allocation by using xpalloc.
7091 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7092 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7093 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7094 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7095 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7096 (a_write, e_write):
7097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7098 (Fcopy_file, non_regular_nbytes, read_non_regular)
7099 (Finsert_file_contents):
7100 Use int, not EMACS_INT, where int is wide enough.
7101 (READ_BUF_SIZE): Verify that it fits in int.
7102 (Finsert_file_contents): Check that counts are in proper range,
7103 rather than assuming fixnums fit into ptrdiff_t etc.
7104 Don't assume fixnums fit into int.
7105 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7106 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7107 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7108 (string_char_to_byte, string_byte_to_char)
7109 (string_make_multibyte, string_to_multibyte)
7110 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7111 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7112 (substring_both, Fdelete, internal_equal, Ffillarray)
7113 (Fclear_string, mapcar1)
7114 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7115 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7116 (larger_vector, make_hash_table, maybe_resize_hash_table)
7117 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7118 (Fmaphash, secure_hash):
7119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7120 (concat): Check for string index and length overflow.
7121 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7122 (Frequire):
7123 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7124 (larger_vector): New API (vec, incr_min, size_max) replaces old
7125 one (vec, new_size, init). This catches size overflow.
7126 INIT was removed because it was always Qnil.
7127 All callers changed.
7128 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7129 the upper bound on a hash table index size.
7130 (make_hash_table, maybe_resize_hash_table): Use it.
7131 (secure_hash): Computer start_byte and end_byte only after
7132 they're known to be in ptrdiff_t range.
7133 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7134 (Ffont_get_glyphs, Ffont_at):
7135 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7136 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7137 (Flist_fonts, Fopen_font):
7138 Don't assume fixnum can fit in int.
7139 (check_gstring): Don't assume index can fit in int.
7140 (font_match_p): Check that fixnum is a character, not a nonnegative
7141 fixnum, since the later code needs to stuff it into an int.
7142 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7143 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7144 conversion overflow issues.
7145 (Fopen_font): Check for integer out of range.
7146 (Ffont_get_glyphs): Don't assume index can fit in int.
7147 * font.h: Adjust decls to match defn changes elsewhere.
7148 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7149 integer overflow.
7150 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7151 printmax_t, where ptrdiff_t is wide enough.
7152 (Finternal_char_font):
7153 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7154 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7155 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7156 (Fset_frame_position, x_set_frame_parameters)
7157 (x_set_line_spacing, x_set_border_width)
7158 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7159 Check that fixnums are in proper range for system types.
7160 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7162 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7163 Use SAFE_ALLOCA_LISP, not alloca.
7164 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7165 intptr_t is wide enough.
7166 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7167 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7168 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7169 Check for fixnum out of range.
7170 * ftfont.c (ftfont_list): Don't assume index fits in int.
7171 Check that fixnums are in proper range for system types.
7172 (ftfont_shape_by_flt):
7173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7174 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7175 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7176 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7177 Check that fixnums are in proper range for system types.
7178 * gnutls.h: Adjust decls to match defn changes elsewhere.
7179 * gtkutil.c (xg_dialog_run):
7180 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7181 (update_frame_tool_bar):
7182 Check that fixnums are in proper range for system types.
7183 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7184 (lookup_image): Check that fixnums are in range for system types.
7185 * indent.c (last_known_column, last_known_column_point):
7186 (current_column_bol_cache):
7187 (skip_invisible, current_column, check_display_width):
7188 (check_display_width, scan_for_column, current_column_1)
7189 (Findent_to, Fcurrent_indentation, position_indentation)
7190 (indented_beyond_p, Fmove_to_column, compute_motion):
7191 (Fcompute_motion, Fvertical_motion):
7192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7193 (last_known_column_modified): Use EMACS_INT, not int.
7194 (check_display_width):
7195 (Fcompute_motion):
7196 Check that fixnums and floats are in proper range for system types.
7197 (compute_motion): Don't assume index or fixnum fits in int.
7198 (compute_motion, Fcompute_motion):
7199 Use int, not EMACS_INT, when it is wide enough.
7200 (vmotion): Omit local var start_hpos that is always 0; that way
7201 we don't need to worry about overflow in expressions involving it.
7202 * indent.h: Adjust decls to match defn changes elsewhere.
7203 (struct position):
7204 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7205 Use int, not EMACS_INT, where int is wide enough.
7206 Remove unused members ovstring_chars_done and tab_offset;
7207 all uses removed.
7208 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7209 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7210 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7211 (make_gap, copy_text, insert, insert_and_inherit)
7212 (insert_before_markers, insert_before_markers_and_inherit)
7213 (insert_1, count_combining_before, count_combining_after)
7214 (insert_1_both, insert_from_string)
7215 (insert_from_string_before_markers, insert_from_string_1)
7216 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7217 (adjust_after_replace, adjust_after_insert, replace_range)
7218 (replace_range_2, del_range, del_range_1, del_range_byte)
7219 (del_range_both, del_range_2, modify_region)
7220 (prepare_to_modify_buffer, signal_before_change)
7221 (signal_after_change, Fcombine_after_change_execute):
7222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7223 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7224 (balance_an_interval, split_interval_right, split_interval_left)
7225 (find_interval, next_interval, update_interval)
7226 (adjust_intervals_for_insertion, delete_node, delete_interval)
7227 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7228 (static_offset_intervals, offset_intervals)
7229 (merge_interval_right, merge_interval_left, make_new_interval)
7230 (graft_intervals_into_buffer, temp_set_point_both)
7231 (temp_set_point, set_point, adjust_for_invis_intang)
7232 (set_point_both, move_if_not_intangible, get_property_and_range)
7233 (get_local_map, copy_intervals, copy_intervals_to_string)
7234 (compare_string_intervals, set_intervals_multibyte_1):
7235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7236 * intervals.h: Adjust decls to match defn changes elsewhere.
7237 (struct interval):
7238 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7239 * keyboard.c (this_command_key_count, this_single_command_key_start)
7240 (before_command_key_count, before_command_echo_length, echo_now)
7241 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7242 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7243 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7244 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7246 (last_non_minibuf_size, last_point_position, echo_truncate)
7247 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7248 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7249 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7250 (stuff_buffered_input):
7251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7252 (last_auto_save, command_loop_1, read_char):
7253 Use EMACS_INT, not int, to avoid integer overflow.
7254 (record_char): Avoid overflow in total_keys computation.
7255 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7256 * keyboard.h: Adjust decls to match defn changes elsewhere.
7257 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7258 (Fkey_description, Fdescribe_vector, Flookup_key):
7259 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7260 (click_position): New function, to check that positions are in range.
7261 (Fcurrent_active_maps):
7262 (describe_command):
7263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7264 (Faccessible_keymaps, Fkey_description):
7265 (preferred_sequence_p):
7266 Don't assume fixnum can fit into int.
7267 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7268 Check for integer overflow in size calculations.
7269 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7270 avoid mishandling large integers.
7271 * lisp.h: Adjust decls to match defn changes elsewhere.
7272 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7273 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7274 (struct Lisp_Marker):
7275 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7276 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7277 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7278 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7279 All callers changed.
7280 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7281 Assume the arg has valid form, since it always does.
7282 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7283 unsigned integer system type.
7284 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7285 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7287 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7288 (duration_to_sec_usec): New decl.
7289 * lread.c (read_from_string_index, read_from_string_index_byte)
7290 (read_from_string_limit, readchar, unreadchar, openp)
7291 (read_internal_start, read1, oblookup):
7292 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7293 (Fload, readevalloop, Feval_buffer, Feval_region):
7294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7295 (openp): Check for out-of-range argument to 'access'.
7296 (read1): Use int, not EMACS_INT, where int is wide enough.
7297 Don't assume fixnum fits into int.
7298 Fix off-by-one error that can read outside a buffer.
7299 (read_filtered_event): Use duration_to_sec_usec
7300 to do proper overflow checking on durations.
7301 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7302 in size calculation.
7303 (Fexecute_kbd_macro):
7304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7305 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7306 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7307 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7308 (set_marker_both, set_marker_restricted_both, marker_position)
7309 (marker_byte_position, Fbuffer_has_markers_at):
7310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7311 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7312 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7313 It now merely ensures that the menu is large enough, without
7314 necessarily growing it, as this avoids some integer overflow issues.
7315 All callers changed.
7316 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7317 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7318 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7319 Use SAFE_ALLOCA_LISP, not alloca.
7320 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7321 to EMACS_INT. Check that fixnums are in proper range for system types.
7322 * minibuf.c (minibuf_prompt_width, string_to_object)
7323 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7324 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7326 (get_minibuffer, read_minibuf_unwind):
7327 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7328 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7329 this simplifies overflow checking. All callers changed.
7330 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7331 (Ftest_completion):
7332 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7333 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7334 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7335 Check that fixnums are in proper range for system types.
7336 (Fx_create_frame, Fx_show_tip):
7337 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7338 * nsfont.m (ns_findfonts, nsfont_list_family):
7339 Don't assume fixnum fits in long.
7340 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7341 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7342 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7343 wide enough.
7344 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7345 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7346 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7347 (PRINTDECLARE, PRINTPREPARE):
7348 (strout, print_string):
7349 (print, print_preprocess, print_check_string_charset_prop)
7350 (print_object):
7351 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7352 (PRINTDECLARE):
7353 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7354 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7355 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7356 (printchar, strout): Use xpalloc to catch size calculation overflow.
7357 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7358 (print_error_message): Use SAFE_ALLOCA, not alloca.
7359 (print_object): Use int, not EMACS_INT, where int is wide enough.
7360 (print_depth, new_backquote_output, print_number_index):
7361 Use ptrdiff_t, not int, where int might not be wide enough.
7362 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7363 (Fset_process_window_size, Fformat_network_address)
7364 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7365 (sigchld_handler):
7366 Check that fixnums are in proper range for system types.
7367 (Fsignal_process): Simplify by avoiding a goto.
7368 Check for process-ids out of pid_t range rather than relying on
7369 undefined behavior.
7370 (process_tick, update_tick): Use EMACS_INT, not int.
7371 (Fformat_network_address, read_process_output, send_process)
7372 (Fprocess_send_region, status_notify):
7373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7374 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7375 (wait_reading_process_output, read_process_output, exec_sentinel):
7376 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7377 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7378 (Faccept_process_output): Use duration_to_sec_usec to do proper
7379 overflow checking on durations.
7380 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7381 Don't assume pid_t fits in int.
7382 * process.h (struct Lisp_Process): Members tick and update_tick
7383 are now of type EMACS_INT, not int.
7384 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7385 configured --with-wide-int.
7386 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7387 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7388 * search.c (looking_at_1, string_match_1):
7389 (fast_string_match, fast_c_string_match_ignore_case)
7390 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7391 (scan_newline, find_before_next_newline, search_command)
7392 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7393 (set_search_regs, wordify):
7394 (Freplace_match):
7395 (Fmatch_data):
7396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7397 (string_match_1, search_buffer, set_search_regs):
7398 (Fmatch_data):
7399 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7400 (wordify): Check for overflow in size calculation.
7401 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7402 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7403 Check that fixnums are in proper range for system types.
7404 * sound.c (struct sound_device)
7405 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7407 (Fplay_sound_internal):
7408 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7409 * syntax.c (struct lisp_parse_state, find_start_modiff)
7410 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7411 (Fparse_partial_sexp):
7412 Don't assume fixnums can fit in int.
7413 (struct lisp_parse_state, find_start_pos, find_start_value)
7414 (find_start_value_byte, find_start_begv)
7415 (update_syntax_table, char_quoted, dec_bytepos)
7416 (find_defun_start, prev_char_comend_first, back_comment):
7417 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7418 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7420 (Finternal_describe_syntax_value): Check that match_lisp is a
7421 character, not an integer, since the code stuffs it into int.
7422 (scan_words, scan_sexps_forward):
7423 Check that fixnums are in proper range for system types.
7424 (Fforward_word):
7425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7426 (scan_sexps_forward):
7427 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7428 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7429 * syntax.h: Adjust decls to match defn changes elsewhere.
7430 (struct gl_state_s):
7431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7432 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7433 MOST_POSITIVE_FIXNUM.
7434 * sysdep.c (wait_for_termination_1, wait_for_termination)
7435 (interruptible_wait_for_termination, mkdir):
7436 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7437 (emacs_read, emacs_write):
7438 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7439 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7440 and double all fit in int.
7441 * term.c (set_tty_color_mode):
7442 Check that fixnums are in proper range for system types.
7443 * termhooks.h (struct input_event):
7444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7445 * textprop.c (validate_interval_range, interval_of)
7446 (Fadd_text_properties, set_text_properties_1)
7447 (Fremove_text_properties, Fremove_list_of_text_properties)
7448 (Ftext_property_any, Ftext_property_not_all)
7449 (copy_text_properties, text_property_list, extend_property_ranges)
7450 (verify_interval_modification):
7451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7452 (Fnext_single_char_property_change)
7453 (Fprevious_single_char_property_change):
7454 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7455 (copy_text_properties):
7456 Check for integer overflow in index calculation.
7457 * undo.c (last_boundary_position, record_point, record_insert)
7458 (record_delete, record_marker_adjustment, record_change)
7459 (record_property_change):
7460 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7461 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7462 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7463 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7464 (Fx_hide_tip, Fx_file_dialog):
7465 * w32menu.c (set_frame_menubar):
7466 Use ptrdiff_t, not int, for consistency with rest of code.
7467 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7468 (select_window, Fdelete_other_windows_internal)
7469 (window_scroll_pixel_based, window_scroll_line_based)
7470 (Frecenter, Fset_window_configuration):
7471 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7472 (Fset_window_hscroll, run_window_configuration_change_hook)
7473 (set_window_buffer, temp_output_buffer_show, scroll_command)
7474 (Fscroll_other_window, Frecenter):
7475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7476 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7477 Don't assume fixnum fits in int.
7478 (Fset_window_scroll_bars):
7479 Check that fixnums are in proper range for system types.
7480 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7481 (string_pos, c_string_pos, number_of_chars, init_iterator)
7482 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7483 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7484 (compute_display_string_end, handle_face_prop)
7485 (face_before_or_after_it_pos, handle_invisible_prop)
7486 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7487 (display_prop_intangible_p, string_buffer_position_lim)
7488 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7489 (get_overlay_strings_1, get_overlay_strings)
7490 (iterate_out_of_display_property, forward_to_next_line_start)
7491 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7492 (get_next_display_element, set_iterator_to_next)
7493 (get_visually_first_element, compute_stop_pos_backwards)
7494 (handle_stop_backwards, next_element_from_buffer)
7495 (move_it_in_display_line_to, move_it_in_display_line)
7496 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7497 (add_to_log, message_dolog, message_log_check_duplicate)
7498 (message2, message2_nolog, message3, message3_nolog
7499 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7500 (current_message_1, truncate_echo_area, truncate_message_1)
7501 (set_message, set_message_1, store_mode_line_noprop)
7502 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7503 (text_outside_line_unchanged_p, check_point_in_composition)
7504 (reconsider_clip_changes)
7505 (redisplay_internal, set_cursor_from_row, try_scrolling)
7506 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7507 (redisplay_window, find_last_unchanged_at_beg_row)
7508 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7509 (trailing_whitespace_p, find_row_edges, display_line)
7510 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7511 (display_mode_element, store_mode_line_string)
7512 (pint2str, pint2hrstr, decode_mode_spec)
7513 (display_count_lines, display_string, draw_glyphs)
7514 (x_produce_glyphs, x_insert_glyphs)
7515 (rows_from_pos_range, mouse_face_from_buffer_pos)
7516 (fast_find_string_pos, mouse_face_from_string_pos)
7517 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7518 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7519 (safe_call, init_from_display_pos, handle_fontified_prop)
7520 (handle_single_display_spec, load_overlay_strings)
7521 (with_echo_area_buffer, setup_echo_area_for_printing)
7522 (display_echo_area, echo_area_display)
7523 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7524 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7525 (redisplay_window, dump_glyph_row, display_mode_line)
7526 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7527 (handle_display_spec, display_prop_string_p):
7528 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7529 (handle_single_display_spec, build_desired_tool_bar_string)
7530 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7531 (get_specified_cursor_type):
7532 Check that fixnums are in proper range for system types.
7533 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7534 (Flookup_image_map):
7535 Don't assume fixnums fit in int.
7536 (compare_overlay_entries):
7537 Avoid mishandling comparisons due to subtraction overflow.
7538 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7539 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7540 (handle_tool_bar_click):
7541 Use int, not unsigned, since we prefer signed and the signedness
7542 doesn't matter here.
7543 (get_next_display_element, next_element_from_display_vector):
7544 Use int, not EMACS_INT, when int is wide enough.
7545 (start_hourglass): Use duration_to_sec_usec to do proper
7546 overflow checking on durations.
7547 * xfaces.c (Fbitmap_spec_p):
7548 Check that fixnums are in proper range for system types.
7549 (compare_fonts_by_sort_order):
7550 Avoid mishandling comparisons due to subtraction overflow.
7551 (Fx_family_fonts, realize_basic_faces):
7552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7553 (Fx_family_fonts):
7554 Don't assume fixnum fits in int.
7555 Use SAFE_ALLOCA_LISP, not alloca.
7556 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7557 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7558 (face_at_buffer_position, face_for_overlay_string)
7559 (face_at_string_position):
7560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7561 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7562 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7563 (Fx_show_tip):
7564 Check that fixnums are in proper range for system types.
7565 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7566 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7567 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7568 (Fx_change_window_property): Don't assume fixnums fit in int.
7569 * xfont.c (xfont_chars_supported):
7570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7571 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7572 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7573 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7574 * xml.c (parse_region):
7575 * xrdb.c (magic_file_p):
7576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7577 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7578 (x_get_local_selection, x_reply_selection_request)
7579 (x_handle_selection_request, wait_for_property_change):
7580 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7581 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7582 short is wide enough.
7583 (x_send_client_event): Don't assume fixnum fits in int.
7584 * xterm.c (x_x_to_emacs_modifiers):
7585 Don't assume EMACS_INT overflows nicely into int.
7586 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7587 may come from Lisp.
7588 (handle_one_xevent): NATNUMP can eval its arg twice.
7589 (x_connection_closed):
7590 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7591 * xterm.h: Adjust decls to match defn changes elsewhere.
7592 (struct scroll_bar): Use struct vectorlike_header
7593 rather than rolling our own approximation.
7594 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7595
7596 2012-05-25 Glenn Morris <rgm@gnu.org>
7597
7598 * lisp.mk (lisp): Update for more files being compiled now.
7599
7600 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7601
7602 * lread.c: Remove `read_pure' which makes no difference.
7603 (read_pure): Remove var.
7604 (unreadpure): Remove function.
7605 (readevalloop): Don't call read_list with -1 flag.
7606 (read1, read_vector): Don't test read_pure any more.
7607 (read_list): Simplify.
7608
7609 * fileio.c, character.h: Minor style tweaks.
7610
7611 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7612
7613 * window.h (clip_changed): Remove useless declaration.
7614
7615 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7616
7617 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7618 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7619
7620 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7621
7622 Remove src/m/*.
7623 This directory predates autoconf and is no longer needed nowadays.
7624 Move its few remaining bits of functionality to where they're needed.
7625 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7626 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7627 * m/template.h: Remove.
7628 * Makefile.in (M_FILE): Remove. All uses removed.
7629 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7630 * lisp.h (USE_LSB_TAG):
7631 * mem-limits.h (EXCEEDS_LISP_PTR):
7632 Use VAL_MAX, not VALBITS, in #if.
7633 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7634 (EMACS_UINT): Define unconditionally now.
7635 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7636 (BITS_PER_EMACS_INT): New constants, replacing
7637 what used to be in config.h, but not useful in #if.
7638 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7639 define them any more.
7640 (VAL_MAX): New macro.
7641 (VALMASK): Use it.
7642 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7643 BITS_PER_EMACS_INT, in #if.
7644 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7645 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7646 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7647 * s/ms-w32.h (DATA_START):
7648 Move here from removed file m/intel386.h.
7649 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7650 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7651
7652 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7653
7654 Assume C89 or later.
7655 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7656 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7657 (xrealloc):
7658 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7659 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7660 * textprop.c, tparam.c (NULL): Remove.
7661 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7662 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7663 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7664 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7665 * xterm.c (input_signal_count): Assume volatile works.
7666
7667 2012-05-21 Ken Brown <kbrown@cornell.edu>
7668
7669 * xgselect.c (xg_select): Fix first argument in call to 'select'
7670 (bug#11508).
7671
7672 2012-05-20 Ken Brown <kbrown@cornell.edu>
7673
7674 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7675 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7676
7677 2012-05-19 Ken Brown <kbrown@cornell.edu>
7678
7679 * xfns.c (x_in_use): Remove `static' qualifier.
7680 * xterm.h (x_in_use): Declare.
7681 * xgselect.c: Include xterm.h.
7682 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7683 and `display_arg' (bug#9754).
7684
7685 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7686
7687 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7688
7689 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7690 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7691
7692 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7693
7694 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7695
7696 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7697 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7698
7699 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7700 reference to image_cache->refcount.
7701 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7702
7703 2012-05-17 Juri Linkov <juri@jurta.org>
7704
7705 * search.c (Fword_search_regexp, Fword_search_backward)
7706 (Fword_search_forward, Fword_search_backward_lax)
7707 (Fword_search_forward_lax): Move functions to isearch.el
7708 (bug#10145, bug#11381).
7709
7710 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7711
7712 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7713
7714 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7715
7716 * lread.c (init_obarray): Declare Qt and Qnil as special.
7717
7718 2012-05-14 Glenn Morris <rgm@gnu.org>
7719
7720 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7721 Put "libexec" before "bin", for the sake of init_callproc_1.
7722
7723 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7724
7725 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7726
7727 * unexaix.c: Port to more-recent AIX compilers.
7728 (report_error, report_error_1, make_hdr, copy_sym)
7729 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7730 Make arguments const char *, not char *, to avoid violations of C
7731 standard and to fix some AIX warnings reported by Gilles Pion.
7732
7733 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7734
7735 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7736 already have overlays loaded.
7737 (handle_single_display_spec): Before returning without displaying
7738 fringe bitmap, synchronize the bidi iterator with the main display
7739 iterator, by calling iterate_out_of_display_property.
7740 (iterate_out_of_display_property): Detect buffer iteration by
7741 testing that it->string is a Lisp string.
7742 (get_next_display_element): When the current object is exhausted,
7743 and there's something on it->stack, call set_iterator_to_next to
7744 proceed with what's on the stack, instead of returning zero.
7745 (set_iterator_to_next): If called at the end of a Lisp string,
7746 proceed to consider_string_end without incrementing string
7747 position. Don't increment display vector index past the end of
7748 the display vector. (Bug#11417)
7749 (pos_visible_p): Don't report a position visible when move_it_to
7750 stopped at the last line of window, which happens to be scanned
7751 backwards by the bidi iteration. (Bug#11464)
7752
7753 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7754
7755 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7756 and right-margin display specs even if the spec is invalid or we
7757 are on a TTY, and thus unable to display on the fringes.
7758 That's because the text with the property will not be displayed anyway,
7759 so we need to signal to the caller that this is a "replacing"
7760 display spec. This fixes display when the spec is invalid or we
7761 are on a TTY.
7762
7763 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7764
7765 * unexaix.c (make_hdr): Fix typo in prototype.
7766 This bug broke the build on AIX. Problem reported by Gilles Pion.
7767
7768 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7769
7770 * keyboard.c (kbd_buffer_get_event): Read special events also in
7771 batch mode. (Bug#11415)
7772
7773 2012-05-12 Glenn Morris <rgm@gnu.org>
7774
7775 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7776
7777 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7778
7779 * lisp.mk (lisp): Add newcomment.elc.
7780
7781 2012-05-12 Glenn Morris <rgm@gnu.org>
7782
7783 * Makefile.in (MKDIR_P): New, set by configure.
7784 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7785
7786 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7787
7788 Remove unused function hourglass_started.
7789 * dispextern.h (hourglass_started):
7790 * w32fns.c (hourglass_started):
7791 * xdisp.c (hourglass_started): Remove.
7792
7793 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7794
7795 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7796 Update dependencies.
7797
7798 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7799
7800 * xgselect.c (xg_select): Put maxfds+1 into a var.
7801 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7802
7803 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7804
7805 2012-05-10 Dave Abrahams <dave@boostpro.com>
7806
7807 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7808 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7809
7810 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7811
7812 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7813 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7814 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7815 Initialize xd_registered_buses.
7816
7817 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7818
7819 Untag more efficiently if USE_LSB_TAG.
7820 This is based on a proposal by YAMAMOTO Mitsuharu in
7821 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7822 For an admittedly artificial (nth 8000 longlist) benchmark on
7823 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7824 Emacs's overall text size by 1%.
7825 * lisp.h (XUNTAG): New macro.
7826 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7827 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7828 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7829 * eval.c (Fautoload):
7830 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7831 * frame.h (XFRAME): Use XUNTAG.
7832
7833 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7834 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7835 Remove unportable assumptions about print widths of types like
7836 dbus_uint32_t.
7837 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7838 intptr_t when converting between pointer and integer, to avoid GCC
7839 warnings about wrong width.
7840
7841 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7842
7843 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7844 stack for each reader_thread, instead of defaulting to 8MB
7845 determined by the linker. This avoids failures in creating
7846 subprocesses on Windows 7, see the discussion in this thread:
7847 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7848
7849 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7850
7851 Fix up display of the *Minibuf-0* buffer in the mini window.
7852 * keyboard.c (read_char): Don't clear the echo area if there's no
7853 message to clear.
7854 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7855 contents of *Minibuf-0*) if there's no message displayed in its stead.
7856
7857 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7858
7859 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7860 batch mode.
7861
7862 2012-05-06 Chong Yidong <cyd@gnu.org>
7863
7864 * lisp.mk (lisp): Update.
7865
7866 2012-05-05 Jim Meyering <meyering@redhat.com>
7867
7868 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7869
7870 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7871
7872 * data.c (PUT_ERROR): New macro.
7873 (syms_of_data): Use it. Add new error type `user-error'.
7874 * undo.c (user_error): New function.
7875 (Fprimitive_undo): Use it.
7876 * print.c (print_error_message): Adjust print style for `user-error'.
7877 * keyboard.c (user_error): New function.
7878 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7879
7880 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7881
7882 Do not limit current-time-string to years 1000..9999.
7883 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7884 (Fcurrent_time_string): Support any year that is supported by the
7885 underlying localtime representation. Don't use asctime, as it
7886 has undefined behavior for years outside the range -999..9999.
7887
7888 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7889
7890 Fix race conditions involving setenv, gmtime, localtime, asctime.
7891 Without this fix, interrupts could mess up code that uses these
7892 nonreentrant functions, since setting TZ invalidates existing
7893 tm_zone or tzname values, and since most of these functions return
7894 pointers to static storage.
7895 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7896 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7897 Grow the critical sections to include not just invoking
7898 localtime/gmtime, but also accessing these functions' results
7899 including their tm_zone values if any, and any related TZ setting.
7900 (format_time_string): Last arg is now struct tm *, not struct tm **,
7901 so that the struct tm is saved in the critical section.
7902 All callers changed. Simplify allocation of initial buffer, partly
7903 motivated by the fact that memory allocation needs to be outside
7904 the critical section.
7905
7906 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7907
7908 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7909 with RESET_INTERVAL.
7910
7911 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7912 Remove duplicated buffer name initialization.
7913
7914 2012-05-02 Jim Meyering <jim@meyering.net>
7915
7916 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7917
7918 * xfns.c (x_window): Use xstrdup (Bug#11375).
7919
7920 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7921
7922 * xdisp.c (pos_visible_p): If already at a newline from the
7923 display string before the 'while' loop, don't walk back the glyphs
7924 from it3.glyph_row. Solves assertion violation when the display
7925 string begins with a newline (egg.el). (Bug#11367)
7926
7927 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7928
7929 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7930 Move to simple.el.
7931
7932 2012-05-01 Glenn Morris <rgm@gnu.org>
7933
7934 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7935 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7936 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7937 All were removed before 23.1.
7938
7939 * dispnew.c: Remove HAVE_LIBNCURSES test;
7940 it is always true on relevant platforms.
7941
7942 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7943 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7944
7945 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7946
7947 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7948
7949 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7950 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7951 Remove.
7952
7953 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7954
7955 Do not avoid creating empty evaporating overlays (Bug#9642).
7956 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7957 That is, do not delete an evaporating overlay if it becomes
7958 empty after its bounds are adjusted to fit within its buffer.
7959 This fix caused other problems, and I'm reverting it until we get
7960 to the bottom of them.
7961
7962 2012-04-27 Chong Yidong <cyd@gnu.org>
7963
7964 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7965
7966 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7967
7968 * xdisp.c (pos_visible_p): If the window start position is beyond
7969 ZV, start the display from buffer beginning. Prevents assertion
7970 violation in init_iterator when the minibuffer window is scrolled
7971 via the scroll bar.
7972
7973 * window.c (window_scroll_pixel_based): Likewise.
7974
7975 2012-04-27 Chong Yidong <cyd@gnu.org>
7976
7977 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7978
7979 2012-04-27 Glenn Morris <rgm@gnu.org>
7980
7981 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7982 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7983
7984 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7985
7986 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7987 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7988
7989 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7990
7991 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7992 display element, check also the underlying string or buffer
7993 character. (Bug#11341)
7994
7995 * w32menu.c: Include w32heap.h.
7996 (add_menu_item): If the call to AppendMenuW (via
7997 unicode_append_menu) fails, disable Unicode menus only if we are
7998 running on Windows 9X/Me.
7999
8000 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8001
8002 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8003 (xgetint): Add missing shift for LSB tags.
8004
8005 2012-04-24 Martin Rudalics <rudalics@gmx.at>
8006
8007 * keyboard.c (read_char): Don't wipe echo area for select window
8008 events: These might get delayed via `mouse-autoselect-window'
8009 (Bug#11304).
8010
8011 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8012
8013 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8014 manipulation of :loaded-from data.
8015
8016 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8017
8018 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8019 now a cons (bug#11311).
8020
8021 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8022
8023 Do not create empty overlays with the evaporate property (Bug#9642).
8024 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8025 if it becomes empty after its bounds are adjusted to fit within
8026 its buffer. Without this fix, in a nonempty buffer (let ((o
8027 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8028 yields an empty overlay that has the evaporate property, which is
8029 not supposed to happen.
8030
8031 Fix minor GTK3 problems found by static checking.
8032 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8033 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8034 (struct _EmacsFixedClass, emacs_fixed_get_type):
8035 Move decls here from emacsgtkfixed.h, since they needn't be public.
8036 (emacs_fixed_get_type): Now static.
8037 (emacs_fixed_class_init): Omit unused local.
8038 (emacs_fixed_child_type): Remove; unused.
8039 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8040 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8041 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8042 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8043 (EMACS_FIXED_GET_CLASS): Remove; unused.
8044 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8045
8046 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8047 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8048
8049 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8050
8051 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8052 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8053 (__malloc_size_t, __malloc_ptrdiff_t):
8054 Remove. All uses removed, replaced by the definiens if needed,
8055 since we can assume C89 or better now.
8056 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8057 (protect_malloc_state, align, get_contiguous_space)
8058 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8059 (malloc_atfork_handler_child, malloc_enable_thread)
8060 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8061 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8062 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8063 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8064 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8065 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8066 Define using prototypes, not old style.
8067 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8068 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8069 (align): Don't assume that signed integer overflow wraps around.
8070 Omit unused local var.
8071 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8072 (_free_internal_nolock, memalign, mallochook, reallochook):
8073 Omit no-longer-needed casts.
8074 (valloc): Use getpagesize, not __getpagesize.
8075 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8076 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8077
8078 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8079
8080 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8081
8082 Move functions from C to Lisp. Make non-blocking method calls
8083 the default. Implement further D-Bus standard interfaces.
8084
8085 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8086 (QCdbus_request_name_allow_replacement)
8087 (QCdbus_request_name_replace_existing)
8088 (QCdbus_request_name_do_not_queue)
8089 (QCdbus_request_name_reply_primary_owner)
8090 (QCdbus_request_name_reply_in_queue)
8091 (QCdbus_request_name_reply_exists)
8092 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8093 (QCdbus_registered_serial, QCdbus_registered_method)
8094 (QCdbus_registered_signal): New Lisp objects.
8095 (XD_DEBUG_MESSAGE): Use sizeof.
8096 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8097 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8098 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8099 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8100 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8101 (xd_signature, xd_append_arg): Allow float for integer types.
8102 (xd_get_connection_references): New function.
8103 (xd_get_connection_address): Rename from xd_initialize.
8104 Return cached address.
8105 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8106 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8107 level.
8108 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8109 Return number of refcounts.
8110 (Fdbus_get_unique_name): Make stronger parameter check.
8111 (Fdbus_message_internal): New defun.
8112 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8113 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8114 (Fdbus_send_signal, Fdbus_register_service)
8115 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8116 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8117 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8118 (Vdbus_compiled_version, Vdbus_runtime_version)
8119 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8120 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8121 (Vdbus_message_type_signal): New defvars.
8122 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8123 Adapt docstring.
8124
8125 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8126
8127 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8128 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8129 Do not assume ptrdiff_t is the same width as 'int'.
8130
8131 * alloc.c: Handle unusual debugging option combinations.
8132 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8133 since the two debugging options are incompatible.
8134 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8135 is defined.
8136 (mem_init, mem_insert, mem_insert_fixup):
8137 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8138 (NEED_MEM_INSERT): Remove; no longer needed.
8139
8140 2012-04-22 Leo Liu <sdl.web@gmail.com>
8141
8142 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8143
8144 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8145
8146 * sysdep.c [__FreeBSD__]: Minor cleanups.
8147 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8148 Use Emacs indenting style more consistently. Avoid some casts.
8149 Use 'double' consistently rather than mixing 'float' and 'double'.
8150
8151 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8152
8153 * sysdep.c (list_system_processes, system_process_attributes):
8154 Add implementation for FreeBSD (Bug#5243).
8155
8156 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8157
8158 * lisp.mk (lisp): Update.
8159
8160 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8161
8162 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8163 It is never used otherwise.
8164
8165 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8166
8167 * print.c (print_preprocess): Only check print_depth if print-circle
8168 is nil.
8169 (print_object): Check for cycles even when print-circle is nil and
8170 print-gensym is t, but only check print_depth if print-circle is nil.
8171
8172 2012-04-20 Chong Yidong <cyd@gnu.org>
8173
8174 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8175 set the status to "failed" and ensure that sentinel is run.
8176
8177 2012-04-20 Glenn Morris <rgm@gnu.org>
8178
8179 * process.c (Fset_process_inherit_coding_system_flag)
8180 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8181 (Fmake_network_process, Fmake_serial_process): Doc fix.
8182
8183 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8184
8185 * xdisp.c (string_buffer_position_lim): Limit starting position to
8186 BEGV.
8187 (set_cursor_from_row): If called for a mode-line or header-line
8188 row, return zero immediately.
8189 (try_cursor_movement): If inside continuation line, don't back up
8190 farther than the first row after the header line, if any.
8191 Don't consider the header-line row as "partially visible", even if
8192 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8193
8194 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8195
8196 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8197 (bug#11238).
8198
8199 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8200 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8201
8202 configure: new option --enable-gcc-warnings (Bug#11207)
8203 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8204 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8205 (ALL_CFLAGS): Use new macros rather than old.
8206 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8207 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8208 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8209 -Wunused-result, -Wunused-variable. This should go away once
8210 the Emacs and Gnulib regex code is merged.
8211 (xmalloc, xrealloc): Now static.
8212
8213 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8214
8215 * dired.c (Fsystem_groups): Remove unused local.
8216
8217 2012-04-17 Glenn Morris <rgm@gnu.org>
8218
8219 * dired.c (Fsystem_users): Doc fix.
8220
8221 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8222
8223 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8224 (syms_of_dired): Add them.
8225
8226 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8227
8228 Fix minor alloc.c problems found by static checking.
8229 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8230 New extern decls, to avoid calling undeclared functions.
8231 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8232 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8233 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8234 (NEED_MEM_INSERT): New macro.
8235 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8236 Remove one incorrect comment and fix another.
8237
8238 Fix minor ralloc.c problems found by static checking.
8239 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8240 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8241 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8242 (r_alloc_sbrk): Now static.
8243
8244 Improve ralloc.c interface checking.
8245 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8246 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8247 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8248 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8249 [REL_ALLOC]: ... to here, to check interface.
8250 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8251 Remove decls. This fixes an "It stinks!".
8252
8253 * alloc.c (which_symbols): Fix alignment issue / type clash.
8254
8255 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8256
8257 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8258 (struct Lisp_Misc_Any): Likewise.
8259 (struct Lisp_Free): Likewise.
8260 * alloc.c (union aligned_Lisp_Symbol): Define.
8261 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8262 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8263 (union aligned_Lisp_Misc): Define.
8264 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8265 aligned_Lisp_Misc instead of union Lisp_Misc.
8266 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8267
8268 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8269
8270 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8271 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8272 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8273 * s/netbsd.h, s/sol2-6.h:
8274 Remove definition of GC_MARK_STACK, since the default now works.
8275 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8276 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8277 no longer the default.
8278 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8279
8280 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8281
8282 * lread.c (lisp_file_lexically_bound_p):
8283 Fix hang at ";-*-\n" (bug#11238).
8284
8285 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8286
8287 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8288 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8289
8290 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8291
8292 * nsterm.m (constrainFrameRect): Always constrain when there is only
8293 one screen (Bug#10962).
8294
8295 2012-04-13 Ken Brown <kbrown@cornell.edu>
8296
8297 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8298
8299 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8300
8301 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8302
8303 2012-04-11 Daniel Colascione <dancol@dancol.org>
8304
8305 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8306 against is gone. It's better to use vfork now so that when Cygwin
8307 gains a new, working vfork, we use it automatically (bug#10398).
8308
8309 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8310
8311 * window.c (save_window_save): Obey window-point-insertion-type.
8312
8313 2012-04-11 Glenn Morris <rgm@gnu.org>
8314
8315 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8316
8317 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8318
8319 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8320
8321 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8322
8323 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8324 (force_quit_count): New var.
8325 (handle_interrupt): Use it.
8326
8327 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8328
8329 * w32.c (w32_delayed_load): Record the full path of the library
8330 being loaded (bug#10424).
8331
8332 2012-04-09 Glenn Morris <rgm@gnu.org>
8333
8334 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8335 not just in the obarray, before snarfing them. (Bug#11036)
8336
8337 * Makefile.in ($(leimdir)/leim-list.el):
8338 Pass EMACS rather than BUILT_EMACS.
8339
8340 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8341
8342 * process.c (make_process):
8343 * process.h: Add integer `gnutls_handshakes_tried' member to
8344 process struct.
8345
8346 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8347 Add convenience `GNUTLS_LOG2i' macro.
8348
8349 * gnutls.c (gnutls_log_function2i): Convenience log function.
8350 (emacs_gnutls_read): Use new log functions,
8351 `gnutls_handshakes_tried' process member, and
8352 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8353 attempts per process (connection).
8354
8355 2012-04-09 Chong Yidong <cyd@gnu.org>
8356
8357 * eval.c (Fuser_variable_p, user_variable_p_eh)
8358 (lisp_indirect_variable): Functions deleted.
8359 (Fdefvar): Caller changed.
8360
8361 * callint.c (Finteractive, Fcall_interactively):
8362 * minibuf.c (Fread_variable): Callers changed.
8363
8364 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8365
8366 * xdisp.c (set_cursor_from_row): If the display string appears in
8367 the buffer at position that is closer to point than the position
8368 after the display string, display the cursor on the first glyph of
8369 the display string. Fixes cursor display when a 'display' text
8370 property immediately follows invisible text. (Bug#11094)
8371
8372 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8373
8374 composite.c: use 'double' consistently
8375 * composite.c (get_composition_id): Use 'double' consistently
8376 instead of converting 'float' to 'double' and vice versa; this is
8377 easier to understand and avoids a GCC warning.
8378
8379 2012-04-09 Glenn Morris <rgm@gnu.org>
8380
8381 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8382 preparation for dumping it with emacs. (Bug#4789)
8383 (leimdir): New variable.
8384 ($(leimdir)/leim-list.el): New rule.
8385 (emacs$(EXEEXT)): Depend on leim-list.el.
8386
8387 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8388 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8389 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8390
8391 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8392
8393 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8394 proper alignment.
8395
8396 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8397
8398 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8399 Remove unused local variable.
8400
8401 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8402
8403 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8404 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8405 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8406 objects, as mark_maybe_pointer will catch them otherwise.
8407 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8408 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8409
8410 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8411
8412 Fix typo that broke non-Windows builds.
8413 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8414
8415 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8416
8417 Support building on MS-Windows with libxml2.
8418
8419 * makefile.w32-in (OBJ2): Add xml.$(O).
8420 (GLOBAL_SOURCES): Add xml.c.
8421 ($(BLD)/xml.$(O)): New dependency list.
8422
8423 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8424 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8425 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8426 [!WINDOWSNT]: New macros.
8427 (init_libxml2_functions, libxml2_loaded_p): New functions.
8428 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8429 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8430 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8431 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8432 linked in).
8433 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8434 Call init_libxml2_functions before calling libxml2 functions.
8435 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8436
8437 * emacs.c: Don't include libxml/parser.h.
8438 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8439 xmlCleanupParser directly.
8440
8441 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8442
8443 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8444
8445 * indent.c (Fvertical_motion): If there is a display string at
8446 point, use it.vpos to compute how many lines to backtrack after
8447 move_it_to point. (Bug#11133)
8448
8449 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8450
8451 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8452 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8453 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8454 macros related to unification of CJK characters. For the details,
8455 see the discussion following the message here:
8456 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8457
8458 2012-04-04 Chong Yidong <cyd@gnu.org>
8459
8460 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8461
8462 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8463
8464 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8465 instead of alloca. (Bug#11138)
8466
8467 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8468
8469 * w32menu.c (is_simple_dialog): Properly check lisp types.
8470 (Bug#11141)
8471
8472 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8473
8474 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8475 position we get to after a call to move_it_to fails the
8476 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8477 only if we wind up in a string from display property. (Bug#11063)
8478
8479 * window.c (Fdelete_other_windows_internal): Invalidate the row
8480 and column information about mouse highlight, so that redisplay
8481 restores it after reallocating the glyph matrices. (Bug#7464)
8482
8483 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8484 string comes from a `display' text property, use the buffer
8485 position of that property as if we actually saw that position in
8486 the row's glyphs.
8487 (move_it_by_lines): Remove the assertion that
8488 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8489 violated when there's a before-string at the beginning of a line.
8490 (Bug#11063)
8491
8492 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8493
8494 * xdisp.c (append_space_for_newline): If the default face was
8495 remapped, use the remapped face for the appended newline.
8496 (extend_face_to_end_of_line): Use the remapped default face for
8497 extending the face to the end of the line.
8498 (display_line): Call extend_face_to_end_of_line when the default
8499 face was remapped. (Bug#11068)
8500
8501 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8502
8503 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8504
8505 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8506
8507 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8508
8509 2012-03-27 Glenn Morris <rgm@gnu.org>
8510
8511 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8512 Doc fixes.
8513
8514 2012-03-26 Kenichi Handa <handa@m17n.org>
8515
8516 * dispextern.h (struct glyph): Fix previous change. Change the
8517 bit length of glyphless.ch to 25 (Bug#11082).
8518
8519 2012-03-26 Chong Yidong <cyd@gnu.org>
8520
8521 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8522 (command_loop_1): Use it; inhibit selection update for
8523 handle-select-window too (Bug#8996).
8524
8525 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8526
8527 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8528
8529 2012-03-25 Kenichi Handa <handa@m17n.org>
8530
8531 * dispextern.h (struct glyph): Change the bit length of
8532 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8533
8534 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8535
8536 * s/ms-w32.h (tzname): Include time.h before redirecting to
8537 _tzname. Fixes the MSVC build. (Bug#9960)
8538
8539 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8540
8541 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8542 characters.
8543
8544 * xterm.c (XTread_socket): Only modify handling_signal if
8545 !SYNC_INPUT. (Bug#11080)
8546
8547 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8548
8549 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8550 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8551 when fetching a multibyte character consumes more bytes than
8552 CHAR_BYTES returns, due to unification of CJK characters in
8553 string_char. (Bug#11073)
8554
8555 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8556
8557 * process.c (wait_reading_process_output): Handle pty disconnect
8558 by refraining from sending oneself a SIGCHLD (bug#10933).
8559
8560 2012-03-22 Chong Yidong <cyd@gnu.org>
8561
8562 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8563
8564 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8565 Mark string as coming from a prefix property.
8566 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8567 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8568
8569 2012-03-21 Chong Yidong <cyd@gnu.org>
8570
8571 * xfaces.c (Vface_remapping_alist): Doc fix.
8572
8573 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8574
8575 * w32proc.c (Fw32_set_console_codepage)
8576 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8577 Doc fixes.
8578
8579 2012-03-20 Chong Yidong <cyd@gnu.org>
8580
8581 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8582 to reflect default non-nil value of redisplay-dont-pause.
8583
8584 2012-03-19 Kenichi Handa <handa@m17n.org>
8585
8586 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8587 it fit in a valid range (Bug#11003).
8588
8589 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8590
8591 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8592 that is not from display property, accept the row as a "cursor
8593 row" if one of the string's character has a non-nil `cursor'
8594 property. Fixes cursor positioning when there are newlines in
8595 overlay strings, e.g. in icomplete.el. (Bug#11035)
8596
8597 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8598
8599 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8600
8601 2012-03-12 Chong Yidong <cyd@gnu.org>
8602
8603 * eval.c (inhibit_lisp_code): Rename from
8604 inhibit_window_configuration_change_hook; move from window.c.
8605
8606 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8607 * window.c (run_window_configuration_change_hook)
8608 (syms_of_window): Callers changed.
8609
8610 2012-03-11 Chong Yidong <cyd@gnu.org>
8611
8612 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8613
8614 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8615
8616 2012-03-10 Chong Yidong <cyd@gnu.org>
8617
8618 * frame.c (other_visible_frames): Don't assume the selected frame
8619 is visible (Bug#10955).
8620
8621 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8622
8623 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8624
8625 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8626
8627 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8628 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8629 zero (Bug#10954).
8630
8631 2012-03-03 Glenn Morris <rgm@gnu.org>
8632
8633 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8634
8635 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8636
8637 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8638 position past the first glyph_row that ends at ZV. (Bug#10902)
8639 (redisplay_window, next_element_from_string): Fix typos in
8640 comments.
8641 (redisplay_window): Pass to move_it_vertically the margin in
8642 pixels, not in screen lines.
8643
8644 2012-03-02 Glenn Morris <rgm@gnu.org>
8645
8646 * buffer.c (buffer-list-update-hook): Doc fix.
8647
8648 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8649
8650 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8651 push_it before setting up the iterator for the first overlay
8652 string, even if we have an empty string loaded.
8653 (next_overlay_string): If there's an empty string on the iterator
8654 stack, pop the stack. (Bug#10903)
8655
8656 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8657
8658 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8659 Suggested by Stefan Monnier in
8660 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8661 * alloc.c (widen_to_Lisp_Object): New static function.
8662 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8663 and widening them to Lisp_Objects. This would work even if
8664 USE_LSB_TAG is defined and wide integers are used, which might
8665 happen in a future version of Emacs.
8666
8667 2012-02-25 Chong Yidong <cyd@gnu.org>
8668
8669 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8670 Doc fix.
8671
8672 * xselect.c (Fx_selection_exists_p): Doc fix.
8673 (x_clipboard_manager_save_all): Print an informative message
8674 before saving to clipboard manager.
8675
8676 2012-02-24 Chong Yidong <cyd@gnu.org>
8677
8678 * keyboard.c (process_special_events): Handle all X selection
8679 requests in kbd_buffer, not just the next one (Bug#8869).
8680
8681 2012-02-23 Chong Yidong <cyd@gnu.org>
8682
8683 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8684 call when setting menu-bar-lines and tool-bar-lines parameters.
8685 (unwind_create_frame_1): New helper function.
8686
8687 * window.c (inhibit_window_configuration_change_hook): New var.
8688 (run_window_configuration_change_hook): Obey it.
8689 (syms_of_window): Initialize it.
8690
8691 2012-02-22 Chong Yidong <cyd@gnu.org>
8692
8693 * xterm.c (x_draw_image_relief): Add missing type check for
8694 Vtool_bar_button_margin (Bug#10743).
8695
8696 2012-02-21 Chong Yidong <cyd@gnu.org>
8697
8698 * fileio.c (Vfile_name_handler_alist): Doc fix.
8699
8700 * buffer.c (Fget_file_buffer): Protect against invalid file
8701 handler return value.
8702
8703 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8704
8705 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8706 when computing $valmask.
8707
8708 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8709 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8710 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8711 It's useless in that case, and it can cause problems on hosts
8712 that allocate halves of EMACS_INT values separately.
8713 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8714 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8715 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8716 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8717 it avoids undefined behavior on hosts where shifting right by more
8718 than the word width has undefined behavior.
8719
8720 2012-02-19 Chong Yidong <cyd@gnu.org>
8721
8722 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8723 (Funhandled_file_name_directory, Ffile_name_as_directory)
8724 (Fdirectory_file_name, Fexpand_file_name)
8725 (Fsubstitute_in_file_name): Protect against invalid file handler
8726 return values (Bug#10845).
8727
8728 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8729
8730 * .gdbinit (pitx): Fix incorrect references to fields of the
8731 iterator stack.
8732
8733 2012-02-17 Chong Yidong <cyd@gnu.org>
8734
8735 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8736
8737 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8738
8739 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8740 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8741
8742 2012-02-15 Chong Yidong <cyd@gnu.org>
8743
8744 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8745 marked as special. Also, starting docstrings with * is obsolete.
8746
8747 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8748
8749 * gnutls.c (emacs_gnutls_write): Fix last change.
8750
8751 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8752
8753 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8754 send_process.
8755
8756 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8757
8758 * keymap.c (Fsingle_key_description): Handle char ranges.
8759
8760 2012-02-12 Chong Yidong <cyd@gnu.org>
8761
8762 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8763 as that creates a dangerous corner case.
8764
8765 * window.c (Fdelete_window_internal): Invalidate the mouse
8766 highlight (Bug#9904).
8767
8768 2012-02-12 Glenn Morris <rgm@gnu.org>
8769
8770 * xselect.c (Fx_own_selection_internal)
8771 (Fx_get_selection_internal, Fx_disown_selection_internal)
8772 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8773 * nsselect.m (Fx_own_selection_internal)
8774 (Fx_disown_selection_internal, Fx_selection_exists_p)
8775 (Fx_selection_owner_p, Fx_get_selection_internal):
8776 Sync docs and argument specs with the xselect.c versions.
8777
8778 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8779
8780 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8781
8782 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8783
8784 * w32select.c (Fx_selection_exists_p): Sync doc string and
8785 argument list with xselect.c. (Bug#10783)
8786
8787 * w16select.c (Fx_selection_exists_p): Sync doc string and
8788 argument list with xselect.c. (Bug#10783)
8789
8790 2012-02-10 Glenn Morris <rgm@gnu.org>
8791
8792 * fns.c (Fsecure_hash): Doc fix.
8793
8794 2012-02-09 Kenichi Handa <handa@m17n.org>
8795
8796 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8797
8798 2012-02-07 Chong Yidong <cyd@gnu.org>
8799
8800 * buffer.c (Fbuffer_local_variables)
8801 (buffer_lisp_local_variables): Handle unbound vars correctly;
8802 don't let Qunbound leak into Lisp.
8803
8804 2012-02-07 Glenn Morris <rgm@gnu.org>
8805
8806 * image.c (Fimagemagick_types): Doc fix.
8807
8808 * image.c (imagemagick-render-type): Change it from a lisp object
8809 to an integer. Move the doc here from the lisp manual.
8810 Treat all values not equal to 0 the same.
8811
8812 2012-02-06 Chong Yidong <cyd@gnu.org>
8813
8814 * doc.c (store_function_docstring): Avoid applying docstring of
8815 alias to base function (Bug#2603).
8816
8817 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8818
8819 * .gdbinit (pp1, pv1): Remove redundant defines.
8820 (pr): Use pp.
8821
8822 2012-02-04 Chong Yidong <cyd@gnu.org>
8823
8824 * nsterm.m: Declare a global (Bug#10694).
8825
8826 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8827
8828 * w32.c (get_emacs_configuration_options):
8829 Include --enable-checking, if specified, in the return value.
8830
8831 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8832
8833 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8834 after rounding frame sizes. (Bug#9723)
8835
8836 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8837
8838 * keyboard.c (adjust_point_for_property): Don't position point
8839 before BEGV. (Bug#10696)
8840
8841 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8842
8843 Handle overflow when computing char display width (Bug#9496).
8844 * character.c (char_width): Return EMACS_INT, not int.
8845 (char_width, c_string_width): Check for overflow when
8846 computing the width; this is possible now that individual
8847 characters can have unbounded width. Problem introduced
8848 by merge from Emacs 23 on 2012-01-19.
8849
8850 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8851
8852 * dbusbind.c (Fdbus_register_method): Mention the return value
8853 :ignore in the docstring.
8854
8855 2012-02-02 Glenn Morris <rgm@gnu.org>
8856
8857 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8858
8859 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8860 Unconditionally set to t. (Bug#10673)
8861 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8862 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8863 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8864
8865 2012-02-02 Kenichi Handa <handa@m17n.org>
8866
8867 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8868 0, do not call append_composite_glyph.
8869
8870 2012-02-02 Kenichi Handa <handa@m17n.org>
8871
8872 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8873 NULL (Bug#6988).
8874 (x_produce_glyphs): If the component of a composition is a null
8875 string, set it->pixel_width to 1 to avoid zero-width glyph.
8876
8877 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8878
8879 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8880 first 2 arguments are identical. This makes inserting large
8881 output from a subprocess an order of magnitude faster on
8882 MS-Windows, where all sbrk'ed memory is always contiguous.
8883
8884 2012-01-31 Glenn Morris <rgm@gnu.org>
8885
8886 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8887 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8888 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8889
8890 2012-01-29 Glenn Morris <rgm@gnu.org>
8891
8892 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8893
8894 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8895
8896 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8897
8898 2012-01-28 Chong Yidong <cyd@gnu.org>
8899
8900 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8901
8902 2012-01-26 Chong Yidong <cyd@gnu.org>
8903
8904 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8905
8906 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8907 repeat counts (Bug#10507).
8908
8909 2012-01-26 Glenn Morris <rgm@gnu.org>
8910
8911 * lread.c (syms_of_lread): Doc fix.
8912
8913 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8914
8915 * coding.c (encode_designation_at_bol): Change return value to
8916 EMACS_INT.
8917
8918 2012-01-25 Chong Yidong <cyd@gnu.org>
8919
8920 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8921
8922 2012-01-21 Chong Yidong <cyd@gnu.org>
8923
8924 * floatfns.c (Fcopysign): Make the second argument non-optional,
8925 since nil is not allowed anyway.
8926
8927 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8928
8929 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8930 (send_process): Likewise.
8931
8932 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8933
8934 * window.c (save_window_save, Fcurrent_window_configuration)
8935 (Vwindow_persistent_parameters): Do not use Qstate.
8936 Rewrite doc-strings.
8937
8938 2012-01-19 Kenichi Handa <handa@m17n.org>
8939
8940 * character.c (char_width): New function.
8941 (Fchar_width, c_string_width, lisp_string_width):
8942 Use char_width (Bug#9496).
8943
8944 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8945
8946 * window.c (Vwindow_persistent_parameters): New variable.
8947 (Fset_window_configuration, save_window_save): Handle persistent
8948 window parameters.
8949
8950 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8951
8952 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8953 thrashing the stack of the thread. (Bug#9087)
8954
8955 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8956
8957 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8958
8959 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8960
8961 * xdisp.c (rows_from_pos_range): Handle the case where the
8962 highlight ends on a newline. (Bug#10464)
8963 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8964 he end column for display of highlight that ends on a newline
8965 before a R2L line.
8966
8967 2012-01-11 Glenn Morris <rgm@gnu.org>
8968
8969 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8970 from load-path also when installation-directory is nil. (Bug#10208)
8971
8972 2012-01-10 Glenn Morris <rgm@gnu.org>
8973
8974 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8975
8976 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8977 Update template values to be closer to their typical values these days.
8978
8979 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8980
8981 * xdisp.c (rows_from_pos_range): Accept additional argument
8982 DISP_STRING, and accept any glyph in a row whose object is that
8983 string as eligible for mouse highlight. Fixes mouse highlight of
8984 display strings from overlays. (Bug#10464)
8985
8986 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8987
8988 emacs: fix an auto-save permissions race condition (Bug#10400)
8989 * fileio.c (auto_saving_dir_umask): New static var.
8990 (Fmake_directory_internal): Use it.
8991 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8992 creating the directory. The old code temporarily assigns
8993 too-generous permissions to the directory.
8994 (do_auto_save_eh): Clear it.
8995 (Fdo_auto_save): Catch all errors, not just file errors, so
8996 that the var is always cleared.
8997
8998 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8999
9000 * search.c (scan_buffer): Pass character positions to
9001 know_region_cache, not byte positions. (Bug#6540)
9002
9003 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
9004
9005 * w32.c (sys_rename): Report EXDEV when rename of a directory
9006 fails because the target is on another logical disk. (Bug#10284)
9007
9008 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9009
9010 * xterm.c (x_embed_request_focus): New function.
9011
9012 * xterm.h: Add prototype.
9013
9014 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9015
9016 2012-01-05 Glenn Morris <rgm@gnu.org>
9017
9018 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9019
9020 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9021
9022 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9023 Load gnutls_transport_set_lowat only if GnuTLS version is below
9024 2.11.1.
9025 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9026 GnuTLS versions below 2.11.1.
9027
9028 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9029
9030 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9031 to the doc string advising against its use for altering the way
9032 windows are scrolled.
9033
9034 2011-12-28 Kenichi Handa <handa@m17n.org>
9035
9036 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9037 coding-system ASCII compatible only when it does not produce BOM
9038 on encoding (Bug#10383).
9039
9040 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9041
9042 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9043 can scroll.
9044 (create_and_show_popup_menu): Always use menu_position_func for
9045 Gtk3 (Bug#10361).
9046
9047 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9048
9049 * callint.c (Fcall_interactively): Don't truncate prompt string.
9050
9051 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9052
9053 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9054 property that ends at ZV, so that the bidi iteration could be
9055 resumed from there (after widening). (Bug#10360)
9056
9057 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9058
9059 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9060
9061 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9062
9063 * nsterm.m (x_free_frame_resources):
9064 Release f->output_data.ns->miniimage.
9065 (ns_index_color): Fix indentation. Do not retain
9066 color_table->colors[i].
9067
9068 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9069 before returning.
9070
9071 * nsfns.m (x_set_background_color): Assign return value from
9072 ns_index_color to face-background instead of NSColor*.
9073 (ns_implicitly_set_icon_type): Fix indentation.
9074 Change assignment in for loop to comparison.
9075
9076 * emacs.c (ns_pool): New variable.
9077 (main): Assign ns_pool.
9078 (Fkill_emacs): Call ns_release_autorelease_pool.
9079
9080 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9081 autorelease fdesc, release fdAttrs and tdict.
9082 (ns_get_covering_families): Release charset.
9083 (ns_findfonts): Release NSFontDescriptor created with new.
9084 (ns_uni_to_glyphs): Fix indentation.
9085 (setString): Release attrStr before assigning new value.
9086
9087 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9088
9089 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9090 and NS_IMPL_COCOA.
9091 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9092 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9093
9094 2011-12-18 David Reitter <reitter@cmu.edu>
9095
9096 * nsterm.m (ns_term_init): Subscribe for notifications
9097 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9098 to method trackingNotification in EmacsMenu.
9099
9100 * nsmenu.m (trackingMenu): New variable.
9101 (trackingNotification): New method (from Aquamacs).
9102 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9103 from Aquamacs (Bug#7030).
9104
9105 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9106
9107 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9108 (symbol_to_nsstring): Fix indentation.
9109 (ns_symbol_to_pb): New function.
9110 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9111 (Fns_rotate_cut_buffers_internal): Remove.
9112 (Fns_store_selection_internal): Rename from
9113 Fns_store_cut_buffer_internal.
9114 (ns_get_foreign_selection, Fx_own_selection_internal)
9115 (Fx_disown_selection_internal, Fx_selection_exists_p)
9116 (Fns_get_selection_internal, Fns_store_selection_internal):
9117 Use ns_symbol_to_pb and check if return value is nil.
9118 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9119 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9120 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9121 renamed to Sns_store_selection_internal.
9122 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9123 and remove this function.
9124 (ns_handle_selection_clear): Remove, never used.
9125 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9126 here.
9127
9128 2011-12-17 Ken Brown <kbrown@cornell.edu>
9129
9130 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9131 GID is unknown (Bug#10257).
9132
9133 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9134
9135 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9136 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9137 which caused a build failure on GNU/Linux IA-64. This problem was
9138 introduced by my 2011-10-07 patch.
9139
9140 2011-12-15 Juri Linkov <juri@jurta.org>
9141
9142 * image.c (imagemagick_error): New function. (Bug#10112)
9143 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9144 Use `imagemagick_error' where ImageMagick functions return
9145 `MagickFalse'.
9146 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9147 proper order.
9148
9149 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9150
9151 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9152 fill background (Bug#8992).
9153
9154 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9155
9156 * window.c (Vwindow_combination_resize)
9157 (Vwindow_combination_limit): Use t instead of non-nil in
9158 doc-strings.
9159 (Vrecenter_redisplay): Add first sentence of doc-string on
9160 separate line.
9161 (Frecenter): Fix doc-string typo.
9162
9163 2011-12-11 Kenichi Handa <handa@m17n.org>
9164
9165 * coding.c (Funencodable_char_position): Pay attention to the
9166 buffer text relocation (Bug#9389).
9167
9168 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9169
9170 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9171 gtk_init (Bug#10100).
9172
9173 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9174
9175 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9176 IT->string is nil. (Bug#10263)
9177
9178 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9179
9180 * nsterm.h (x_free_frame_resources): Declare.
9181
9182 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9183 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9184
9185 * nsterm.h (ns_get_defaults_value): Declare.
9186
9187 * nsterm.m (ns_default): Call ns_get_defaults_value.
9188
9189 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9190
9191 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9192 (Bug#10170)
9193
9194 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9195
9196 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9197 that where the value of an _OBJC_* symbol points to is in the .bss
9198 section (Bug#10240).
9199
9200 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9201
9202 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9203 after the loop to call ccl_driver at least once (Bug#8619).
9204
9205 2011-12-08 Kenichi Handa <handa@m17n.org>
9206
9207 * ftfont.c (get_adstyle_property): Fix previous change
9208 (Bug#10233).
9209
9210 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9211
9212 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9213 dirs from the default value of EMACSLOADPATH (bug#10208).
9214
9215 2011-12-07 Glenn Morris <rgm@gnu.org>
9216
9217 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9218 installation and source directories as well. (Bug#10208)
9219
9220 2011-12-06 Chong Yidong <cyd@gnu.org>
9221
9222 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9223
9224 2011-12-06 Glenn Morris <rgm@gnu.org>
9225
9226 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9227 as an error, not just -1. (Bug#10217)
9228
9229 2011-12-05 Chong Yidong <cyd@gnu.org>
9230
9231 * keyboard.c (process_special_events): New function.
9232 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9233
9234 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9235
9236 * coding.c (encode_designation_at_bol): Don't use uninitialized
9237 local variable (Bug#9318).
9238
9239 2011-12-05 Kenichi Handa <handa@m17n.org>
9240
9241 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9242 return Qnil (Bug#8046, Bug#10193).
9243
9244 2011-12-05 Kenichi Handa <handa@m17n.org>
9245
9246 * coding.c (encode_designation_at_bol): New args charbuf_end and
9247 dst. Return the number of produced bytes. Callers changed.
9248 (coding_set_source): Return how many bytes coding->source was
9249 relocated.
9250 (coding_set_destination): Return how many bytes
9251 coding->destination was relocated.
9252 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9253 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9254
9255 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9256
9257 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9258 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9259 macro (Bug#9318).
9260
9261 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9262
9263 The following changes are to fix Bug#9318.
9264
9265 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9266 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9267 (encode_coding_iso_2022, encode_coding_sjis)
9268 (encode_coding_big5, encode_coding_charset): Use the above macros.
9269
9270 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9271
9272 * lisp.h (process_quit_flag): Fix external declaration.
9273
9274 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9275
9276 Don't macro-inline non-performance-critical code.
9277 * eval.c (process_quit_flag): New function.
9278 * lisp.h (QUIT): Use it.
9279
9280 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9281
9282 * nsfns.m (get_geometry_from_preferences): New function.
9283 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9284
9285 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9286
9287 * emacs.c (Qkill_emacs): Define.
9288 (syms_of_emacs): Initialize it.
9289 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9290 Qquit_flag to `kill-emacs' instead.
9291 (quit_throw_to_read_char): Add parameter `from_signal'.
9292 All callers changed. Call Fkill_emacs if requested and safe.
9293 * lisp.h (QUIT): Call Fkill_emacs if requested.
9294
9295 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9296
9297 * widget.c (update_wm_hints): Return if wmshell is null.
9298 (widget_update_wm_size_hints): New function.
9299
9300 * widget.h (widget_update_wm_size_hints): Declare.
9301
9302 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9303 widget_update_wm_size_hints (Bug#10104).
9304
9305 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9306
9307 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9308 before a newline, prepare the bidi iterator for consuming the
9309 newline, and keep the current paragraph direction. (Bug#10183)
9310 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9311
9312 2011-12-02 Juri Linkov <juri@jurta.org>
9313
9314 * search.c (Fword_search_regexp): New Lisp function created from
9315 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9316 (Fword_search_backward, Fword_search_forward)
9317 (Fword_search_backward_lax, Fword_search_forward_lax):
9318 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9319 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9320
9321 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9322
9323 * fileio.c (Finsert_file_contents): Move after-change-function call
9324 to before the "handled:" label, since all "goto handled" appear in
9325 cases where the *-change-functions have already been properly called
9326 (bug#10117).
9327
9328 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9329
9330 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9331 waiting for input. (Bug#10169)
9332
9333 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9334
9335 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9336 verifies glyph row's hash code--we have just reallocated the
9337 glyphs, so their contents can be complete garbage. (Bug#10164)
9338
9339 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9340
9341 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9342
9343 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9344
9345 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9346 attributes are tested _before_ calling verify_row_hash, to protect
9347 against GCC re-ordering of the tests. (Bug#10164)
9348
9349 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9350
9351 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9352
9353 * xterm.c (handle_one_xevent): Only set async_visible and friends
9354 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9355 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9356 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9357
9358 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9359
9360 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9361 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9362 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9363 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9364 All uses changed to use GCPRO1 etc.
9365 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9366 Revert to old implementation (i.e., before 2011-03-11).
9367
9368 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9369
9370 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9371 of scroll runs so as to avoid assigning disabled bogus rows and
9372 unnecessary graphics copy operations.
9373
9374 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9375
9376 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9377 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9378 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9379 (malloc, free, realloc, calloc): Redirect to e_* only when
9380 compiling Emacs.
9381
9382 * lisp.h (GCTYPEBITS): Move before first use.
9383 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9384 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9385 this macro definition.
9386
9387 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9388 _MSC_VER.
9389
9390 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9391
9392 * gtkutil.c (xg_create_frame_widgets):
9393 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9394 present with Gtk+ 2.0.
9395
9396 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9397
9398 * fileio.c (Finsert_file_contents): Undo previous change; see
9399 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9400
9401 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9402
9403 Rename locals to avoid shadowing.
9404 * fileio.c (Finsert_file_contents):
9405 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9406 * process.c (wait_reading_process_output):
9407 Rename inner 'proc' to 'p' to avoid shadowing.
9408 Indent for consistency with usual Emacs style.
9409
9410 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9411
9412 * xdisp.c (redisplay_window): If cursor row is not fully visible
9413 after recentering, and scroll-conservatively is set to a large
9414 number, scroll window by a few more lines to make the cursor fully
9415 visible and out of scroll-margin. (Bug#10105)
9416 (start_display): Don't move to the next line if the display should
9417 start at a newline that is part of a display vector or an overlay
9418 string. (Bug#10119)
9419
9420 2011-11-24 Juri Linkov <juri@jurta.org>
9421
9422 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9423 after the `MagickPingImage' call. (Bug#10112)
9424
9425 2011-11-23 Chong Yidong <cyd@gnu.org>
9426
9427 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9428
9429 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9430
9431 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9432 making another buffer current. (Bug#10114)
9433
9434 2011-11-23 Glenn Morris <rgm@gnu.org>
9435
9436 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9437
9438 2011-11-23 Chong Yidong <cyd@gnu.org>
9439
9440 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9441 using it (Bug#5984).
9442
9443 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9444
9445 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9446 and header-lines, as they don't have one computed for them.
9447 (Bug#10098)
9448
9449 * .gdbinit (prow): Make displayed values more self-explaining.
9450 Add row's hash code.
9451
9452 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9453
9454 * process.c (wait_reading_process_output): Fix asynchrounous
9455 GnuTLS socket handling on some versions of the GnuTLS library.
9456 (wait_reading_process_output): Add comment and URL.
9457
9458 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9459
9460 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9461
9462 2011-11-21 Chong Yidong <cyd@gnu.org>
9463
9464 * window.c (Fnext_window, Fprevious_window): Doc fix.
9465
9466 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9467
9468 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9469
9470 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9471
9472 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9473
9474 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9475
9476 * window.c (Fset_window_combination_limit): Rename argument
9477 STATUS to LIMIT.
9478 (Vwindow_combination_limit): Remove "status" from doc-string.
9479
9480 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9481
9482 * m/ibms390.h: Remove.
9483 * m/ibms390x.h: Don't include "ibms390.h".
9484
9485 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9486
9487 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9488 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9489
9490 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9491
9492 * casetab.c (Fset_case_table):
9493 * charset.c (Fcharset_after): Fix typos.
9494
9495 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9496
9497 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9498 Otherwise, valgrind does not work on some platforms.
9499 Problem reported by Andreas Schwab in
9500 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9501 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9502 is set, removing the need for VIRT_ADDRESS_VARIES.
9503 (PURE_P): Use a more-efficient implementation that needs just one
9504 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9505 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9506 to 4 (xorl, subq, cmpq, setbe).
9507 * alloc.c (pure): Always extern now, since that's the
9508 VIRT_ADDR_VARIES behavior.
9509 (PURE_POINTER_P): Use a single comparison, not two, for
9510 consistency with the new puresize.h.
9511 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9512 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9513 Remove VIRT_ADDR_VARIES no longer needed.
9514
9515 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9516
9517 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9518 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9519 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9520 behave as if the cursor position were at the window margin.
9521
9522 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9523 and the cursor position is out of bounds, behave as if the cursor
9524 position were at the window margin. (Bug#10075)
9525
9526 2011-11-18 Chong Yidong <cyd@gnu.org>
9527
9528 * window.c (Fwindow_combination_limit): Make first argument
9529 non-optional, since it is meaningless for live windows like the
9530 selected window.
9531
9532 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9533
9534 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9535
9536 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9537
9538 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9539 (graft_intervals_into_buffer): Simplify.
9540
9541 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9542
9543 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9544 hash values of the two rows.
9545 (copy_row_except_pointers): Preserve the used[] arrays and the
9546 hash values of the two rows. (Bug#10035)
9547 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9548
9549 * xdisp.c (row_hash): New function, body extracted from
9550 compute_line_metrics.
9551 (compute_line_metrics): Call row_hash, instead of computing the
9552 hash code inline.
9553
9554 * dispnew.c (verify_row_hash): Call row_hash for computing the
9555 hash code of a row, instead of duplicating code from xdisp.c.
9556
9557 * dispextern.h (row_hash): Add prototype.
9558
9559 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9560
9561 * frame.c (delete_frame): Don't delete the terminal when the last
9562 X frame is closed if emacs is built with GTK toolkit.
9563
9564 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9565
9566 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9567
9568 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9569
9570 * window.c (Vwindow_splits): Rename to
9571 Vwindow_combination_resize. Suggested by Juri Linkov.
9572 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9573 of Vwindow_splits.
9574
9575 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9576
9577 * nsfns.m (Fns_font_name):
9578 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9579
9580 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9581
9582 * window.h (window): Rename slot "nest" to "combination_limit".
9583 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9584 (Fset_window_nest): Rename to Fset_window_combination_limit.
9585 (Vwindow_nest): Rename to Vwindow_combination_limit.
9586 (recombine_windows, make_parent_window, make_window)
9587 (Fsplit_window_internal, saved_window)
9588 (Fset_window_configuration, save_window_save): Rename all
9589 occurrences of window_nest to window_combination_limit.
9590
9591 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9592
9593 * image.c (imagemagick_load_image): Fix typo.
9594
9595 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9596
9597 * xdisp.c (display_line): Move the call to
9598 highlight_trailing_whitespace before the call to
9599 compute_line_metrics, since the latter needs to see the final
9600 faces of all the glyphs to compute ROW's hash value.
9601 Fixes assertion violations in row_equal_p. (Bug#10035)
9602
9603 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9604
9605 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9606 just return (bug#10044).
9607
9608 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9609
9610 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9611 with user-defined heap size. Bump the default size of the temacs
9612 heap to 27MB, to avoid memory warning when running temacs.
9613 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9614
9615 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9616 current_matrix and desired_matrix. (Bug#9990)
9617 (verify_row_hash) [XASSERTS]: New function.
9618 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9619 that the hash value of glyph rows is correct.
9620
9621 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9622
9623 * window.h (window): Remove splits slot.
9624 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9625 (Fdelete_other_windows_internal, make_parent_window)
9626 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9627 (Fset_window_configuration, save_window_save): Don't deal with
9628 split status of windows.
9629 (saved_window): Remove splits slot.
9630 (Vwindow_splits): Rewrite doc-string.
9631
9632 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9633
9634 * xfns.c (unwind_create_frame):
9635 * nsfns.m (unwind_create_frame):
9636 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9637 Vframe_list (Bug#9999).
9638
9639 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9640
9641 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9642
9643 2011-11-11 Kenichi Handa <handa@m17n.org>
9644
9645 * callproc.c (Fcall_process): Set the member dst_multibyte of
9646 process_coding.
9647
9648 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9649
9650 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9651 avoid a crash (bug#9496).
9652
9653 2011-11-09 Chong Yidong <cyd@gnu.org>
9654
9655 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9656 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9657
9658 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9659
9660 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9661
9662 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9663
9664 Avoid some portability problems by eschewing 'extern inline' functions.
9665 The trivial performance wins aren't worth the portability hassles; see
9666 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9667 et seq.
9668 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9669 (window_box_width, window_box_left, window_box_left_offset)
9670 (window_box_right, window_box_right_offset): Undo previous change,
9671 by removing the "extern"s.
9672 * intervals.c (adjust_intervals_for_insertion)
9673 (adjust_intervals_for_deletion): Undo previous change,
9674 making these static again.
9675 (offset_intervals, temp_set_point_both, temp_set_point)
9676 (copy_intervals_to_string): No longer inline.
9677 * xdisp.c (window_text_bottom_y, window_box_width)
9678 (window_box_height, window_box_left_offset)
9679 (window_box_right_offset, window_box_left, window_box_right)
9680 (window_box): No longer inline.
9681
9682 2011-11-08 Chong Yidong <cyd@gnu.org>
9683
9684 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9685 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9686 Signal an error if not a live window.
9687 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9688 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9689
9690 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9691
9692 * lisp.h (syms_of_abbrev): Remove declaration.
9693 Reported by CHENG Gao <chenggao@royau.me>.
9694
9695 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9696
9697 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9698 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9699 of temacs in GUI mode.
9700
9701 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9702
9703 * window.h: Declare delete_all_child_windows instead of
9704 delete_all_subwindows.
9705 * window.c (Fwindow_nest, Fset_window_nest)
9706 (Fset_window_new_total, Fset_window_new_normal)
9707 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9708 (delete_all_subwindows): Rename to delete_all_child_windows.
9709 (Fdelete_other_windows_internal, Fset_window_configuration):
9710 Call delete_all_child_windows instead of delete_all_subwindows.
9711 * frame.c (delete_frame): Call delete_all_child_windows instead
9712 of delete_all_subwindows.
9713
9714 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9715
9716 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9717 This is also needed for porting to any host where GC_MARK_STACK is
9718 not GC_MAKE_GCPROS_NOOPS.
9719 (which_symbols): Use it.
9720
9721 2011-11-07 Kenichi Handa <handa@m17n.org>
9722
9723 * coding.c (coding_set_destination): Check coding->src_pos only
9724 when coding->src_object is a buffer (bug#9910).
9725
9726 * process.c (send_process): Set the member src_multibyte of coding
9727 to 0 (bug#9911) when sending a unibyte text.
9728
9729 * callproc.c (Fcall_process): Set the member src_multibyte of
9730 process_coding to 0 (bug#9912).
9731
9732 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9733
9734 * xmenu.c (cleanup_widget_value_tree): New function.
9735 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9736 calling free_menubar_widget_value_tree directly (Bug#9830).
9737
9738 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9739
9740 Fix some portability problems with 'inline'.
9741 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9742 (window_box_width, window_box_left, window_box_left_offset)
9743 (window_box_right, window_box_right_offset): Declare extern.
9744 Otherwise, these inline functions do not conform to C99 and
9745 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9746 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9747 * intervals.c (adjust_intervals_for_insertion)
9748 (adjust_intervals_for_deletion): Now extern, because otherwise the
9749 extern inline functions 'offset_intervals' couldn't refer to it.
9750 (static_offset_intervals): Remove.
9751 (offset_intervals): Rewrite using the old contents of
9752 static_offset_intervals. The old version didn't conform to C99
9753 because an extern inline function contained a reference to an
9754 identifier with static linkage.
9755
9756 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9757
9758 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9759 GC.
9760
9761 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9762
9763 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9764 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9765 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9766 return Qleft_to_right.
9767
9768 2011-11-06 Chong Yidong <cyd@gnu.org>
9769
9770 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9771 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9772 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9773 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9774 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9775 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9776 (Fwindow_vscroll): Doc fix.
9777 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9778 argument, since it makes no sense to pass a live window and for
9779 consistency with window-child.
9780
9781 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9782
9783 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9784 support MSVC.
9785
9786 2011-11-05 Jason Rumney <jasonr@gnu.org>
9787
9788 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9789 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9790 fonts (Bug#6029).
9791 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9792 bitwise arithmetic preventing use of unicode-sip and non-truetype
9793 opentype fonts.
9794
9795 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9796
9797 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9798 "emacs"-only part.
9799
9800 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9801 initialization code to keep similarity to xfns.c after changes
9802 from 2011-11-05.
9803
9804 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9805
9806 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9807 (unwind_create_frame): New function (Bug#9943).
9808 (Fx_create_frame): Restructure code to be more similar to the one in
9809 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9810 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9811 Move terminal->reference_count++ just before making the frame official
9812 (Bug#9943).
9813
9814 * nsterm.m (x_free_frame_resources): New function.
9815 (x_destroy_window): Move code to x_free_frame_resources.
9816
9817 * xfns.c (unwind_create_frame): Fix comment.
9818 (Fx_create_frame, x_create_tip_frame):
9819 Move terminal->reference_count++ just before making the frame
9820 official. Move initialization of image_cache_refcount and
9821 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9822
9823 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9824
9825 Support MSVC build with newer versions of Visual Studio.
9826 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9827 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9828 nt/gmake.defs.
9829
9830 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9831 which are not supported by MSVC.
9832 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9833 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9834 bitfields.
9835 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9836 types in bitfields.
9837 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9838
9839 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9840
9841 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9842
9843 Support MSVC build with newer versions of Visual Studio.
9844 * w32.c: Don't include w32api.h for MSVC.
9845 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9846
9847 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9848 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9849 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9850 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9851 e_* cousins.
9852 (alloca) [_MSC_VER]: Define to _alloca.
9853
9854 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9855
9856 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9857
9858 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9859
9860 * xdisp.c (note_mouse_highlight): If either of
9861 previous/next-single-property-change returns nil, treat that as
9862 the beginning or the end of the buffer. (Bug#9955)
9863
9864 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9865
9866 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9867 label is not null (Bug#9951).
9868 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9869 may be NULL.
9870
9871 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9872
9873 * window.c (Fwindow_body_size): Mention in the doc string that the
9874 return value is in frame's canonical units. (Bug#9949)
9875
9876 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9877
9878 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9879
9880 * w32fns.c (unwind_create_frame): If needed, free the glyph
9881 matrices of the partially constructed frame. (Bug#9943)
9882 * xfns.c (unwind_create_frame): Likewise.
9883
9884 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9885
9886 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9887 Don't stop backward scan on the continuation glyph, even though
9888 its CHARPOS is positive.
9889 (mouse_face_from_buffer_pos, note_mouse_highlight):
9890 Rename cover_string to disp_string.
9891
9892 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9893
9894 * window.c (temp_output_buffer_show): Don't use
9895 Vtemp_buffer_show_specifiers.
9896 (Vtemp_buffer_show_specifiers): Remove unused variable.
9897
9898 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9899
9900 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9901 past the beginning of the current glyph matrix.
9902
9903 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9904
9905 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9906 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9907 HAVE_GTK3 (Bug#9869).
9908
9909 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9910 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9911
9912 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9913
9914 * xterm.c: Declare x_handle_net_wm_state to return int.
9915 (handle_one_xevent): Check if we are iconified but don't have
9916 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9917 (get_current_wm_state): Return non-zero if not hidden,
9918 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9919 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9920 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9921 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9922
9923 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9924
9925 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9926 so that this new function doesn't get optimized away by a
9927 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9928
9929 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9930
9931 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9932
9933 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9934
9935 Fix the `xbytecode' command.
9936 * .gdbinit (xprintbytestr): New command.
9937 (xwhichsymbols): Rename from `which'; all callers changed.
9938 (xbytecode): Print the byte-code string as well.
9939
9940 2011-10-29 Kim Storm <storm@cua.dk>
9941
9942 * alloc.c (which_symbols): New function.
9943
9944 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9945
9946 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9947 line. (Bug#9903)
9948
9949 2011-10-29 Glenn Morris <rgm@gnu.org>
9950
9951 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9952 Not clear what it was for, and it causes various bugs. (Bug#9839)
9953
9954 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9955
9956 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9957 possible random value that matches one of those tested as
9958 condition to clear the mouse face.
9959
9960 2011-10-28 Chong Yidong <cyd@gnu.org>
9961
9962 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9963
9964 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9965
9966 * window.c (make_window): Initialize phys_cursor_on_p.
9967
9968 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9969
9970 * lisp.h (struct Lisp_Symbol): Update comments.
9971
9972 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9973
9974 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9975
9976 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9977
9978 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9979 <oslsachem@gmail.com> for helping to debug this.
9980
9981 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9982 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9983 (g_b_init_get_glyph_outline_w): New static variables.
9984 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9985 (GetGlyphOutlineW_Proc): New typedefs.
9986 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9987 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9988 New functions.
9989 (w32font_open_internal, compute_metrics):
9990 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9991 instead of calling the "wide" APIs directly.
9992
9993 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9994
9995 * w32.h (syms_of_w32font): Add prototype.
9996
9997 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9998
9999 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10000 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10001 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10002 (Fmove_to_window_line): Doc fix.
10003
10004 2011-10-27 Chong Yidong <cyd@gnu.org>
10005
10006 * process.c (make_process): Set gnutls_state to NULL.
10007
10008 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10009 non-NULL, regardless of GNUTLS_INITSTAGE.
10010 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10011 an error. Set process slots as soon as we allocate them.
10012
10013 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10014
10015 2011-10-27 Chong Yidong <cyd@gnu.org>
10016
10017 * gnutls.c (emacs_gnutls_deinit): New function.
10018 Deallocate credentials structures as well as calling gnutls_deinit.
10019 (Fgnutls_deinit, Fgnutls_boot): Use it.
10020
10021 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10022 (deactivate_process): Call emacs_gnutls_deinit.
10023
10024 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10025
10026 * image.c (x_create_x_image_and_pixmap):
10027 * w32.c (sys_rename, w32_delayed_load):
10028 * w32font.c (fill_in_logfont):
10029 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10030
10031 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10032
10033 * w32fns.c (w32_default_color_map): New function,
10034 extracted from Fw32_default_color_map.
10035 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10036
10037 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10038
10039 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10040
10041 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10042
10043 * keyboard.c (test_undefined): New function (bug#9751).
10044 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10045
10046 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10047
10048 * sysdep.c (init_sys_modes): Fix the check for the controlling
10049 terminal (Bug#6649).
10050
10051 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10052
10053 * dispextern.h (struct bidi_it): New member next_en_type.
10054
10055 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10056 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10057 current character, check also for next_en_type being WEAK_EN.
10058 (bidi_resolve_weak): Don't enter the expensive loop if the current
10059 position is before next_en_pos. Record the bidi type of the first
10060 non-ET, non-BN character we find, in addition to its position.
10061 (bidi_level_of_next_char): Invalidate next_en_type when
10062 next_en_pos is over-stepped.
10063
10064 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10065
10066 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10067 * editfns.c: Rewrite current-time-zone so that it invokes
10068 the equivalent of (format-time-string "%Z") to get the time zone name.
10069 This fixes a bug when the time zone name contains characters that
10070 need converting from the system time locale to Emacs internal format.
10071 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10072 that patch fixed format-time-string to do the conversion, but
10073 I forgot to fix current-time-zone.
10074 (format_time_string): New function, containing most of
10075 what Fformat_time_string used to contain.
10076 (Fformat_time_string): Rewrite in terms of format_time_string.
10077 This doesn't change this function's behavior.
10078 (current-time-zone): Rewrite to use format_time_string.
10079 This fixes the bug reported by Michael Schierl in
10080 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10081 Jason Rumney's 2007-06-07 change worked around this bug, but
10082 didn't fix it.
10083 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10084
10085 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10086
10087 * xdisp.c (start_display): If the character at POS is displayed
10088 via a display vector, reset IT->current.dpvec_index to zero.
10089 (try_window_reusing_current_matrix): If a line ends in a display
10090 vector or the next line starts in a display vector, continue
10091 redrawing the window even though the character position of
10092 start_row was reached.
10093 (Bug#9771, part 2)
10094
10095 2011-10-18 Chong Yidong <cyd@gnu.org>
10096
10097 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10098 with nobreak-char-display too.
10099
10100 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10101
10102 Fix part 3 of bug#9771.
10103 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10104 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10105 non-neutral characters if the current character is a paragraph
10106 separator (a.k.a. Newline). This avoids running the same
10107 expensive loop twice, once when we consume the preceding newline
10108 and the other time when the line actually needs to be displayed.
10109 Avoid the loop when we see neutrals on the base embedding level
10110 following a character whose directionality is the same as the
10111 paragraph's. This avoids running the expensive loop when a line
10112 ends in a long sequence of neutrals, like control characters.
10113 Add assertion against STRONG_AL type. Slightly rearrange code
10114 that determines the type of a neutral given the first non-neutral
10115 that follows it.
10116 (bidi_level_of_next_char): Set next_en_pos to zero when
10117 invalidating its info.
10118
10119 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10120
10121 * xdisp.c (push_display_prop): Determine whether to record string
10122 or buffer position by IT->string, not by IT->method. Allow
10123 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10124 (move_it_vertically_backward): Don't look for character position
10125 immediately after the newline when in a continuation line.
10126 (Bug#9771, part 1)
10127
10128 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10129
10130 * window.c (coordinates_in_window): Rewrite and delabelize
10131 vertical border check. (Bug#5357) (Bug#9618)
10132
10133 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10134
10135 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10136 errors in XSetWindowBorder (bug#9310).
10137
10138 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10139
10140 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10141 avoid crash when xmalloc overrun checking is enabled.
10142
10143 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10144
10145 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10146 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10147 cursor motion with <left> and <right> arrow keys.
10148
10149 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10150 some callers set that themselves.
10151
10152 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10153
10154 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10155 display string and the previous row comes from the same string and
10156 is empty. (Bug#9739) (Bug#9738)
10157
10158 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10159
10160 * doc.c (get_doc_string): Encode file name (bug#9735).
10161
10162 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10163
10164 * bidi.c (bidi_level_of_next_char):
10165 * xdisp.c (get_visually_first_element): Remove old incorrect
10166 comments regarding the Unicode Line Separator character.
10167
10168 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10169
10170 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10171
10172 * alloc.c (Fgc_status): Do not access beyond zombies array
10173 boundary if nzombies > MAX_ZOMBIES.
10174 * alloc.c (dump_zombies): Add missing format specifier.
10175
10176 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10177
10178 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10179 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10180
10181 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10182 Some packages use them to denote characters with modifiers.
10183
10184 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10185
10186 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10187 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10188 matching a pp-number. Rename parameter var to var1.
10189
10190 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10191
10192 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10193
10194 2011-10-08 Glenn Morris <rgm@gnu.org>
10195
10196 * callint.c (Fcall_interactively): Give a more explicit error for the
10197 'c' case with a non-character input. (Bug#8479)
10198
10199 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10200
10201 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10202 lines.
10203 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10204 lines that are hscrolled on the left.
10205
10206 * dispnew.c (buffer_posn_from_coords): Account for a possible
10207 presence of header-line. (Bug#4426)
10208
10209 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10210
10211 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10212 Don't advertise functionality which we discourage or doesn't work.
10213
10214 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10215
10216 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10217 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10218 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10219 this makes Emacs dump core during garbage collection on rare
10220 occasions. sizeof is obviously inferior to offsetof here, so
10221 stick with offsetof.
10222 (GC_POINTER_ALIGNMENT): New macro.
10223 (mark_memory): Omit 3rd (offset) arg; caller changed.
10224 Don't assume EMACS_INT alignment is the same as pointer alignment.
10225
10226 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10227
10228 * keyboard.c (read_key_sequence_remapped): New var.
10229 (read_key_sequence): Compute remapping in the right buffer.
10230 (command_loop_1): Use read_key_sequence's remapping directly.
10231
10232 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10233
10234 * dired.c (file_name_completion): Don't expand file name.
10235 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10236 before checking file name handler.
10237
10238 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10239 they've been requested explicitly (bug#9591).
10240
10241 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10242
10243 * keymap.c (Fsingle_key_description): Use make_specified_string
10244 instead of build_string to build string from push_key_description.
10245 (Bug#5193)
10246
10247 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10248
10249 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10250 This fixes a Y2038 bug on 64-bit hosts.
10251 * buffer.c (reset_buffer):
10252 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10253 (Fclear_buffer_auto_save_failure):
10254 Use 0, not -1, to represent an unset failure time, since time_t
10255 might not be signed.
10256
10257 Remove dependency on glibc malloc internals.
10258 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10259 Move back here from lisp.h, but with their new implementations.
10260 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10261 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10262 * charset.c (charset_table_init): New static var.
10263 (syms_of_charset): Use it instead of xmalloc. This removes a
10264 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10265 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10266 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10267 Move back to alloc.c.
10268 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10269 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10270
10271 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10272
10273 * nsterm.m (windowDidResize): Call x_set_window_size only when
10274 ns_in_resize is true. Otherwise set pixelwidth/height and
10275 call change_frame_size (Bug#9628).
10276
10277 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10278
10279 Port --enable-checking=all to Fedora 14 x86-64.
10280 * charset.c (syms_of_charset): Also account for glibc malloc's
10281 internal overhead when calculating the initial malloc maximum.
10282
10283 Port --enable-checking=all to Fedora 14 x86.
10284 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10285 Move to lisp.h.
10286 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10287 (overrun_check_realloc, overrun_check_free):
10288 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10289 That way, xmalloc returns a properly-aligned pointer even if
10290 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10291 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10292 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10293 into account when calculating the initial malloc maximum.
10294 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10295 Move here from alloc.c, so that charset.c can use it too.
10296 Properly align; the old code wasn't right for common 32-bit hosts
10297 when configured with --enable-checking=all.
10298 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10299 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10300
10301 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10302
10303 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10304 use EDOM.
10305
10306 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10307
10308 * xdisp.c (compute_display_string_end): If there's no display
10309 string at CHARPOS, return -1.
10310
10311 * bidi.c (bidi_fetch_char): When compute_display_string_end
10312 returns a negative value, treat the character as a normal
10313 character not covered by a display string. (Bug#9624)
10314
10315 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10316
10317 * lread.c (Fread_from_string): Fix typo in docstring.
10318
10319 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10320
10321 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10322 newline, reseat the iterator instead of bidi-iterating there one
10323 character at a time. (Bug#9610)
10324 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10325 TO_CHARPOS if the bidi iterator is at base embedding level.
10326
10327 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10328
10329 * lread.c (readevalloop): Use correct code for NBSP.
10330 (read1): Likewise. (Bug#9608)
10331
10332 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10333
10334 * dbusbind.c (Fdbus_register_signal): When service is not
10335 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10336
10337 2011-09-25 Glenn Morris <rgm@gnu.org>
10338
10339 * buffer.c (truncate-lines): Doc fix.
10340
10341 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10342
10343 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10344 (Fset_window_next_buffers): Doc fix.
10345
10346 2011-09-24 Glenn Morris <rgm@gnu.org>
10347
10348 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10349
10350 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10351
10352 Fix minor problems found by static checking.
10353 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10354 * indent.c (Fvertical_motion): Fix == vs = typo.
10355
10356 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10357
10358 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10359 Default value is now t. Doc fix.
10360
10361 * indent.c (Fvertical_motion): Compute and apply the overshoot
10362 logic when moving up, not only when moving down. Fix the
10363 confusing name and values of the it_overshoot_expected variable;
10364 logic changes accordingly. (Bug#9254) (Bug#9549)
10365
10366 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10367 CHARPOS is covered by a display string which includes newlines.
10368 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10369 is covered by a display string with embedded newlines.
10370
10371 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10372
10373 * dbusbind.c (Fdbus_register_signal): Add match rule to
10374 Vdbus_registered_objects_table. (Bug#9581)
10375 (Fdbus_register_method, Vdbus_registered_objects_table):
10376 Fix docstring.
10377
10378 2011-09-24 Jim Meyering <meyering@redhat.com>
10379
10380 do not ignore write error for any output size
10381 The previous change was incomplete.
10382 While it makes emacs --batch detect the vast majority of stdout
10383 write failures, errors were still ignored whenever the output size is
10384 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10385 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10386 && echo FAIL: ignored write error
10387 FAIL: ignored write error
10388 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10389 && echo FAIL: ignored write error
10390 FAIL: ignored write error
10391 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10392
10393 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10394
10395 * emacs.c (Fkill_emacs): In noninteractive mode exit
10396 non-successfully if a write error occurred on stdout. (Bug#9574)
10397
10398 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10399
10400 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10401 the xassert test.
10402
10403 * dispextern.h (struct it): Update the comment documenting what
10404 can it->OBJECT be.
10405
10406 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10407
10408 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10409 a display string, extend search for cursor position to end of row.
10410 (find_row_edges): If the row ends in a newline from a display
10411 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10412 Handle the case of a display string with multiple newlines.
10413 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10414 non-empty line. Fixes confusing cursor motion with arrow keys at
10415 the beginning of a line that starts with whitespace.
10416
10417 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10418
10419 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10420 (bug#9493).
10421
10422 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10423
10424 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10425 boolean (Bug#9154).
10426
10427 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10428
10429 * xdisp.c (display_line): Record maximum and minimum buffer
10430 positions even if no glyphs were produced (e.g., by a zero-width
10431 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10432 buffer positions that will be removed from the glyph row because
10433 they don't fit.
10434 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10435 column is beyond frame width: don't subtract 1 "pixel" when
10436 computing width of the stretch.
10437 (reseat_at_next_visible_line_start): Undo the change made on
10438 2011-09-17 that saved paragraph information and restored it after
10439 the call to `reseat'. (Bug#9545)
10440
10441 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10442
10443 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10444 and turn window cursor on if cleared (Bug#9415).
10445
10446 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10447
10448 * search.c (boyer_moore): Take unibyte characters from pattern
10449 literally. (Bug#9458)
10450
10451 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10452
10453 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10454
10455 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10456
10457 Fix minor problem found by static checking.
10458 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10459 initialized, to pacify gcc -Wuninitialized.
10460
10461 * fileio.c: Report proper errno when syscall falls.
10462 (Finsert_file_contents): Save and restore errno,
10463 so that report_file_error outputs the correct diagnostic.
10464 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10465
10466 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10467
10468 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10469
10470 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10471
10472 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10473 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10474
10475 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10476
10477 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10478 about the current paragraph and restore it after the call to reseat.
10479
10480 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10481 (bidi_find_paragraph_start): Search back for paragraph beginning
10482 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10483 (bidi_move_to_visually_next): Only trigger paragraph-related
10484 computations when the last character is a newline or at EOB, not
10485 just any NEUTRAL_B. (Bug#9470)
10486
10487 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10488 truncated lines if point is covered by a display string. (Bug#9524)
10489
10490 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10491
10492 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10493 (cons_to_x_long): New function.
10494 (lisp_data_to_selection_data): Use it. Correct the test for
10495 short-versus-long data; it was negated. Break out of vector
10496 loop, for efficiency, when a long datum is discovered.
10497
10498 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10499
10500 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10501
10502 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10503
10504 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10505 GCC PR/17406) by declaring this function with external scope.
10506
10507 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10508
10509 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10510 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10511
10512 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10513
10514 * editfns.c (Fformat): Correctly handle text properties on "%%".
10515
10516 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10517
10518 * xterm.c (x_draw_composite_glyph_string_foreground):
10519 * w32term.c (x_draw_composite_glyph_string_foreground):
10520 * term.c (encode_terminal_code):
10521 * composite.c (composition_update_it, get_composition_id):
10522 * xdisp.c (get_next_display_element)
10523 (fill_composite_glyph_string): Add comments about special meaning
10524 of TAB characters in a composition.
10525
10526 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10527
10528 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10529 This occurs when processing a multibyte format.
10530 Problem reported by Wolfgang Jenker.
10531
10532 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10533
10534 * xdisp.c (try_cursor_movement): Only check for exact match if
10535 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10536
10537 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10538
10539 Remove unused external symbols.
10540 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10541 * xdisp.c (calc_pixel_width_or_height): Now static.
10542 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10543 * indent.c (check_display_width):
10544 * w32term.c: Fix comment to match code.
10545 * xterm.c, xterm.h (x_catching_errors): Remove.
10546
10547 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10548
10549 * xselect.c: Use signed conversions more consistently (Bug#9498).
10550 (selection_data_to_lisp_data): Assume incoming selection data are
10551 signed integers, not unsigned. This is to be consistent with
10552 outgoing selection data, which was modified to use signed integers
10553 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10554 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10555 expects long, not unsigned long.
10556
10557 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10558
10559 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10560 computation of loop end. Reported by Johan Bockgård
10561 <bojohan@gnu.org>.
10562
10563 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10564
10565 * frame.c (Fother_visible_frames_p): Function deleted.
10566
10567 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10568
10569 * indent.c (compute_motion): Process display vector front to back
10570 rather than the other way around. (Bug#2496)
10571
10572 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10573
10574 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10575
10576 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10577
10578 * minibuf.c (Fread_from_minibuffer): Doc fix.
10579
10580 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10581
10582 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10583 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10584
10585 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10586
10587 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10588 value for non-existent files.
10589
10590 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10591
10592 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10593 set its "size" to -1. This will set the modtime_size field of
10594 the corresponding buffer to -1, which is what
10595 verify-visited-file-modtime expects for files that do not exist.
10596 (Bug#9139)
10597
10598 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10599
10600 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10601 here ...
10602 * lisp.h: ... from here. push_key_description is no longer
10603 defined in keyboard.c, so its declaration should not be in
10604 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10605 logically belongs with push_key_description.
10606
10607 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10608
10609 * buffer.h: Include <sys/types.h> instead of <time.h>.
10610 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10611 Problem reported by Herbert J. Skuhra.
10612
10613 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10614
10615 * xml.c (parse_region): Make the parsing work for
10616 non-comment-starting XML files again (bug#9144).
10617
10618 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10619
10620 * image.c (gif_load): Fix calculation of bottom and right corner.
10621 (Bug#9468)
10622
10623 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10624
10625 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10626 redisplay in small windows.
10627
10628 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10629
10630 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10631
10632 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10633
10634 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10635 Operate on live windows only.
10636
10637 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10638
10639 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10640
10641 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10642
10643 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10644 only under bidi iteration.
10645
10646 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10647
10648 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10649
10650 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10651
10652 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10653 Without this fix, the command to link temacs failed due to an
10654 undefined symbol __builtin_isnan. This is because
10655 /usr/include/iso/math_c99.h #defines isnan(x) to
10656 __builtin_isnan(x), but the bundled gcc, which identifies itself
10657 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10658 a __builtin_isnan.
10659 * floatfns.c (isnan): #undef, and then #define to a clone of
10660 what's in data.c.
10661 (Fisnan): Always define, since it's always available now.
10662 (syms_of_floatfns): Always define isnan at the Lisp level.
10663
10664 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10665
10666 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10667
10668 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10669
10670 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10671 The previous code assumed that file offsets (off_t values) fit in
10672 EMACS_INT variables, which is not true on typical 32-bit hosts.
10673 The code messed up by falsely reporting buffer overflow in cases
10674 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10675 when "big" contains more than 2**29 bytes, even though this
10676 inserts just one byte and does not overflow the buffer.
10677 (Finsert_file_contents): Store file offsets as off_t
10678 values, not as EMACS_INT values. Check for overflow when
10679 converting between EMACS_INT and off_t. When checking for
10680 buffer overflow or for overlap, take the offsets into account.
10681 Don't use EMACS_INT for small values where int suffices.
10682 When checking for overlap, fix a typo: ZV was used where
10683 ZV_BYTE was intended.
10684 (Fwrite_region): Don't assume off_t fits into 'long'.
10685 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10686
10687 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10688
10689 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10690
10691 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10692
10693 sprintf-related integer and memory overflow issues (Bug#9412).
10694
10695 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10696 (esprintf, exprintf, evxprintf): New functions.
10697 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10698 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10699 (modify_event_symbol): Do not assume that the length of
10700 name_alist_or_stem is safe to alloca and fits in int.
10701 (Fexecute_extended_command): Likewise for function name and binding.
10702 (Frecursion_depth): Wrap around reliably on integer overflow.
10703 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10704 since some callers pass EMACS_INT values.
10705 (Fsingle_key_description): Don't crash if symbol name contains more
10706 than MAX_ALLOCA bytes.
10707 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10708 (get_minibuffer): Arg is now EMACS_INT, not int.
10709 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10710 (esprintf, exprintf, evxprintf): New decls.
10711 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10712
10713 * dbusbind.c (signature_cat): New function.
10714 (xd_signature, Fdbus_register_signal):
10715 Do not overrun buffer; instead, report string overflow.
10716
10717 * dispnew.c (add_window_display_history): Don't overrun buffer.
10718 Truncate instead; this is OK since it's just a log.
10719
10720 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10721 even if the time zone offset is outlandishly large.
10722 Don't mishandle offset == INT_MIN.
10723
10724 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10725 when creating daemon; the previous buffer-overflow check was incorrect.
10726
10727 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10728 which has the guts of the old verror function.
10729
10730 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10731 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10732
10733 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10734 (font_unparse_xlfd): Don't blindly alloca long strings.
10735 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10736 fits in int, when using sprintf. Use single snprintf to count
10737 length of string rather than counting it via multiple sprintfs;
10738 that's simpler and more reliable.
10739 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10740 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10741 sprintf, in case result does not fit in int.
10742
10743 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10744 (fontset_from_font): Print it.
10745
10746 * frame.c (tty_frame_count): Now printmax_t, not int.
10747 (make_terminal_frame, set_term_frame_name): Print it.
10748 (x_report_frame_params): In X, window IDs are unsigned long,
10749 not signed long, so print them as unsigned.
10750 (validate_x_resource_name): Check for implausibly long names,
10751 and don't assume name length fits in 'int'.
10752 (x_get_resource_string): Don't blindly alloca invocation name;
10753 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10754 not fit in int.
10755
10756 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10757 (xg_check_special_colors, xg_set_geometry):
10758 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10759
10760 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10761 Use esprintf, not sprintf, in case result does not fit in int.
10762
10763 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10764 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10765 it as a large positive number.
10766 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10767 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10768
10769 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10770 in case result does not fit in int.
10771
10772 * print.c (float_to_string): Detect width overflow more reliably.
10773 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10774 buffer overrun. Don't assume list length fits in 'int'. Treat
10775 print length of 0 as 0, not as infinity; to be consistent with other
10776 uses of print length in this function. Don't overflow print length
10777 index. Don't assume hash table size fits in 'long', or that
10778 vectorlike size fits in 'unsigned long'.
10779
10780 * process.c (make_process): Use printmax_t, not int, to format
10781 process-name gensyms.
10782
10783 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10784
10785 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10786 to avoid potential buffer overrun.
10787
10788 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10789 if X resource line is longer than 512 bytes.
10790
10791 * xfns.c (x_window): Make sprintf buffer a bit bigger
10792 to avoid potential buffer overrun.
10793
10794 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10795
10796 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10797
10798 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10799
10800 Integer overflow fixes for scrolling, etc.
10801 Without these, Emacs silently mishandles large integers sometimes.
10802 For example, "C-u 4294967297 M-x recenter" was treated as if
10803 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10804
10805 * xdisp.c (try_window_id): Check Emacs fixnum range before
10806 converting to 'int'.
10807
10808 * window.c (window_scroll_line_based, Frecenter):
10809 Check that an Emacs fixnum is in range before assigning it to 'int'.
10810 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10811 values converted from Emacs fixnums.
10812 (Frecenter): Don't wrap around a line count if it is out of 'int'
10813 range; instead, treat it as an extreme value.
10814 (Fset_window_configuration, compare_window_configurations):
10815 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10816
10817 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10818 that can exceed INT_MAX. Check that EMACS_INT value is in range
10819 before assigning it to the (possibly-narrower) index.
10820 (match_limit): Don't assume that a fixnum can fit in 'int'.
10821
10822 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10823 exceed INT_MAX.
10824
10825 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10826 (Fvertical_motion): Don't wrap around LINES values that don't fit
10827 in 'int'. Instead, treat them as extreme values. This is good
10828 enough for windows, which can't have more than INT_MAX lines anyway.
10829
10830 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10831
10832 * Require libxml/parser.h to avoid compilation warning.
10833
10834 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10835
10836 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10837 since this reportedly can destroy thread storage.
10838
10839 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10840
10841 * syntax.c (find_defun_start): Update all cache variables if
10842 exiting early (Bug#9401).
10843
10844 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10845
10846 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10847
10848 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10849 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10850 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10851
10852 * term.c (tty_append_glyph): New function.
10853 (produce_stretch_glyph): Static function and its prototype deleted.
10854
10855 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10856 Add prototypes.
10857
10858 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10859
10860 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10861 when checking :margin (Bug#9390).
10862 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10863 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10864 so that the name doesn't mislead. All uses changed.
10865
10866 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10867
10868 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10869 set_tty_hooks.
10870
10871 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10872
10873 * xdisp.c (move_it_to): Don't bail out early when reaching
10874 position beyond to_charpos, if we are scanning backwards.
10875 (move_it_vertically_backward): When DY == 0, make sure we get to
10876 the first character in the line after the newline.
10877
10878 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10879
10880 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10881 (ccl_driver): Do not generate an out-of-range pointer.
10882 (Fccl_execute_on_string): Remove unnecessary check for
10883 integer overflow, noted by Stefan Monnier in
10884 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10885 Remove a FIXME that didn't need fixing.
10886 Simplify the newly-introduced buffer reallocation code.
10887
10888 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10889
10890 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10891
10892 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10893
10894 Integer and memory overflow issues (Bug#9196).
10895
10896 * doc.c (get_doc_string): Rework so that
10897 get_doc_string_buffer_size is the actual buffer size, rather than
10898 being 1 less than the actual buffer size; this makes xpalloc more
10899 convenient.
10900
10901 * image.c (x_allocate_bitmap_record, cache_image):
10902 * xselect.c (Fx_register_dnd_atom):
10903 Simplify previous changes by using xpalloc.
10904
10905 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10906 since either will do and ptrdiff_t is convenient with xpalloc.
10907
10908 * charset.c (charset_table_size)
10909 (struct charset_sort_data.priority): Now ptrdiff_t.
10910 (charset_compare): Don't overflow if priorities differ greatly.
10911 (Fsort_charsets): Don't assume list length fits in int.
10912 Check for size-calculation overflow when allocating sort data.
10913 (syms_of_charset): Allocate an initial charset table that is
10914 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10915
10916 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10917
10918 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10919 The actual value is always <= INT_MAX, and leaving it unsigned made
10920 overflow checking harder.
10921
10922 * dispextern.h (struct glyph_matrix.rows_allocated)
10923 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10924 with xpalloc. The values are still always <= INT_MAX.
10925
10926 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10927
10928 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10929 (SAFE_NALLOCA): New macro.
10930
10931 * region-cache.c (struct boundary.pos, find_cache_boundary)
10932 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10933 (set_cache_region, invalidate_region_cache)
10934 (revalidate_region_cache, know_region_cache, region_cache_forward)
10935 (region_cache_backward, pp_cache):
10936 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10937 so that ptrdiff_t * can be passed to xpalloc.
10938 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10939 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10940 (pp_cache): Don't assume cache_len fits in int.
10941 * region-cache.h: Adjust extern decls to match.
10942
10943 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10944 EMACS_INT, since either will do, for xpalloc.
10945
10946 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10947 (xnmalloc, xnrealloc, xpalloc): New functions.
10948
10949 * bidi.c (bidi_shelve_header_size): New constant.
10950 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10951 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10952
10953 * bidi.c (bidi_cache_shrink):
10954 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10955 (overlay_strings):
10956 Don't update size of array until after memory allocation succeeds,
10957 because xmalloc/xrealloc may not return.
10958 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10959 now that we have proper integer overflow checking.
10960 (record_overlay_string, overlay_strings): Catch overflows when
10961 calculating size of overlay_str_buf.
10962
10963 * callproc.c (Fcall_process): Check for size overflow when
10964 calculating size of args2.
10965 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10966 Normally we prefer signed values, but sticking with ptrdiff_t would
10967 require adding more-complicated checks.
10968
10969 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10970 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10971 Redo buffer-overflow calculations to avoid integer overflow.
10972 Add a FIXME comment where memory seems to be over-allocated.
10973
10974 * character.c (Fstring): Check for size-calculation overflow.
10975
10976 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10977 unnecessary integer overflow. Check for size overflow.
10978 (encode_coding_object): Don't update size until xmalloc succeeds.
10979
10980 * composite.c (get_composition_id): Check for overflow in glyph
10981 length calculations.
10982
10983 Integer and memory overflow fixes for display code.
10984 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10985 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10986 (scrolling_window): Check for overflow in size calculations.
10987 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10988 Don't assume glyph table len fits in int.
10989 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10990 (row_table_size): Now ptrdiff_t, not int.
10991 (scrolling_window): Avoid overflow in size calculations.
10992 Don't update size until allocation succeeds.
10993 * fns.c (concat): Check for overflow in size calculations.
10994 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10995 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10996 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10997
10998 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10999 (get_doc_string): Check for size calculation overflow.
11000 Don't update size until allocation succeeds.
11001 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11002 EMACS_INT, where ptrdiff_t will do.
11003 (Fsubstitute_command_keys): Check for string overflow.
11004
11005 * editfns.c (set_time_zone_rule): Don't assume environment length
11006 fits in int.
11007 (message_length): Now ptrdiff_t, not int.
11008 (Fmessage_box): Don't update size until allocation succeeds.
11009 Don't assume message length fits in int.
11010 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11011
11012 * emacs.c (main): Do not reallocate argv, since there is a null at
11013 the end that can be overwritten, and this way there's no need to
11014 worry about size-calculation overflow.
11015 (sort_args): Check for size-calculation overflow.
11016
11017 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11018 alloc succeeds.
11019 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11020
11021 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11022 (x_set_scroll_bar_width, x_figure_window_size):
11023 Check for integer overflow.
11024 (x_set_alpha): Do not assume XINT fits in int.
11025
11026 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11027 This is for the members text_lines, text_cols, total_lines, total_cols,
11028 where the system imposes an 'int' limit.
11029
11030 * fringe.c (Fdefine_fringe_bitmap):
11031 Don't update size until alloc works.
11032
11033 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11034 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11035
11036 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11037 Check for size-calculation overflow.
11038 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11039 do, as we prefer signed integers.
11040 (id_to_widget.max_size, id_to_widget.used)
11041 (xg_store_widget_in_map, xg_remove_widget_from_map)
11042 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11043 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11044 Use and return ptrdiff_t, not int.
11045 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11046 * gtkutil.h: Change prototypes to match the above.
11047
11048 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11049 are duplicate now that they've been promoted to lisp.h.
11050 (x_allocate_bitmap_record, x_alloc_image_color)
11051 (make_image_cache, cache_image, xpm_load):
11052 Don't update size until alloc is done.
11053 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11054 (x_detect_edges):
11055 Check for size calculation overflow.
11056 (ct_colors_allocated_max): New constant.
11057 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11058 overflow.
11059
11060 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11061 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11062 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11063 Use ptrdiff_t, not int, to count maps.
11064 (read_char_minibuf_menu_prompt): Check for overflow in size
11065 calculations. Don't update size until allocation succeeds.
11066 Redo calculations to avoid overflow.
11067 * keyboard.h: Change prototypes to match the above.
11068
11069 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11070 to count maps.
11071 (current_minor_maps): Check for size calculation overflow.
11072 * keymap.h: Change prototypes to match the above.
11073
11074 * lread.c (read1, init_obarray): Don't update size until alloc done.
11075
11076 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11077 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11078
11079 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11080 Now ptrdiff_t, not int.
11081 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11082 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11083
11084 * process.c (Fnetwork_interface_list): Check for overflow
11085 in size calculation.
11086
11087 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11088
11089 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11090 overflow. Don't bother calling xmalloc when xrealloc will do.
11091
11092 * search.c (Freplace_match): Check for size calculation overflow.
11093 (Fset_match_data): Don't assume list lengths fit in 'int'.
11094
11095 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11096 for command line length. Do not attempt to address one before the
11097 beginning of an array, as that's not portable.
11098
11099 * term.c (max_frame_lines): Remove; unused.
11100 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11101 not int.
11102 (encode_terminal_code, calculate_costs): Check for size
11103 calculation overflow.
11104 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11105 table lengths and related sizes. Don't update size until alloc
11106 done. Redo calculations to avoid overflow.
11107 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11108
11109 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11110 subtracting pointers.
11111 (gobble_line): Check for overflow more carefully. Don't update size
11112 until alloc done.
11113
11114 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11115 Don't update size until alloc done.
11116 Redo size calculations to avoid overflow.
11117 Check for size calculation overflow.
11118 (main) [DEBUG]: Fix typo in invoking tparam1.
11119
11120 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11121 Use ptrdiff_t, not int, for sizes.
11122 (store_mode_line_noprop_char): Don't update size until alloc done.
11123
11124 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11125 Use ptrdiff_t, not int, for sizes.
11126 (Finternal_make_lisp_face, cache_face):
11127 Check for size calculation overflow.
11128 (cache_face): Treat size calculation overflows as if they were
11129 memory exhaustion (the usual treatment), rather than aborting.
11130
11131 * xfns.c (x_encode_text, x_set_name_internal)
11132 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11133 sizes, since they can exceed INT_MAX in size. Check for size
11134 calculation overflow.
11135
11136 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11137 (xg_select): Check for size calculation overflow.
11138 Don't update size until alloc done.
11139
11140 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11141 as sprintf is limited to int lengths.
11142
11143 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11144 (X_LONG_MIN): New macros.
11145 Use them to make the following changes clearer.
11146 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11147 This change doesn't affect the value now, but it may help remind
11148 future maintainers not to raise the value too much later.
11149 (SELECTION_QUANTUM): Remove, replacing with ...
11150 (selection_quantum): ... new function, which avoids overflow.
11151 All uses changed.
11152 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11153 assumption that selection length fits in 'int'.
11154 (x_reply_selection_request, x_handle_selection_request)
11155 (x_get_window_property, receive_incremental_selection)
11156 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11157 (lisp_data_to_selection_data, clean_local_selection_data):
11158 Use ptrdiff_t, not int, to record length of selection.
11159 (x_reply_selection_request, x_get_window_property)
11160 (receive_incremental_selection, x_property_data_to_lisp):
11161 Redo calculations to avoid overflow.
11162 (x_reply_selection_request): When sending hint, ceiling it at
11163 X_LONG_MAX rather than relying on wraparound overflow to send
11164 something.
11165 (x_get_window_property, receive_incremental_selection)
11166 (lisp_data_to_selection_data, x_property_data_to_lisp):
11167 Check for size-calculation overflow.
11168 (x_get_window_property, receive_incremental_selection)
11169 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11170 Don't store size until memory allocation succeeds.
11171 (x_get_window_property): Plug memory leak on memory exhaustion.
11172 Don't double-block input; malloc is safe here. Don't assume 2**34
11173 - 4 fits in unsigned long. Add an xassert to check
11174 XGetWindowProperty overflow. Be more careful about overflow
11175 calculations, and distinguish size from memory overflow better.
11176 (receive_incremental_selection): When tracing, don't assume
11177 unsigned int is less than INT_MAX.
11178 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11179 harmful) conversions of unsigned short to int.
11180 (lisp_data_to_selection_data): Don't assume that integers
11181 in the range -65535 through -1 fit in an X unsigned short.
11182 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11183 result parameters unless successful. Rely on cons_to_unsigned
11184 to report problems with elements; the old code wasn't right anyway.
11185 (x_check_property_data): Check for int overflow; we cannot use
11186 a wider type due to X limits.
11187 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11188
11189 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11190
11191 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11192 (x_term_init): Check for size calculation overflow.
11193 (x_color_cells): Don't store size until memory allocation succeeds.
11194 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11195 Don't assume alloca size is less than MAX_ALLOCA.
11196 (x_term_init): Don't assume length fits in int (sprintf is limited
11197 to int size).
11198
11199 Use ptrdiff_t for composition IDs.
11200 * character.c (lisp_string_width):
11201 * composite.c (composition_table_size, n_compositions)
11202 (get_composition_id, composition_gstring_from_id):
11203 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11204 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11205 * window.c (Frecenter):
11206 Use ptrdiff_t, not int, for composition IDs.
11207 * composite.c (get_composition_id): Check for integer overflow.
11208 * composite.h: Adjust prototypes to match the above changes.
11209
11210 Use ptrdiff_t for hash table indexes.
11211 * category.c (hash_get_category_set):
11212 * ccl.c (ccl_driver):
11213 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11214 * coding.c (coding_system_charset_list, detect_coding_system):
11215 * coding.h (struct coding_system.id):
11216 * composite.c (get_composition_id, gstring_lookup_cache):
11217 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11218 * image.c (xpm_get_color_table_h):
11219 * lisp.h (hash_lookup, hash_put):
11220 * minibuf.c (Ftest_completion):
11221 Use ptrdiff_t for hash table indexes, not int (which is too
11222 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11223 32-bit --with-wide-int hosts).
11224
11225 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11226 Add a FIXME comment about memory leaks.
11227 (syms_of_charset): Don't assume xmalloc returns.
11228
11229 Don't assume that stated character widths fit in int.
11230 * character.c (Fchar_width, c_string_width, lisp_string_width):
11231 * character.h (CHAR_WIDTH):
11232 * indent.c (MULTIBYTE_BYTES_WIDTH):
11233 Use sanitize_char_width to avoid undefined and/or bad behavior
11234 with outlandish widths.
11235 * character.h (sanitize_tab_width): Rename from sanitize_width,
11236 now that we have two such functions. All uses changed.
11237 (sanitize_char_width): New inline function.
11238
11239 Don't assume that tab-width fits in int.
11240 * character.h (sanitize_width): New inline function.
11241 (SANE_TAB_WIDTH): New macro.
11242 (ASCII_CHAR_WIDTH): Use it.
11243 * indent.c (sane_tab_width): Remove. All uses replaced by
11244 SANE_TAB_WIDTH (current_buffer).
11245 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11246
11247 * fileio.c: Integer overflow issues with file modes.
11248 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11249
11250 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11251 Remove unreachable code.
11252 (read_hex, load_charset_map_from_file): Check for integer overflow.
11253
11254 * xterm.c: Don't go over XClientMessageEvent limit.
11255 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11256 (x_send_scroll_bar_event): Likewise. Check that the size does not
11257 exceed limits imposed by XClientMessageEvent, as well as the usual
11258 ptrdiff_t and size_t limits.
11259
11260 * keyboard.c: Overflow, signedness and related fixes.
11261 (make_lispy_movement): Use same integer type in forward decl
11262 that is used in the definition.
11263 (read_key_sequence, keyremap_step):
11264 Change bufsize argument back to int, undoing my 2011-03-30 change.
11265 We prefer signed types, and int is wide enough here.
11266 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11267 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11268 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11269 length, not size_t. Use ptrdiff_t for index, not int.
11270 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11271 possibility of integer overflow.
11272
11273 Overflow, signedness and related fixes for images.
11274
11275 * dispextern.h (struct it.stack[0].u.image.image_id)
11276 (struct_it.image_id, struct image.id, struct image_cache.size)
11277 (struct image_cache.used, struct image_cache.ref_count):
11278 * gtkutil.c (update_frame_tool_bar):
11279 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11280 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11281 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11282 * nsmenu.m (update_frame_tool_bar):
11283 * xdisp.c (calc_pixel_width_or_height):
11284 * xfns.c (image_cache_refcount):
11285 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11286 on typical 64-bit hosts.
11287
11288 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11289 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11290 Omit unnecessary casts to int.
11291 (parse_image_spec): Check that integers fall into 'int' range
11292 when the callers expect that.
11293 (image_ascent): Redo ascent calculation to avoid int overflow.
11294 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11295 (lookup_image): Remove unnecessary tests.
11296 (xbm_image_p): Locals are now of int, not EMACS_INT,
11297 since parse_image_check makes sure they fit into int.
11298 (png_load, gif_load, svg_load_image):
11299 Prefer int to unsigned where either will do.
11300 (tiff_handler): New function, combining the cores of the
11301 old tiff_error_handler and tiff_warning_handler.
11302 This function is rewritten to use vsnprintf and thereby avoid
11303 stack buffer overflows. It uses only the features of vsnprintf
11304 that are common to both POSIX and native Microsoft.
11305 (tiff_error_handler, tiff_warning_handler): Use it.
11306 (tiff_load, gif_load, imagemagick_load_image):
11307 Don't assume :index value fits in 'int'.
11308 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11309 (imagemagick_load_image): Check that crop parameters fit into
11310 the integer types that MagickCropImage accepts. Don't assume
11311 Vimagemagick_render_type has a nonnegative value. Don't assume
11312 size_t fits in 'long'.
11313 (gs_load): Use printmax_t to print the widest integers possible.
11314 Check for integer overflow when computing image height and width.
11315
11316 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11317
11318 * xdisp.c (redisplay_window): Don't force window start if point
11319 will be invisible in the resulting window. (Bug#9324)
11320
11321 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11322
11323 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11324 the display spec is of the form `(space ...)'.
11325 (handle_display_spec): Return the value returned by
11326 handle_single_display_spec, not just 1 or zero.
11327 (handle_single_display_spec): If the display spec is of the form
11328 `(space ...)', and specifies display in the text area, return 2
11329 rather than 1.
11330 (try_cursor_movement): Check for the need to scroll more
11331 accurately, and prefer exact match for point under bidi.
11332 Don't advance `row' beyond the last row of the window.
11333
11334 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11335 into disp_prop; all users changed.
11336
11337 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11338 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11339 for the text covered by the display property.
11340
11341 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11342
11343 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11344 Change return value to nil.
11345 (Frecord_buffer): Delete unused function.
11346
11347 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11348
11349 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11350 buffers, return left-to-right.
11351 (set_cursor_from_row): Consider candidate row a win if its glyph
11352 represents a newline and point is on that newline. Fixes cursor
11353 positioning on the newline at EOL of R2L text within L2R
11354 paragraph, and vice versa.
11355 (try_cursor_movement): Check continued rows, in addition to
11356 continuation rows. Fixes unwarranted scroll when point enters a
11357 continued line of R2L text within an L2R paragraph, or vice versa.
11358 (cursor_row_p): Consider the case of point being equal to
11359 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11360 from the end of a short line to the beginning of a continued line
11361 of R2L text within L2R paragraph.
11362 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11363 composed characters.
11364
11365 * bidi.c (bidi_check_type): Use xassert.
11366 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11367 members.
11368
11369 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11370
11371 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11372 a character.
11373
11374 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11375
11376 * nsfont.m (ns_otf_to_script): Fix typo.
11377
11378 2011-08-22 Kenichi Handa <handa@m17n.org>
11379
11380 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11381 extra slot even if the purpose is char-code-property-table.
11382
11383 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11384
11385 * xdisp.c (redisplay_window): When computing centering_position,
11386 account for the height of the header line. (Bug#8874)
11387
11388 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11389 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11390 candidate is selected by the mouse, and that candidate has a
11391 composed character under the mouse.
11392
11393 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11394 coordinates reported by pos-visible-in-window-p for a composed
11395 character in column zero.
11396
11397 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11398
11399 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11400
11401 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11402
11403 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11404 consider it a hit if to_charpos is anywhere in the range of the
11405 composed buffer positions.
11406
11407 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11408
11409 * image.c (gif_load): Don't assume that each subimage has the same
11410 dimensions as the base image. Handle disposal method that is
11411 "undefined" by the gif spec (Bug#9335).
11412
11413 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11414
11415 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11416 (Fcondition_case): Document `debug' symbol in error handler.
11417
11418 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11419
11420 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11421 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11422 from an Org mode buffer to a Speedbar frame.
11423
11424 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11425 a composition, take its buffer position from IT->cmp_it.charpos.
11426 Fixes cursor positioning at the beginning of a line that begins
11427 with a composed character.
11428
11429 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11430
11431 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11432 character bidirectional type, use STRONG_L instead. Fixes crashes
11433 in a buffer produced by `describe-categories'.
11434
11435 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11436 members before the level stack, so they would be saved and
11437 restored when copying iterator state. Fixes incorrect reordering
11438 around TABs covered by display properties.
11439
11440 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11441
11442 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11443
11444 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11445
11446 * eval.c (internal_condition_case, internal_condition_case_1)
11447 (internal_condition_case_2, internal_condition_case_n):
11448 Remove unnecessary aborts (Bug#9081).
11449
11450 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11451
11452 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11453 has no `load' handler, try opening the file locally. (Bug#9311)
11454
11455 2011-08-16 Ken Brown <kbrown@cornell.edu>
11456
11457 * gmalloc.c: Expand comment.
11458
11459 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11460
11461 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11462 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11463
11464 2011-08-16 Ken Brown <kbrown@cornell.edu>
11465
11466 Fix memory allocation problems in Cygwin build (Bug#9273).
11467
11468 * unexcw.c ( __malloc_initialized): Declare external variable.
11469 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11470
11471 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11472 New variables.
11473 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11474 dumped emacs.
11475 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11476 in the static heap.
11477 [CYGWIN] (special_realloc): New function.
11478 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11479 requests to realloc storage in the static heap.
11480
11481 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11482
11483 * bidi.c (bidi_initialize): Remove unused local.
11484
11485 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11486
11487 * bidimirror.h:
11488 * biditype.h: Remove file.
11489 * makefile.w32-in ($(BLD)/bidi.$(O)):
11490 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11491
11492 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11493
11494 * chartab.c: Improve commentary for the uniprop_table API.
11495
11496 * bidi.c (bidi_paragraph_init): Support zero value of
11497 bidi_ignore_explicit_marks_for_paragraph_level.
11498 (bidi_initialize): Use uniprop_table instead of including
11499 biditype.h and bidimirror.h.
11500
11501 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11502 coordinates of the iterator when restoring from ppos_it.
11503 (Bug#9296)
11504
11505 2011-08-14 Kenichi Handa <handa@m17n.org>
11506
11507 * process.c (create_process): Call setup_process_coding_systems
11508 after the pid of the process is set to -1 (Bug#8162).
11509
11510 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11511
11512 * xdisp.c (move_it_in_display_line_to): Don't invoke
11513 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11514 ppos_it. Fixes vertical cursor motion when line beginning is
11515 covered by an image. (Bug#9296)
11516
11517 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11518
11519 * nsterm.h (ns_run_ascript): Declare.
11520 (NSAPP_DATA2_RUNASSCRIPT): Define.
11521
11522 * nsfns.m (as_script, as_result, as_status): New static variables.
11523 (ns_run_ascript): New function.
11524 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11525 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11526 the event loop. Get status from as_status (Bug#7276).
11527
11528 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11529 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11530 the event loop (Bug#7276).
11531
11532 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11533
11534 * gnutls.c (QCgnutls_bootprop_priority)
11535 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11536 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11537 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11538 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11539 (QCgnutls_bootprop_verify_hostname_error)
11540 (QCgnutls_bootprop_callbacks_verify): Rename from
11541 Qgnutls_bootprop_..., all uses changed.
11542
11543 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11544 uses changed.
11545
11546 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11547
11548 * xfaces.c (Qframe_set_background_mode): Now static.
11549 * dispextern.h (Qframe_set_background_mode): Remove decl.
11550
11551 * process.c (Fnetwork_interface_info): Declare local only if needed.
11552
11553 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11554
11555 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11556 (Fnetwork_interface_list): Allocate in increments of bytes instead
11557 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11558 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11559 sockaddr.
11560 (struct ifflag_def): notrailers is smart on OSX.
11561 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11562 Get hardware address with getifaddrs if available.
11563
11564 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11565
11566 * xdisp.c (iterate_out_of_display_property): xassert that
11567 IT->position is set to within IT->object's boundaries. Break from
11568 the loop as soon as EOB is reached; avoids infloops in redisplay
11569 when IT->position is set up wrongly due to some bug.
11570 Set IT->current to match the bidi iterator unconditionally.
11571 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11572 entry. Force push_it to save on the stack the current
11573 buffer/string position, to be restored by pop_it. Fix flags in
11574 the iterator structure wrt the object coming from a display
11575 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11576 properties. (Bug#9284)
11577
11578 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11579
11580 * fontset.c (fontset_get_font_group): Add proper type checks.
11581 (Bug#9172)
11582
11583 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11584
11585 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11586 and LC_VERSION_MIN_MACOSX.
11587 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11588 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11589
11590 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11591
11592 * xdisp.c (forward_to_next_line_start): Allow to use the
11593 no-display-properties-and-no-overlays under bidi display.
11594 Set disp_pos in the bidi iterator to avoid searches for display
11595 properties and overlays.
11596
11597 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11598
11599 * editfns.c (Fset_time_zone_rule): Document relationship with the
11600 setenv function.
11601
11602 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11603 the font entity extracted from the cache (Bug#8109).
11604
11605 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11606
11607 * composite.c (autocmp_chars): Don't reset point. That is done by
11608 restore_point_unwind (Bug#5984).
11609
11610 2011-08-07 Juri Linkov <juri@jurta.org>
11611
11612 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11613 to show the arg `TIME' instead of `TIMEVAL'.
11614
11615 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11616
11617 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11618 display property strides EOL and includes a newline, as in
11619 longlines-mode. (Bug#9254)
11620 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11621 word-wrap under bidirectional display. (Bug#9224)
11622
11623 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11624 is non-zero, even if the data buffer is NULL. Fixes a crash in
11625 vertical-motion with longlines-mode. (Bug#9254)
11626
11627 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11628
11629 * bidi.c <bidi_cache_total_alloc>: Now static.
11630 (bidi_initialize): Initialize bidi_cache_total_alloc.
11631
11632 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11633 cache. (Bug#9221)
11634
11635 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11636 amount allocated this far in `bidi_cache_total_alloc'.
11637 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11638 non-zero, only free the data buffer without restoring the cache
11639 contents. All callers changed.
11640
11641 * dispextern.h (bidi_unshelve_cache): Update prototype.
11642
11643 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11644 (move_it_in_display_line, move_it_to)
11645 (move_it_vertically_backward, move_it_by_lines): Replace the call
11646 to xfree to an equivalent call to bidi_unshelve_cache.
11647 (move_it_in_display_line_to): Fix logic of returning
11648 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11649
11650 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11651
11652 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11653 came from a string character with a `cursor' property. (Bug#9229)
11654
11655 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11656
11657 * Makefile.in (LIB_PTHREAD): New variable.
11658 (LIBES): Add LIB_PTHREAD (Bug#9216).
11659
11660 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11661 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11662
11663 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11664
11665 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11666
11667 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11668
11669 * xterm.c (x_find_topmost_parent): New function.
11670 (x_set_frame_alpha): Find topmost parent window with
11671 x_find_topmost_parent and set the property there also (bug#9181).
11672 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11673
11674 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11675
11676 * callproc.c (Fcall_process): Avoid vfork clobbering
11677 the local vars buffer, coding_systems, current_dir.
11678
11679 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11680
11681 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11682
11683 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11684
11685 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11686 so that it is not optimized away.
11687
11688 * xdisp.c (compute_display_string_pos): Remove unused local.
11689
11690 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11691
11692 Fix slow cursor motion and scrolling in large buffers with
11693 selective display, like Org Mode buffers. (Bug#9218)
11694
11695 * dispextern.h (struct bidi_it): New member disp_prop_p.
11696
11697 * xdisp.c: Remove one-slot cache of display string positions.
11698 (compute_display_string_pos): Accept an additional argument
11699 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11700 for a display string or property. If found, set DISP_PROP_P
11701 non-zero.
11702
11703 * bidi.c (bidi_fetch_char): Accept an additional argument
11704 DISP_PROP_P, and pass it to compute_display_string_pos.
11705 Only handle text covered by a display string if DISP_PROP_P is returned
11706 non-zero. All callers of bidi_fetch_char changed.
11707
11708 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11709
11710 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11711
11712 2010-12-03 Don March <don@ohspite.net>
11713
11714 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11715 last character M-[char] is translated to ESC [char] (bug#7541).
11716
11717 2011-08-02 Kenichi Handa <handa@m17n.org>
11718
11719 * lisp.h (uniprop_table): Extern it.
11720
11721 * chartab.c (uniprop_table): Make it non-static.
11722
11723 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11724
11725 * xdisp.c (forward_to_next_line_start): Accept additional argument
11726 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11727 on the newline.
11728 (reseat_at_next_visible_line_start): Use the bidi iterator state
11729 returned by forward_to_next_line_start to restore the state of
11730 it->bidi_it after backing up to previous newline. (Bug#9212)
11731
11732 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11733
11734 * regex.c (re_comp): Protoize.
11735 (re_exec): Fix return type.
11736 (regexec): Fix type of `ret'. (Bug#9203)
11737
11738 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11739
11740 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11741 This is needed if max-image-size is a floating-point number.
11742
11743 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11744
11745 * print.c (print_object): Print empty symbol as ##.
11746
11747 * lread.c (read1): Read ## as empty symbol.
11748
11749 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11750
11751 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11752 setting frame foreground color (Bug#9175).
11753 (x_set_background_color): Likewise.
11754
11755 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11756 contents (Bug#9176).
11757 (EmacsTooltip -init): Remove bezels and add shadows to
11758 tooltip windows.
11759
11760 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11761 or scroll bar (Bug#8470).
11762
11763 * nsfont.m (nsfont_open): Remove assignment to voffset and
11764 unnecessary vars hshink, expand, hd, full_height, min_height.
11765 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11766
11767 * nsterm.h (nsfont_info): Remove voffset field.
11768
11769 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11770
11771 Implement strike-through and overline on NextStep (Bug#8863).
11772
11773 * nsfont.m (nsfont_open): Use underline position provided by font,
11774 instead of hard-coded value of 2.
11775 (nsfont_draw): Call ns_draw_text_decoration instead.
11776
11777 * nsterm.h: Add declaration for ns_draw_text_decoration.
11778
11779 * nsterm.m (ns_draw_text_decoration): New function for drawing
11780 underline, overline, and strike-through.
11781 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11782 ns_draw_text_decoration. Change treatment of cursor drawing to
11783 accommodate underlining, etc.
11784
11785 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11786
11787 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11788 default.
11789
11790 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11791
11792 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11793 Without this fix, if a signal arrives just after memory fills up,
11794 'malloc' might be invoked reentrantly.
11795
11796 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11797 In other words, assume that every image size is allowed, on non-X
11798 hosts. This assumption is probably wrong, but it lets Emacs compile.
11799
11800 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11801
11802 * regex.c (re_iswctype): Convert return values to boolean.
11803
11804 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11805
11806 * xdisp.c (compute_display_string_pos): Don't use cached display
11807 string position if the buffer had its restriction changed.
11808 (Bug#9184)
11809
11810 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11811
11812 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11813
11814 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11815
11816 Integer signedness and overflow and related fixes. (Bug#9079)
11817
11818 * bidi.c: Integer size and overflow fixes.
11819 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11820 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11821 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11822 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11823 (bidi_find_other_level_edge):
11824 Use ptrdiff_t instead of EMACS_INT where either will do.
11825 This works better on 32-bit hosts configured --with-wide-int.
11826 (bidi_cache_ensure_space): Check for size-calculation overflow.
11827 Use % rather than repeated addition, for better worst-case speed.
11828 Don't set bidi_cache_size until after xrealloc returns, because it
11829 might not return.
11830 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11831 (bidi_cache_ensure_space): Also check that the bidi cache size
11832 does not exceed that of the largest Lisp string or buffer. See Eli
11833 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11834
11835 * alloc.c (__malloc_size_t): Remove.
11836 All uses replaced by size_t. See Andreas Schwab's note
11837 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11838
11839 * image.c: Improve checking for integer overflow.
11840 (check_image_size): Assume that f is nonnull, since
11841 it is always nonnull in practice. This is one less thing to
11842 worry about when checking for integer overflow later.
11843 (x_check_image_size): New function, which checks for integer
11844 overflow issues inside X.
11845 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11846 This removes the need for a memory_full check.
11847 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11848 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11849 (xbm_read_bitmap_data): Change locals back to 'int', since
11850 their values must fit in 'int'.
11851 (xpm_load_image, png_load, tiff_load):
11852 Invoke x_create_x_image_and_pixmap earlier,
11853 to avoid much needless work if the image is too large.
11854 (tiff_load): Treat overly large images as if
11855 x_create_x_image_and_pixmap failed, not as malloc failures.
11856 (gs_load): Use x_check_image_size.
11857
11858 * gtkutil.c: Omit integer casts.
11859 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11860 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11861
11862 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11863
11864 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11865 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11866 would wrongly return t on a 64-bit host.
11867
11868 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11869 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11870 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11871 and therefore cause GCC to emit a bogus diagnostic in some cases.
11872
11873 * image.c: Integer signedness and overflow and related fixes.
11874 This is not an exhaustive set of fixes, but it's time to
11875 record what I've got.
11876 (lookup_pixel_color, check_image_size): Remove redundant decls.
11877 (check_image_size): Don't assume that arbitrary EMACS_INT values
11878 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11879 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11880 (tiff_load, imagemagick_load_image):
11881 Check for overflow in size calculations.
11882 (x_create_x_image_and_pixmap): Remove unnecessary test for
11883 xmalloc returning NULL; that can't happen.
11884 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11885 (xpm_color_bucket): Use better integer hashing function.
11886 (xpm_cache_color): Don't possibly over-allocate memory.
11887 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11888 (gif_memory_source):
11889 Use ptrdiff_t, not int or size_t, to record sizes.
11890 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11891 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11892 either works, as we prefer signed integers.
11893 (tiff_read_from_memory, tiff_write_from_memory):
11894 Return tsize_t, not size_t, since that's what the TIFF API wants.
11895 (tiff_read_from_memory): Don't fail simply because the read would
11896 go past EOF; instead, return a short read.
11897 (tiff_load): Omit no-longer-needed casts.
11898 (Fimagemagick_types): Don't assume size fits into 'int'.
11899
11900 Improve hashing quality when configured --with-wide-int.
11901 * fns.c (hash_string): New function, taken from sxhash_string.
11902 Do not discard information about ASCII character case; this
11903 discarding is no longer needed.
11904 (sxhash-string): Use it. Change sig to match it. Caller changed.
11905 * lisp.h: Declare it.
11906 * lread.c (hash_string): Remove, since we now use fns.c's version.
11907 The fns.c version returns a wider integer if --with-wide-int is
11908 specified, so this should help the quality of the hashing a bit.
11909
11910 * emacs.c: Integer overflow minor fix.
11911 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11912 Define only if GNU_LINUX.
11913 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11914
11915 * dispnew.c: Integer signedness and overflow fixes.
11916 Remove unnecessary forward decls, that were a maintenance hassle.
11917 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11918 All uses changed.
11919 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11920 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11921 (prepare_desired_row, line_draw_cost):
11922 Use int, not unsigned, where either works.
11923 (save_current_matrix, restore_current_matrix):
11924 Use ptrdiff_t, not size_t, where either works.
11925 (init_display): Check for overflow more accurately, and without
11926 relying on undefined behavior.
11927
11928 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11929 Remove, replacing with the new symbols in lisp.h. All uses changed.
11930 * fileio.c (make_temp_name):
11931 * filelock.c (lock_file_1, lock_file):
11932 * xdisp.c (message_dolog):
11933 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11934 Use pMd etc. instead.
11935 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11936 replacing the pWIDE etc. symbols removed from editfns.c.
11937
11938 * keyboard.h (num_input_events): Now uintmax_t.
11939 This is (very slightly) less likely to mess up due to wraparound.
11940 All uses changed.
11941
11942 * buffer.c: Integer signedness fixes.
11943 (alloc_buffer_text, enlarge_buffer_text):
11944 Use ptrdiff_t rather than size_t when either will do, as we prefer
11945 signed integers.
11946
11947 * alloc.c: Integer signedness and overflow fixes.
11948 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11949 (__malloc_size_t): Default to size_t, not to int.
11950 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11951 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11952 Prefer ptrdiff_t to size_t when either would do, as we prefer
11953 signed integers.
11954 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11955 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11956 Now const. Initialize with values that are in range even if char
11957 is signed.
11958 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11959 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11960 These functions do the right thing with sizes > 2**32.
11961 (check_depth): Now ptrdiff_t, not int.
11962 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11963 Adjust to new way of storing sizes. Check for size overflow bugs
11964 in rest of code.
11965 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11966 slightly wrong anyway, as it missed one instance of
11967 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11968 (refill_memory_reserve): Omit needless cast to size_t.
11969 (mark_object_loop_halt): Mark as externally visible.
11970
11971 * xselect.c: Integer signedness and overflow fixes.
11972 (Fx_register_dnd_atom, x_handle_dnd_message):
11973 Use ptrdiff_t, not size_t, since we prefer signed.
11974 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11975 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11976 x_dnd_atoms_size and x_dnd_atoms_length.
11977
11978 * doprnt.c: Prefer signed to unsigned when either works.
11979 * eval.c (verror):
11980 * doprnt.c (doprnt):
11981 * lisp.h (doprnt):
11982 * xdisp.c (vmessage):
11983 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11984 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11985 prefer signed arithmetic to avoid comparison confusion.
11986 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11987 but is a bit tricky.
11988
11989 Assume freestanding C89 headers, string.h, stdlib.h.
11990 * data.c, doprnt.c, floatfns.c, print.c:
11991 Include float.h unconditionally.
11992 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11993 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11994 * regex.c: Likewise for stddef.h, string.h.
11995 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11996 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11997 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11998 (STDC_HEADERS): Remove obsolete defines.
11999 * sysdep.c: Include limits.h unconditionally.
12000
12001 Assume support for memcmp, memcpy, memmove, memset.
12002 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12003 * regex.c (memcmp, memcpy):
12004 Remove; we assume C89 now.
12005
12006 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12007 (__malloc_safe_bcopy): Remove; no longer needed.
12008
12009 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
12010 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12011 well either way, and we prefer signed to unsigned.
12012
12013 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12014
12015 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12016 closes the connection while we're reading (bug#9182).
12017
12018 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12019
12020 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12021 are specified (Bug#9168).
12022
12023 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12024
12025 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12026 Found by GCC static checking and --with-wide-int on a 32-bit host.
12027
12028 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12029
12030 * xdisp.c (compute_display_string_pos): Fix logic of caching
12031 previous display string position. Initialize cached_prev_pos to
12032 -1. Fixes slow-down at the beginning of a buffer.
12033
12034 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12035
12036 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12037 for attrs[LFACE_FONTSET_INDEX].
12038
12039 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12040
12041 * xml.c (parse_region): Remove unused local
12042 that was recently introduced.
12043
12044 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12045
12046 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12047 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12048
12049 * xdisp.c (move_it_in_display_line_to): Record the best matching
12050 position for TO_CHARPOS while scanning the line, and restore it on
12051 exit if none of the characters scanned was an exact match.
12052 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12053 when exact match is impossible due to invisible text, and the
12054 lines are truncated.
12055
12056 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12057
12058 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12059 for OSX >= 10.7.
12060
12061 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12062
12063 Fix a significant slow-down of cursor motion with C-n, C-p,
12064 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12065 auto-repeat under bidi redisplay in fontified buffers.
12066 * xdisp.c (compute_stop_pos_backwards): New function.
12067 (next_element_from_buffer): Call compute_stop_pos_backwards to
12068 find a suitable prev_stop when we find ourselves before
12069 base_level_stop.
12070 (reseat): Don't look for prev_stop, as that could mean a very long
12071 run.
12072 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12073 <cached_disp_overlay_modiff>: Cache for last found display string
12074 position.
12075 (compute_display_string_pos): Return the cached position if asked
12076 about the same buffer in the same area of character positions, and
12077 the buffer wasn't changed since the time the display string
12078 position was cached.
12079
12080 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12081
12082 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12083 is an integer, which is important for empty lines. (Bug#9149)
12084
12085 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12086
12087 * frame.c (Fmodify_frame_parameters): In tty case, update the
12088 default face if necessary (Bug#4238).
12089
12090 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12091
12092 * editfns.c (Fstring_to_char): No need to explain what a character
12093 is in the docstring (Bug#6576).
12094
12095 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12096
12097 * xml.c (parse_region): Make sure we always return a tree.
12098
12099 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12100
12101 * xml.c (parse_region): If a document contains only comments,
12102 return that, too.
12103
12104 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12105
12106 * xml.c (make_dom): Return comments, too.
12107
12108 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12109
12110 Port to OpenBSD.
12111 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12112 and the surrounding thread.
12113 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12114 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12115 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12116 timer goes off.
12117 * s/openbsd.h (BROKEN_SIGIO): Define.
12118 * unexelf.c (unexec) [__OpenBSD__]:
12119 Don't update the .mdebug section of the Alpha COFF symbol table.
12120
12121 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12122
12123 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12124 (bug#8460).
12125
12126 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12127
12128 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12129 This fixes some race conditions on the permissions of any newly
12130 created file.
12131
12132 * alloc.c (valid_pointer_p): Use pipe, not open.
12133 This fixes some permissions issues when debugging.
12134
12135 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12136 If fchown fails to set both uid and gid, try to set just gid,
12137 as that is sometimes allowed. Adjust the file's mode to eliminate
12138 setuid or setgid bits that are inappropriate if fchown fails.
12139
12140 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12141
12142 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12143 to compare Lisp_Objects.
12144 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12145 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12146 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12147
12148 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12149
12150 * lread.c (read_integer): Unread even EOF character.
12151 (read1): Likewise. Properly record start position of symbol.
12152
12153 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12154 symbol character follows.
12155
12156 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12157
12158 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12159 This works around a problem with the previous change to Fcopy_file.
12160 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12161 and without this change, GCC might complain about discarding
12162 fchown's return value.
12163
12164 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12165
12166 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12167
12168 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12169
12170 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12171
12172 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12173
12174 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12175 it's used from the C level.
12176
12177 * process.c: Use the same condition for POLL_FOR_INPUT in both
12178 keyboard.c and process.c (bug#1858).
12179
12180 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12181
12182 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12183 (Fgnutls_boot): Use it.
12184
12185 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12186
12187 * doc.c (Fsubstitute_command_keys): Revert last change.
12188
12189 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12190
12191 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12192 quotes the next character, and doesn't affect other longer
12193 sequences (bug#8935).
12194
12195 * lread.c (syms_of_lread): Clarify that is isn't only
12196 `eval-buffer' and `eval-defun' that's affected by
12197 `lexical-binding' (bug#8460).
12198
12199 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12200
12201 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12202 bidi redisplay when a line includes both an image and is truncated.
12203
12204 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12205
12206 Fix minor problems found by static checking.
12207 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12208 (elsz): Now a signed constant, not a size_t var. We prefer signed
12209 types to unsigned, to avoid integer comparison confusion. Without
12210 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12211 "cannot optimize loop, the loop counter may overflow", a symptom
12212 of the confusion.
12213 * indent.c (Fvertical_motion): Mark locals as initialized.
12214 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12215
12216 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12217
12218 * search.c (Fre_search_backward): Mention `case-fold-search' in
12219 all the re_search_* functions (bug#8138).
12220
12221 * keyboard.c (Fopen_dribble_file): Document when the file is
12222 closed (bug#8056).
12223
12224 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12225
12226 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12227 bidi_cache_idx.
12228
12229 Support bidi reordering of display and overlay strings.
12230 * xdisp.c (compute_display_string_pos)
12231 (compute_display_string_end): Accept additional argument STRING.
12232 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12233 (reseat_to_string): Initialize bidi_it->string.s and
12234 bidi_it->string.schars.
12235 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12236 NULL (avoids a crash in bidi_paragraph_init).
12237 Initialize itb.string.lstring.
12238 (init_iterator): Call bidi_init_it only of a valid
12239 buffer position was specified. Initialize paragraph_embedding to
12240 L2R.
12241 (reseat_to_string): Initialize the bidi iterator.
12242 (display_string): If we need to ignore text properties of
12243 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12244 original value of -1 will not work with bidi.)
12245 (compute_display_string_pos): First arg is now struct
12246 `text_pos *'; all callers changed. Support display properties on
12247 Lisp strings.
12248 (compute_display_string_end): Support display properties on Lisp
12249 strings.
12250 (init_iterator, reseat_1, reseat_to_string): Initialize the
12251 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12252 when iterating on a string not from display properties).
12253 (compute_display_string_pos, compute_display_string_end):
12254 Fix calculation of the object to scan. Fixes an error when using
12255 arrow keys.
12256 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12257 base_level_stop; instead, set base_level_stop to BEGV.
12258 Fixes crashes in vertical-motion.
12259 (next_element_from_buffer): Improve commentary for when
12260 the iterator is before prev_stop.
12261 (init_iterator): Initialize bidi_p from the default value of
12262 bidi-display-reordering, not from buffer-local value. Use the
12263 buffer-local value only if initializing for buffer iteration.
12264 (handle_invisible_prop): Support invisible properties on strings
12265 that are being bidi-reordered.
12266 (set_iterator_to_next): Support bidi reordering of C strings and
12267 Lisp strings.
12268 (next_element_from_string): Support bidi reordering of Lisp
12269 strings.
12270 (handle_stop_backwards): Support Lisp strings as well.
12271 (display_string): Support display of R2L glyph rows.
12272 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12273 (init_iterator): Don't initialize it->bidi_p for strings
12274 here.
12275 (reseat_to_string): Initialize it->bidi_p for strings here.
12276 (next_element_from_string, next_element_from_c_string)
12277 (next_element_from_buffer): Add xassert's for correspondence
12278 between IT's object being iterated and it->bidi_it.string
12279 structure.
12280 (face_before_or_after_it_pos): Support bidi iteration.
12281 (next_element_from_c_string): Handle the case of the first string
12282 character that is not the first one in the visual order.
12283 (get_visually_first_element): New function, refactored from common
12284 parts of next_element_from_buffer, next_element_from_string, and
12285 next_element_from_c_string.
12286 (tool_bar_lines_needed, redisplay_tool_bar)
12287 (display_menu_bar): Force left-to-right direction. Add a FIXME
12288 comment for making that be controlled by a user option.
12289 (push_it, pop_it): Save and restore the state of the
12290 bidi iterator. Save and restore the bidi_p flag.
12291 (pop_it): Iterate out of display property for string iteration as
12292 well.
12293 (iterate_out_of_display_property): Support iteration over strings.
12294 (handle_single_display_spec): Set up it->bidi_it for iteration
12295 over a display string, and call bidi_init_it.
12296 (handle_single_display_spec, next_overlay_string)
12297 (get_overlay_strings_1, push_display_prop): Set up the bidi
12298 iterator for displaying display or overlay strings.
12299 (forward_to_next_line_start): Don't use the shortcut if
12300 bidi-iterating.
12301 (back_to_previous_visible_line_start): If handle_display_prop
12302 pushed the iterator stack, restore the internal state of the bidi
12303 iterator by calling bidi_pop_it same number of times.
12304 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12305 and we are bidi-iterating, don't decrement the iterator position;
12306 instead, set the first_elt flag in the bidi iterator, to produce
12307 the same effect.
12308 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12309 (push_display_prop): xassert that we are iterating a buffer.
12310 (push_it, pop_it): Save and restore paragraph_embedding member.
12311 (handle_single_display_spec, next_overlay_string)
12312 (get_overlay_strings_1, reseat_1, reseat_to_string)
12313 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12314 correctly. Don't assume unibyte strings are not bidi-reordered.
12315 (compute_display_string_pos)
12316 (compute_display_string_end): Fix handling the case of C string.
12317 (push_it, pop_it): Save and restore from_disp_prop_p.
12318 (handle_single_display_spec, push_display_prop): Set the
12319 from_disp_prop_p flag.
12320 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12321 (pop_it): Call iterate_out_of_display_property only if we are
12322 popping after iteration over a string that came from a display
12323 property. Fix a typo in popping stretch info. Add an assertion
12324 for verifying that the iterator position is in sync with the bidi
12325 iterator.
12326 (handle_single_display_spec, get_overlay_strings_1)
12327 (push_display_prop): Fix initialization of paragraph direction for
12328 string when that of the parent object is not yet determined.
12329 (reseat_1): Call bidi_init_it to resync the bidi
12330 iterator with IT's position. (Bug#7616)
12331 (find_row_edges): If ROW->start.pos gives position
12332 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12333 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12334 Reset the from_disp_prop_p flag.
12335 (SAVE_IT, RESTORE_IT): New macros.
12336 (pos_visible_p, face_before_or_after_it_pos)
12337 (back_to_previous_visible_line_start)
12338 (move_it_in_display_line_to, move_it_in_display_line)
12339 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12340 (try_scrolling, redisplay_window, display_line): Use them when
12341 saving a temporary copy of the iterator and restoring it back.
12342 (back_to_previous_visible_line_start, reseat_1)
12343 (init_iterator): Empty the bidi cache "stack".
12344 (move_it_in_display_line_to): If iterator ended up at
12345 EOL, but we never saw any buffer positions smaller than
12346 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12347 motion in bidi-reordered lines.
12348 (move_it_in_display_line_to): Record prev_method and prev_pos
12349 immediately before the call to set_iterator_to_next. Fixes cursor
12350 motion in bidi-reordered lines with stretch glyphs and strings
12351 displayed in margins. (Bug#8133) (Bug#8867)
12352 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12353 TO_CHARPOS.
12354 (pos_visible_p): Support positions in bidi-reordered lines.
12355 Save and restore bidi cache.
12356
12357 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12358 (bidi_paragraph_info): Delete unused struct.
12359 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12360 (bidi_cache_start): New variable.
12361 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12362 to zero.
12363 (bidi_cache_fetch_state, bidi_cache_search)
12364 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12365 (bidi_cache_find, bidi_peek_at_next_level)
12366 (bidi_level_of_next_char, bidi_find_other_level_edge)
12367 (bidi_move_to_visually_next): Compare cache index with
12368 bidi_cache_start rather than with zero.
12369 (bidi_fetch_char): Accept new argument STRING; all callers
12370 changed. Support iteration over a string. Support strings with
12371 display properties. Support unibyte strings. Fix the type of
12372 `len' according to what STRING_CHAR_AND_LENGTH expects.
12373 (bidi_paragraph_init, bidi_resolve_explicit_1)
12374 (bidi_resolve_explicit, bidi_resolve_weak)
12375 (bidi_level_of_next_char, bidi_move_to_visually_next):
12376 Support iteration over a string.
12377 (bidi_set_sor_type, bidi_resolve_explicit_1)
12378 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12379 can now be zero (for strings); special values 0 and -1 were
12380 changed to -1 and -2, respectively.
12381 (bidi_char_at_pos): New function.
12382 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12383 Call it instead of FETCH_MULTIBYTE_CHAR.
12384 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12385 initialized to valid values.
12386 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12387 values.
12388 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12389 the test for valid cached positions. Fix the logic for looking up
12390 the sentinel state in the cache. GCPRO the Lisp string we are
12391 iterating.
12392 (bidi_push_it, bidi_pop_it): New functions.
12393 (bidi_initialize): Initialize the bidi cache start stack pointer.
12394 (bidi_cache_ensure_space): New function, refactored from part of
12395 bidi_cache_iterator_state. Don't assume the required size is just
12396 one BIDI_CACHE_CHUNK away.
12397 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12398 (bidi_count_bytes, bidi_char_at_pos): New functions.
12399 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12400 always valid if bidi_cache_idx is valid.
12401 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12402 is valid if it's going to be used.
12403 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12404 (bidi_cache_fetch_state, bidi_cache_search)
12405 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12406 (bidi_cache_iterator_state, bidi_cache_find)
12407 (bidi_find_other_level_edge, bidi_cache_start_stack):
12408 All variables related to cache indices are now EMACS_INT.
12409
12410 * dispextern.h (struct bidi_string_data): New structure.
12411 (struct bidi_it): New member `string'. Make flag members be 1-bit
12412 fields, and put them last in the struct.
12413 (compute_display_string_pos, compute_display_string_end):
12414 Update prototypes.
12415 (bidi_push_it, bidi_pop_it): Add prototypes.
12416 (struct iterator_stack_entry): New members bidi_p,
12417 paragraph_embedding, and from_disp_prop_p.
12418 (struct it): Member bidi_p is now a bit field 1 bit wide.
12419 (bidi_shelve_cache, bidi_unshelve_cache):
12420 Declare prototypes.
12421
12422 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12423 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12424 and vector-like objects.
12425
12426 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12427 cache around display iteration.
12428
12429 * window.c (Fwindow_end, window_scroll_pixel_based)
12430 (displayed_window_lines, Frecenter): Save and restore the bidi
12431 cache around display iteration.
12432
12433 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12434
12435 * editfns.c (Fdelete_region): Clarify the use of the named
12436 parameters (bug#6788).
12437
12438 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12439
12440 * indent.c (Fvertical_motion): Set and restore w->pointm when
12441 saving and restoring the window's buffer (Bug#9006).
12442
12443 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12444
12445 * editfns.c (Fstring_to_char): Clarify just what is returned
12446 (bug#6576). Text by Eli Zaretskii.
12447
12448 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12449
12450 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12451
12452 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12453
12454 * buffer.c (mmap_find): Fix a typo.
12455
12456 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12457
12458 Fix execution of x selection hooks.
12459 * xselect.c (Qx_lost_selection_functions)
12460 (Qx_sent_selection_functions): New vars.
12461 (syms_of_xselect): DEFSYM them.
12462 (x_handle_selection_request): Pass Qx_sent_selection_functions
12463 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12464 (x_handle_selection_clear,x_clear_frame_selections):
12465 Pass Qx_lost_selection_functions rather than
12466 Vx_lost_selection_functions to Frun_hook_with_args.
12467
12468 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12469
12470 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12471 The old code sometimes used this field without initializing it.
12472
12473 * alloc.c (gc_sweep): Don't read past end of array.
12474 In theory, the old code could also have corrupted Emacs internals,
12475 though it'd be very unlikely.
12476
12477 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12478
12479 * character.c (Fcharacterp): Don't advertise optional ignored
12480 argument. (Bug#4026)
12481
12482 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12483
12484 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12485 key" (bug#4257).
12486
12487 * window.c (Fset_window_start): Doc fix (bug#4199).
12488 (Fset_window_hscroll): Ditto.
12489
12490 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12491
12492 Fix minor new problems caught by GCC 4.6.1.
12493 * term.c (init_tty): Remove unused local.
12494 * xsettings.c (store_monospaced_changed): Define this function only
12495 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12496 not used otherwise.
12497
12498 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12499
12500 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12501
12502 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12503
12504 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12505 are the mini-buffer and the echo area (bug#3320).
12506
12507 * term.c (init_tty): Remove support for supdup, c10 and perq
12508 terminals, which are no longer supported (bug#1482).
12509
12510 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12511
12512 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12513
12514 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12515
12516 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12517 for non-popups (Bug#3642).
12518
12519 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12520
12521 * alloc.c (reset_malloc_hooks): Protoize.
12522 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12523 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12524 * cm.c (losecursor): Likewise.
12525 * data.c (fmod): Likewise.
12526 * dispnew.c (swap_glyphs_in_rows): Likewise.
12527 * emacs.c (memory_warning_signal): Likewise.
12528 * floatfns.c (float_error): Likewise.
12529 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12530 (otf_open, font_otf_capability, generate_otf_features)
12531 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12532 Likewise.
12533 * image.c (pbm_read_file): Likewise.
12534 * indent.c (string_display_width): Likewise.
12535 * intervals.c (check_for_interval, search_for_interval)
12536 (inc_interval_count, count_intervals, root_interval)
12537 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12538 * lread.c (defalias): Likewise.
12539 * ralloc.c (r_alloc_check): Likewise.
12540 * regex.c (set_image_of_range_1, set_image_of_range)
12541 (regex_grow_registers): Likewise.
12542 * sysdep.c (strerror): Likewise.
12543 * termcap.c (valid_filename_p, tprint, main): Likewise.
12544 * tparam.c (main): Likewise.
12545 * unexhp9k800.c (run_time_remap, save_data_space)
12546 (update_file_ptrs, read_header, write_header, calculate_checksum)
12547 (copy_file, copy_rest, display_header): Likewise.
12548 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12549 Likewise.
12550 * xdisp.c (check_it): Likewise.
12551 * xfaces.c (register_color, unregister_color, unregister_colors):
12552 Likewise.
12553 * xfns.c (print_fontset_result): Likewise.
12554 * xrdb.c (member, fatal, main): Likewise.
12555
12556 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12557
12558 Fix minor problems found by static checking (Bug#9031).
12559 * chartab.c (char_table_set_range, map_sub_char_table):
12560 Remove unused locals.
12561 (uniprop_table): Now static.
12562 * composite.c (_work_char): Remove unused static var.
12563
12564 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12565
12566 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12567
12568 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12569
12570 * gtkutil.c (qttip_cb): Remove code without function.
12571
12572 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12573
12574 * w32.c (pthread_sigmask): New stub.
12575
12576 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12577
12578 Use pthread_sigmask, not sigprocmask (Bug#9010).
12579 sigprocmask is portable only for single-threaded applications, and
12580 Emacs can be multi-threaded when it uses GTK.
12581 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12582 (LIBES): Use it.
12583 * callproc.c (Fcall_process):
12584 * process.c (create_process):
12585 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12586 Use pthread_sigmask, not sigprocmask.
12587
12588 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12589
12590 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12591 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12592 wrong (Bug#8591).
12593
12594 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12595
12596 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12597 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12598 (xg_hide_tooltip): Fix comment.
12599
12600 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12601 in registerServicesMenuSendTypes.
12602 (validRequestorForSendType): Don't check ns_return_types.
12603
12604 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12605 ns_return_type.
12606
12607 2011-07-08 Jason Rumney <jasonr@gnu.org>
12608
12609 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12610 SH_SHOW for hidden windows (Bug#5482).
12611
12612 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12613 frame struct members of non-existent frames (Bug#6284).
12614
12615 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12616
12617 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12618 variable firstTime not needed on OSX >= 10.6.
12619 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12620 >= 10.5. Use setKnobProportion, setDoubleValue.
12621
12622 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12623 (MAC_OS_X_VERSION_10_5): Define if not defined.
12624 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12625 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12626 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12627
12628 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12629 cString and lossyCString on OSX >= 10.4.
12630
12631 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12632 sizeToFit on OSX >= 10.2.
12633
12634 * nsimage.m (allocInitFromFile): Don't use deprecated method
12635 bestRepresentationForDevice on OSX >= 10.6.
12636
12637 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12638 to avoid warning.
12639
12640 * emacs.c: Declare unexec_init_emacs_zone.
12641
12642 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12643
12644 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12645
12646 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12647 on svcsMenu (Bug#8842).
12648
12649 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12650 ns_return_types.
12651 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12652
12653 * nsterm.m (QUTF8_STRING): Declare.
12654 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12655 (validRequestorForSendType): Return type is (id).
12656 Change indexOfObjectIdenticalTo to indexOfObject.
12657 Check if we have local selection before returning self (Bug#8842).
12658 (writeSelectionToPasteboard): Put local selection into paste board
12659 if we have a local selection (Bug#8842).
12660 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12661
12662 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12663 (ns_get_local_selection): Declare.
12664
12665 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12666
12667 * keymap.c (describe_map_tree): Don't insert a double newline at
12668 the end of the buffer (bug#1169) and return whether we inserted
12669 something.
12670
12671 * callint.c (Fcall_interactively): Change "reading args" to
12672 "providing args" to try to clarify what it does (bug#1010).
12673
12674 2011-07-07 Kenichi Handa <handa@m17n.org>
12675
12676 * composite.c (composition_compute_stop_pos): Ignore a static
12677 composition starting before CHARPOS (Bug#8915).
12678
12679 * xdisp.c (handle_composition_prop): Likewise.
12680
12681 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12682
12683 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12684 (Bug#9015)
12685
12686 2011-07-07 Kenichi Handa <handa@m17n.org>
12687
12688 * character.h (unicode_category_t): New enum type.
12689
12690 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12691 (Qchar_code_property_table): New variable.
12692 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12693 (UNIPROP_COMPRESSED_FORM_P): New macros.
12694 (char_table_ascii): Uncompress the compressed values.
12695 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12696 Uncompress the compressed values.
12697 (sub_char_table_ref_and_range): Likewise.
12698 (char_table_ref_and_range): Uncompress the compressed values.
12699 (sub_char_table_set): New arg is_uniprop. Callers changed.
12700 Uncompress the compressed values.
12701 (sub_char_table_set_range): Args changed. Callers changed.
12702 (char_table_set_range): Adjuted for the above change.
12703 (map_sub_char_table): Delete args default_val and parent. Add arg
12704 top. Give decoded values to a Lisp function.
12705 (map_char_table): Adjust for the above change. Give decoded
12706 values to a Lisp function. Gcpro more variables.
12707 (uniprop_table_uncompress)
12708 (uniprop_decode_value_run_length): New functions.
12709 (uniprop_decoder, uniprop_decoder_count): New variables.
12710 (uniprop_get_decoder, uniprop_encode_value_character)
12711 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12712 New functions.
12713 (uniprop_encoder, uniprop_encoder_count): New variables.
12714 (uniprop_get_encoder, uniprop_table)
12715 (Funicode_property_table_internal, Fget_unicode_property_internal)
12716 (Fput_unicode_property_internal): New functions.
12717 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12718 Sunicode_property_table_internal, Sget_unicode_property_internal,
12719 and Sput_unicode_property_internal. Defvar_lisp
12720 char-code-property-alist.
12721
12722 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12723 Vunicode_category_table.
12724
12725 * font.c (font_range): Adjust for the change of
12726 Vunicode_category_table.
12727
12728 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12729
12730 * m/iris4d.h: Remove file, move contents ...
12731 * s/irix6-5.h: ... here.
12732
12733 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12734
12735 Remove unportable assumption about struct layout (Bug#8884).
12736 * alloc.c (mark_buffer):
12737 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12738 (clone_per_buffer_values): Don't assume that
12739 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12740 This isn't true in general, and it's particularly not true
12741 if Emacs is configured with --with-wide-int.
12742 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12743 New macros, used in the buffer.c change.
12744
12745 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12746
12747 * xsettings.c: Use both GConf and GSettings if both are available.
12748 (store_config_changed_event): Add comment.
12749 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12750 (store_tool_bar_style_changed): New functions.
12751 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12752 (struct xsettings): Move font inside HAVE_XFT.
12753 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12754 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12755 Move inside HAVE_XFT.
12756 (something_changed_gsettingsCB): Rename from something_changedCB.
12757 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12758 also.
12759 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12760 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12761 (something_changed_gconfCB): Rename from something_changedCB.
12762 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12763 (parse_settings): Move check for font inside HAVE_XFT.
12764 (read_settings, apply_xft_settings): Add comment.
12765 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12766 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12767 call store_font_name_changed.
12768 (xft_settings_event): Add comment.
12769 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12770 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12771 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12772 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12773 (xsettings_initialize): Call init_gsettings last.
12774 (xsettings_get_system_font, xsettings_get_system_normal_font):
12775 Add comment.
12776
12777 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12778
12779 Random fixes. E.g., (random) never returned negative values.
12780 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12781 subseconds part to the entropy, as that's a bit more random.
12782 Prefer signed to unsigned, since the signedness doesn't matter and
12783 in general we prefer signed. When given a limit, use a
12784 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12785 latter isn't right if USE_2_TAGS_FOR_INTS.
12786 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12787 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12788
12789 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12790
12791 * textprop.c (text_property_stickiness):
12792 Obey Vtext_property_default_nonsticky.
12793 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12794 * w32fns.c (syms_of_w32fns):
12795 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12796
12797 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12798
12799 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12800 This is more efficient than Ffile_directory_p and avoids a minor race.
12801
12802 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12803
12804 * buffer.c (Foverlay_put): Say what the return value is
12805 (bug#7835).
12806
12807 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12808 is a directory before asking whether to use the file name
12809 (bug#7564).
12810 (barf_or_query_if_file_exists): Make the "File is a directory"
12811 error be more correct.
12812
12813 * fns.c (Frequire): Remove the mention of the .gz files, since
12814 that's installation-specific, but keep the mention of
12815 `get-load-suffixes'.
12816
12817 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12818
12819 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12820 Report string overflow if the output is too long.
12821
12822 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12823
12824 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12825 (syms_of_gnutls): Remove duplicate DEFSYM for
12826 Qgnutls_bootprop_verify_hostname_error, an error for
12827 Qgnutls_bootprop_verify_error (which is no longer used).
12828
12829 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12830 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12831 Also (re)move comments that are misplaced or no longer relevant.
12832
12833 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12834
12835 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12836
12837 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12838
12839 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12840 and background color parameters if they have been changed.
12841
12842 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12843
12844 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12845
12846 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12847
12848 * xsettings.c (SYSTEM_FONT): Define only when used.
12849 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12850
12851 * keymap.c (access_keymap_1): Now static.
12852
12853 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12854
12855 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12856 leave any prefix arg for the up event (Bug#1586).
12857
12858 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12859
12860 * lread.c (syms_of_lread): Mention single symbols defined by
12861 `defvar' or `defconst' (bug#7154).
12862
12863 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12864 (Frequire): Mention get-load-suffixes.
12865
12866 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12867
12868 * window.h (window): Remove clone_number slot.
12869 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12870 Remove.
12871 (make_parent_window, make_window, saved_window)
12872 (Fset_window_configuration, save_window_save): Don't deal with
12873 clone numbers.
12874 * buffer.c (Qclone_number): Remove declaration.
12875 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12876
12877 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12878
12879 Add multiple inheritance to keymaps.
12880 * keymap.c (Fmake_composed_keymap): New function.
12881 (Fset_keymap_parent): Simplify.
12882 (fix_submap_inheritance): Remove.
12883 (access_keymap_1): New function extracted from access_keymap to handle
12884 embedded parents and handle lists of maps.
12885 (access_keymap): Use it.
12886 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12887 (Fcopy_keymap): Handle embedded parents.
12888 (Fcommand_remapping, define_as_prefix): Simplify.
12889 (Fkey_binding): Simplify.
12890 (syms_of_keymap): Move minibuffer-local-completion-map,
12891 minibuffer-local-filename-completion-map,
12892 minibuffer-local-must-match-map, and
12893 minibuffer-local-filename-must-match-map to Elisp.
12894 (syms_of_keymap): Defsubr make-composed-keymap.
12895 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12896 (parse_menu_item): Trivial simplification.
12897
12898 2011-07-01 Glenn Morris <rgm@gnu.org>
12899
12900 * Makefile.in (SETTINGS_LIBS): Fix typo.
12901
12902 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12903
12904 * coding.c (Fencode_coding_string): Record the last coding system
12905 used, as the function doc string says (bug#8738).
12906
12907 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12908
12909 * xsettings.c (store_monospaced_changed): Take new font as arg and
12910 check for change against current_mono_font.
12911 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12912 (emacs_settings_constructor, emacs_settings_get_property)
12913 (emacs_settings_set_property, emacs_settings_class_init)
12914 (emacs_settings_init, gsettings_obj): Remove.
12915 (something_changedCB): New function for HAVE_GSETTINGS.
12916 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12917 with value as argument.
12918 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12919 g_settings_new (Bug#8967). Do not create gsettings_obj.
12920 Remove calls to g_settings_bind. Connect something_changedCB to
12921 "changed".
12922
12923 * xgselect.c: Add defined (HAVE_GSETTINGS).
12924 (xgselect_initialize): Ditto.
12925
12926 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12927 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12928 xg_select.
12929
12930 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12931
12932 * eval.c (struct backtrace): Simplify and port the data structure.
12933 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12934 signed bit field, as this assumption is not portable and it makes
12935 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12936 "char debug_on_exit : 1" as this is not portable either; instead,
12937 use the portable "unsigned int debug_on_exit : 1". Remove unused
12938 member evalargs. Remove obsolete comments about cc bombing out.
12939
12940 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12941
12942 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12943 Let HAVE_GSETTINGS override HAVE_GCONF.
12944 (store_monospaced_changed): New function.
12945 (EMACS_SETTINGS): A new type derived from GObject to handle
12946 GSettings notifications.
12947 (emacs_settings_constructor, emacs_settings_get_property)
12948 (emacs_settings_set_property, emacs_settings_class_init):
12949 New functions.
12950 (gsettings_client, gsettings_obj): New variables.
12951 (GSETTINGS_SCHEMA): New define.
12952 (something_changedCB): Call store_monospaced_changed.
12953 (init_gsettings): New function.
12954 (xsettings_initialize): Call init_gsettings.
12955 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12956 to NULL.
12957
12958 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12959 GCONF_CFLAGS/LIBS.
12960
12961 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12962
12963 * window.c (resize_root_window, grow_mini_window)
12964 (shrink_mini_window): Rename Qresize_root_window to
12965 Qwindow_resize_root_window and Qresize_root_window_vertically to
12966 Qwindow_resize_root_window_vertically.
12967
12968 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12969
12970 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12971
12972 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12973
12974 * makefile.w32-in: Redesign dependencies so they reflect more
12975 clearly which files are directly included by each source file,
12976 and not through other includes.
12977
12978 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12979
12980 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12981 (sort_overlays, overlay_strings): When an overlay's clone number
12982 matches the window's clone number process the overlay even if
12983 the overlay's window property doesn't match the current window.
12984
12985 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12986 (Fwindow_hchild): Rename to Fwindow_left_child.
12987 (Fwindow_next): Rename to Fwindow_next_sibling.
12988 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12989 (resize_window_check): Rename to window_resize_check.
12990 (resize_window_apply): Rename to window_resize_apply.
12991 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12992 (Fdelete_other_windows_internal, resize_frame_windows)
12993 (Fsplit_window_internal, Fdelete_window_internal)
12994 (grow_mini_window, shrink_mini_window)
12995 (Fresize_mini_window_internal): Fix callers accordingly.
12996
12997 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12998
12999 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13000 (emacs_fixed_set_min_size): Remove.
13001 (emacs_fixed_new): Take frame as argument.
13002
13003 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13004 (_EmacsFixedPrivate): Remove minwidth/height.
13005 Add struct frame *f.
13006 (emacs_fixed_init): Initialize priv->f.
13007 (get_parent_class, emacs_fixed_set_min_size): Remove.
13008 (emacs_fixed_new): Set priv->f to argument.
13009 (emacs_fixed_get_preferred_width)
13010 (emacs_fixed_get_preferred_height): Use min_width/height from
13011 frames size_hint to set minimum and natural (Bug#8919).
13012 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13013 and use min_width/height from frames size_hint to set
13014 min_width/height (Bug#8919).
13015
13016 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13017 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13018 Fix indentation.
13019
13020 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13021
13022 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13023 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13024 called at ZV.
13025
13026 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13027
13028 * process.c (wait_reading_process_output): Bypass select if
13029 waiting for a cell while ignoring keyboard input, and input is
13030 pending. Suggested by Jan Djärv (Bug#8869).
13031
13032 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13033
13034 Use gnulib's dup2 module instead of rolling our own.
13035 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13036
13037 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13038
13039 * dispnew.c (scrolling_window): Before scrolling, turn off a
13040 mouse-highlight in the window being scrolled.
13041
13042 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13043
13044 Move DEFSYM to lisp.h and use everywhere.
13045
13046 * character.h (DEFSYM): Move declaration...
13047 * lisp.h (DEFSYM): ...here.
13048
13049 * gnutls.c:
13050 * minibuf.c:
13051 * w32menu.c:
13052 * w32proc.c:
13053 * w32select.c: Don't include character.h.
13054
13055 * alloc.c (syms_of_alloc):
13056 * buffer.c (syms_of_buffer):
13057 * bytecode.c (syms_of_bytecode):
13058 * callint.c (syms_of_callint):
13059 * casefiddle.c (syms_of_casefiddle):
13060 * casetab.c (init_casetab_once):
13061 * category.c (init_category_once, syms_of_category):
13062 * ccl.c (syms_of_ccl):
13063 * cmds.c (syms_of_cmds):
13064 * composite.c (syms_of_composite):
13065 * dbusbind.c (syms_of_dbusbind):
13066 * dired.c (syms_of_dired):
13067 * dispnew.c (syms_of_display):
13068 * doc.c (syms_of_doc):
13069 * editfns.c (syms_of_editfns):
13070 * emacs.c (syms_of_emacs):
13071 * eval.c (syms_of_eval):
13072 * fileio.c (syms_of_fileio):
13073 * fns.c (syms_of_fns):
13074 * frame.c (syms_of_frame):
13075 * fringe.c (syms_of_fringe):
13076 * insdel.c (syms_of_insdel):
13077 * keymap.c (syms_of_keymap):
13078 * lread.c (init_obarray, syms_of_lread):
13079 * macros.c (syms_of_macros):
13080 * msdos.c (syms_of_msdos):
13081 * print.c (syms_of_print):
13082 * process.c (syms_of_process):
13083 * search.c (syms_of_search):
13084 * sound.c (syms_of_sound):
13085 * syntax.c (init_syntax_once, syms_of_syntax):
13086 * terminal.c (syms_of_terminal):
13087 * textprop.c (syms_of_textprop):
13088 * undo.c (syms_of_undo):
13089 * w32.c (globals_of_w32):
13090 * window.c (syms_of_window):
13091 * xdisp.c (syms_of_xdisp):
13092 * xfaces.c (syms_of_xfaces):
13093 * xfns.c (syms_of_xfns):
13094 * xmenu.c (syms_of_xmenu):
13095 * xsettings.c (syms_of_xsettings):
13096 * xterm.c (syms_of_xterm): Use DEFSYM.
13097
13098 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13099
13100 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13101
13102 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13103
13104 Integer and buffer overflow fixes (Bug#8873).
13105
13106 * print.c (printchar, strout): Check for string overflow.
13107 (PRINTPREPARE, printchar, strout):
13108 Don't set size unless allocation succeeds.
13109
13110 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13111 for sizes. Check for string overflow more accurately.
13112 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13113
13114 * macros.c: Integer and buffer overflow fixes.
13115 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13116 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13117 Use ptrdiff_t, not int, for sizes.
13118 Don't increment bufsize until after realloc succeeds.
13119 Check for size-calculation overflow.
13120 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13121
13122 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13123
13124 * lread.c: Integer overflow fixes.
13125 (read_integer): Radix is now EMACS_INT, not int,
13126 to improve quality of diagnostics for out-of-range radices.
13127 Calculate buffer size correctly for out-of-range radices.
13128 (read1): Check for integer overflow in radices, and in
13129 read-circle numbers.
13130 (read_escape): Avoid int overflow.
13131 (Fload, openp, read_buffer_size, read1)
13132 (substitute_object_recurse, read_vector, read_list, map_obarray):
13133 Use ptrdiff_t, not int, for sizes.
13134 (read1): Use EMACS_INT, not int, for sizes.
13135 Check for size overflow.
13136
13137 * image.c (cache_image): Check for size arithmetic overflow.
13138
13139 * lread.c: Integer overflow issues.
13140 (saved_doc_string_size, saved_doc_string_length)
13141 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13142 Now ptrdiff_t, not int.
13143 (read1): Don't assume doc string length fits in int. Check for
13144 out-of-range doc string lengths.
13145 (read_list): Don't assume file position fits in int.
13146 (read_escape): Check for hex character overflow.
13147
13148 2011-06-22 Leo Liu <sdl.web@gmail.com>
13149
13150 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13151 Move to minibuffer.el.
13152
13153 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13154
13155 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13156 The following patches are for when GLYPH_DEBUG && !XASSERT.
13157 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13158 * dispnew.c (flush_stdout):
13159 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13160 Mark as externally visible.
13161 * dispnew.c (check_window_matrix_pointers): Now static.
13162 * dispnew.c (window_to_frame_vpos):
13163 * xfns.c (unwind_create_frame):
13164 * xterm.c (x_check_font): Remove unused local.
13165 * scroll.c (CHECK_BOUNDS):
13166 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13167 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13168 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13169 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13170 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13171 Now static.
13172 (debug_method_add): Use va_list and vsprintf rather than relying
13173 on undefined behavior with wrong number of arguments.
13174 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13175 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13176 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13177 since we're not interested in debugging glyphs with old libraries.
13178 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13179 GCC 4.6.0's static checking.
13180
13181 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13182
13183 Integer overflow and signedness fixes (Bug#8873).
13184 A few related buffer overrun fixes, too.
13185
13186 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13187
13188 * dispextern.h (struct face.stipple):
13189 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13190 (x_bitmap_mask, x_allocate_bitmap_record)
13191 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13192 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13193 (x_create_bitmap_from_xpm_data):
13194 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13195 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13196 (.bitmaps_last):
13197 * xfaces.c (load_pixmap):
13198 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13199 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13200 (.bitmaps_last, struct x_output.icon_bitmap):
13201 Use ptrdiff_t, not int, for bitmap indexes.
13202 (x_allocate_bitmap_record): Check for size overflow.
13203 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13204
13205 Use ptrdiff_t, not int, for overlay counts.
13206 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13207 * editfns.c (overlays_around, get_pos_property):
13208 * textprop.c (get_char_property_and_overlay):
13209 * xdisp.c (next_overlay_change, note_mouse_highlight):
13210 * xfaces.c (face_at_buffer_position):
13211 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13212 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13213 (Fnext_overlay_change, Fprevious_overlay_change)
13214 (mouse_face_overlay_overlaps, Foverlays_in):
13215 Use ptrdiff_t, not int, for sizes.
13216 (overlays_at, overlays_in): Check for size-calculation overflow.
13217
13218 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13219
13220 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13221 (x_session_initialize): Do not assume string length fits in int.
13222
13223 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13224 This is unlikely, but can occur if DPI is outlandish.
13225
13226 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13227 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13228
13229 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13230 * xrdb.c (magic_file_p, search_magic_path):
13231 Omit last arg SUFFIX; it was always 0. All callers changed.
13232 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13233
13234 * xfont.c (xfont_match): Avoid need for strlen.
13235
13236 * xfns.c: Don't assume strlen fits in int.
13237 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13238
13239 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13240 not unsigned long, as we prefer signed integers. All callers changed.
13241 Detect integer overflow in repeat count.
13242 (message_dolog): Don't assume print length fits in 39 bytes.
13243 (display_mode_element): Don't assume strlen fits in int.
13244
13245 * termcap.c: Don't assume sizes fit in int and never overflow.
13246 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13247 (gobble_line): Check for size-calculation overflow.
13248
13249 * minibuf.c (Fread_buffer):
13250 * lread.c (intern, intern_c_string):
13251 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13252 Don't assume string length fits in int.
13253
13254 * keyboard.c (parse_tool_bar_item):
13255 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13256
13257 * font.c: Don't assume string length fits in int.
13258 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13259 Use ptrdiff_t, not int.
13260 (font_intern_prop): Don't assume string length fits in int.
13261 Don't assume integer property fits in fixnum.
13262 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13263
13264 * filelock.c: Fix some buffer overrun and integer overflow issues.
13265 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13266 Reformulate so as not to need the command string.
13267 Invoke gzip -cd rather than gunzip, as it's more portable.
13268 (lock_info_type, lock_file_1, lock_file):
13269 Don't assume pid_t and time_t fit in unsigned long.
13270 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13271 (current_lock_owner): Prefer signed type for sizes.
13272 Use memcpy, not strncpy, where memcpy is what is really wanted.
13273 Don't assume (via atoi) that time_t and pid_t fit in int.
13274 Check for time_t and/or pid_t out of range, e.g., via a network share.
13275 Don't alloca where an auto var works fine.
13276
13277 * fileio.c: Fix some integer overflow issues.
13278 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13279 Don't assume string length fits in int.
13280 (directory_file_name): Don't assume string length fits in long.
13281 (make_temp_name): Don't assume pid fits in int, or that its print
13282 length is less than 20.
13283
13284 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13285
13286 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13287
13288 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13289
13290 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13291 We prefer signed integers, even for size calculations.
13292
13293 * emacs.c: Don't assume string length fits in 'int'.
13294 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13295 (main): Don't invoke strlen when not needed.
13296
13297 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13298 (XD_DEBUG_MESSAGE): Don't waste a byte.
13299
13300 * callproc.c (getenv_internal_1, getenv_internal)
13301 (Fgetenv_internal):
13302 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13303
13304 * lread.c (invalid_syntax): Omit length argument.
13305 All uses changed. This doesn't fix a bug, but it simplifies the
13306 code away from its former Hollerith-constant appearance, and it's
13307 one less 'int' to worry about when looking at integer-overflow issues.
13308 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13309
13310 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13311 This didn't break anything, but it didn't help either.
13312 It's confusing to put a bogus integer in a place where the actual
13313 value does not matter.
13314 (LIST_END_P): Remove unused macro and its bogus comment.
13315 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13316
13317 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13318 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13319 implementation.
13320 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13321 We prefer signed types, and the value cannot exceed the EMACS_INT
13322 range anyway (because otherwise the length would not be representable).
13323 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13324 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13325 This avoids a GCC warning when WIDE_EMACS_INT.
13326
13327 * indent.c (sane_tab_width): New function.
13328 (current_column, scan_for_column, Findent_to, position_indentation)
13329 (compute_motion): Use it. This is just for clarity.
13330 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13331
13332 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13333
13334 * lisp.h (lint_assume): New macro.
13335 * composite.c (composition_gstring_put_cache):
13336 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13337
13338 * editfns.c, insdel.c:
13339 Omit unnecessary forward decls, to simplify future changes.
13340
13341 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13342
13343 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13344
13345 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13346 Use much-faster test for byte-length change.
13347 Don't assume string byte-length fits in 'int'.
13348 Check that character arg fits in 'int'.
13349 (mapcar1): Declare byte as byte, for clarity.
13350
13351 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13352
13353 * fns.c (concat): Catch string overflow earlier.
13354 Do not rely on integer wraparound.
13355
13356 * dispextern.h (struct it.overlay_strings_charpos)
13357 (struct it.selective): Now EMACS_INT, not int.
13358 * xdisp.c (forward_to_next_line_start)
13359 (back_to_previous_visible_line_start)
13360 (reseat_at_next_visible_line_start, next_element_from_buffer):
13361 Don't arbitrarily truncate the value of 'selective' to int.
13362
13363 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13364
13365 * composite.c: Don't truncate sizes to 'int'.
13366 (composition_gstring_p, composition_reseat_it)
13367 (composition_adjust_point): Use EMACS_INT, not int.
13368 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13369 not EMACS_UINT, for indexes.
13370
13371 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13372
13373 * buffer.c: Include <verify.h>.
13374 (struct sortvec.priority, struct sortstr.priority):
13375 Now EMACS_INT, not int.
13376 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13377 (struct sortstr.size, record_overlay_string)
13378 (struct sortstrlist.size, struct sortlist.used):
13379 Don't truncate size to int.
13380 (record_overlay_string): Check for size-calculation overflow.
13381 (init_buffer_once): Check at compile-time, not run-time.
13382
13383 2011-06-22 Jim Meyering <meyering@redhat.com>
13384
13385 Don't leak an XBM-image-sized buffer
13386 * image.c (xbm_load): Free the image buffer after using it.
13387
13388 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13389
13390 Port to Sun C.
13391 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13392 that Sun C diagnosed.
13393 * fns.c (secure_hash): Fix pointer signedness issue.
13394 * intervals.c (static_offset_intervals): New function.
13395 (offset_intervals): Use it.
13396
13397 2011-06-21 Leo Liu <sdl.web@gmail.com>
13398
13399 * deps.mk (fns.o):
13400 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13401 sha512.h.
13402
13403 * fns.c (secure_hash): Rename from crypto_hash_function and change
13404 the first arg to accept symbols.
13405 (Fsecure_hash): New primitive.
13406 (syms_of_fns): New symbols.
13407
13408 2011-06-20 Deniz Dogan <deniz@dogan.se>
13409
13410 * process.c (Fset_process_buffer): Clarify return value in
13411 docstring.
13412
13413 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13414
13415 * dispnew.c (add_window_display_history): Use BVAR.
13416
13417 * xdisp.c (debug_method_add): Use BVAR.
13418 (check_window_end, dump_glyph_matrix, dump_glyph)
13419 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13420
13421 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13422 Likewise.
13423
13424 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13425 check till after the cache is created in init_frame_faces.
13426
13427 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13428
13429 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13430
13431 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13432
13433 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13434 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13435 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13436
13437 Improve buffer-overflow checking (Bug#8873).
13438 * fileio.c (Finsert_file_contents):
13439 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13440 Remove the old (too-loose) buffer overflow checks.
13441 They weren't needed, since make_gap checks for buffer overflow.
13442 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13443 The old code merely checked for Emacs fixnum overflow, and relied
13444 on undefined (wraparound) behavior. The new code avoids undefined
13445 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13446
13447 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13448 Tune. Don't use wider integers than needed. Don't use alloca.
13449 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13450
13451 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13452
13453 * insdel.c, lisp.h (buffer_overflow): New function.
13454 (insert_from_buffer_1, replace_range, replace_range_2):
13455 * insdel.c (make_gap_larger):
13456 * editfns.c (Finsert_char):
13457 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13458
13459 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13460
13461 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13462
13463 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13464
13465 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13466 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13467
13468 * fileio.c: Don't assume EMACS_INT fits in off_t.
13469 (emacs_lseek): New static function.
13470 (Finsert_file_contents, Fwrite_region): Use it.
13471 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13472
13473 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13474
13475 * fns.c: Don't overflow int when computing a list length.
13476 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13477 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13478 truncation on 64-bit hosts. Check for QUIT every
13479 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13480 faster and is responsive enough.
13481 (Flength): Report an error instead of overflowing an integer.
13482 (Fsafe_length): Return a float if the value is not representable
13483 as a fixnum. This shouldn't happen except in contrived situations.
13484 (Fnthcdr, Fsort): Don't assume list length fits in int.
13485 (Fcopy_sequence): Don't assume vector length fits in int.
13486
13487 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13488 (header_size, word_size): New constants.
13489 (allocate_vectorlike): Don't check size overflow here.
13490 (allocate_vector): Check it here instead, since this is the only
13491 caller of allocate_vectorlike that could cause overflow.
13492 Check that the new vector's length is representable as a fixnum.
13493
13494 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13495 The previous code was bogus. For example, next_almost_prime (32)
13496 returned 39, which is undesirable as it is a multiple of 3; and
13497 next_almost_prime (24) returned 25, which is a multiple of 5 so
13498 why was the code bothering to check for multiples of 7?
13499
13500 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13501
13502 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13503
13504 Variadic C functions now count arguments with ptrdiff_t.
13505 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13506 Back then I didn't know that the Emacs coding style prefers signed int.
13507 Also, in the meantime I found a few more instances where arguments
13508 were being counted with int, which may truncate counts on 64-bit
13509 machines, or EMACS_INT, which may be unnecessarily wide.
13510 * lisp.h (struct Lisp_Subr.function.aMANY)
13511 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13512 Arg counts are now ptrdiff_t, not size_t.
13513 All variadic functions and their callers changed accordingly.
13514 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13515 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13516 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13517 * callint.c (Fcall_interactively): Check arg count for overflow,
13518 to avoid potential buffer overrun. Use signed char, not 'int',
13519 for 'varies' array, so that we needn't bother to check its size
13520 calculation for overflow.
13521 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13522 * eval.c (apply_lambda):
13523 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13524 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13525 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13526
13527 * callint.c (Fcall_interactively): Don't use index var as event count.
13528
13529 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13530 * mem-limits.h (SIZE): Remove; no longer used.
13531
13532 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13533
13534 Remove unnecessary casts.
13535 * xterm.c (x_term_init):
13536 * xfns.c (x_set_border_pixel):
13537 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13538 These aren't needed now that we assume ANSI C.
13539
13540 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13541 It's more likely to cause problems (due to unsigned overflow)
13542 than to cure them.
13543
13544 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13545
13546 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13547
13548 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13549
13550 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13551
13552 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13553
13554 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13555
13556 GLYPH_CODE_FACE returns EMACS_INT, not int.
13557 * dispextern.h (merge_faces):
13558 * xfaces.c (merge_faces):
13559 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13560 Don't assume EMACS_INT fits in int.
13561
13562 * character.h (CHAR_VALID_P): Remove unused parameter.
13563 * fontset.c, lisp.h, xdisp.c: All uses changed.
13564
13565 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13566
13567 * fns.c (concat): Minor tuning based on overflow analysis.
13568 This doesn't fix any bugs. Use int to hold character, instead
13569 of constantly refetching from Emacs object. Use XFASTINT, not
13570 XINT, for value known to be a character. Don't bother comparing
13571 a single byte to 0400, as it's always less.
13572
13573 * floatfns.c (Fexpt):
13574 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13575
13576 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13577 for characters.
13578
13579 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13580
13581 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13582 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13583 incorrectly succeed when S was a string, because 4294967386 was
13584 truncated before it was used.
13585
13586 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13587 Otherwise, an out-of-range integer could cause undefined behavior
13588 on a 64-bit host.
13589
13590 * composite.c: Use int, not EMACS_INT, for characters.
13591 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13592 EMACS_INT, for values that are known to be in character range.
13593 This doesn't fix any bugs but is the usual style inside Emacs and
13594 may generate better code on 32-bit machines.
13595
13596 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13597 This is for reasons similar to the recent CHAR_STRING fix.
13598 * charset.c (Fencode_char): Check that character arg is actually
13599 a character. Pass an int to ENCODE_CHAR.
13600 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13601 wider than 'int', as a compile-time check to prevent future regressions
13602 in this area.
13603
13604 * character.c (char_string): Remove unnecessary casts.
13605
13606 Make sure a 64-bit char is never passed to CHAR_STRING.
13607 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13608 by silently ignoring the top 32 bits, allowing some values
13609 that were far too large to be valid characters.
13610 * character.h: Include <verify.h>.
13611 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13612 arguments are no wider than unsigned, as a compile-time check
13613 to prevent future regressions in this area.
13614 * data.c (Faset):
13615 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13616 (Fsubst_char_in_region):
13617 * fns.c (concat):
13618 * xdisp.c (decode_mode_spec_coding):
13619 Adjust to CHAR_STRING's new requirement.
13620 * editfns.c (Finsert_char, Fsubst_char_in_region):
13621 * fns.c (concat): Check that character args are actually
13622 characters. Without this test, these functions did the wrong
13623 thing with wildly out-of-range values on 64-bit hosts.
13624
13625 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13626 These casts should not be needed on 32-bit hosts, either.
13627 * keyboard.c (read_char):
13628 * lread.c (Fload): Remove casts to unsigned.
13629
13630 * lisp.h (UNSIGNED_CMP): New macro.
13631 This fixes comparison bugs on 64-bit hosts.
13632 (ASCII_CHAR_P): Use it.
13633 * casefiddle.c (casify_object):
13634 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13635 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13636 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13637 * dispextern.h (FACE_FROM_ID):
13638 * keyboard.c (read_char): Use UNSIGNED_CMP.
13639
13640 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13641 not to EMACS_INT, to avoid GCC warning.
13642
13643 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13644
13645 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13646 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13647 isn't needed on 32-bit machines.
13648
13649 * buffer.c (Fgenerate_new_buffer_name):
13650 Use EMACS_INT for count, not int.
13651 (advance_to_char_boundary): Return EMACS_INT, not int.
13652
13653 * data.c (Qcompiled_function): Now static.
13654
13655 * window.c (window_body_lines): Now static.
13656
13657 * image.c (gif_load): Rename local to avoid shadowing.
13658
13659 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13660 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13661 * alloc.c (make_save_value): Integer argument is now of type
13662 ptrdiff_t, not int.
13663 (mark_object): Use ptrdiff_t, not int.
13664 * lisp.h (pD): New macro.
13665 * print.c (print_object): Use it.
13666
13667 * alloc.c: Use EMACS_INT, not int, to count objects.
13668 (total_conses, total_markers, total_symbols, total_vector_size)
13669 (total_free_conses, total_free_markers, total_free_symbols)
13670 (total_free_floats, total_floats, total_free_intervals)
13671 (total_intervals, total_strings, total_free_strings):
13672 Now EMACS_INT, not int. All uses changed.
13673 (Fgarbage_collect): Compute overall total using a double, so that
13674 integer overflow is less likely to be a problem. Check for overflow
13675 when converting back to an integer.
13676 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13677 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13678 These were 'int' variables that could overflow on 64-bit hosts;
13679 they were never used, so remove them instead of repairing them.
13680 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13681 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13682 Previously, this ceilinged at INT_MAX, but that doesn't work on
13683 64-bit machines.
13684 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13685
13686 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13687 (allocate_vectorlike): Check for ptrdiff_t overflow.
13688 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13689 when a (possibly-narrower) signed value would do just as well.
13690 We prefer using signed arithmetic, to avoid comparison confusion.
13691
13692 * alloc.c: Catch some string size overflows that we were missing.
13693 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13694 for convenience in STRING_BYTES_MAX.
13695 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13696 The definition here is exact; the one in lisp.h was approximate.
13697 (allocate_string_data): Check for string overflow. This catches
13698 some instances we weren't catching before. Also, it catches
13699 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13700 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13701 and ptrdiff_t and EMACS_INT are both 64 bits.
13702
13703 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13704 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13705 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13706
13707 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13708
13709 * alloc.c (Fmake_string): Check for out-of-range init.
13710
13711 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13712
13713 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13714
13715 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13716
13717 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13718 xg_get_default_scrollbar_width.
13719
13720 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13721 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13722 (style_changed_cb): Call update_theme_scrollbar_width and call
13723 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13724 all frames (Bug#8505).
13725 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13726 Call gtk_window_set_resizable if HAVE_GTK3.
13727 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13728 and height if HAVE_GTK3 (Bug#8505).
13729 (scroll_bar_width_for_theme): New variable.
13730 (update_theme_scrollbar_width): New function.
13731 (xg_get_default_scrollbar_width): Move code to
13732 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13733 (xg_initialize): Call update_theme_scrollbar_width.
13734
13735 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13736
13737 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13738
13739 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13740
13741 * frame.c (make_frame): Call other_buffer_safely instead of
13742 other_buffer.
13743
13744 * window.c (temp_output_buffer_show): Call display_buffer with
13745 second argument Vtemp_buffer_show_specifiers and reset latter
13746 immediately after the call.
13747 (Vtemp_buffer_show_specifiers): New variable.
13748 (auto_window_vscroll_p, next_screen_context_lines)
13749 (Vscroll_preserve_screen_position): Remove leading asterisks from
13750 doc-strings.
13751
13752 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13753
13754 Fix minor problems found by GCC 4.6.0 static checking.
13755 * buffer.c (Qclone_number): Remove for now, as it's unused.
13756 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13757 (record_buffer): Remove unused local.
13758 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13759 (set_frame_buffer_list): Remove; unused.
13760 * frame.h (other_visible_frames): Remove decl.
13761 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13762 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13763 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13764 if HAVE_GPM.
13765 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13766 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13767 Define only if HAVE_GPM.
13768 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13769 (update_hints_inhibit): Remove; never set. All uses removed.
13770 * widgetprv.h (emacsFrameClassRec): Remove decl.
13771 * window.c (delete_deletable_window): Now returns void, since it
13772 wasn't returning anything.
13773 (compare_window_configurations): Remove unused locals.
13774 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13775 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13776 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13777 the same widths as pointers. This follows up on the 2011-05-06 patch.
13778 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13779 * xterm.h: Likewise.
13780 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13781
13782 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13783
13784 * makefile.w32-in: Update dependencies.
13785 (LISP_H): Add lib/intprops.h.
13786
13787 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13788
13789 * image.c (gif_load): Add animation frame delay to the metadata.
13790 (syms_of_image): Use DEFSYM. New symbol `delay'.
13791
13792 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13793
13794 * window.c (delete_deletable_window): Re-add.
13795 (Fset_window_configuration): Rewrite to handle dead buffers and
13796 consequently deletable windows.
13797 (window_tree, Fwindow_tree): Remove. Supply functionality in
13798 window.el.
13799 (compare_window_configurations): Simplify code.
13800
13801 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13802
13803 * image.c (imagemagick_load_image): Fix type mismatch.
13804 (Fimagemagick_types): Likewise.
13805
13806 * window.h (replace_buffer_in_windows): Declare.
13807
13808 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13809
13810 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13811 Qclone_number. Remove external declaration of Qdelete_window.
13812 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13813 code.
13814 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13815 Run Qbuffer_list_update_hook if allowed.
13816 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13817 buffer list implementation.
13818 (other_buffer_safely): New function.
13819 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13820 calls to replace_buffer_in_windows and
13821 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13822 if allowed.
13823 (record_buffer): Inhibit quitting and rewrite using quittable
13824 functions. Run Qbuffer_list_update_hook if allowed.
13825 (Frecord_buffer, Funrecord_buffer): New functions.
13826 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13827 Move switch-to-buffer to window.el.
13828 (bury-buffer): Move to window.el.
13829 (Vbuffer_list_update_hook): New variable.
13830
13831 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13832 section.
13833
13834 * window.h (resize_frame_windows): Move up in code.
13835 (Fwindow_frame): Remove EXFUN.
13836 (replace_buffer_in_all_windows): Remove prototype.
13837 (replace_buffer_in_windows_safely): Add prototype.
13838
13839 * window.c: Declare Qdelete_window static again. Move down
13840 declaration of select_count.
13841 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13842 (Fother_window): Move to window.el.
13843 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13844 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13845 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13846 window.el.
13847 (replace_buffer_in_windows): Implement by calling
13848 Qreplace_buffer_in_windows.
13849 (replace_buffer_in_all_windows): Remove with some functionality
13850 moved into replace_buffer_in_windows_safely.
13851 (replace_buffer_in_windows_safely): New function.
13852 (select_window_norecord, select_frame_norecord): Move in front
13853 of run_window_configuration_change_hook. Remove now obsolete
13854 declarations.
13855 (Fset_window_buffer): Rewrite doc-string.
13856 Call Qrecord_window_buffer.
13857 (keys_of_window): Move binding for other-window to window.el.
13858
13859 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13860
13861 * dispextern.h (struct image): Replace data member, whose int_val
13862 and ptr_val fields were not used by anything, with a single
13863 lisp_val object.
13864
13865 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13866 (gif_clear_image, gif_load, imagemagick_load_image)
13867 (gs_clear_image, gs_load): Callers changed.
13868
13869 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13870
13871 * buffer.h: Include <time.h>, for time_t.
13872 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13873
13874 Fix minor problems found by static checking.
13875
13876 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13877
13878 Make identifiers static if they are not used in other modules.
13879 * data.c (Qcompiled_function, Qframe, Qvector):
13880 * image.c (QimageMagick, Qsvg):
13881 * minibuf.c (Qmetadata):
13882 * window.c (resize_window_check, resize_root_window): Now static.
13883 * window.h (resize_window_check, resize_root_window): Remove decls.
13884
13885 * window.c (window_deletion_count, delete_deletable_window):
13886 Remove; unused.
13887 (window_body_lines): Now static.
13888 (Fdelete_other_windows_internal): Mark vars as initialized.
13889 Make sure 'resize_failed' is initialized.
13890 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13891 (resize_window_apply): Remove unused local.
13892 * window.h (delete_deletable_window): Remove decl.
13893
13894 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13895 (imagemagick_load_image): Fix pointer signedness problem by changing
13896 last arg from unsigned char * to char *. All uses changed.
13897 Also, fix a local for similar reasons.
13898 Remove unused locals. Remove locals to avoid shadowing.
13899 (fn_rsvg_handle_free): Remove; unused.
13900 (svg_load, svg_load_image): Fix pointer signedness problem.
13901 (imagemagick_load_image): Don't use garbage pointer image_wand.
13902
13903 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13904
13905 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13906
13907 * image.c (gif_load): Fix omitted cast error introduced by
13908 2011-06-06 change.
13909
13910 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13911
13912 * window.h (resize_proportionally, orig_total_lines)
13913 (orig_top_line): Remove from window structure.
13914 (set_window_height, set_window_width, change_window_heights)
13915 (Fdelete_window): Remove prototypes.
13916 (resize_frame_windows): Remove duplicate declaration.
13917
13918 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13919
13920 * window.h (resize_frame_windows, resize_window_check)
13921 (delete_deletable_window, resize_root_window)
13922 (resize_frame_windows): Declare prototypes.
13923
13924 * window.c (resize_window_apply): Make definition be "static" to
13925 match the prototype.
13926
13927 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13928
13929 * window.c: Remove declarations of Qwindow_size_fixed,
13930 window_min_size_1, window_min_size_2, window_min_size,
13931 size_window, window_fixed_size_p, enlarge_window, delete_window.
13932 Remove static from declaration of Qdelete_window, it's
13933 temporarily needed by Fbury_buffer.
13934 (replace_window): Don't assign orig_top_line and
13935 orig_total_lines.
13936 (Fdelete_window, delete_window): Remove. Window deletion is
13937 handled by window.el.
13938 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13939 Replace Fdelete_window calls with calls to Qdelete_window.
13940 (Fdelete_other_windows): Remove. Deleting other windows is
13941 handled by window.el.
13942 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13943 handled in window.el.
13944 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13945 Window minimum sizes are handled in window.el.
13946 (shrink_windows, size_window, set_window_height)
13947 (set_window_width, change_window_heights, window_height)
13948 (window_width, CURBEG, CURSIZE, enlarge_window)
13949 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13950 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13951 handled in window.el.
13952 (make_dummy_parent): Rename to make_parent_window and give it a
13953 second argument horflag.
13954 (make_window): Don't set resize_proportionally any more.
13955 (Fsplit_window): Remove. Windows are split in window.el.
13956 (save_restore_action, save_restore_orig_size)
13957 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13958 Resize mini windows in window.el.
13959 (grow_mini_window, shrink_mini_window): Implement by calling
13960 Qresize_root_window_vertically, resize_window_check and
13961 resize_window_apply.
13962 (saved_window, Fset_window_configuration, save_window_save):
13963 Do not handle orig_top_line, orig_total_lines, and
13964 resize_proportionally.
13965 (window_min_height, window_min_width): Move to window.el.
13966 (keys_of_window): Move bindings for delete-other-windows,
13967 split-window, delete-window and enlarge-window to window.el.
13968
13969 * buffer.c: Temporarily extern Qdelete_window.
13970 (Fbury_buffer): Temporarily call Qdelete_window instead of
13971 Fdelete_window (Fbury_buffer will move to window.el soon).
13972
13973 * frame.c (set_menu_bar_lines_1): Remove code handling
13974 orig_top_line and orig_total_lines.
13975
13976 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13977 set_window_height but set heights directly.
13978 (change_frame_size_1): Use resize_frame_windows.
13979
13980 * xdisp.c (init_xdisp): Don't use set_window_height but set
13981 heights directly.
13982
13983 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13984 Use resize_frame_windows instead of change_window_heights and run
13985 run_window_configuration_change_hook.
13986
13987 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13988 instead of change_window_heights and run
13989 run_window_configuration_change_hook.
13990
13991 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13992
13993 * window.c (replace_window): Rename second argument REPLACEMENT to
13994 NEW. New third argument SETFLAG. Rewrite.
13995 (delete_window, make_dummy_parent): Call replace_window with
13996 third argument 1.
13997 (window_list_1): Move down in code.
13998 (run_window_configuration_change_hook): Move set_buffer part
13999 before select_frame_norecord part in order to unwind correctly.
14000 Rename count1 to count.
14001 (recombine_windows, delete_deletable_window, resize_root_window)
14002 (Fdelete_other_windows_internal)
14003 (Frun_window_configuration_change_hook, make_parent_window)
14004 (resize_window_check, resize_window_apply, Fresize_window_apply)
14005 (resize_frame_windows, Fsplit_window_internal)
14006 (Fdelete_window_internal, Fresize_mini_window_internal):
14007 New functions.
14008 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14009
14010 2011-06-08 Martin Rudalics <rudalics@gmx.at>
14011
14012 * window.h (window): Add some new members to window structure -
14013 normal_lines, normal_cols, new_total, new_normal, clone_number,
14014 splits, nest, prev_buffers, next_buffers.
14015 (WINDOW_TOTAL_SIZE): Move here from window.c.
14016 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14017
14018 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14019 Remove.
14020 (make_dummy_parent): Set new members of windows structure.
14021 (make_window): Move down in code. Handle new members of window
14022 structure.
14023 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14024 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14025 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14026 (Fset_window_prev_buffers, Fwindow_next_buffers)
14027 (Fset_window_next_buffers, Fset_window_clone_number):
14028 New functions.
14029 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14030 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14031 Doc-string fixes.
14032 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14033 Argument WINDOW can be now internal window too.
14034 (Fwindow_use_time): Move up in code.
14035 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14036 Rewrite doc-string.
14037 (Fset_window_configuration, saved_window)
14038 (Fcurrent_window_configuration, save_window_save): Handle new
14039 members of window structure.
14040 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14041 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14042 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14043 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14044 Qget_mru_window, Qresize_root_window,
14045 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14046 Qauto_buffer_name; staticpro them.
14047
14048 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14049
14050 * window.c (Fwindow_total_size, Fwindow_left_column)
14051 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14052 (Fwindow_list_1): New functions.
14053 (window_box_text_cols): Replace with window_body_cols.
14054 (Fwindow_width, Fscroll_left, Fscroll_right):
14055 Use window_body_cols instead of window_box_text_cols.
14056 (delete_window, Fset_window_configuration):
14057 Call delete_all_subwindows with window as argument.
14058 (delete_all_subwindows): Take a window as argument and not a
14059 structure. Rewrite.
14060 (window_loop): Remove handling of GET_LRU_WINDOW and
14061 GET_LARGEST_WINDOW.
14062 (Fget_lru_window, Fget_largest_window): Move to window.el.
14063
14064 * window.h: Extern window_body_cols instead of
14065 window_box_text_cols. delete_all_subwindows now takes a
14066 Lisp_Object as argument.
14067
14068 * indent.c (compute_motion, Fcompute_motion):
14069 Use window_body_cols instead of window_box_text_cols.
14070
14071 * frame.c (delete_frame): Call delete_all_subwindows with root
14072 window as argument.
14073
14074 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14075
14076 * fns.c (Fputhash): Document return value.
14077
14078 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14079
14080 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14081
14082 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14083
14084 Cons<->int and similar integer overflow fixes (Bug#8794).
14085
14086 Check for overflow when converting integer to cons and back.
14087 * charset.c (Fdefine_charset_internal, Fdecode_char):
14088 Use cons_to_unsigned to catch overflow.
14089 (Fencode_char): Use INTEGER_TO_CONS.
14090 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14091 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14092 * data.c (long_to_cons, cons_to_long): Remove.
14093 (cons_to_unsigned, cons_to_signed): New functions.
14094 These signal an error for invalid or out-of-range values.
14095 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14096 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14097 * font.c (Ffont_variation_glyphs):
14098 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14099 * lisp.h: Include <intprops.h>.
14100 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14101 (cons_to_signed, cons_to_unsigned): New decls.
14102 (long_to_cons, cons_to_long): Remove decls.
14103 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14104 (Fprimitive_undo): Use CONS_TO_INTEGER.
14105 * xfns.c (Fx_window_property): Likewise.
14106 * xselect.c: Include <limits.h>.
14107 (x_own_selection, selection_data_to_lisp_data):
14108 Use INTEGER_TO_CONS.
14109 (x_handle_selection_request, x_handle_selection_clear)
14110 (x_get_foreign_selection, Fx_disown_selection_internal)
14111 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14112 (lisp_data_to_selection_data): Use cons_to_unsigned.
14113 (x_fill_property_data): Use cons_to_signed.
14114 Report values out of range.
14115
14116 Check for buffer and string overflow more precisely.
14117 * buffer.h (BUF_BYTES_MAX): New macro.
14118 * lisp.h (STRING_BYTES_MAX): New macro.
14119 * alloc.c (Fmake_string):
14120 * character.c (string_escape_byte8):
14121 * coding.c (coding_alloc_by_realloc):
14122 * doprnt.c (doprnt):
14123 * editfns.c (Fformat):
14124 * eval.c (verror):
14125 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14126 since they may not be the same number.
14127 * editfns.c (Finsert_char):
14128 * fileio.c (Finsert_file_contents):
14129 Likewise for BUF_BYTES_MAX.
14130
14131 * image.c: Use ptrdiff_t, not int, for sizes.
14132 (slurp_file): Switch from int to ptrdiff_t.
14133 All uses changed.
14134 (slurp_file): Check that file size fits in both size_t (for
14135 malloc) and ptrdiff_t (for sanity and safety).
14136
14137 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14138 if b->modtime has its maximal value.
14139
14140 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14141
14142 Don't assume time_t can fit into int.
14143 * buffer.h (struct buffer.modtime): Now time_t, not int.
14144 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14145 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14146
14147 Minor fixes for signed vs unsigned integers.
14148 * character.h (MAYBE_UNIFY_CHAR):
14149 * charset.c (maybe_unify_char):
14150 * keyboard.c (read_char, reorder_modifiers):
14151 XINT -> XFASTINT, since the integer must be nonnegative.
14152 * ftfont.c (ftfont_spec_pattern):
14153 * keymap.c (access_keymap, silly_event_symbol_error):
14154 XUINT -> XFASTINT, since the integer must be nonnegative.
14155 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14156 since it makes no difference and we prefer signed.
14157 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14158 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14159 nonnegative.
14160
14161 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14162
14163 * window.h (Fwindow_frame): Declare.
14164
14165 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14166
14167 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14168 (SPARE_MEMORY): Always define.
14169 (LARGE_REQUEST): Remove.
14170 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14171
14172 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14173
14174 * lisp.h: Move EXFUNS for Fframe_root_window,
14175 Fframe_first_window and Fset_frame_selected_window to window.h.
14176
14177 * window.h: Move EXFUNS for Fframe_root_window,
14178 Fframe_first_window and Fset_frame_selected_window here from
14179 lisp.h.
14180
14181 * frame.c (Fwindow_frame, Fframe_first_window)
14182 (Fframe_root_window, Fframe_selected_window)
14183 (Fset_frame_selected_window): Move to window.c.
14184 (Factive_minibuffer_window): Move to minibuf.c.
14185 (Fother_visible_frames_p): New function.
14186
14187 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14188
14189 * window.c (decode_window, decode_any_window): Move up in code.
14190 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14191 (inhibit_frame_unsplittable): Remove unused variable.
14192 (Fwindow_buffer): Move up and rewrite doc-string.
14193 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14194 (Fwindow_prev): New functions.
14195 (Fwindow_frame): Move here from frame.c. Accept any window as
14196 argument.
14197 (Fframe_root_window, Fframe_first_window)
14198 (Fframe_selected_window): Move here from frame.c. Accept frame
14199 or arbitrary window as argument. Update doc-strings.
14200 (Fminibuffer_window): Move up in code.
14201 (Fwindow_minibuffer_p): Move up in code and simplify.
14202 (Fset_frame_selected_window): Move here from frame.c.
14203 Marginal rewrite.
14204 (Fselected_window, select_window, Fselect_window): Move up in
14205 code. Minor doc-string fixes.
14206
14207 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14208
14209 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14210 Do not assume that spare memory exists; that assumption is valid
14211 only if SYSTEM_MALLOC.
14212 (LARGE_REQUEST): New macro, so that the issue of large requests
14213 is separated from the issue of spare memory.
14214
14215 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14216
14217 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14218 format. (Bug#8806)
14219
14220 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14221
14222 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14223 before statements.
14224
14225 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14226
14227 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14228
14229 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14230
14231 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14232 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14233
14234 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14235
14236 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14237
14238 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14239
14240 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14241 (x_clipboard_manager_save): Add return value.
14242 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14243 New error handlers.
14244 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14245 Obey Vx_select_enable_clipboard_manager. Catch errors in
14246 x_clipboard_manager_save (Bug#8779).
14247 (Vx_select_enable_clipboard_manager): New variable.
14248 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14249
14250 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14251
14252 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14253
14254 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14255
14256 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14257 in the current matrix if keep_current_p is non-zero.
14258
14259 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14260
14261 * bidi.c (bidi_level_of_next_char): Fix last change.
14262
14263 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14264
14265 Support bidi reordering of text covered by display properties.
14266
14267 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14268 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14269 (bidi_cache_search, bidi_cache_iterator_state)
14270 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14271 (bidi_level_of_next_char, bidi_move_to_visually_next):
14272 Support character positions inside a run of characters covered by a
14273 display string.
14274 (bidi_paragraph_init, bidi_resolve_explicit_1)
14275 (bidi_level_of_next_char): Call bidi_fetch_char and
14276 bidi_fetch_char_advance instead of FETCH_CHAR and
14277 FETCH_CHAR_ADVANCE.
14278 (bidi_init_it): Initialize new members.
14279 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14280 definitions.
14281 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14282 instead of using explicit *_CHAR codes.
14283 (bidi_resolve_explicit, bidi_resolve_weak):
14284 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14285 bidirectional text is supported only in multibyte buffers.
14286 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14287 it to initialize the frame_window_p member of struct bidi_it.
14288 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14289 (bidi_resolve_explicit, bidi_resolve_weak)
14290 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14291 bidi_it->nchars is non-positive.
14292 (bidi_level_of_next_char): Don't try to lookup the cache for the
14293 next/previous character if nothing is cached there yet, or if we
14294 were just reseat()'ed to a new position.
14295
14296 * xdisp.c (set_cursor_from_row): Set start and stop points
14297 according to the row's direction when priming the loop that looks
14298 for the glyph on which to display cursor.
14299 (single_display_spec_intangible_p): Function deleted.
14300 (display_prop_intangible_p): Reimplement to call
14301 handle_display_spec instead of single_display_spec_intangible_p.
14302 Accept 3 additional arguments needed by handle_display_spec.
14303 This fixes incorrect cursor motion across display property with complex
14304 values: lists, `(when COND...)' forms, etc.
14305 (single_display_spec_string_p): Support property values that are
14306 lists with the argument STRING its top-level element.
14307 (display_prop_string_p): Fix the condition for processing a
14308 property that is a list to be consistent with handle_display_spec.
14309 (handle_display_spec): New function, refactored from the
14310 last portion of handle_display_prop.
14311 (compute_display_string_pos): Accept additional argument
14312 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14313 value of a `display' property is a "replacing spec".
14314 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14315 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14316 the display property, but just return a value indicating whether
14317 the display property will replace the characters it covers.
14318 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14319 frame_window_p members of struct bidi_it.
14320 (compute_display_string_pos, compute_display_string_end):
14321 New functions.
14322 (push_it): Accept second argument POSITION, where pop_it should
14323 jump to continue iteration.
14324 (reseat_1): Initialize bidi_it.disp_pos.
14325
14326 * keyboard.c (adjust_point_for_property): Adjust the call to
14327 display_prop_intangible_p to its new signature.
14328
14329 * dispextern.h (struct bidi_it): New member frame_window_p.
14330 (bidi_init_it): Update prototypes.
14331 (display_prop_intangible_p): Update prototype.
14332 (compute_display_string_pos, compute_display_string_end):
14333 Declare prototypes.
14334 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14335 EMACS_INT.
14336
14337 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14338
14339 Malloc failure behavior now depends on size of allocation.
14340 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14341 * lisp.h: Change signatures accordingly.
14342 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14343 All callers changed. (Bug#8762)
14344
14345 * gnutls.c: Use Emacs's memory allocators.
14346 Without this change, the gnutls library would invoke malloc etc.
14347 directly, which causes problems on non-SYNC_INPUT hosts, and which
14348 runs afoul of improving memory_full behavior. (Bug#8761)
14349 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14350 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14351 xfree instead of the default malloc, realloc, free.
14352 (Fgnutls_boot): No need to check for memory allocation failure,
14353 since xmalloc does that for us.
14354
14355 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14356 * category.c (hash_get_category_set):
14357 * ccl.c (ccl_driver):
14358 * charset.c (Fdefine_charset_internal):
14359 * charset.h (struct charset.hash_index):
14360 * composite.c (get_composition_id, gstring_lookup_cache)
14361 (composition_gstring_put_cache):
14362 * composite.h (struct composition.hash_index):
14363 * dispextern.h (struct image.hash):
14364 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14365 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14366 (hashfn_equal, hashfn_user_defined, make_hash_table)
14367 (maybe_resize_hash_table, hash_lookup, hash_put)
14368 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14369 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14370 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14371 * image.c (make_image, search_image_cache, lookup_image)
14372 (xpm_put_color_table_h):
14373 * lisp.h (struct Lisp_Hash_Table):
14374 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14375 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14376 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14377 * alloc.c (allocate_vectorlike):
14378 Check for overflow in vector size calculations.
14379 * ccl.c (ccl_driver):
14380 Check for overflow when converting EMACS_INT to int.
14381 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14382 need to be updated by these changes.
14383 * fns.c (make_hash_table, maybe_resize_hash_table):
14384 Check for integer overflow with large hash tables.
14385 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14386 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14387 (SXHASH_REDUCE): New macro.
14388 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14389 Use it instead of discarding useful hash info with large hash values.
14390 (sxhash_float): New function.
14391 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14392 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14393 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14394 Rewrite to use FIXNUM_BITS, as this simplifies things.
14395 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14396 Adjust signatures to match updated version of code.
14397 (consing_since_gc): Now EMACS_INT, since a single hash table can
14398 use more than INT_MAX bytes.
14399
14400 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14401
14402 Make it possible to build with GCC-4.6+ -O2 -flto.
14403
14404 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14405
14406 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14407
14408 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14409 Call minibuffer-inactive-mode.
14410
14411 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14412
14413 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14414 Update dependencies.
14415
14416 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14417
14418 * data.c (init_data): Remove code for UTS, this system is not
14419 supported anymore.
14420
14421 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14422
14423 Don't force ./temacs to start in terminal mode.
14424
14425 * frame.c (make_initial_frame): Initialize faces in all cases, not
14426 only when CANNOT_DUMP is defined.
14427 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14428
14429 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14430
14431 * dispnew.c (add_window_display_history): Use const for the string
14432 pointer. Remove declaration, not needed.
14433
14434 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14435
14436 Use 'inline', not 'INLINE'.
14437 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14438 * alloc.c, fontset.c (INLINE): Remove.
14439 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14440 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14441 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14442 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14443 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14444
14445 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14446
14447 Make it possible to run ./temacs.
14448
14449 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14450 syms_of_callproc does the same thing. Remove test for
14451 "initialized", do it in the caller.
14452 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14453
14454 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14455
14456 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14457 (read_minibuf): Use get_minibuffer.
14458 (syms_of_minibuf): Use DEFSYM.
14459 (Qmetadata): New var.
14460 * data.c (Qbuffer): Don't make it static.
14461 (syms_of_data): Use DEFSYM.
14462
14463 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14464
14465 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14466 (CCL_CODE_MIN): New macro.
14467
14468 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14469
14470 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14471
14472 * eval.c (Qdebug): Now static.
14473 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14474 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14475 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14476
14477 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14478
14479 * image.c: Various fixes to ImageMagick code comments.
14480 (Fimagemagick_types): Doc fix.
14481
14482 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14483
14484 Minor fixes prompted by GCC 4.6.0 warnings.
14485
14486 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14487
14488 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14489 (x_clipboard_manager_save_all): Move extern decl to ...
14490 * xterm.h: ... here, so that it can be checked for consistency.
14491
14492 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14493
14494 * xselect.c (x_clipboard_manager_save_frame)
14495 (x_clipboard_manager_save_all): New functions.
14496 (Fx_clipboard_manager_save): Lisp function deleted.
14497
14498 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14499 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14500
14501 * xterm.h: Update prototype.
14502
14503 2011-05-28 William Xu <william.xwl@gmail.com>
14504
14505 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14506 exiting (Bug#8239).
14507
14508 2011-05-28 Jim Meyering <meyering@redhat.com>
14509
14510 Avoid a sign-extension bug in crypto_hash_function.
14511 * fns.c (to_uchar): Define.
14512 (crypto_hash_function): Use it to convert some newly-signed
14513 variables to unsigned, to avoid sign-extension bugs. For example,
14514 without this change, (md5 "truc") would evaluate to
14515 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14516 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14517 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14518
14519 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14520
14521 Integer overflow fixes.
14522
14523 * dbusbind.c: Serial number integer overflow fixes.
14524 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14525 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14526 to hold a serial number that is too large for a fixnum.
14527 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14528 Check for serial numbers out of range. Decode any serial number
14529 that was so large that it became a float. (Bug#8722)
14530
14531 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14532 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14533 Use XFASTINT rather than XUINT when numbers are nonnegative.
14534 (xd_append_arg, Fdbus_method_return_internal):
14535 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14536 arguments, check that Lisp number is nonnegative, rather than
14537 silently wrapping negative numbers around. (Bug#8722)
14538 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14539 (Bug#8722)
14540
14541 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14542
14543 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14544
14545 ccl: Add integer overflow checks.
14546 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14547 (IN_INT_RANGE): New macros.
14548 (ccl_driver): Use them to check for integer overflow when
14549 decoding a CCL program. Many of the new checks are whether XINT (x)
14550 fits in int; it doesn't always, on 64-bit hosts. The new version
14551 doesn't catch all possible integer overflows, but it's an
14552 improvement. (Bug#8719)
14553
14554 * alloc.c (make_event_array): Use XINT, not XUINT.
14555 There's no need for unsigned here.
14556
14557 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14558 This follows up to the 2011-05-06 change that substituted uintptr_t
14559 for EMACS_INT. This case wasn't caught back then.
14560
14561 Rework Fformat to avoid integer overflow issues.
14562 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14563 now (part of C89). Include <verify.h>.
14564 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14565 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14566 (Fformat): Avoid the prepass trying to compute sizes; it was only
14567 approximate and thus did not catch overflow reliably. Instead, walk
14568 through the format just once, formatting and computing sizes as we go,
14569 checking for integer overflow at every step, and allocating a larger
14570 buffer as needed. Keep track separately whether the format is
14571 multibyte. Keep only the most-recently calculated precision, rather
14572 than them all. Record whether each argument has been converted to
14573 string. Use EMACS_INT, not int, for byte and char and arg counts.
14574 Support field widths and precisions larger than INT_MAX. Avoid
14575 sprintf's undefined behavior with conversion specifications such as %#d
14576 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14577 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14578 formatting out-of-range floating point numbers with int
14579 formats. (Bug#8668)
14580
14581 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14582
14583 * data.c: Avoid integer truncation in expressions involving floats.
14584 * data.c: Include <intprops.h>.
14585 (arith_driver): When there's an integer overflow in an expression
14586 involving floating point, convert the integers to floating point
14587 so that the resulting value does not suffer from catastrophic
14588 integer truncation. For example, on a 64-bit host (* 4
14589 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14590 Do not rely on undefined behavior after integer overflow.
14591
14592 merge count_size_as_multibyte, parse_str_to_multibyte
14593 * character.c, character.h (count_size_as_multibyte):
14594 Rename from parse_str_to_multibyte; all uses changed.
14595 Check for integer overflow.
14596 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14597 since it's now a duplicate of the other. This is more of
14598 a character than a buffer op, so better that it's in character.c.
14599 * fns.c, print.c: Adjust to above changes.
14600
14601 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14602
14603 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14604
14605 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14606
14607 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14608 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14609 (x_clipboard_manager_save): Now static.
14610 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14611
14612 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14613 (crypto_hash_function): Now static.
14614 Fix pointer signedness problems. Avoid unnecessary initializations.
14615
14616 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14617
14618 * termhooks.h (Vselection_alist): Make it terminal-local.
14619
14620 * terminal.c (create_terminal): Initialize it.
14621
14622 * xselect.c: Support for clipboard managers.
14623 (Vselection_alist): Move to termhooks.h as terminal-local var.
14624 (LOCAL_SELECTION): New macro.
14625 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14626 (symbol_to_x_atom): Remove gratuitous arg.
14627 (x_handle_selection_request, lisp_data_to_selection_data)
14628 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14629 (x_own_selection, x_get_local_selection, x_convert_selection):
14630 New arg, specifying work frame. Use terminal-local Vselection_alist.
14631 (some_frame_on_display): Delete unused function.
14632 (Fx_own_selection_internal, Fx_get_selection_internal)
14633 (Fx_disown_selection_internal, Fx_selection_owner_p)
14634 (Fx_selection_exists_p): New optional frame arg.
14635 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14636 (x_handle_selection_clear): Don't treat other terminals with the
14637 same keyboard specially. Use the terminal-local Vselection_alist.
14638 (x_clear_frame_selections): Use Frun_hook_with_args.
14639
14640 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14641
14642 * xterm.h: Add support for those atoms.
14643
14644 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14645
14646 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14647 (converted_selections, conversion_fail_tag): New global variables.
14648 (x_selection_request_lisp_error): Free the above.
14649 (x_get_local_selection): Remove unnecessary code.
14650 (x_reply_selection_request): Args changed; handle arbitrary array
14651 of converted selections stored in converted_selections.
14652 Separate the XChangeProperty and SelectionNotify steps.
14653 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14654 (x_convert_selection): New function.
14655 (x_handle_selection_event): Simplify.
14656 (x_get_foreign_selection): Don't ignore incoming requests while
14657 waiting for an answer; this will fail when we implement
14658 SAVE_TARGETS, and seems unnecessary anyway.
14659 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14660 (Vx_sent_selection_functions): Doc fix.
14661
14662 2011-05-26 Leo Liu <sdl.web@gmail.com>
14663
14664 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14665
14666 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14667
14668 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14669
14670 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14671 for fringe update if it has periodic bitmap.
14672 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14673 and fringe_bitmap_periodic_p.
14674
14675 * fringe.c (get_fringe_bitmap_data): New function.
14676 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14677 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14678 row. Mark glyph row for fringe update if periodicity changed.
14679
14680 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14681 for fringe update unless it has periodic bitmap.
14682
14683 2011-05-25 Kenichi Handa <handa@m17n.org>
14684
14685 * xdisp.c (get_next_display_element): Set correct it->face_id for
14686 a static composition.
14687
14688 2011-05-24 Leo Liu <sdl.web@gmail.com>
14689
14690 * deps.mk (fns.o):
14691 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14692
14693 * fns.c (crypto_hash_function, Fsha1): New function.
14694 (Fmd5): Use crypto_hash_function.
14695 (syms_of_fns): Add Ssha1.
14696
14697 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14698
14699 * gnutls.c: Remove unused macros.
14700 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14701 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14702 Remove macros that are defined and never used.
14703 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14704
14705 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14706
14707 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14708 (Fx_get_selection_internal): Minor cleanup.
14709 (Fx_own_selection_internal): Rename arguments for consistency with
14710 select.el.
14711
14712 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14713
14714 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14715
14716 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14717
14718 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14719
14720 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14721
14722 * dispnew.c (scrolling_window): Don't exclude the case that the
14723 last enabled row in the desired matrix touches the bottom boundary.
14724
14725 2011-05-21 Glenn Morris <rgm@gnu.org>
14726
14727 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14728 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14729 and add some more files.
14730
14731 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14732
14733 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14734 report_file_error introduced by the change from 2011-05-07.
14735
14736 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14737
14738 * systime.h (Time): Define only if emacs is defined.
14739 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14740 where the include path doesn't have X11/X.h by default. See
14741 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14742
14743 2011-05-20 Kenichi Handa <handa@m17n.org>
14744
14745 * composite.c (find_automatic_composition): Fix previous change.
14746
14747 2011-05-20 Glenn Morris <rgm@gnu.org>
14748
14749 * lisp.mk: New file, split from Makefile.in.
14750 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14751 (shortlisp): Remove.
14752 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14753
14754 2011-05-19 Glenn Morris <rgm@gnu.org>
14755
14756 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14757 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14758 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14759 (lisp): Set the order to that of loadup.el.
14760 (shortlisp): Make it a copy of $lisp.
14761 (SOME_MACHINE_LISP): Remove.
14762 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14763 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14764
14765 2011-05-18 Kenichi Handa <handa@m17n.org>
14766
14767 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14768 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14769 (find_automatic_composition): Mostly rewrite for efficiency.
14770
14771 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14772
14773 * makefile.w32-in: Update dependencies.
14774
14775 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14776
14777 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14778 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14779
14780 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14781
14782 Fix some integer overflow issues, such as string length overflow.
14783
14784 * insdel.c (count_size_as_multibyte): Check for string overflow.
14785
14786 * character.c (lisp_string_width): Check for string overflow.
14787 Use EMACS_INT, not int, for string indexes and lengths; in
14788 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14789 the resulting string length overflows an EMACS_INT; instead,
14790 report a string overflow if no precision given. When checking for
14791 precision exhaustion, use a check that cannot possibly have
14792 integer overflow. (Bug#8675)
14793 * character.h (lisp_string_width): Adjust to new signature.
14794
14795 * alloc.c (string_overflow): New function.
14796 (Fmake_string): Use it. This doesn't change behavior, but saves
14797 a few bytes and will simplify future changes.
14798 * character.c (string_escape_byte8): Likewise.
14799 * lisp.h (string_overflow): New decl.
14800
14801 Fixups, following up to the user-interface timestamp change.
14802 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14803 for UI timestamps, instead of unsigned long.
14804 * msdos.c (mouse_get_pos): Likewise.
14805 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14806 * w32gui.h (Time): Define by including "systime.h" rather than by
14807 declaring it ourselves. (Bug#8664)
14808
14809 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14810 * image.c (clear_image_cache): Likewise.
14811
14812 * term.c (term_mouse_position): Don't assume time_t wraparound.
14813
14814 Be more systematic about user-interface timestamps.
14815 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14816 and sometimes 'EMACS_UINT', to represent these timestamps.
14817 This change causes it to use 'Time' uniformly, as that's what X uses.
14818 This makes the code easier to follow, and makes it easier to catch
14819 integer overflow bugs such as Bug#8664.
14820 * frame.c (Fmouse_position, Fmouse_pixel_position):
14821 Use Time, not unsigned long, for user-interface timestamps.
14822 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14823 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14824 * keyboard.h (last_event_timestamp): Likewise.
14825 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14826 * menu.h (xmenu_show): Likewise.
14827 * term.c (term_mouse_position): Likewise.
14828 * termhooks.h (struct input_event.timestamp): Likewise.
14829 (struct terminal.mouse_position_hook): Likewise.
14830 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14831 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14832 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14833 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14834 what it was before.
14835 * menu.h, termhooks.h: Include "systime.h", for Time.
14836
14837 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14838 Don't assume that the difference between two unsigned long values
14839 can fit into an integer. At this point, we know button_down_time
14840 <= event->timestamp, so the difference must be nonnegative, so
14841 there's no need to cast the result if double-click-time is
14842 nonnegative, as it should be; check that it's nonnegative, just in
14843 case. This bug is triggered when events are more than 2**31 ms
14844 apart (about 25 days). (Bug#8664)
14845
14846 * xselect.c (last_event_timestamp): Remove duplicate decl.
14847 (x_own_selection): Remove needless cast to unsigned long.
14848
14849 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14850 that always fit in int. Use a sentinel instead of a counter, to
14851 avoid a temp and to allay GCC's concerns about possible int overflow.
14852 * frame.h (struct frame): Use int for menu_bar_items_used
14853 instead of EMACS_INT, since it always fits in int.
14854
14855 * menu.c (grow_menu_items): Check for int overflow.
14856
14857 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14858
14859 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14860 Before, the code was not consistent. These values cannot exceed
14861 2**31 - 1 so there's no need to make them unsigned.
14862 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14863 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14864 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14865 as modifiers.
14866 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14867
14868 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14869 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14870 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14871 presumably because the widths might not match.
14872
14873 * window.c (size_window): Avoid needless test at loop start.
14874
14875 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14876
14877 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14878
14879 2011-05-12 Drew Adams <drew.adams@oracle.com>
14880
14881 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14882
14883 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14884
14885 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14886 `width' to `bar_area_x' and `bar_area_width', respectively.
14887 (x_scroll_run): Take account of fringe background extension.
14888
14889 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14890 Rename local vars `left' and `width' to `bar_area_x' and
14891 `bar_area_width', respectively.
14892 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14893 background extension.
14894
14895 2011-05-10 Jim Meyering <meyering@redhat.com>
14896
14897 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14898
14899 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14900
14901 * image.c (Finit_image_library): Return t for built-in image types,
14902 like pbm and xbm. (Bug#8640)
14903
14904 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14905
14906 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14907
14908 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14909
14910 * w32console.c (Fset_screen_color): Doc fix.
14911 (Fget_screen_color): New function.
14912 (syms_of_ntterm): Defsubr it.
14913
14914 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14915 unlink the temporary file if Fcall_process didn't create it in the
14916 first place.
14917 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14918 child process will be redirected to a file specified with `:file'.
14919 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14920 cue to call_process_cleanup not to close that handle.
14921
14922 2011-05-07 Ben Key <bkey76@gmail.com>
14923
14924 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14925 one of two shell specific rules, either bootstrap-temacs-CMD or
14926 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14927 to the previous implementation of the bootstrap-temacs rule.
14928 The bootstrap-temacs-CMD rule is similar to the previous
14929 implementation of the bootstrap-temacs rule except that it
14930 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14931 variable.
14932
14933 These changes, along with some changes to nt/configure.bat,
14934 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14935 earlier fix to add support for --cflags and --ldflags options
14936 that include quotes so that it works whether make uses cmd or
14937 sh as the shell.
14938
14939 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14940
14941 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14942 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14943 is a constant.
14944 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14945 a string. Handle both cases.
14946 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14947 (Fdbus_register_method): Use Qinvalid_function.
14948
14949 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14950
14951 * makefile.w32-in: Update dependencies.
14952 (LISP_H): Add inttypes.h and stdin.h.
14953 (PROCESS_H): Add unistd.h.
14954
14955 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14956
14957 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14958 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14959
14960 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14961
14962 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14963
14964 * term.c (vfatal): Remove stray call to va_end.
14965 It's not needed and the C Standard doesn't allow it here anyway.
14966
14967 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14968 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14969
14970 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14971 bytes.
14972
14973 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14974
14975 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14976
14977 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14978
14979 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14980
14981 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14982
14983 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14984 * charset.c (Fdefine_charset_internal): Don't initialize
14985 charset.code_space[15]. The value was garbage, on hosts with
14986 32-bit int (Bug#8600).
14987
14988 * lread.c (read_integer): Be more consistent with string-to-number.
14989 Use string_to_number to do the actual conversion; this avoids
14990 rounding errors and fixes some other screwups. Without this fix,
14991 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14992 (digit_to_number): Move earlier, for benefit of read_integer.
14993 Return -1 if the digit is out of range for the base, -2 if it is
14994 not a digit in any supported base. (Bug#8602)
14995
14996 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14997
14998 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14999 to match comment at start of function. This also removes a
15000 GCC warning about overflow in a 32+64-bit port.
15001
15002 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15003
15004 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15005 Reported by Stefan Monnier in
15006 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
15007 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15008 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
15009
15010 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15011 (EMACS_UINTPTR): Likewise, with uintptr_t.
15012
15013 * lisp.h: Prefer 64-bit EMACS_INT if available.
15014 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15015 on 32-bit hosts that have 64-bit int, so that they can access
15016 large files.
15017 However, temporarily disable this change unless the temporary
15018 symbol WIDE_EMACS_INT is defined.
15019
15020 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15021
15022 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15023 This removes an assumption that EMACS_INT and long are the same
15024 width as pointers. The assumption is true for Emacs porting targets
15025 now, but we want to make other targets possible.
15026 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15027 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15028 In the rest of the code, change types of integers that hold casted
15029 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15030 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15031 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15032 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15033 No need to cast type when ORing.
15034 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15035 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15036 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15037 assume EMACS_INT is the same width as char *.
15038 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15039 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15040 Remove no-longer-needed casts.
15041 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15042 (xg_tool_bar_help_callback, xg_make_tool_item):
15043 Use EMACS_INTPTR to hold an integer
15044 that will be cast to void *; this can avoid a GCC warning
15045 if EMACS_INT is not the same width as void *.
15046 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15047 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15048 (current_message_1, set_message_1):
15049 Use a local to convert to proper width without a cast.
15050 * xmenu.c (dialog_selection_callback): Likewise.
15051
15052 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15053 Also, don't assume VALBITS / RAND_BITS is less than 5,
15054 and don't rely on undefined behavior when shifting a 1 left into
15055 the sign bit.
15056 * lisp.h (get_random): Change signature to match.
15057
15058 * lread.c (hash_string): Use size_t, not int, for hash computation.
15059 Normally we prefer signed values; but hashing is special, because
15060 it's better to use unsigned division on hash table sizes so that
15061 the remainder is nonnegative. Also, size_t is the natural width
15062 for hashing into memory. The previous code used 'int', which doesn't
15063 retain enough info to hash well into very large tables.
15064 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15065
15066 * dbusbind.c: Don't possibly lose pointer info when converting.
15067 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15068 Use XPNTR rather than XHASH, so that the high-order bits of
15069 the pointer aren't lost when converting through void *.
15070
15071 * eval.c (Fautoload): Don't double-shift a pointer.
15072
15073 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15074
15075 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15076
15077 * gnutls.c (DEF_GNUTLS_FN):
15078 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15079
15080 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15081
15082 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15083 marker. (Bug#8610)
15084
15085 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15086
15087 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15088 New version that can reserve upto 2GB of heap space.
15089
15090 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15091
15092 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15093
15094 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15095
15096 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15097 `gnutls_certificate_set_x509_key_file'.
15098
15099 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15100
15101 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15102 Update dependencies.
15103
15104 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15105
15106 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15107 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15108 Remove unused parameter `fildes'.
15109 * process.c (read_process_output, send_process): Don't pass it.
15110
15111 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15112
15113 Fix previous change: the library cache is defined in w32.c.
15114 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15115 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15116
15117 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15118
15119 Implement dynamic loading of GnuTLS on Windows.
15120
15121 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15122 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15123 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15124 Declare.
15125
15126 * gnutls.c (Qgnutls_dll): Define.
15127 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15128 (gnutls_*): Declare function pointers.
15129 (init_gnutls_functions): New function to initialize function pointers.
15130 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15131 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15132 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15133 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15134 (emacs_gnutls_write, emacs_gnutls_read)
15135 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15136 (Fgnutls_available_p): New function.
15137 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15138 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15139 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15140
15141 * image.c: Include w32.h.
15142 (Vimage_type_cache): Delete.
15143 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15144 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15145 (w32_delayed_load): Move to w32.c.
15146
15147 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15148
15149 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15150 (w32_delayed_load): Move from image.c. When loading a library, record
15151 its filename in the :loaded-from property of the library id.
15152 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15153 Initialize and staticpro them.
15154 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15155
15156 * process.c: Include lisp.h before w32.h, not after.
15157 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15158 instead of gnutls_record_check_pending.
15159
15160 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15161
15162 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15163
15164 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15165 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15166 as passed in.
15167
15168 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15169
15170 * xterm.c (x_set_frame_alpha): Do not set property on anything
15171 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15172
15173 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15174
15175 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15176
15177 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15178
15179 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15180 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15181 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15182 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15183 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15184 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15185 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15186 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15187 (Qgnutls_bootprop_callbacks_verify): Make static.
15188
15189 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15190
15191 * callproc.c: Indentation fixup.
15192
15193 * sysdep.c (wait_for_termination_1): Make static.
15194 (wait_for_termination, interruptible_wait_for_termination):
15195 Move after wait_for_termination_1.
15196
15197 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15198
15199 * sysdep.c (interruptible_wait_for_termination): New function
15200 which is like wait_for_termination, but allows keyboard
15201 interruptions.
15202
15203 * callproc.c (Fcall_process): Add (:file "file") as an option for
15204 the STDOUT buffer.
15205 (Fcall_process_region): Ditto.
15206
15207 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15208
15209 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15210 rather than `XVECTOR (FOO)->size'.
15211
15212 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15213 inttypes.h, as a gnulib replacement is used if it not available in
15214 system headers.
15215
15216 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15217
15218 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15219 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15220 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15221
15222 * coding.c (coding_alloc_by_realloc): Error out if destination
15223 will grow beyond MOST_POSITIVE_FIXNUM.
15224 (decode_coding_emacs_mule): Abort if there isn't enough place in
15225 charbuf for the composition carryover bytes. Reserve an extra
15226 space for up to 2 characters produced in a loop.
15227 (decode_coding_iso_2022): Abort if there isn't enough place in
15228 charbuf for the composition carryover bytes.
15229
15230 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15231
15232 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15233 aborting when %lld or %lll format is passed.
15234 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15235 %llo or %llx format is passed. (Bug#8545)
15236
15237 * window.c (window_scroll_line_based): Use a marker instead of
15238 simple variables to record original value of point. (Bug#7952)
15239
15240 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15241 produced by %s or %c overflows available buffer space. (Bug#8545)
15242
15243 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15244
15245 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15246 (SIZE_MAX): Move defn after all includes, as they might #define it.
15247
15248 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15249
15250 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15251
15252 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15253
15254 * keyboard.c (Qdelayed_warnings_hook): Define.
15255 (command_loop_1): Run `delayed-warnings-hook'
15256 if Vdelayed_warnings_list is non-nil.
15257 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15258 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15259
15260 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15261
15262 * doprnt.c (doprnt): Don't return value smaller than the buffer
15263 size if the message was truncated. (Bug#8545).
15264
15265 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15266
15267 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15268 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15269
15270 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15271
15272 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15273
15274 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15275
15276 * makefile.w32-in: Update dependencies.
15277
15278 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15279
15280 Improve `doprnt' and its usage. (Bug#8545)
15281 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15282 `format_end'. Remove support for %l as a conversion specifier.
15283 Don't use xrealloc. Improve diagnostics when the %l size modifier
15284 is used. Update the commentary.
15285
15286 * eval.c (verror): Simplify calculation of size_t.
15287
15288 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15289 messages.
15290
15291 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15292
15293 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15294 change.
15295
15296 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15297
15298 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15299 This makes this file independent of the recent pseudovector change.
15300
15301 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15302
15303 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15304
15305 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15306 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15307 Remove unused local.
15308 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15309
15310 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15311 GCC 4.6.0 optimizes based on type-based alias analysis.
15312 For example, if b is of type struct buffer * and v of type struct
15313 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15314 != &v->size, and therefore "v->size = 1; b->size = 2; return
15315 v->size;" must therefore return 1. This assumption is incorrect
15316 for Emacs, since it type-puns struct Lisp_Vector * with many other
15317 types. To fix this problem, this patch adds a new type struct
15318 vectorlike_header that documents the constraints on layout of vectors
15319 and pseudovectors, and helps optimizing compilers not get fooled
15320 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15321 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15322 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15323 the size member.
15324 (XSETPVECTYPE): Rewrite in terms of new macro.
15325 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15326 This is a bit clearer, and further avoids the possibility of
15327 undesirable aliasing.
15328 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15329 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15330 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15331 since Lisp_Subr is a special case (no "next" field).
15332 (ASIZE): Now uses header.size rather than size.
15333 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15334 to avoid the hassle of writing XVECTOR (foo)->header.size.
15335 (struct vectorlike_header): New type.
15336 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15337 object, to help avoid aliasing.
15338 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15339 (SUBRP): Likewise, since Lisp_Subr is a special case.
15340 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15341 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15342 (struct Lisp_Hash_Table): Combine first two members into a single
15343 struct vectorlike_header member. All uses of "size" and "next" members
15344 changed to be "header.size" and "header.next".
15345 * buffer.h (struct buffer): Likewise.
15346 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15347 * frame.h (struct frame): Likewise.
15348 * process.h (struct Lisp_Process): Likewise.
15349 * termhooks.h (struct terminal): Likewise.
15350 * window.c (struct save_window_data, struct saved_window): Likewise.
15351 * window.h (struct window): Likewise.
15352 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15353 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15354 * buffer.c (init_buffer_once): Likewise.
15355 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15356 special case.
15357 * process.c (Fformat_network_address): Use local var for size,
15358 for brevity.
15359
15360 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15361
15362 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15363 * data.c (atof): Remove decl; no longer used or needed.
15364 (digit_to_number): Move to lread.c.
15365 (Fstring_to_number): Use new string_to_number function, to be
15366 consistent with how the Lisp reader treats infinities and NaNs.
15367 Do not assume that floating-point numbers represent EMACS_INT
15368 without losing information; this is not true on most 64-bit hosts.
15369 Avoid double-rounding errors, by insisting on integers when
15370 parsing non-base-10 numbers, as the documentation specifies.
15371 * lisp.h (string_to_number): New decl, replacing ...
15372 (isfloat_string): Remove.
15373 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15374 (read1): Do not accept +. and -. as integers; this
15375 appears to have been a coding error. Similarly, do not accept
15376 strings like +-1e0 as floating point numbers. Do not report
15377 overflow for integer overflows unless the base is not 10 which
15378 means we have no simple and reliable way to continue.
15379 Break out the floating-point parsing into a new
15380 function string_to_number, so that Fstring_to_number parses
15381 floating point numbers consistently with the Lisp reader.
15382 (digit_to_number): Move here from data.c. Make it static inline.
15383 (E_CHAR, EXP_INT): Remove, replacing with ...
15384 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15385 (string_to_number): New function, replacing isfloat_string.
15386 This function checks for valid syntax and produces the resulting
15387 Lisp float number too. Rework it so that string-to-number
15388 no longer mishandles examples like "1.0e+". Use strtoumax,
15389 so that overflow for non-base-10 numbers is reported only when
15390 there's no portable and simple way to convert to floating point.
15391
15392 * textprop.c (set_text_properties_1): Rewrite for clarity,
15393 and to avoid GCC warning about integer overflow.
15394
15395 * intervals.h (struct interval): Use EMACS_INT for members
15396 where EMACS_UINT might cause problems. See
15397 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15398 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15399 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15400 All uses changed.
15401 (offset_intervals): Tell GCC not to worry about length overflow
15402 when negating a negative length.
15403
15404 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15405 (overrun_check_free): Likewise.
15406
15407 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15408 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15409 word size.
15410
15411 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15412 (gnutls_make_error): Rename local to avoid shadowing.
15413 (gnutls_emacs_global_deinit): ifdef out; not used.
15414 (Fgnutls_boot): Use const for pointer to readonly storage.
15415 Comment out unused local. Fix pointer signedness problems.
15416
15417 * lread.c (openp): Don't stuff size_t into an 'int'.
15418 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15419 about possible signed overflow.
15420
15421 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15422 (GDK_KEY_g): Don't define if already defined.
15423 (xg_prepare_tooltip): Avoid pointer signedness problem.
15424 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15425
15426 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15427 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15428
15429 * xfns.c (Fx_window_property): Simplify a bit,
15430 to make a bit faster and to avoid GCC 4.6.0 warning.
15431 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15432
15433 * fns.c (internal_equal): Don't assume size_t fits in int.
15434
15435 * alloc.c (compact_small_strings): Tighten assertion a little.
15436
15437 Replace pEd with more-general pI, and fix some printf arg casts.
15438 * lisp.h (pI): New macro, generalizing old pEd macro to other
15439 conversion specifiers. For example, use "...%"pI"d..." rather
15440 than "...%"pEd"...".
15441 (pEd): Remove. All uses replaced with similar uses of pI.
15442 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15443 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15444 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15445 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15446 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15447 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15448 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15449 64-bit hosts.
15450 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15451 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15452 * print.c (safe_debug_print, print_object): Likewise.
15453 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15454 to int.
15455 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15456 avoiding the 0 flag, which is not portable.
15457 * process.c (Fmake_network_process): Use pI to avoid cast.
15458 * region-cache.c (pp_cache): Likewise.
15459 * xdisp.c (decode_mode_spec): Likewise.
15460 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15461 behavior on 64-bit hosts with printf arg.
15462 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15463 (x_stop_queuing_selection_requests): Likewise.
15464 (x_get_window_property): Don't truncate byte count to an 'int'
15465 when tracing.
15466
15467 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15468 here, since it parses constructs like leading '-' and spaces,
15469 which are not wanted; and it overflows with large numbers.
15470 Instead, simply match F[0-9]+, which is what is wanted anyway.
15471
15472 * alloc.c: Remove unportable assumptions about struct layout.
15473 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15474 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15475 (allocate_vectorlike, make_pure_vector): Use the new macros,
15476 plus offsetof, to remove unportable assumptions about struct layout.
15477 These assumptions hold on all porting targets that I know of, but
15478 they are not guaranteed, they're easy to remove, and removing them
15479 makes further changes easier.
15480
15481 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15482 This doesn't fix a bug but makes the code clearer.
15483 (string_overrun_cookie): Now const. Use initializers that
15484 don't formally overflow signed char, to avoid warnings.
15485 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15486 can cause Emacs to crash when string overrun checking is enabled.
15487 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15488 multiple of sizeof (EMACS_INT); it need not be, if
15489 alignof(EMACS_INT) < sizeof (EMACS_INT).
15490 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15491
15492 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15493
15494 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15495
15496 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15497
15498 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15499 supposed to be handshaking. (Bug#8556)
15500 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15501
15502 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15503
15504 * lisp.h (Qdebug): List symbol.
15505 * eval.c (Qdebug): Restore global linkage.
15506 * keyboard.c (debug-on-event): New variable.
15507 (handle_user_signal): Break into debugger when debug-on-event
15508 matches the current signal symbol.
15509
15510 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15511
15512 * alloc.c (check_sblock, check_string_bytes)
15513 (check_string_free_list): Convert to standard C.
15514
15515 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15516
15517 * w32.c (emacs_gnutls_push): Fix typo.
15518
15519 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15520
15521 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15522 "cast to pointer from integer of different size".
15523
15524 Improve doprnt and its use in verror. (Bug#8545)
15525 * doprnt.c (doprnt): Document the set of format control sequences
15526 supported by the function. Use SAFE_ALLOCA instead of always
15527 using `alloca'.
15528
15529 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15530 is one byte too soon. Don't use xrealloc; instead xfree and
15531 xmalloc anew.
15532
15533 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15534
15535 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15536 callbacks stage.
15537
15538 * gnutls.c: Renamed global_initialized to
15539 gnutls_global_initialized. Added internals for the
15540 :verify-hostname-error, :verify-error, and :verify-flags
15541 parameters of `gnutls-boot' and documented those parameters in the
15542 docstring. Start callback support.
15543 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15544 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15545 on error. Return error code.
15546 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15547 (emacs_gnutls_read): Likewise.
15548 (Fgnutls_boot): Return handshake error code.
15549 (emacs_gnutls_handle_error): New function.
15550 (wsaerror_to_errno): Likewise.
15551
15552 * w32.h (emacs_gnutls_pull): Add prototype.
15553 (emacs_gnutls_push): Likewise.
15554
15555 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15556 (emacs_gnutls_push): Likewise.
15557
15558 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15559
15560 * process.c (wait_reading_process_output): Check if GnuTLS
15561 buffered some data internally if no FDs are set for TLS
15562 connections.
15563
15564 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15565 (LIBS): Link to USER_LIBS.
15566 ($(BLD)/gnutls.$(0)): New target.
15567
15568 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15569
15570 * xdisp.c (handle_single_display_spec): Rename the
15571 display_replaced_before_p argument into display_replaced_p, to
15572 make it consistent with the commentary. Fix typos in the
15573 commentary.
15574
15575 * textprop.c (syms_of_textprop): Remove dead code.
15576 (copy_text_properties): Delete obsolete commentary about an
15577 interface that was deleted long ago. Fix typos in the description
15578 of arguments.
15579
15580 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15581 to changes in oldXMenu/XMenu.h from 2011-04-16.
15582 <menu_help_message, prev_menu_help_message>: Constify.
15583 (IT_menu_make_room): menu->help_text is now `const char **';
15584 adjust.
15585
15586 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15587 to changes in oldXMenu/XMenu.h from 2011-04-16.
15588 (struct XMenu): Declare `help_text' `const char **'.
15589
15590 * xfaces.c <Qunspecified>: Make extern again.
15591
15592 * syntax.c: Include sys/types.h before including regex.h, as
15593 required by POSIX.
15594
15595 * doc.c (get_doc_string): Improve the format passed to `error'.
15596
15597 * doprnt.c (doprnt): Improve commentary.
15598
15599 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15600
15601 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15602 them with etags.
15603
15604 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15605 changes in globals.h immediately force recompilation.
15606 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15607 $(CURDIR)/s/ms-w32.h.
15608 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15609
15610 * character.c (Fchar_direction): Function deleted.
15611 (syms_of_character): Don't defsubr it.
15612 <char-direction-table>: Deleted.
15613
15614 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15615
15616 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15617 * doprnt.c: Include limits.h.
15618 (SIZE_MAX): New macro.
15619 (doprnt): Return a size_t value. 2nd arg is now size_t.
15620 Many local variables are now size_t instead of int or unsigned.
15621 Improve overflow protection. Support `l' modifier for integer
15622 conversions. Support %l conversion. Don't assume an EMACS_INT
15623 argument for integer conversions and for %c.
15624
15625 * lisp.h (doprnt): Restore prototype.
15626
15627 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15628 $(SRC)/character.h.
15629
15630 * Makefile.in (base_obj): Add back doprnt.o.
15631
15632 * deps.mk (doprnt.o): Add back prerequisites.
15633 (callint.o): Depend on character.h.
15634
15635 * eval.c (internal_lisp_condition_case): Include the handler
15636 representation in the error message.
15637 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15638 when breaking from the loop.
15639
15640 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15641
15642 * callint.c (Fcall_interactively): When displaying error message
15643 about invalid control letter, pass the character's codepoint, not
15644 a pointer to its multibyte form. Improve display of the character
15645 in octal and display also its hex code.
15646
15647 * character.c (char_string): Use %x to display the (unsigned)
15648 codepoint of an invalid character, to avoid displaying a bogus
15649 negative value.
15650
15651 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15652 `error', not SYMBOL_NAME itself.
15653
15654 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15655 character arguments to `error'.
15656
15657 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15658 to `error' in error message about FINAL_CHAR argument. Make sure
15659 FINAL_CHAR is a character, and use %c when it is passed as
15660 argument to `error'.
15661
15662 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15663
15664 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15665
15666 * w32.c: Include <time.h>.
15667 (sys_localtime): New function.
15668
15669 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15670
15671 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15672
15673 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15674
15675 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15676
15677 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15678 zombies (Bug#8467).
15679
15680 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15681
15682 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15683 gl_state.e_property when gl_state.object is Qt.
15684
15685 * insdel.c (make_gap_larger): Remove limitation of buffer size
15686 to <= INT_MAX.
15687
15688 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15689
15690 * xdisp.c (lookup_glyphless_char_display)
15691 (produce_glyphless_glyph): Handle cons cell entry in
15692 glyphless-char-display.
15693 (Vglyphless_char_display): Document it.
15694
15695 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15696 glyphless-char-display.
15697
15698 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15699
15700 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15701
15702 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15703
15704 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15705 definition for no-X builds.
15706
15707 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15708
15709 Static checks with GCC 4.6.0 and non-default toolkits.
15710
15711 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15712
15713 * process.c (keyboard_bit_set): Define only if SIGIO.
15714 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15715 (send_process): Repair possible setjmp clobbering.
15716
15717 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15718
15719 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15720
15721 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15722
15723 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15724 Define only if needed.
15725
15726 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15727 by pacifying GCC about it. Maybe it's time to retire it?
15728 * xfaces.c (USG, __TIMEVAL__): Likewise.
15729
15730 * dispextern.h (struct redisplay_interface): Rename param
15731 to avoid shadowing.
15732 * termhooks.h (struct terminal): Likewise.
15733 * xterm.c (xembed_send_message): Likewise.
15734
15735 * insdel.c (make_gap_smaller): Define only if
15736 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15737
15738 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15739 it.
15740
15741 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15742 so that we aren't warned about unused symbols.
15743
15744 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15745
15746 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15747
15748 * xfns.c (x_real_positions): Mark locals as initialized.
15749
15750 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15751
15752 * xterm.c: Fix problems found by static analysis with other toolkits.
15753 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15754 (x_dispatch_event): Declare static if USE_GTK, and
15755 define if USE_GTK || USE_X_TOOLKIT.
15756 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15757 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15758 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15759 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15760
15761 * xmenu.c (menu_help_callback): Pointer type fixes.
15762 Use const pointers when pointing at readonly data. Avoid pointer
15763 signedness clashes.
15764 (FALSE): Remove unused macro.
15765 (update_frame_menubar): Remove unused decl.
15766
15767 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15768
15769 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15770 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15771 (single_menu_item): Rename local to avoid shadowing.
15772
15773 * keyboard.c (make_lispy_event): Remove unused local var.
15774
15775 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15776 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15777
15778 * bitmaps: Change bitmaps from unsigned char back to the X11
15779 compatible char. Avoid the old compiler warnings about
15780 out-of-range initializers by using, for example, '\xab' rather
15781 than 0xab.
15782
15783 * xgselect.c (xgselect_initialize): Check vs interface
15784 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15785
15786 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15787
15788 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15789 to read-only memory.
15790
15791 * fns.c (vector): Remove; this old hack is no longer needed.
15792
15793 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15794 Remove unused var.
15795 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15796
15797 * xrdb.c (x_load_resources): Omit unused local.
15798
15799 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15800 (x_window): Rename locals to avoid shadowing.
15801 (USG): Use the kludged USG macro, to pacify gcc.
15802
15803 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15804 (x_term_init): Remove local to avoid shadowing.
15805
15806 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15807
15808 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15809 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15810
15811 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15812
15813 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15814
15815 Fix regex.c, syntax.c and friends for buffers > 2GB.
15816 * syntax.h (struct gl_state_s): Declare character position members
15817 EMACS_INT.
15818
15819 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15820
15821 * textprop.c (verify_interval_modification, interval_of):
15822 Declare arguments EMACS_INT.
15823
15824 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15825 EMACS_INT.
15826
15827 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15828
15829 * indent.c (Fvertical_motion): Local variable it_start is now
15830 EMACS_INT.
15831
15832 * regex.c (re_match, re_match_2, re_match_2_internal)
15833 (bcmp_translate, regcomp, regexec, print_double_string)
15834 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15835 (re_compile_pattern, re_exec): Declare arguments and local
15836 variables `size_t' and `ssize_t' and return values `regoff_t', as
15837 appropriate.
15838 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15839 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15840 <compile_stack_type>: `size' and `avail' are now `size_t'.
15841
15842 * regex.h <regoff_t>: Use ssize_t, not int.
15843 (re_search, re_search_2, re_match, re_match_2): Arguments that
15844 specify buffer/string position and length are now ssize_t and
15845 size_t. Return type is regoff_t.
15846
15847 2011-04-16 Ben Key <bkey76@gmail.com>
15848
15849 * nsfont.m: Fixed bugs in ns_get_family and
15850 ns_descriptor_to_entity that were caused by using free to
15851 deallocate memory blocks that were allocated by xmalloc (via
15852 xstrdup). This caused Emacs to crash when compiled with
15853 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15854 --enable-checking=xmallocoverrun). xfree is now used to
15855 deallocate these memory blocks.
15856
15857 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15858
15859 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15860
15861 emacs_write: Accept and return EMACS_INT for sizes.
15862 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15863 et seq.
15864 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15865 Accept and return EMACS_INT.
15866 (emacs_gnutls_write): Return the number of bytes written on
15867 partial writes.
15868 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15869 (emacs_read, emacs_write): Remove check for negative size, as the
15870 Emacs source code has been audited now.
15871 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15872 (emacs_read, emacs_write): Use it.
15873 * process.c (send_process): Adjust to the new signatures of
15874 emacs_write and emacs_gnutls_write. Do not attempt to store
15875 a byte offset into an 'int'; it might overflow.
15876 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15877
15878 * sound.c: Don't assume sizes fit in 'int'.
15879 (struct sound_device.period_size, alsa_period_size):
15880 Return EMACS_INT, not int.
15881 (struct sound_device.write, vox_write, alsa_write):
15882 Accept EMACS_INT, not int.
15883 (wav_play, au_play): Use EMACS_INT to store sizes and to
15884 record read return values.
15885
15886 2011-04-15 Ben Key <bkey76@gmail.com>
15887
15888 * keyboard.c (Qundefined): Don't declare static since it is used
15889 in nsfns.m.
15890 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15891 static since they are used in nsfont.m.
15892
15893 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15894
15895 * process.c (Qprocessp): Don't declare static.
15896 * lisp.h (Qprocessp): Declare again.
15897
15898 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15899
15900 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15901
15902 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15903
15904 Improve C-level modularity by making more things 'static'.
15905
15906 Don't publish debugger-only interfaces to other modules.
15907 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15908 (verify_bytepos, count_markers): Move decls to the only modules
15909 that need them.
15910 * region-cache.h (pp_cache): Likewise.
15911 * window.h (check_all_windows): Likewise.
15912 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15913
15914 * sysdep.c (croak): Now static, if
15915 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15916 * syssignal.h (croak): Declare only if not static.
15917
15918 * alloc.c (refill_memory_reserve): Now static if
15919 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15920 * lisp.h (refill_memory_reserve): Declare only if not static.
15921
15922 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15923 Define only if USE_LUCID.
15924
15925 * xrdb.c (x_customization_string, x_rm_string): Now static.
15926
15927 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15928 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15929
15930 * xdisp.c (draw_row_with_mouse_face): Now static.
15931 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15932
15933 * window.h (check_all_windows): Mark externally visible.
15934
15935 * window.c (window_deletion_count): Now static.
15936
15937 * undo.c: Make symbols static if they're not exported.
15938 (last_undo_buffer, last_boundary_position, pending_boundary):
15939 Now static.
15940
15941 * textprop.c (interval_insert_behind_hooks): Now static.
15942 (interval_insert_in_front_hooks): Likewise.
15943
15944 * term.c: Make symbols static if they're not exported.
15945 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15946 (max_frame_lines, tty_set_terminal_modes):
15947 (tty_reset_terminal_modes, tty_turn_off_highlight):
15948 (get_tty_terminal): Now static.
15949 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15950 * termhooks.h (term_mouse_moveto): Do not declare if
15951 HAVE_WINDOW_SYSTEM.
15952 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15953 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15954
15955 * sysdep.c: Make symbols static if they're not exported.
15956 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15957 Now static.
15958 (sigprocmask_set, full_mask): Remove; unused.
15959 (wait_debugging): Mark as visible.
15960 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15961 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15962
15963 * syntax.c (syntax_temp): Define only if !__GNUC__.
15964
15965 * sound.c (current_sound_device, current_sound): Now static.
15966
15967 * search.c (searchbufs, searchbuf_head): Now static.
15968
15969 * scroll.c (scroll_cost): Remove; unused.
15970 * dispextern.h (scroll_cost): Remove decl.
15971
15972 * region-cache.h (pp_cache): Mark as externally visible.
15973
15974 * process.c: Make symbols static if they're not exported.
15975 (process_tick, update_tick, create_process, chan_process):
15976 (Vprocess_alist, proc_buffered_char, datagram_access):
15977 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15978 (deactivate_process): Mark defn as static, as well as decl.
15979 * lisp.h (create_process): Remove decl.
15980 * process.h (chan_process, Vprocess_alist): Remove decls.
15981
15982 * print.c: Make symbols static if they're not exported.
15983 (print_depth, new_backquote_output, being_printed, print_buffer):
15984 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15985 (print_interval, print_number_index, initial_stderr_stream):
15986 Now static.
15987 * lisp.h (Fprinc): Remove decl.
15988 (debug_output_compilation_hack): Mark as externally visible.
15989
15990 * sysdep.c (croak): Move decl from here to syssignal.h.
15991 * syssignal.h (croak): Put it here, so the API can be checked when
15992 'croak' is called from dissociate_if_controlling_tty.
15993
15994 * minibuf.c: Make symbols static if they're not exported.
15995 (minibuf_save_list, choose_minibuf_frame): Now static.
15996 * lisp.h (choose_minibuf_frame): Remove decl.
15997
15998 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15999
16000 * lread.c: Make symbols static if they're not exported.
16001 (read_objects, initial_obarray, oblookup_last_bucket_number):
16002 Now static.
16003 (make_symbol): Remove; unused.
16004 * lisp.h (initial_obarray, make_symbol): Remove decls.
16005
16006 * keyboard.c: Make symbols static if they're not exported.
16007 (single_kboard, recent_keys_index, total_keys, recent_keys):
16008 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16009 (this_single_command_key_start, echoing, last_auto_save):
16010 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16011 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16012 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16013 (Vlispy_mouse_stem, double_click_count):
16014 Now static.
16015 (force_auto_save_soon): Define only if SIGDANGER.
16016 (ignore_mouse_drag_p): Now static if
16017 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16018 (print_help): Remove; unused.
16019 (stop_character, last_timer_event): Mark as externally visible.
16020 * keyboard.h (ignore_mouse_drag_p): Declare only if
16021 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16022 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16023 * lisp.h (echoing): Remove decl.
16024 (force_auto_save_soon): Declare only if SIGDANGER.
16025 * xdisp.c (redisplay_window): Simplify code, to make it more
16026 obvious that ignore_mouse_drag_p is not accessed if !defined
16027 USE_GTK && !defined HAVE_NS.
16028
16029 * intervals.c: Make symbols static if they're not exported.
16030 (merge_properties_sticky, merge_interval_right, delete_interval):
16031 Now static.
16032 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16033
16034 * insdel.c: Make symbols static if they're not exported.
16035 However, leave prepare_to_modify_buffer alone. It's never
16036 called from outside this function, but that appears to be a bug.
16037 (combine_after_change_list, combine_after_change_buffer):
16038 (adjust_after_replace, signal_before_change): Now static.
16039 (adjust_after_replace_noundo): Remove; unused.
16040 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16041 (signal_before_change): Remove decls.
16042
16043 * indent.c (val_compute_motion, val_vmotion): Now static.
16044
16045 * image.c: Make symbols static if they're not exported.
16046 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16047 if USE_GTK.
16048 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16049 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16050
16051 * fringe.c (standard_bitmaps): Now static.
16052 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16053
16054 * frame.c: Make symbols static if they're not exported.
16055 (x_report_frame_params, make_terminal_frame): Now static.
16056 (get_frame_param): Now static, unless HAVE_NS.
16057 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16058 (x_get_resource_string): Remove; not used.
16059 * frame.h (make_terminal_frame, x_report_frame_params):
16060 (x_get_resource_string); Remove decls.
16061 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16062 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16063
16064 * font.c, fontset.c: Make symbols static if they're not exported.
16065 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16066 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16067 * font.c (font_close_object): Now static.
16068 * font.h (font_close_object): Remove.
16069 * fontset.c (FONTSET_OBJLIST): Remove.
16070 (free_realized_fontset) #if-0 the body, which does nothing.
16071 (face_suitable_for_char_p): #if-0, as it's never called.
16072 * fontset.h (face_suitable_for_char_p): Remove decl.
16073 * xfaces.c (face_at_string_position):
16074 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16075 since 0 is always ASCII.
16076
16077 * fns.c (weak_hash_tables): Now static.
16078
16079 * fileio.c: Make symbols static if they're not exported.
16080 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16081 (Vwrite_region_annotation_buffers): Now static.
16082
16083 * eval.c: Make symbols static if they're not exported.
16084 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16085 * lisp.h (backtrace_list): Remove decl.
16086
16087 * emacs.c: Make symbols static if they're not exported.
16088 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16089 (fatal_error_code, fatal_error_signal_hook, standard_args):
16090 Now static.
16091 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16092 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16093 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16094 * lisp.h (fatal_error_signal_hook): Remove decl.
16095 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16096
16097 * editfns.c: Move a (normally-unused) function to its only use.
16098 * editfns.c, lisp.h (get_operating_system_release): Remove.
16099 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16100 worth the hassle of breaking this out.
16101
16102 * xterm.c: Make symbols static if they're not exported.
16103 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16104 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16105 (x_destroy_window, x_delete_display):
16106 Now static.
16107 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16108 (x_mouse_leave): Remove; unused.
16109 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16110 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16111 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16112 Remove decls.
16113 (x_mouse_leave): Declare only if WINDOWSNT.
16114 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16115 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16116 USE_X_TOOLKIT.
16117
16118 * ftxfont.c: Make symbols static if they're not exported.
16119 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16120 HAVE_FREETYPE.
16121 * font.h (ftxfont_driver): Likewise.
16122
16123 * xfns.c: Make symbols static if they're not exported.
16124 (x_last_font_name, x_display_info_for_name):
16125 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16126 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16127 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16128 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16129 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16130 (last_show_tip_args): Now static.
16131 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16132 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16133 (x_screen_planes): Remove; unused.
16134 * dispextern.h (x_screen_planes): Remove decl.
16135
16136 * dispnew.c: Make symbols static if they're not exported.
16137 * dispextern.h (redraw_garbaged_frames, scrolling):
16138 (increment_row_positions): Remove.
16139 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16140 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16141 Now static.
16142 (redraw_garbaged_frames): Remove; unused.
16143
16144 * xfaces.c: Make symbols static if they're not exported.
16145 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16146 Remove decls.
16147 * xterm.h (defined_color): Remove decls.
16148 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16149 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16150 (menu_face_changed_default, defined_color, free_realized_face):
16151 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16152 (ascii_face_of_lisp_face): Remove; unused.
16153
16154 * xdisp.c: Make symbols static if they're not exported.
16155 * dispextern.h (scratch_glyph_row, window_box_edges):
16156 (glyph_to_pixel_coords, set_cursor_from_row):
16157 (get_next_display_element, set_iterator_to_next):
16158 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16159 (show_mouse_face): Remove decls
16160 * frame.h (message_buf_print): Likewise.
16161 * lisp.h (pop_message, set_message, check_point_in_composition):
16162 Likewise.
16163 * xterm.h (set_vertical_scroll_bar): Likewise.
16164 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16165 (message_buf_print, scratch_glyph_row, displayed_buffer):
16166 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16167 (get_next_display_element, show_mouse_face, window_box_edges):
16168 (frame_to_window_pixel_xy, check_point_in_composition):
16169 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16170 (glyph_to_pixel_coords): Remove; unused.
16171
16172 * dired.c (file_name_completion): Now static.
16173
16174 * dbusbind.c (xd_in_read_queued_messages): Now static.
16175
16176 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16177 * data.c (circular_list_error): Remove.
16178
16179 * commands.h (last_point_position, last_point_position_buffer):
16180 (last_point_position_window): Remove decls.
16181 * keyboard.c: Make these variables static.
16182
16183 * coding.h (coding, code_convert_region, encode_coding_gap):
16184 Remove decls.
16185 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16186 (iso_code_class, detect_coding, code_convert_region): Now static.
16187 (encode_coding_gap): Remove; unused.
16188
16189 * chartab.c (chartab_chars, chartab_bits): Now static.
16190
16191 * charset.h (charset_iso_8859_1): Remove decl.
16192 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16193 Now static.
16194
16195 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16196 * ccl.c (Vccl_program_table): Now static.
16197 (check_ccl_update): Remove; unused.
16198
16199 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16200 * category.h: ... from here.
16201 * category.c (check_category_table, set_category_set): Now static.
16202
16203 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16204 * lisp.h: Remove these decls.
16205
16206 * buffer.c (buffer_count): Remove unused var.
16207
16208 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16209 so that it's not optimized away.
16210 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16211 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16212 exported only to the debugger.
16213
16214 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16215 * atimer.h (run_all_atimers): Remove; not exported.
16216
16217 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16218 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16219 was inaccessible from Lisp.
16220 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16221 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16222
16223 alloc.c: Import and export fewer symbols, and remove unused items.
16224 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16225 is defined.
16226 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16227 it's not optimized away by whole-program optimization.
16228 (message_enable_multibyte, free_misc): Remove.
16229 (catchlist, handlerlist, mark_backtrace):
16230 Declare only if BYTE_MARK_STACK.
16231 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16232 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16233 (message_enable_multibyte): Remove decl.
16234 (free_misc, interval_free_list, float_block, float_block_index):
16235 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16236 (cons_free_list, last_marked_index):
16237 Now static.
16238 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16239 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16240 (mark_backtrace): Define only if BYTE_MARK_STACK.
16241 * xdisp.c (message_enable_multibyte): Now static.
16242
16243 Declare Lisp_Object Q* variables to be 'static' if not exported.
16244 This makes it easier for human readers (and static analyzers)
16245 to see whether these variables are used from other modules.
16246 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16247 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16248 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16249 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16250 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16251 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16252 * xmenu.c, xselect.c:
16253 Declare Q* vars static if they are not used in other modules.
16254 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16255 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16256 Remove decls of unexported vars.
16257 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16258
16259 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16260
16261 Make Emacs functions such as Fatom 'static' by default.
16262 This makes it easier for human readers (and static analyzers)
16263 to see whether these functions can be called from other modules.
16264 DEFUN now defines a static function. To make the function external
16265 so that it can be used in other C modules, use the new macro DEFUE.
16266 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16267 (Finit_image_library):
16268 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16269 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16270 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16271 Remove decls, since these functions are now static.
16272 (Funintern, Fget_internal_run_time): New decls, since these functions
16273 were already external.
16274
16275 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16276 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16277 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16278 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16279 * keyboard.c, keymap.c, lread.c:
16280 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16281 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16282 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16283 Mark functions with DEFUE instead of DEFUN,
16284 if they are used in other modules.
16285 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16286 decls for now-static functions.
16287 * buffer.h (Fdelete_overlay): Remove decl.
16288 * callproc.c (Fgetenv_internal): Mark as internal.
16289 * composite.c (Fremove_list_of_text_properties): Remove decl.
16290 (Fcomposition_get_gstring): New forward static decl.
16291 * composite.h (Fcomposite_get_gstring): Remove decl.
16292 * dired.c (Ffile_attributes): New forward static decl.
16293 * doc.c (Fdocumntation_property): New forward static decl.
16294 * eval.c (Ffetch_bytecode): New forward static decl.
16295 (Funintern): Remove extern decl; now in .h file where it belongs.
16296 * fileio.c (Fmake_symbolic_link): New forward static decl.
16297 * image.c (Finit_image_library): New forward static decl.
16298 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16299 * intervals.h (Fprevious_property_change):
16300 (Fremove_list_of_text_properties): Remove decls.
16301 * keyboard.c (Fthis_command_keys): Remove decl.
16302 (Fcommand_execute): New forward static decl.
16303 * keymap.c (Flookup_key): New forward static decl.
16304 (Fcopy_keymap): Now static.
16305 * keymap.h (Flookup_key): Remove decl.
16306 * process.c (Fget_process): New forward static decl.
16307 (Fprocess_datagram_address): Mark as internal.
16308 * syntax.c (Fsyntax_table_p): New forward static decl.
16309 (skip_chars): Remove duplicate decl.
16310 * textprop.c (Fprevious_property_change): New forward static decl.
16311 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16312 Now internal.
16313 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16314 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16315
16316 * editfns.c (Fformat): Remove unreachable code.
16317
16318 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16319
16320 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16321 change. (Bug#8496)
16322
16323 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16324
16325 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16326 when at ZV. (Bug#8487)
16327
16328 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16329
16330 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16331 (Bug#8437)
16332 * keyboard.c (parse_tool_bar_item): Likewise.
16333 * sound.c (sound_cleanup, alsa_close): Likewise.
16334 * termcap.c (tgetent): Likewise.
16335 * xfns.c (x_default_font_parameter): Likewise.
16336 * xsettings.c (read_and_apply_settings): Likewise.
16337
16338 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16339 (overrun_check_free): Protoize.
16340
16341 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16342
16343 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16344 since callers should never pass a negative size.
16345 Change the signature to match that of plain 'read' and 'write'; see
16346 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16347 * lisp.h: Update prototypes of emacs_write and emacs_read.
16348
16349 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16350
16351 * xdisp.c (redisplay_window): Don't try to determine the character
16352 position of the scroll margin if the window start point w->startp
16353 is outside the buffer's accessible region. (Bug#8468)
16354
16355 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16356
16357 Fix write-region and its subroutines for buffers > 2GB.
16358 * fileio.c (a_write, e_write): Modify declaration of arguments and
16359 local variables to support buffers larger than 2GB.
16360 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16361
16362 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16363 argument, local variables, and return value.
16364
16365 * lisp.h: Update prototypes of emacs_write and emacs_read.
16366
16367 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16368
16369 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16370
16371 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16372
16373 Fix more problems found by GCC 4.6.0's static checks.
16374
16375 * xdisp.c (vmessage): Use a better test for character truncation.
16376
16377 * charset.c (load_charset_map): <, not <=, for optimization,
16378 and to avoid potential problems with integer overflow.
16379 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16380 * casetab.c (set_identity, shuffle): Likewise.
16381 * editfns.c (Fformat): Likewise.
16382 * syntax.c (skip_chars): Likewise.
16383
16384 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16385 This also lets GCC 4.6.0 generate slightly better loop code.
16386
16387 * callint.c (Fcall_interactively): <, not <=, for optimization.
16388 (Fcall_interactively): Count the number of arguments produced,
16389 not the number of arguments given. This is simpler and lets GCC
16390 4.6.0 generate slightly better code.
16391
16392 * ftfont.c: Distingish more carefully between FcChar8 and char.
16393 The previous code passed unsigned char * to a functions like
16394 strlen and xstrcasecmp that expect char *, which does not
16395 conform to the C standard.
16396 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16397 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16398 char * when the C standard requires it.
16399
16400 * keyboard.c (read_char): Remove unused var.
16401
16402 * eval.c: Port to Windows vsnprintf (Bug#8435).
16403 Include <limits.h>.
16404 (SIZE_MAX): Define if the headers do not.
16405 (verror): Do not give up if vsnprintf returns a negative count.
16406 Instead, grow the buffer. This ports to Windows vsnprintf, which
16407 does not conform to C99. Problem reported by Eli Zaretskii.
16408 Also, simplify the allocation scheme, by avoiding the need for
16409 calling realloc, and removing the ALLOCATED variable.
16410
16411 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16412
16413 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16414 But keep the doprint source code for now, as we might revamp it
16415 and use it again (Bug#8435).
16416 * lisp.h (doprnt): Remove.
16417 * Makefile.in (base_obj): Remove doprnt.o.
16418 * deps.mk (doprnt.o): Remove.
16419
16420 error: Print 32- and 64-bit integers portably (Bug#8435).
16421 Without this change, on typical 64-bit hosts error ("...%d...", N)
16422 was used to print both 32- and 64-bit integers N, which relied on
16423 undefined behavior.
16424 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16425 * lisp.h (error, verror): Mark as printf-like functions.
16426 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16427 Report overflow in size calculations when allocating printf buffer.
16428 Do not truncate output string at its first null byte.
16429 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16430 Truncate the output at a character boundary, since vsnprintf does not
16431 do that.
16432 * charset.c (check_iso_charset_parameter): Convert internal
16433 character to string before calling 'error', since %c now has the
16434 printf meaning.
16435 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16436 overflow when computing char to be passed to 'error'. Do not
16437 pass Lisp_Object to 'error'; pass the integer instead.
16438 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16439 formatted with plain %d.
16440
16441 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16442
16443 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16444
16445 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16446
16447 * xterm.c (x_catch_errors): Remove duplicate declaration.
16448
16449 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16450
16451 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16452
16453 2011-04-10 Jim Meyering <meyering@redhat.com>
16454
16455 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16456 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16457 return ssize_t not "int", and use size_t as the buffer length.
16458 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16459 * gnutls.h: Update declarations.
16460 * process.c (read_process_output): Use ssize_t, to match.
16461 (send_process): Likewise.
16462
16463 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16464
16465 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16466
16467 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16468
16469 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16470 Use unsigned char, to match FcChar8 type definition.
16471
16472 * xterm.c (handle_one_xevent):
16473 * xmenu.c (create_and_show_popup_menu):
16474 * xselect.c (x_decline_selection_request)
16475 (x_reply_selection_request): Avoid type-punned deref of X events.
16476
16477 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16478
16479 Fix some uses of `int' instead of EMACS_INT.
16480 * search.c (string_match_1, fast_string_match)
16481 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16482 (scan_buffer, find_next_newline_no_quit)
16483 (find_before_next_newline, search_command, Freplace_match)
16484 (Fmatch_data): Make some `int' variables be EMACS_INT.
16485
16486 * xdisp.c (display_count_lines): 3rd argument and return value now
16487 EMACS_INT. All callers changed.
16488 (pint2hrstr): Last argument is now EMACS_INT.
16489
16490 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16491 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16492 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16493 (decode_coding_utf_16, decode_coding_emacs_mule)
16494 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16495 (decode_coding_ccl, decode_coding_charset)
16496 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16497 (decode_coding_iso_2022, decode_coding_emacs_mule)
16498 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16499 <char_offset, last_offset>: Declare EMACS_INT.
16500 (encode_coding_utf_8, encode_coding_utf_16)
16501 (encode_coding_emacs_mule, encode_invocation_designation)
16502 (encode_designation_at_bol, encode_coding_iso_2022)
16503 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16504 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16505 Declare EMACS_INT.
16506 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16507 (encode_invocation_designation): Last argument P_NCHARS is now
16508 EMACS_INT.
16509 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16510 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16511
16512 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16513 All users changed.
16514
16515 * ccl.c (Fccl_execute_on_string): Declare some variables
16516 EMACS_INT.
16517
16518 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16519
16520 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16521
16522 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16523
16524 * process.c (Fformat_network_address): Doc fix.
16525
16526 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16527
16528 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16529
16530 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16531
16532 * keyboard.c (read_char): Call Lisp function help-form-show,
16533 instead of using internal_with_output_to_temp_buffer.
16534 (Qhelp_form_show): New var.
16535 (syms_of_keyboard): Use DEFSYM macro.
16536
16537 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16538
16539 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16540
16541 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16542
16543 * process.c (Flist_processes): Remove to Lisp.
16544 (list_processes_1): Delete.
16545
16546 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16547
16548 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16549
16550 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16551
16552 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16553
16554 Fix more problems found by GCC 4.6.0's static checks.
16555
16556 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16557
16558 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16559
16560 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16561
16562 * xdisp.c (vmessage): Mark as a printf-like function.
16563
16564 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16565
16566 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16567
16568 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16569 printf-like functions.
16570 (tiff_load): Add casts to remove these marks before passing them
16571 to system-supplied API.
16572
16573 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16574
16575 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16576 This avoids several warnings with gcc -Wstrict-overflow.
16577 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16578 directly, rather than having caller test rule sign. This avoids
16579 some unnecessary tests.
16580 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16581 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16582 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16583
16584 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16585 (xfont_open): Avoid unnecessary tests.
16586
16587 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16588
16589 * composite.h, composite.c (composition_gstring_put_cache):
16590 Use EMACS_INT, not int, for length.
16591
16592 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16593 breaking out part of COMPOSITION_DECODE_RULE.
16594 (COMPOSITION_DECODE_RULE): Use it.
16595 * composite.c (get_composition_id): Remove unused local vars,
16596 by using the new macro.
16597
16598 * textprop.c (set_text_properties_1): Change while to do-while,
16599 since the condition is always true at first.
16600
16601 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16602 (interval_deletion_adjustment): Return unsigned value.
16603 All uses changed.
16604
16605 * process.c (list_processes_1, create_pty, read_process_output):
16606 (exec_sentinel): Remove vars that were set but not used.
16607 (create_pty): Remove unnecessary "volatile"s.
16608 (Fnetwork_interface_info): Avoid possibility of int overflow.
16609 (read_process_output): Do adaptive read buffering even if carryover.
16610 (read_process_output): Simplify nbytes computation if buffered.
16611
16612 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16613
16614 * syntax.c (scan_words): Remove var that was set but not used.
16615 (update_syntax_table): Use unsigned instead of int.
16616
16617 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16618 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16619 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16620
16621 * print.c (print_error_message): Avoid int overflow.
16622
16623 * font.c (font_list_entities): Redo for clarity,
16624 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16625
16626 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16627 (font_score): Avoid potential overflow in diff calculation.
16628
16629 * fns.c (substring_both): Remove var that is set but not used.
16630 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16631
16632 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16633
16634 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16635 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16636 can always succeed if overflow has undefined behavior.
16637
16638 * search.c (boyer_moore, wordify): Remove vars set but not used.
16639 (wordify): Omit three unnecessary tests.
16640
16641 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16642 All callers changed. This avoids the need for an unused var.
16643
16644 * casefiddle.c (casify_region): Remove var that is set but not used.
16645
16646 * dired.c (file_name_completion): Remove var that is set but not used.
16647
16648 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16649
16650 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16651 (Finsert_file_contents): Remove unnecessary code checking fd.
16652
16653 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16654 Check for integer overflow on size calculations.
16655
16656 * buffer.c (Fprevious_overlay_change): Remove var that is set
16657 but not used.
16658
16659 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16660 Remove vars that are set but not used.
16661 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16662 (timer_check_2): Mark vars as initialized.
16663
16664 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16665
16666 * image.c (lookup_image): Remove var that is set but not used.
16667 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16668
16669 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16670 that are set but not used.
16671
16672 * xfns.c (make_invisible_cursor): Don't return garbage
16673 if XCreateBitmapFromData fails (Bug#8410).
16674
16675 * xselect.c (x_get_local_selection, x_handle_property_notify):
16676 Remove vars that are set but not used.
16677
16678 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16679 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16680
16681 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16682 Remove var that is set but not used.
16683 (scroll_bar_windows_size): Now size_t, not int.
16684 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16685 Check for overflow.
16686
16687 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16688 (map_tty_color) [!defined MSDOS]: Likewise.
16689
16690 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16691
16692 * coding.c: Remove vars that are set but not used.
16693 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16694 All callers changed.
16695 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16696 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16697 (decode_coding_charset): Remove vars that are set but not used.
16698
16699 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16700 that is set but not used.
16701
16702 * print.c (print_object): Remove var that is set but not used.
16703
16704 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16705 The gnulib version avoids calling malloc in the usual case,
16706 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16707 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16708 * filelock.c (current_lock_owner): Likewise.
16709 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16710 * sysdep.c: Include allocator.h, careadlinkat.h.
16711 (emacs_no_realloc_allocator): New static constant.
16712 (emacs_readlink): New function.
16713 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16714 ../lib/careadlinkat.h.
16715
16716 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16717
16718 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16719 first non-nil return value).
16720
16721 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16722
16723 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16724 if not defined (Bug#8403).
16725
16726 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16727
16728 * xdisp.c (display_count_lines): Remove parameter `start',
16729 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16730 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16731 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16732 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16733 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16734 and thereabouts. All callers changed.
16735 (get_per_char_metric): Remove parameter `f', unused since
16736 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16737
16738 2011-04-02 Jim Meyering <meyering@redhat.com>
16739
16740 do not dereference NULL upon failed strdup
16741 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16742 (ns_get_family): Likewise.
16743
16744 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16745
16746 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16747
16748 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16749
16750 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16751 later (Bug#8403).
16752
16753 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16754
16755 Add lexical binding.
16756
16757 * window.c (Ftemp_output_buffer_show): New fun.
16758 (Fsave_window_excursion):
16759 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16760
16761 * lread.c (lisp_file_lexically_bound_p): New function.
16762 (Fload): Bind Qlexical_binding.
16763 (readevalloop): Remove `evalfun' arg.
16764 Bind Qinternal_interpreter_environment.
16765 (Feval_buffer): Bind Qlexical_binding.
16766 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16767 Mark as dynamic.
16768 (syms_of_lread): Declare `lexical-binding'.
16769
16770 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16771
16772 * keyboard.c (eval_dyn): New fun.
16773 (menu_item_eval_property): Use it.
16774
16775 * image.c (parse_image_spec): Use Ffunctionp.
16776
16777 * fns.c (concat, mapcar1): Accept byte-code-functions.
16778
16779 * eval.c (Fsetq): Handle lexical vars.
16780 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16781 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16782 (FletX, Flet): Obey lexical binding.
16783 (Fcommandp): Handle closures.
16784 (Feval): New `lexical' arg.
16785 (eval_sub): New function extracted from Feval. Use it almost
16786 everywhere where Feval was used. Look up vars in lexical env.
16787 Handle closures.
16788 (Ffunctionp): Move from subr.el.
16789 (Ffuncall): Handle closures.
16790 (apply_lambda): Remove `eval_flags'.
16791 (funcall_lambda): Handle closures and new byte-code-functions.
16792 (Fspecial_variable_p): New function.
16793 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16794 but without exporting it to Lisp.
16795
16796 * doc.c (Fdocumentation, store_function_docstring):
16797 * data.c (Finteractive_form): Handle closures.
16798
16799 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16800 interactive spec.
16801
16802 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16803 New byte-codes.
16804 (exec_byte_code): New function extracted from Fbyte_code to handle new
16805 calling convention for byte-code-functions. Add new byte-codes.
16806
16807 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16808
16809 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16810
16811 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16812
16813 * xdisp.c (redisplay_internal): Fix prototype.
16814
16815 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16816
16817 * xdisp.c (SCROLL_LIMIT): New macro.
16818 (try_scrolling): Use it when setting scroll_limit.
16819 Limit scrolling to 100 screen lines.
16820 (redisplay_window): Even when falling back on "recentering",
16821 position point in the window according to scroll-conservatively,
16822 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16823
16824 (try_scrolling): When point is above the window, allow searching
16825 as far as scroll_max, or one screenful, to compute vertical
16826 distance from PT to the scroll margin position. This prevents
16827 try_scrolling from unnecessarily failing when
16828 scroll-conservatively is set to a value slightly larger than the
16829 window height. Clean up the case of PT below the margin at bottom
16830 of window: scroll_max can no longer be INT_MAX. When aggressive
16831 scrolling is in use, don't let point enter the opposite scroll
16832 margin as result of the scroll.
16833 (syms_of_xdisp) <scroll-conservatively>: Document the
16834 threshold of 100 lines for never-recentering scrolling.
16835
16836 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16837
16838 * dispextern.h (move_it_by_lines):
16839 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16840 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16841 (message_log_check_duplicate): Remove parameters `prev_bol' and
16842 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16843 (redisplay_internal): Remove parameter `preserve_echo_area',
16844 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16845
16846 * indent.c (Fvertical_motion):
16847 * window.c (window_scroll_pixel_based, Frecenter):
16848 Don't pass `need_y_p' to `move_it_by_lines'.
16849
16850 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16851
16852 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16853 steal a few bits to be more compact.
16854 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16855 Remove unneeded casts.
16856
16857 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16858
16859 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16860
16861 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16862 binding" message (bug#7967).
16863
16864 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16865
16866 Fix more problems found by GCC 4.6.0's static checks.
16867
16868 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16869 Remove unused local var.
16870
16871 * editfns.c (Fmessage_box): Remove unused local var.
16872
16873 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16874 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16875 Omit unused local vars.
16876 * window.c (shrink_windows): Omit unused local var.
16877 * menu.c (digest_single_submenu): Omit unused local var.
16878 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16879 Omit unused local var.
16880
16881 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16882 Don't assume string length fits in int.
16883 (keyremap_step, read_key_sequence): Use size_t for sizes.
16884 (read_key_sequence): Don't check last_real_key_start redundantly.
16885
16886 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16887 instead of alloca (Bug#8344).
16888
16889 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16890 (Fbacktrace_frame): Don't assume nframes fits in int.
16891
16892 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16893
16894 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16895 concerns.
16896
16897 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16898
16899 * cm.c (calccost): Turn while-do into do-while, for clarity.
16900
16901 * keyboard.c (syms_of_keyboard): Use the same style as later
16902 in this function when indexing through an array. This also
16903 works around GCC bug 48267.
16904
16905 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16906
16907 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16908
16909 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16910 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16911
16912 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16913 This avoids undefined behavior on integer overflow, and is a bit
16914 more convenient anyway since it is compared to a size_t variable.
16915
16916 Variadic C functions now count arguments with size_t, not int.
16917 This avoids an unnecessary limitation on 64-bit machines, which
16918 caused (substring ...) to crash on large vectors (Bug#8344).
16919 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16920 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16921 All variadic functions and their callers changed accordingly.
16922 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16923 * data.c (arith_driver, float_arith_driver): Likewise.
16924 * editfns.c (general_insert_function): Likewise.
16925 * eval.c (struct backtrace.nargs, interactive_p)
16926 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16927 (funcall_lambda, mark_backtrace): Likewise.
16928 * fns.c (concat): Likewise.
16929 * frame.c (x_set_frame_parameters): Likewise.
16930 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16931 0 if not found, not -1. All callers changed.
16932
16933 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16934 (stack_copy_size): Now size_t, not int.
16935 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16936
16937 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16938
16939 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16940 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16941 All callers changed.
16942
16943 * lisp.h (multibyte_char_to_unibyte):
16944 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16945 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16946 * character.h (CHAR_TO_BYTE8):
16947 * cmds.c (internal_self_insert):
16948 * editfns.c (general_insert_function):
16949 * keymap.c (push_key_description):
16950 * search.c (Freplace_match):
16951 * xdisp.c (message_dolog, set_message_1): All callers changed.
16952
16953 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16954
16955 * keyboard.c (safe_run_hook_funcall): New function.
16956 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16957 don't set the hook to nil, but remove the offending function instead.
16958 (Qcommand_hook_internal): Remove, unused.
16959 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16960 Vcommand_hook_internal.
16961
16962 * eval.c (enum run_hooks_condition): Remove.
16963 (funcall_nil, funcall_not): New functions.
16964 (run_hook_with_args): Call each function through a `funcall' argument.
16965 Remove `cond' argument, now redundant.
16966 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16967 (Frun_hook_with_args_until_failure): Adjust accordingly.
16968 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16969
16970 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16971
16972 * dispextern.h (string_buffer_position): Remove declaration.
16973
16974 * print.c (strout): Remove parameter `multibyte', unused since
16975 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16976
16977 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16978 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16979 All callers changed.
16980
16981 * w32.c (_wsa_errlist): Use braces for struct initializers.
16982
16983 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16984 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16985 All callers changed.
16986 (string_buffer_position): Likewise. Also, make static (it's never
16987 used outside xdisp.c).
16988 (cursor_row_p): Remove parameter `w', unused since
16989 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16990 (decode_mode_spec): Remove parameter `precision', introduced during
16991 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16992 All callers changed.
16993
16994 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16995
16996 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16997
16998 2011-03-27 Anders Lindgren <andlind@gmail.com>
16999
17000 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17001 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17002 (ns_update_auto_hide_menu_bar): New functions.
17003 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17004 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17005 ns_constrain_all_frames.
17006 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17007 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17008
17009 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17010
17011 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17012
17013 2011-03-27 Glenn Morris <rgm@gnu.org>
17014
17015 * syssignal.h: Replace RETSIGTYPE with void.
17016 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17017 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17018 Replace SIGTYPE with void everywhere.
17019 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17020 * s/template.h (SIGTYPE): Remove commented out definition.
17021
17022 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17023
17024 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17025 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17026
17027 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17028
17029 * w32.c (read_unc_volume): Use parameter `henum', instead of
17030 global variable `wget_enum_handle'.
17031
17032 * keymap.c (describe_vector): Remove parameters `indices' and
17033 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17034 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17035
17036 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17037
17038 * keyboard.c (timer_check): Remove parameter `do_it_now',
17039 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17040 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17041 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17042
17043 * keyboard.c (read_char):
17044 * w32menu.c (w32_menu_display_help):
17045 * xmenu.c (show_help_event, menu_help_callback):
17046 Adjust calls to `show_help_echo'.
17047
17048 * gtkutil.c (xg_maybe_add_timer):
17049 * keyboard.c (readable_events):
17050 * process.c (wait_reading_process_output):
17051 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17052
17053 * insdel.c (adjust_markers_gap_motion):
17054 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17055 (gap_left, gap_right): Don't call it.
17056
17057 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17058
17059 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17060 incurred during fontification.
17061
17062 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17063
17064 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17065 (DEFVAR_PER_BUFFER): Don't pass it.
17066
17067 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17068 (scrolling_window): Don't pass it.
17069
17070 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17071
17072 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17073
17074 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17075 and `suffix'.
17076 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17077 of variables specific to SELinux and computation of `encoded_absname'.
17078
17079 * image.c (XPutPixel): Remove unused variable `height'.
17080
17081 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17082
17083 * unexw32.c (get_section_info): Remove unused variable `section'.
17084
17085 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17086 (system_process_attributes): Remove unused variable `sess'.
17087 (sys_read): Remove unused variable `err'.
17088
17089 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17090 (w32_wnd_proc): Remove unused variable `isdead'.
17091 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17092 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17093 (x_create_tip_frame): Remove unused variable `tem'.
17094
17095 * w32inevt.c (w32_console_read_socket):
17096 Remove unused variable `no_events'.
17097
17098 * w32term.c (x_draw_composite_glyph_string_foreground):
17099 Remove unused variable `width'.
17100
17101 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17102
17103 * w32term.c (x_set_glyph_string_clipping):
17104 Don't pass uninitialized region to CombineRgn.
17105
17106 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17107
17108 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17109 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17110 (Fx_close_connection): Remove unused variable `i'.
17111
17112 * w32font.c (w32font_draw): Return number of glyphs.
17113 (w32font_open_internal): Remove unused variable `i'.
17114 (w32font_driver): Add missing initializer.
17115
17116 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17117 (fill_in_menu): Remove unused variable `items_added'.
17118
17119 * w32term.c (last_mouse_press_frame): Remove static global variable.
17120 (w32_clip_to_row): Remove unused variable `f'.
17121 (x_delete_terminal): Remove unused variable `i'.
17122
17123 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17124 (NOTHING): Remove unused static global variable.
17125 (uniscribe_check_otf): Remove unused variable `table'.
17126 (uniscribe_font_driver): Add missing initializers.
17127
17128 2011-03-23 Julien Danjou <julien@danjou.info>
17129
17130 * term.c (Fsuspend_tty, Fresume_tty):
17131 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17132 * window.c (temp_output_buffer_show):
17133 * insdel.c (signal_before_change):
17134 * frame.c (Fhandle_switch_frame):
17135 * fileio.c (Fdo_auto_save):
17136 * emacs.c (Fkill_emacs):
17137 * editfns.c (save_excursion_restore):
17138 * cmds.c (internal_self_insert):
17139 * callint.c (Fcall_interactively):
17140 * buffer.c (Fkill_all_local_variables):
17141 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17142 Use Frun_hooks.
17143 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17144 unconditionally since it does the check itself.
17145
17146 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17147
17148 Fix more problems found by GCC 4.5.2's static checks.
17149
17150 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17151 the first time through the loop, since we know p0 < p1 then.
17152 This also avoids a gcc -Wstrict-overflow warning.
17153
17154 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17155 leading to a memory leak, possible in functions like
17156 load_charset_map_from_file that can allocate an unbounded number
17157 of objects (Bug#8318).
17158
17159 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17160 that could (at least in theory) be that large.
17161
17162 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17163 This is less likely to overflow, and avoids undefined behavior if
17164 overflow does occur. All callers changed. Use strtoul to scan
17165 for the unsigned long integer.
17166 (pint2hrstr): Simplify and tune code slightly.
17167 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17168
17169 * scroll.c (do_scrolling): Work around GCC bug 48228.
17170 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17171
17172 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17173 This also avoids a warning with gcc -Wstrict-overflow.
17174 (validate_x_resource_name): Simplify count usage.
17175 This also avoids a warning with gcc -Wstrict-overflow.
17176
17177 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17178 fail (Bug#8306).
17179
17180 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17181
17182 * process.c (Fmake_network_process): Use socklen_t, not int,
17183 where POSIX says socklen_t is required in portable programs.
17184 This fixes a porting bug on hosts like 64-bit HP-UX, where
17185 socklen_t is wider than int (Bug#8277).
17186 (Fmake_network_process, server_accept_connection):
17187 (wait_reading_process_output, read_process_output):
17188 Likewise.
17189
17190 * process.c: Rename or move locals to avoid shadowing.
17191 (list_processes_1, Fmake_network_process):
17192 (read_process_output_error_handler, exec_sentinel_error_handler):
17193 Rename or move locals.
17194 (Fmake_network_process): Define label "retry_connect" only if needed.
17195 (Fnetwork_interface_info): Fix pointer signedness.
17196 (process_send_signal): Add cast to avoid pointer signedness problem.
17197 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17198 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17199
17200 Make tparam.h and terminfo.c consistent.
17201 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17202 Include tparam.h instead, since it declares them.
17203 * cm.h (PC): Remove extern decl; tparam.h now does this.
17204 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17205 * terminfo.c: Include tparam.h, to check interfaces.
17206 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17207 (tparam): Adjust signature to match interface in tparam.h;
17208 this removes some undefined behavior. Check that outstring and len
17209 are zero, which they always are with Emacs.
17210 * tparam.h (PC, BC, UP): New extern decls.
17211
17212 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17213 (xftfont_open): Rename locals to avoid shadowing.
17214
17215 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17216 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17217 (OTF_TAG_SYM): Omit macro if not needed.
17218 (ftfont_list): Remove unused local.
17219 (get_adstyle_property, ftfont_pattern_entity):
17220 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17221 Rename locals to avoid shadowing.
17222
17223 * xfont.c (xfont_list_family): Mark var as initialized.
17224
17225 * xml.c (make_dom): Now static.
17226
17227 * composite.c (composition_compute_stop_pos): Rename local to
17228 avoid shadowing.
17229 (composition_reseat_it): Remove unused locals.
17230 (find_automatic_composition, composition_adjust_point): Likewise.
17231 (composition_update_it): Mark var as initialized.
17232 (find_automatic_composition): Mark vars as initialized,
17233 with a FIXME (Bug#8290).
17234
17235 character.h: Rename locals to avoid shadowing.
17236 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17237 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17238 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17239 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17240 to avoid shadowing.
17241
17242 * textprop.c (property_change_between_p): Remove; unused.
17243
17244 * intervals.c (interval_start_pos): Now static.
17245
17246 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17247
17248 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17249 Rename locals to avoid shadowing.
17250
17251 * sound.c (wav_play, au_play, Fplay_sound_internal):
17252 Fix pointer signedness.
17253 (alsa_choose_format): Remove unused local var.
17254 (wav_play): Initialize a variable to 0, to prevent undefined
17255 behavior (Bug#8278).
17256
17257 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17258
17259 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17260
17261 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17262 clobbering (Bug#8298).
17263 * sysdep.c (sys_subshell): Likewise.
17264 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17265
17266 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17267 This should get cleaned up, so that child_setup has the
17268 same signature on all platforms.
17269
17270 * callproc.c (call_process_cleanup): Now static.
17271 (relocate_fd): Rename locals to avoid shadowing.
17272
17273 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17274
17275 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17276 not to be necessary, and produces flickering.
17277
17278 2011-03-20 Glenn Morris <rgm@gnu.org>
17279
17280 * config.in: Remove file.
17281
17282 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17283
17284 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17285 are now in src/globals.h.
17286 (syms_of_minibuf): Remove spurious & from previous change.
17287
17288 2011-03-20 Leo Liu <sdl.web@gmail.com>
17289
17290 * minibuf.c (completing-read-function): New variable.
17291 (completing-read-default): Rename from completing-read.
17292 (completing-read): Call completing-read-function.
17293
17294 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17295
17296 * xfaces.c (Fx_load_color_file):
17297 Read color file from absolute filename (bug#8250).
17298
17299 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17300
17301 * makefile.w32-in: Update dependencies.
17302
17303 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17304
17305 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17306
17307 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17308
17309 Fix more problems found by GCC 4.5.2's static checks.
17310
17311 * process.c (make_serial_process_unwind, send_process_trap):
17312 (sigchld_handler): Now static.
17313
17314 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17315 That way, the code declares only the vars that it needs.
17316 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17317 * s/cygwin.h (PTY_ITERATION): Likewise.
17318 * s/darwin.h (PTY_ITERATION): Likewise.
17319 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17320
17321 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17322 * process.c (allocate_pty): Don't declare stb unless it's needed.
17323
17324 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17325 (CONSTANTLIM): Remove; unused.
17326 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17327 Define only if needed.
17328
17329 * unexelf.c (unexec): Name an expression,
17330 to avoid gcc -Wbad-function-cast warning.
17331 Use a different way to cause a compilation error if anyone uses
17332 n rather than nn, a way that does not involve shadowing.
17333 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17334
17335 * deps.mk (unexalpha.o): Remove; unused.
17336
17337 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17338 * unexec.h: New file.
17339 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17340 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17341 Depend on unexec.h.
17342 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17343 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17344 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17345 Change as necessary to match prototype in unexec.h.
17346
17347 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17348 shadowing.
17349 (back_comment, skip_chars): Mark vars as initialized.
17350
17351 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17352 Rename locals to avoid shadowing.
17353
17354 * lread.c (read1): Rewrite so as not to use empty "else".
17355 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17356
17357 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17358
17359 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17360 warning when compiling print.c.
17361
17362 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17363 instead of using an uninitialized var.
17364 (font_sort_entities): Mark var as initialized.
17365
17366 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17367
17368 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17369 pointers to constants.
17370 (font_parse_fcname): Remove unused vars.
17371 (font_delete_unmatched): Now static.
17372 (font_get_spec): Remove; unused.
17373 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17374 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17375 Rename or move locals to avoid shadowing.
17376
17377 * fns.c (require_nesting_list, require_unwind): Now static.
17378 (Ffillarray): Rename locals to avoid shadowing.
17379
17380 * floatfns.c (domain_error2): Define only if needed.
17381 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17382
17383 * alloc.c (mark_backtrace): Move decl from here ...
17384 * lisp.h: ... to here, so that it can be checked.
17385
17386 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17387 (Fdefvar): Rewrite so as not to use empty "else".
17388 (lisp_indirect_variable): Name an expression,
17389 to avoid gcc -Wbad-function-cast warning.
17390 (Fdefvar): Rename locals to avoid shadowing.
17391
17392 * callint.c (quotify_arg, quotify_args): Now static.
17393 (Fcall_interactively): Rename locals to avoid shadowing.
17394 Use const pointer when appropriate.
17395
17396 * lisp.h (get_system_name, get_operating_system_release):
17397 Move decls here, to check interfaces.
17398 * process.c (get_operating_system_release): Move decl to lisp.h.
17399 * xrdb.c (get_system_name): Likewise.
17400 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17401 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17402 some of which prompt warnings from gcc -Wbad-function-cast.
17403 (Fformat_time_string, Fencode_time, Finsert_char):
17404 (Ftranslate_region_internal, Fformat):
17405 Rename or remove local vars to avoid shadowing.
17406 (Ftranslate_region_internal): Mark var as initialized.
17407
17408 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17409 avoid shadowing.
17410
17411 * lisp.h (eassert): Check that the argument compiles, even if
17412 ENABLE_CHECKING is not defined.
17413
17414 * data.c (Findirect_variable): Name an expression, to avoid
17415 gcc -Wbad-function-cast warning.
17416 (default_value, arithcompare, arith_driver, arith_error): Now static.
17417 (store_symval_forwarding): Rename local to avoid shadowing.
17418 (Fmake_variable_buffer_local, Fmake_local_variable):
17419 Mark variables as initialized.
17420 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17421
17422 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17423 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17424 Rename locals to avoid shadowing.
17425 (mark_stack): Move local variables into the #ifdef region where
17426 they're used.
17427 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17428 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17429 needed otherwise.
17430 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17431 (GC_STRING_CHARS): Remove; not used.
17432 (Fmemory_limit): Cast sbrk's returned value to char *.
17433
17434 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17435 avoids undefined behavior in theory.
17436
17437 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17438
17439 Use functions, not macros, for up- and down-casing (Bug#8254).
17440 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17441 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17442 to use the following functions instead of these macros.
17443 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17444 EMACS_INT, since callers assume the returned value fits in int.
17445 (upcase1): Likewise, for UPCASE_TABLE.
17446 (uppercasep, lowercasep, upcase): New static inline functions.
17447 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17448 the race-condition problem in the old DOWNCASE.
17449
17450 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17451 Rename locals to avoid shadowing.
17452 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17453 (regex_compile, re_search_2, re_match_2_internal):
17454 Remove unused local vars.
17455 (FREE_VAR): Rewrite so as not to use empty "else",
17456 which gcc can warn about.
17457 (regex_compile, re_match_2_internal): Mark locals as initialized.
17458 (RETALLOC_IF): Define only if needed.
17459 (WORDCHAR_P): Likewise. This one is never needed, but is used
17460 only in a comment talking about a compiler bug, so put inside
17461 the #if 0 of that comment.
17462 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17463 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17464 Remove; unused.
17465
17466 * search.c (boyer_moore): Rename locals to avoid shadowing.
17467 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17468 (PREV_CHAR_BOUNDARY): Likewise.
17469
17470 * search.c (simple_search): Remove unused var.
17471
17472 * dired.c (compile_pattern): Move decl from here ...
17473 * lisp.h: ... to here, so that it can be checked.
17474 (struct re_registers): New forward decl.
17475
17476 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17477
17478 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17479 All uses changed.
17480 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17481 Rename locals to avoid shadowing.
17482 (Fvertical_motion): Mark locals as initialized.
17483
17484 * casefiddle.c (casify_object, casify_region): Now static.
17485 (casify_region): Mark local as initialized.
17486
17487 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17488
17489 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17490 New macros, so that the caller can use some names other than
17491 gcpro1, gcpro2, etc.
17492 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17493 of the new macros.
17494 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17495 argument, for consistency with GCPRO2_VAR, etc: it is now the
17496 prefix of the variable, not the variable itself. All uses
17497 changed.
17498 * dired.c (directory_files_internal, file_name_completion):
17499 Rename locals to avoid shadowing.
17500
17501 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17502 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17503 dired.c's scmp function, had undefined behavior.
17504 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17505 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17506 * buffer.h: ... to here, because these macros use current_buffer,
17507 and the new implementation with inline functions needs to have
17508 current_buffer in scope now, rather than later when the macros
17509 are used.
17510 (downcase, upcase1): New static inline functions.
17511 (DOWNCASE, UPCASE1): Reimplement using these functions.
17512 This avoids undefined behavior in expressions like
17513 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17514 from race conditions in accessing the global variables
17515 case_temp1 and case_temp2.
17516 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17517 * lisp.h (case_temp1, case_temp2): Remove their decls.
17518 * character.h (ASCII_CHAR_P): Move from here ...
17519 * lisp.h: ... to here, so that the inline functions mentioned
17520 above can use them.
17521
17522 * dired.c (directory_files_internal_unwind): Now static.
17523
17524 * fileio.c (file_name_as_directory, directory_file_name):
17525 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17526 Now static.
17527 (file_name_as_directory): Use const pointers when appropriate.
17528 (Fexpand_file_name): Likewise. In particular, newdir might
17529 point at constant storage, so make it a const pointer.
17530 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17531 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17532 signedness issues.
17533 (Fset_file_times, Finsert_file_contents, auto_save_error):
17534 Rename locals to avoid shadowing.
17535
17536 * minibuf.c (choose_minibuf_frame_1): Now static.
17537 (Ftry_completion, Fall_completions): Rename or remove locals
17538 to avoid shadowing.
17539
17540 * marker.c (bytepos_to_charpos): Remove; unused.
17541
17542 * lisp.h (verify_bytepos, count_markers): New decls,
17543 so that gcc does not warn that these functions aren't declared.
17544
17545 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17546 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17547 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17548 (copy_text): Remove unused local var.
17549
17550 * filelock.c (within_one_second): Now static.
17551 (lock_file_1): Rename local to avoid shadowing.
17552
17553 * buffer.c (fix_overlays_before): Mark locals as initialized.
17554 (fix_start_end_in_overlays): Likewise. This function should be
17555 simplified by using pointers-to-pointers, but that's a different
17556 matter.
17557 (switch_to_buffer_1): Now static.
17558 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17559 (report_overlay_modification): Rename locals to avoid shadowing.
17560
17561 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17562 Fix pointer signedness issue.
17563 (sys_subshell): Mark local as volatile if checking for lint,
17564 to suppress a gcc -Wclobbered warning that does not seem to be right.
17565 (MAXPATHLEN): Define only if needed.
17566
17567 * process.c (serial_open, serial_configure): Move decls from here ...
17568 * systty.h: ... to here, so that they can be checked.
17569
17570 * fns.c (get_random, seed_random): Move extern decls from here ...
17571 * lisp.h: ... to here, so that they can be checked.
17572
17573 * sysdep.c (reset_io): Now static.
17574 (wait_for_termination_signal): Remove; unused.
17575
17576 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17577 (copy_keymap_item, append_key, push_text_char_description):
17578 Now static.
17579 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17580 (DENSE_TABLE_SIZE): Remove; unused.
17581 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17582 (describe_map_tree):
17583 Rename locals to avoid shadowing.
17584
17585 * keyboard.c: Declare functions static if they are not used elsewhere.
17586 (echo_char, echo_dash, cmd_error, top_level_2):
17587 (poll_for_input, handle_async_input): Now static.
17588 (read_char, kbd_buffer_get_event, make_lispy_position):
17589 (make_lispy_event, make_lispy_movement, apply_modifiers):
17590 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17591 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17592 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17593 (read_key_sequence, read_char): Mark locals as initialized.
17594 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17595
17596 * keyboard.h (make_ctrl_char): New decl.
17597 (mark_kboards): Move decl here ...
17598 * alloc.c (mark_kboards): ... from here.
17599
17600 * lisp.h (force_auto_save_soon): New decl.
17601
17602 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17603 (DEFINE_DUMMY_FUNCTION): New macro.
17604 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17605 Use it.
17606 (main): Add casts to avoid warnings
17607 if GCC considers string literals to be constants.
17608
17609 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17610
17611 * dbusbind.c: Pointer signedness fixes.
17612 (xd_signature, xd_append_arg, xd_initialize):
17613 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17614 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17615 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17616 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17617
17618 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17619 if GCC considers string literals to be constants.
17620 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17621
17622 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17623
17624 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17625 (print_preprocess, print_object): New macro to fix last change.
17626
17627 * print.c (print_preprocess): Don't forget font objects.
17628
17629 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17630
17631 * emacs.c (USAGE3): Doc fixes.
17632
17633 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17634
17635 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17636 structure.
17637
17638 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17639
17640 * lisp.h (VWindow_system, Qfile_name_history):
17641 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17642 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17643 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17644
17645 * w32select.c: Don't #include "keyboard.h".
17646 (run_protected): Add extern declaration for waiting_for_input.
17647
17648 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17649 * w32console.c (detect_input_pending, read_input_pending)
17650 (encode_terminal_code):
17651 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17652 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17653 (w32_system_caret_y, Qfile_name_history):
17654 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17655 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17656 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17657 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17658 * w32proc.c (Qlocal, report_file_error):
17659 * w32term.c (Vwindow_system, updating_frame):
17660 * w32uniscribe.c (initialized, uniscribe_font_driver):
17661 Remove unneeded extern declarations.
17662
17663 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17664
17665 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17666
17667 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17668
17669 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17670 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17671 These macros can no longer be used for assignment.
17672
17673 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17674 Assign struct members directly, instead of using BUF_BEGV etc.
17675 (record_buffer_markers, fetch_buffer_markers): New functions for
17676 recording and fetching special buffer markers.
17677 (set_buffer_internal_1, set_buffer_temp): Use them.
17678
17679 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17680
17681 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17682
17683 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17684 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17685
17686 * xdisp.c (hscroll_window_tree):
17687 (reconsider_clip_changes): Use PT instead of BUF_PT.
17688
17689 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17690
17691 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17692 $(EMACS_ROOT)/lib/intprops.h.
17693
17694 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17695
17696 Fix more problems found by GCC 4.5.2's static checks.
17697
17698 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17699 to unsigned char * to avoid compiler diagnostic.
17700 (xg_free_frame_widgets): Make it clear that a local variable is
17701 needed only if USE_GTK_TOOLTIP.
17702 (gdk_window_get_screen): Make it clear that this macro is needed
17703 only if USE_GTK_TOOLTIP.
17704 (int_gtk_range_get_value): New function, which avoids a diagnostic
17705 from gcc -Wbad-function-cast.
17706 (xg_set_toolkit_scroll_bar_thumb): Use it.
17707 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17708 diagnostic from gcc -Wbad-function-cast.
17709 (get_utf8_string, xg_get_file_with_chooser):
17710 Rename locals to avoid shadowing.
17711 (create_dialog): Move locals to avoid shadowing.
17712
17713 * xgselect.c (xg_select): Remove unused var.
17714
17715 * image.c (four_corners_best): Mark locals as initialized.
17716 (gif_load): Initialize transparent_p to zero (Bug#8238).
17717 Mark another local as initialized.
17718 (my_png_error, my_error_exit): Mark with NO_RETURN.
17719
17720 * image.c (clear_image_cache): Now static.
17721 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17722 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17723 (x_edge_detection): Remove unnecessary cast that
17724 gcc -Wbad-function-cast diagnoses.
17725 (gif_load): Fix pointer signedness.
17726 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17727 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17728
17729 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17730
17731 Improve quality of tests for time stamp overflow.
17732 For example, without this patch (encode-time 0 0 0 1 1
17733 1152921504606846976) returns the obviously-bogus value (-948597
17734 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17735 reports time overflow. See
17736 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17737 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17738 * editfns.c: Include limits.h and intprops.h.
17739 (TIME_T_MIN, TIME_T_MAX): New macros.
17740 (time_overflow): Move earlier, to before first use.
17741 (hi_time, lo_time): New functions, for an accurate test for
17742 out-of-range times.
17743 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17744 (Fget_internal_run_time): Don't assume time_t fits in int.
17745 (make_time): Use list2 instead of Fcons twice.
17746 (Fdecode_time): More accurate test for out-of-range times.
17747 (check_tm_member): New function.
17748 (Fencode_time): Use it, to test for out-of-range times.
17749 (lisp_time_argument): Don't rely on undefined left-shift and
17750 right-shift behavior when checking for time stamp overflow.
17751
17752 * editfns.c (time_overflow): New function, refactoring common code.
17753 (Fformat_time_string, Fdecode_time, Fencode_time):
17754 (Fcurrent_time_string): Use it.
17755
17756 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17757 * dired.c (make_time): Move to ...
17758 * editfns.c (make_time): ... here.
17759 * systime.h: Note the move.
17760
17761 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17762
17763 * fringe.c (update_window_fringes): Remove unused variables.
17764
17765 * unexmacosx.c (copy_data_segment): Also copy __got section.
17766 (Bug#8223)
17767
17768 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17769
17770 * termcap.c [MSDOS]: Include "msdos.h".
17771 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17772 Constify `char *' arguments and their references according to
17773 prototypes in tparam.h.
17774
17775 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17776
17777 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17778 Adapt all references accordingly.
17779
17780 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17781
17782 2011-03-11 Tom Tromey <tromey@redhat.com>
17783
17784 * buffer.c (syms_of_buffer): Remove obsolete comment.
17785
17786 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17787
17788 * termhooks.h (encode_terminal_code): Declare prototype.
17789
17790 * msdos.c (encode_terminal_code): Don't declare prototype.
17791
17792 * term.c (encode_terminal_code): Now external again, used by
17793 w32console.c and msdos.c.
17794
17795 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17796 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17797
17798 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17799
17800 Fix some minor problems found by GCC 4.5.2's static checks.
17801
17802 * fringe.c (update_window_fringes): Mark locals as initialized
17803 (Bug#8227).
17804 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17805
17806 * alloc.c (mark_fringe_data): Move decl from here ...
17807 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17808 to check its interface.
17809 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17810
17811 * fontset.c (free_realized_fontset): Now static.
17812 (Fset_fontset_font): Rename local to avoid shadowing.
17813 (fontset_font): Mark local as initialized.
17814 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17815
17816 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17817
17818 * xselect.c (x_disown_buffer_selections): Remove; not used.
17819 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17820 (x_own_selection, Fx_disown_selection_internal): Rename locals
17821 to avoid shadowing.
17822 (x_handle_dnd_message): Remove local to avoid shadowing.
17823
17824 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17825 so that the caller can use some name other than gcpro1.
17826 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17827 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17828 (Fx_backspace_delete_keys_p):
17829 Use them to avoid shadowing, and rename vars to avoid shadowing.
17830 (x_decode_color, x_set_name, x_window): Now static.
17831 (Fx_create_frame): Add braces to silence GCC warning.
17832 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17833 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17834 Remove unused locals.
17835 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17836 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17837 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17838 macros.
17839
17840 * xterm.h (x_mouse_leave): New decl.
17841
17842 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17843 Remove unused functions.
17844 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17845 (x_calc_absolute_position): Now static.
17846 (XTread_socket): Don't define label "out" unless it's used.
17847 Don't declare local "event" unless it's used.
17848 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17849 unless they are used.
17850 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17851 (x_fatal_error_signal): Remove; not used.
17852 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17853 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17854 (x_error_catcher, x_connection_closed, x_error_handler):
17855 (x_error_quitter, xembed_send_message, x_iconify_frame):
17856 (my_log_handler): Rename locals to avoid shadowing.
17857 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17858 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17859
17860 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17861 Rename or move locals to avoid shadowing.
17862 (tty_defined_color, merge_face_heights): Now static.
17863 (free_realized_faces_for_fontset): Remove; not used.
17864 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17865 does not deduce is never used uninitialized.
17866 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17867 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17868
17869 * terminal.c (store_terminal_param): Now static.
17870
17871 * xmenu.c (menu_highlight_callback): Now static.
17872 (set_frame_menubar): Remove unused local.
17873 (xmenu_show): Rename parameter to avoid shadowing.
17874 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17875 since they might point to immutable storage.
17876 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17877 since it's unused otherwise.
17878
17879 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17880 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17881 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17882 avoids a gcc -Wuninitialized diagnostic.
17883 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17884 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17885 does not deduce are never used uninitialized.
17886
17887 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17888
17889 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17890 * window.c (window_loop, size_window):
17891 (run_window_configuration_change_hook, enlarge_window): Likewise.
17892
17893 * window.c (display_buffer): Now static.
17894 (size_window): Mark variables that gcc -Wuninitialized
17895 does not deduce are never used uninitialized.
17896 * window.h (check_all_windows): New decl, to forestall
17897 gcc -Wmissing-prototypes diagnostic.
17898 * dispextern.h (bidi_dump_cached_states): Likewise.
17899
17900 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17901 shadowing.
17902 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17903 Include <limits.h>.
17904 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17905 and to avoid gcc -Wuninitialized warning.
17906 (load_charset_map): Mark variables that gcc -Wuninitialized
17907 does not deduce are never used uninitialized.
17908 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17909
17910 * coding.c (coding_set_source, coding_set_destination):
17911 Use "else { /* comment */ }" rather than "else /* comment */;"
17912 for clarity, and to avoid gcc -Wempty-body warning.
17913 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17914 a block, when the outer 'i' will do.
17915 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17916 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17917 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17918 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17919 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17920 Rename locals to avoid shadowing.
17921 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17922 * coding.c (emacs_mule_char, encode_invocation_designation):
17923 Now static, since they're not used elsewhere.
17924 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17925 (decode_coding_object, encode_coding_object, detect_coding_system):
17926 (decode_coding_emacs_mule): Mark variables that gcc
17927 -Wuninitialized does not deduce are never used uninitialized.
17928 (detect_coding_iso_2022): Initialize a local variable that might
17929 be used uninitialized. Leave a FIXME because it's not clear that
17930 this initialization is needed. (Bug#8211)
17931 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17932 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17933 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17934 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17935 Remove unused macros.
17936
17937 * category.c (hash_get_category_set): Remove unused local var.
17938 (copy_category_table): Now static, since it's not used elsewhere.
17939 * character.c (string_count_byte8): Likewise.
17940
17941 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17942 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17943
17944 * chartab.c (copy_sub_char_table): Now static, since it's not used
17945 elsewhere.
17946 (sub_char_table_ref_and_range, char_table_ref_and_range):
17947 Rename locals to avoid shadowing.
17948 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17949
17950 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17951 (BIDI_BOB): Remove unused macro.
17952
17953 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17954 deduce are never used uninitialized.
17955 * term.c (encode_terminal_code): Likewise.
17956
17957 * term.c (encode_terminal_code): Now static. Remove unused local.
17958
17959 * tparam.h: New file.
17960 * term.c, tparam.h: Include it.
17961 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17962 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17963 Move these decls to tparam.h, and make them agree with what
17964 is actually in tparam.c. The previous trick of using incompatible
17965 decls in different modules does not conform to the C standard.
17966 All callers of tparam changed to use tparam's actual API.
17967 * tparam.c (tparam1, tparam, tgoto):
17968 Use const pointers where appropriate.
17969
17970 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17971 * cm.h (struct cm): Likewise.
17972 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17973 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17974 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17975 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17976 (turn_on_face, init_tty): Likewise.
17977 * termchar.h (struct tty_display_info): Likewise.
17978
17979 * term.c (term_mouse_position): Rename local to avoid shadowing.
17980
17981 * alloc.c (mark_ttys): Move decl from here ...
17982 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17983
17984 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17985
17986 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17987
17988 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17989
17990 * search.c (compile_pattern_1): Remove argument regp, unused since
17991 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17992 (compile_pattern): Don't pass it.
17993
17994 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17995
17996 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17997 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17998 for ! HAVE_GTK3.
17999 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18000
18001 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18002
18003 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18004 gdk_window_get_screen, gdk_window_get_geometry,
18005 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18006 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18007 (xg_get_pixbuf_from_pixmap): New function.
18008 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18009 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18010 Call xg_get_pixbuf_from_pixmap instead of
18011 gdk_pixbuf_get_from_drawable.
18012 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18013 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18014 (xg_check_special_colors): Use GtkStyleContext and its functions
18015 for HAVE_GTK3.
18016 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18017 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18018 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18019 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18020 Call gtk_widget_get_preferred_size.
18021 (xg_frame_resized): gdk_window_get_geometry only takes 5
18022 parameters.
18023 (xg_win_to_widget, xg_event_is_for_menubar):
18024 Call gdk_x11_window_lookup_for_display.
18025 (xg_set_widget_bg): New function.
18026 (delete_cb): New function.
18027 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18028 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18029 (xg_set_background_color): Call xg_set_widget_bg.
18030 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18031 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18032 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18033 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18034 if ! HAVE_GTK3.
18035 (update_frame_tool_bar): Call gtk_widget_hide.
18036 (xg_initialize): Use GDK_KEY_g.
18037
18038 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18039 if ! HAVE_GTK3
18040 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18041
18042 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18043 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18044 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18045
18046 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18047
18048 * w32xfns.c (select_palette): Check success of RealizePalette against
18049 GDI_ERROR, not zero.
18050
18051 See ChangeLog.11 for earlier changes.
18052
18053 ;; Local Variables:
18054 ;; coding: utf-8
18055 ;; End:
18056
18057 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18058
18059 This file is part of GNU Emacs.
18060
18061 GNU Emacs is free software: you can redistribute it and/or modify
18062 it under the terms of the GNU General Public License as published by
18063 the Free Software Foundation, either version 3 of the License, or
18064 (at your option) any later version.
18065
18066 GNU Emacs is distributed in the hope that it will be useful,
18067 but WITHOUT ANY WARRANTY; without even the implied warranty of
18068 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18069 GNU General Public License for more details.
18070
18071 You should have received a copy of the GNU General Public License
18072 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.