Fix compilation failure introduced in 2012-09-30T06:19:33Z!eggert@cs.ucla.edu.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2
3 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4 HAVE_TIMER_SETTIME is defined.
5
6 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
7
8 Profiler improvements: more-accurate timers, overflow checks.
9 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
10 signal.h, setjmp.h. Include systime.h instead.
11 (saturated_add): New function.
12 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
13 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
14 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
15 New static vars.
16 (enum profiler_cpu_running): New enum.
17 (profiler_cpu_running): Now of that enum type, not bool.
18 All uses changed to store the new value.
19 (handle_profiler_signal): Rename from sigprof_handler_1,
20 for consistency with other handlers. Do not check whether
21 cpu_log is a hash-table if garbage collecting, since it
22 doesn't matter in that case.
23 (deliver_profiler_signal): Rename from sigprof_handler,
24 for consistency with other handlers.
25 (setup_cpu_timer): New function, with much of what used to be in
26 Fprofiler_cpu_start. Check for out-of-range argument.
27 Prefer timer_settime if available, and prefer
28 thread cputime clocks, then process cputime clocks, then
29 monotonic clocks, to the old realtime clock. Use make_timeval
30 to round more-correctly when falling back to setitimer.
31 (Fprofiler_cpu_start): Use it.
32 (Fprofiler_cpu_stop): Prefer timer_settime if available.
33 Don't assume that passing NULL as the 2nd argument of setitimer
34 is the same as passing a pointer to all-zero storage.
35 Ignore SIGPROF afterwards.
36 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
37 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
38 non-fatal signal handlers. Ignore SIGPROF on startup.
39 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
40 in profiler.c, since sysdep.c now uses it.
41
42 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
43 Suggested by Eli Zaretskii in
44 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
45
46 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
47
48 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
49
50 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
51
52 * lisp.h (struct backtrace): Remove indirection for `function' field.
53 * xdisp.c (redisplay_internal):
54 * profiler.c (record_backtrace, sigprof_handler_1):
55 * alloc.c (Fgarbage_collect):
56 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
57 (Fbacktrace_frame): Adjust accordingly.
58
59 2012-09-28 Glenn Morris <rgm@gnu.org>
60
61 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
62 (Frun_hook_with_args_until_failure): Doc fixes.
63
64 2012-09-28 Eli Zaretskii <eliz@gnu.org>
65
66 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
67 Qautomatic_redisplay and change the symbol name. All users changed.
68
69 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
70
71 * profiler.c (sigprof_handler): Fix race condition.
72
73 2012-09-28 Glenn Morris <rgm@gnu.org>
74
75 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
76
77 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
78
79 Check more robustly for timer_settime.
80 * Makefile.in (LIB_TIMER_TIME): New macro.
81 (LIBES): Add it.
82 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
83 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
84 call timer_settime.
85
86 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
87
88 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
89
90 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
91
92 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
93
94 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
95
96 * character.h (MAYBE_UNIFY_CHAR): Remove.
97 * charset.c, charset.h (maybe_unify_char): Now static.
98 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
99 Since this stuff is now private to charset.c, there's no need for
100 a public macro and no need to inline by hand.
101
102 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
103 Stefan Monnier <monnier@iro.umontreal.ca>
104 Juanma Barranquero <lekktu@gmail.com>
105
106 * profiler.c: New file.
107 * Makefile.in (base_obj): Add profiler.o.
108 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
109 ($(BLD)/profiler.$(O)): New target.
110 * emacs.c (main): Call syms_of_profiler.
111 * alloc.c (Qautomatic_gc): New constant.
112 (MALLOC_PROBE): New macro.
113 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
114 (total_bytes_of_live_objects): New function.
115 (Fgarbage_collect): Use it. Record itself in backtrace_list.
116 Call malloc_probe for the memory profiler.
117 (syms_of_alloc): Define Qautomatic_gc.
118 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
119 race condition.
120 (struct backtrace): Move definition...
121 * lisp.h (struct backtrace): ..here.
122 (Qautomatic_gc, profiler_memory_running): Declare vars.
123 (malloc_probe, syms_of_profiler): Declare functions.
124 * xdisp.c (Qautomatic_redisplay): New constant.
125 (redisplay_internal): Record itself in backtrace_list.
126 (syms_of_xdisp): Define Qautomatic_redisplay.
127
128 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
129
130 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
131
132 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
133
134 Prefer POSIX timers if available.
135 They avoid a race if the timer is too close to the current time.
136 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
137 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
138 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
139
140 2012-09-25 Eli Zaretskii <eliz@gnu.org>
141
142 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
143 CHAR_STRING_ADVANCE.
144 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
145 STRING_CHAR_ADVANCE.
146
147 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
148
149 Move Vlibrary_cache to emacs.c and reset before dumping.
150
151 * lisp.h (reset_image_types): Declare.
152 [WINDOWSNT] (Vlibrary_cache): Declare.
153
154 * image.c (reset_image_types): New function.
155
156 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
157 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
158 (Fdump_emacs): Reset Vlibrary_cache and image_types.
159
160 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
161 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
162
163 * w32.h (Vlibrary_cache): Do not declare.
164
165 2012-09-25 Eli Zaretskii <eliz@gnu.org>
166
167 * w32proc.c (sys_signal): Handle all signals defined by the
168 MS-Windows runtime, not just SIGCHLD. Actually install the signal
169 handlers for signals supported by Windows. Don't override
170 term_ntproc as the handler for SIGABRT.
171 (sigaction): Rewrite to call sys_signal instead of duplicating its
172 code.
173 (sys_kill): Improve commentary.
174
175 * w32.c (term_ntproc): Accept (and ignore) one argument, for
176 consistency with a signature of a signal handler. All callers
177 changed.
178 (init_ntproc): Accept an argument DUMPING. If dumping, don't
179 install term_ntproc as a signal handler for SIGABRT, as that
180 should be done by the dumped Emacs.
181
182 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
183
184 * w32select.c (term_w32select): Protect against repeated
185 invocation by setting clipboard_owner to NULL after calling
186 DestroyWindow.
187
188 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
189 and term_ntproc to their modified signatures.
190
191 * character.c (char_string, string_char): Remove calls to
192 MAYBE_UNIFY_CHAR. See the discussion starting at
193 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
194 for the details.
195
196 2012-09-25 Chong Yidong <cyd@gnu.org>
197
198 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
199
200 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
201
202 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
203 when encountering an unknown bytecode.
204
205 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
206
207 image.c, indent.c: Use bool for booleans.
208 * dispextern.h (struct image_type): Members valid_p, load, init
209 now return bool, not int. All uses changed.
210 * image.c: Omit unnecessary static decls.
211 (x_create_bitmap_mask, x_build_heuristic_mask):
212 Return void, not int, since callers don't care about the return value.
213 (x_create_bitmap_mask, define_image_type, valid_image_p)
214 (struct image_keyword, parse_image_spec, image_spec_value)
215 (check_image_size, image_background)
216 (image_background_transparent, x_clear_image_1)
217 (postprocess_image, lookup_image, x_check_image_size)
218 (x_create_x_image_and_pixmap, xbm_image_p)
219 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
220 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
221 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
222 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
223 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
224 (png_image_p, init_png_functions, png_load_body, png_load)
225 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
226 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
227 (init_gif_functions, gif_load, imagemagick_image_p)
228 (imagemagick_load_image, imagemagick_load, svg_image_p)
229 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
230 (gs_load):
231 * nsimage.m (ns_load_image):
232 * nsterm.m (ns_defined_color):
233 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
234 * xfns.c (x_defined_color):
235 * xterm.c (x_alloc_lighter_color_for_widget)
236 (x_alloc_nearest_color_1, x_alloc_nearest_color)
237 (x_alloc_lighter_color):
238 * indent.c (disptab_matches_widthtab, current_column)
239 (scan_for_column, string_display_width, indented_beyond_p)
240 (compute_motion, vmotion, Fvertical_motion):
241 Use bool for booleans.
242
243 2012-09-24 Chong Yidong <cyd@gnu.org>
244
245 * chartab.c (Fset_char_table_default): Obsolete function removed.
246
247 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
248
249 Move pid_t related decls out of lisp.h.
250 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
251 (interruptible_wait_for_termination):
252 Move these decls from lisp.h to syswait.h, since they use pid_t.
253 Needed on FreeBSD; see Herbert J. Skuhra in
254 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
255 * callproc.c: Include syswait.h.
256
257 gnutls.c, gtkutil.c: Use bool for boolean.
258 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
259 (emacs_gnutls_handle_error):
260 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
261 (xg_hide_tooltip, xg_create_frame_widgets)
262 (create_dialog, xg_uses_old_file_dialog)
263 (xg_get_file_with_chooser, xg_get_file_with_selection)
264 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
265 (xg_item_label_same_p, xg_update_menubar)
266 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
267 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
268 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
269 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
270 (update_frame_tool_bar, free_frame_tool_bar):
271 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
272 * nsmenu.m (ns_update_menubar):
273 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
274 * xfns.c (Fx_show_tip) [USE_GTK]:
275 Use bool for boolean.
276 * gtkutil.c (xg_update_frame_menubar):
277 * xmenu.c (update_frame_menubar):
278 Return void, not int, since caller ignores return value.
279 * gtkutil.c (xg_change_toolbar_position):
280 Return void, not 1.
281
282 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
283
284 * makefile.w32-in (BLOCKINPUT_H): Remove.
285 (SYSSIGNAL_H): New macro.
286 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
287 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
288 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
289 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
290 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
291 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
292 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
293 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
294 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
295 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
296 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
297 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
298 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
299 ($(BLD)/w32xfns.$(O)): Update dependencies.
300
301 2012-09-23 Eli Zaretskii <eliz@gnu.org>
302
303 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
304 fatal_error_backtrace.
305
306 * w32proc.c (sys_kill): Undo last change: don't do anything when
307 invoked to deliver SIGABRT to our own process. This is now
308 handled by emacs_raise.
309
310 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
311
312 * w32term.c (w32_read_socket): Remove leftover reference to
313 interrupt_input_pending.
314
315 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
316
317 Do not use SA_NODEFER.
318 Problem reported by Dani Moncayo in
319 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
320 * alloc.c (die):
321 * sysdep.c (emacs_abort): Do not reset signal handler.
322 * emacs.c (terminate_due_to_signal): Reset signal handler here.
323 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
324 wanted even on POSIXish hosts, and it doesn't work on Windows.
325
326 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
327
328 * xterm.c (x_term_init): Call fixup_locale before and after calling
329 gtk_init (Bug#12392).
330
331 2012-09-23 Chong Yidong <cyd@gnu.org>
332
333 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
334 Vdynamic_library_alist.
335
336 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
337 (Fgnutls_available_p): Caller changed.
338
339 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
340 (Flibxml_parse_xml_region): Likewise.
341
342 * dispextern.h (struct image_type): Remove arg from init function.
343
344 * image.c (Finit_image_library, lookup_image_type)
345 (define_image_type): Remove now-unneeded second arg.
346 (init_xpm_functions, init_png_functions, init_jpeg_functions)
347 (init_tiff_functions, init_gif_functions, init_svg_functions):
348 Arglist and w32_delayed_load calling convention changed.
349 (gs_type): Remove init_gs_functions; there is no such function.
350 (valid_image_p, make_image): Fix caller to lookup_image_type.
351
352 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
353
354 Simplify and avoid signal-handling races (Bug#12471).
355 * alloc.c (die):
356 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
357 Avoid recursive loop if there's a fatal error in the function itself.
358 * atimer.c (pending_atimers):
359 * blockinput.h: Don't include "atimer.h"; no longer needed.
360 (interrupt_input_pending): Remove. All uses removed.
361 pending_signals now counts both atimers and ordinary interrupts.
362 This is less racy than having three separate pending-signal flags.
363 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
364 (input_blocked_p):
365 Rename from their upper-case counterparts BLOCK_INPUT,
366 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
367 INPUT_BLOCKED_P, and turn into functions. All uses changed.
368 This makes it easier to access volatile variables more accurately.
369 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
370 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
371 that's more reliable if the code is buggy and sets
372 interrupt_input_blocked to a negative value. All uses changed.
373 * atimer.c (deliver_alarm_signal):
374 Remove. No need to deliver this to the parent; any thread can
375 handle this signal now. All uses replaced by underlying handler.
376 * atimer.c (turn_on_atimers):
377 * dispnew.c (handle_window_change_signal):
378 * emacs.c (handle_danger_signal):
379 * keyboard.c (kbd_buffer_get_event):
380 Don't reestablish signal handler; not needed with sigaction.
381 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
382 (UNBLOCK_INPUT_TO):
383 Rework to avoid unnecessary accesses to volatile variables.
384 (UNBLOCK_INPUT_TO): Now a function.
385 (totally_unblock_input, unblock_input): New decls.
386 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
387 (init_data): Remove. Necessary stuff now done in init_signal.
388 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
389 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
390 (fatal_error_code): Remove; no longer needed.
391 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
392 it doesn't always backtrace. All uses changed. No need to reset
393 signal to default, since sigaction and/or die does that for us now.
394 Use emacs_raise (FOO), not kill (getpid (), FOO).
395 (main): Check more-accurately whether we're dumping.
396 Move fatal-error setup to sysdep.c
397 * floatfns.c: Do not include "syssignal.h"; no longer needed.
398 * gtkutil.c (xg_get_file_name, xg_get_font):
399 Remove no-longer-needed signal-mask manipulation.
400 * keyboard.c, process.c (POLL_FOR_INPUT):
401 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
402 * keyboard.c (read_avail_input): Remove.
403 All uses replaced by gobble_input.
404 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
405 (kbd_buffer_store_event_hold, gobble_input):
406 (record_asynch_buffer_change) [USABLE_SIGIO]:
407 (store_user_signal_events):
408 No need to mess with signal mask.
409 (gobble_input): If blocking input and there are terminals, simply
410 set pending_signals to 1 and return. All hooks changed to not
411 worry about whether input is blocked.
412 (process_pending_signals): Clear pending_signals before processing
413 them, in case a signal comes in while we're processing.
414 By convention callers now test pending_signals before calling us.
415 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
416 New functions, to support changes to blockinput.h.
417 (handle_input_available_signal): Now extern.
418 (reinvoke_input_signal): Remove. All uses replaced by
419 handle_async_input.
420 (quit_count): Now volatile, since a signal handler uses it.
421 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
422 All callers changed. Block SIGINT only if not already blocked.
423 Clear sigmask reliably, even if Fsignal returns, which it can.
424 Omit unnecessary accesses to volatile var.
425 (quit_throw_to_read_char): No need to restore sigmask.
426 * keyboard.c (gobble_input, handle_user_signal):
427 * process.c (wait_reading_process_output):
428 Call signal-handling code rather than killing ourselves.
429 * lisp.h: Include <float.h>, for...
430 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
431 (pending_signals): Now volatile.
432 (syms_of_data): Now const if IEEE floating point.
433 (handle_input_available_signal) [USABLE_SIGIO]:
434 (terminate_due_to_signal, record_child_status_change): New decls.
435 * process.c (create_process): Avoid disaster if memory is exhausted
436 while we're processing a vfork, by tightening the critical section
437 around the vfork.
438 (send_process_frame, process_sent_to, handle_pipe_signal)
439 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
440 ignores SIGPIPE.
441 (send_process): No need for setjmp/longjmp any more, since the
442 SIGPIPE stuff is now gone. Instead, report an error if errno
443 is EPIPE.
444 (record_child_status_change): Now extern. PID and W are now args.
445 Return void, not bool. All callers changed.
446 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
447 Remove. All uses removed. This bug should be fixed now in a
448 different way.
449 (wait_for_termination_1): Use waitpid rather than sigsuspend,
450 and record the child status change directly. This avoids the
451 need to futz with the signal mask.
452 (process_fatal_action): Move here from emacs.c.
453 (emacs_sigaction_flags): New function, containing
454 much of what used to be in emacs_sigaction_init.
455 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
456 caught by emacs, to make races less likely.
457 (deliver_process_signal): Rename from handle_on_main_thread.
458 All uses changed.
459 (BACKTRACE_LIMIT_MAX): Now at top level.
460 (thread_backtrace_buffer, threadback_backtrace_pointers):
461 New static vars.
462 (deliver_thread_signal, deliver_fatal_thread_signal):
463 New functions, for more-accurate delivery of thread-specific signals.
464 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
465 (deliver_arith_signal): Handle in this thread, not
466 in the main thread, since it's triggered by this thread.
467 (maybe_fatal_sig): New function.
468 (init_signals): New arg DUMPING so that we can be more accurate
469 about whether we're dumping. Caller changed.
470 Treat thread-specific signals differently from process-general signals.
471 Block all signals while handling fatal error; that's safer.
472 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
473 on IEEE hosts.
474 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
475 Ignore SIGPIPE unless batch.
476 (emacs_backtrace): Output backtrace for the appropriate thread,
477 which is not necessarily the main thread.
478 * syssignal.h: Include <stdbool.h>.
479 (emacs_raise): New macro.
480 * xterm.c (x_connection_signal): Remove; no longer needed
481 now that we use sigaction.
482 (x_connection_closed): No need to mess with sigmask now.
483 (x_initialize): No need to reset SIGPIPE handler here, since
484 init_signals does this for us now.
485
486 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
487
488 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
489 background rect may be larger (Bug#12245).
490
491 2012-09-23 Chong Yidong <cyd@gnu.org>
492
493 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
494
495 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
496
497 * .gdbinit: Just stop at fatal_error_backtrace.
498 See Stefan Monnier's request in
499 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
500 Remove no-longer-used query of system type.
501
502 2012-09-22 Chong Yidong <cyd@gnu.org>
503
504 * search.c (Freplace_match): Doc fix (Bug#12325).
505
506 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
507
508 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
509 (Fline_end_position): Doc fix.
510
511 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
512
513 2012-09-22 Chong Yidong <cyd@gnu.org>
514
515 * dispextern.h (struct image_type): Add new slot, storing a type
516 initialization function.
517
518 * image.c (define_image_type): Call the image initializer function
519 if it is defined. Arguments and return value changed.
520 (valid_image_p, make_image): Callers changed.
521 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
522 (gif_type, imagemagick_type, svg_type, gs_type):
523 Add initialization functions.
524 (Finit_image_library): Call lookup_image_type.
525 (CHECK_LIB_AVAILABLE): Macro deleted.
526 (lookup_image_type): Call define_image_type here, rather than via
527 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
528 (syms_of_image): Move define_image_type calls for xbm_type and
529 pbm_type to lookup_image_type.
530
531 2012-09-22 Eli Zaretskii <eliz@gnu.org>
532
533 * keyboard.c (timer_check_2): Move calculation of 'timers' and
534 'idle_timers' from here ...
535 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
536 lists, to avoid infloops when the timer does something stupid,
537 like reinvoke itself with the same or smaller time-out.
538 (Bug#12447)
539
540 2012-09-22 Martin Rudalics <rudalics@gmx.at>
541
542 * window.c (Fsplit_window_internal): Handle only Qt value of
543 Vwindow_combination_limit separately.
544 (Qtemp_buffer_resize): New symbol.
545 (Vwindow_combination_limit): New default value.
546 Rewrite doc-string.
547
548 2012-09-22 Eli Zaretskii <eliz@gnu.org>
549
550 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
551 the new overlay string. (Bug#10159)
552
553 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
554
555 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
556 or that fprintf is async-signal-safe. POSIX doesn't require
557 either assumption.
558
559 2012-09-22 Chong Yidong <cyd@gnu.org>
560
561 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
562 (Bug#8207).
563
564 2012-09-22 Kenichi Handa <handa@gnu.org>
565
566 * composite.c (composition_reseat_it): Handle the case that a
567 grapheme cluster is not covered by a single font (Bug#12352).
568
569 2012-09-21 Chong Yidong <cyd@gnu.org>
570
571 * image.c (define_image_type): Avoid adding duplicate types to
572 image_types (Bug#12463). Suggested by Jörg Walter.
573
574 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
575
576 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
577 (print_load_command_name): Add case LC_DATA_IN_CODE.
578 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
579
580 2012-09-21 Glenn Morris <rgm@gnu.org>
581
582 * eval.c (Frun_hook_with_args_until_success)
583 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
584
585 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
586
587 * fileio.c (Ffile_selinux_context): Only call freecon when
588 lgetfilecon succeeded.
589 (Fset_file_selinux_context): Likewise. (Bug#12444)
590
591 2012-09-21 Eli Zaretskii <eliz@gnu.org>
592
593 * xdisp.c (try_window_reusing_current_matrix): Under bidi
594 reordering, locate the cursor by calling set_cursor_from_row; if
595 that fails, clear the desired glyph matrix before returning a
596 failure indication to the caller. Fixes leaving garbled display
597 when fast scrolling with a down-key. (Bug#12403)
598 (compute_stop_pos_backwards): Fix a typo that caused crashes while
599 scrolling through multibyte text.
600
601 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
602
603 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
604 calling mark_vectorlike since that's the one that marks the window.
605 (mark_discard_killed_buffers): Mark the final cdr.
606 * window.h (struct window): Move prev/next_buffers to the
607 non-standard fields.
608 * window.c (make_window): Initialize prev/next_buffers manually.
609
610 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
611
612 Omit unused arg EXPECTED from socket hooks.
613 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
614 * nsterm.m (ns_term_init):
615 * termhooks.h (struct terminal.read_socket_hook):
616 * w32inevt.c (w32_console_read_socket):
617 * w32term.c (w32_read_socket):
618 * xterm.c (XTread_socket):
619 Omit unused arg EXPECTED. All callers changed.
620 (store_user_signal_events): Return void, not int, since callers no
621 longer care about the return value. All uses changed.
622
623 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
624
625 * w32gui.h (XParseGeometry): Do not declare.
626
627 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
628
629 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
630 Ignore 'expected'. See Eli Zaretskii in
631 <http://bugs.gnu.org/12471#8> (last line).
632
633 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
634 (XParseGeometry): Now static. Substitute extremal values for
635 values that are out of range.
636
637 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
638
639 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
640
641 * nsfns.m (XParseGeometry): Remove.
642 (Fx_create_frame): Call x_set_offset to correctly interpret
643 top_pos in geometry.
644
645 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
646 (Fx_parse_geometry): If there is a space in string, call
647 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
648
649 2012-09-17 Eli Zaretskii <eliz@gnu.org>
650
651 * search.c (scan_buffer): Use character positions in calls to
652 region_cache_forward and region_cache_backward, not byte
653 positions. (Bug#12196)
654
655 * w32term.c (w32_read_socket): Set pending_signals to 1, like
656 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
657
658 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
659 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
660 emacs_blocked_malloc, now deleted.
661
662 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
663
664 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
665 The workaround was for improving performance on Solaris 2.4, but
666 is getting in the way now. Emacs will still work if someone is
667 still running Solaris 2.4 in a museum somewhere; Sun dropped
668 support for Solaris 2.4 in 2003.
669 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
670 * process.c (create_process) [HAVE_WORKING_VFORK]:
671 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
672 since Emacs no longer uses vfork on that platform.
673
674 2012-09-17 Glenn Morris <rgm@gnu.org>
675
676 * emacs.c: Use COPYRIGHT.
677
678 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
679
680 Remove configure's --without-sync-input option (Bug#12450).
681 When auditing signal-handling in preparation for cleaning it up,
682 I found that SYNC_INPUT has race conditions and would be a real
683 pain to fix. Since it's an undocumented and deprecated
684 configure-time option, now seems like a good time to remove it.
685 Also see <http://bugs.gnu.org/11080#16>.
686 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
687 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
688 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
689 (malloc_hysteresis):
690 (check_depth) [XMALLOC_OVERRUN_CHECK]:
691 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
692 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
693 (dont_register_blocks, bytes_used_when_reconsidered)
694 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
695 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
696 [!SYSTEM_MALLOC && !SYNC_INPUT]:
697 Remove. All uses removed.
698 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
699 implementation, one that depends on whether the new macro
700 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
701 is defined.
702 * atimer.c (run_timers, handle_alarm_signal):
703 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
704 (handle_async_input, process_pending_signals)
705 (handle_input_available_signal, init_keyboard):
706 * nsterm.m (ns_read_socket):
707 * process.c (wait_reading_process_output):
708 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
709 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
710 (emacs_write):
711 * xterm.c (XTread_socket):
712 Assume SYNC_INPUT.
713 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
714 * eval.c (handling_signal): Remove. All uses removed.
715 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
716 All uses replaced with the SYNC_INPUT version.
717 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
718 Remove decls.
719 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
720 Now static.
721
722 * font.c (Ffont_shape_gstring): Remove unused local.
723
724 2012-09-16 Glenn Morris <rgm@gnu.org>
725
726 * Makefile.in (clean): No longer run nextstep's clean.
727
728 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
729 (ns_frag): Remove.
730 (ns-app): Move here from ns.mk, and simplify.
731 (clean): Simplify nextstep entry.
732 * ns.mk: Remove file.
733
734 2012-09-17 Kenichi Handa <handa@gnu.org>
735
736 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
737 not covert the last few charactes.
738
739 2012-09-16 Kenichi Handa <handa@gnu.org>
740
741 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
742 here, but just check the validity of glyphs in the glyph-string.
743
744 2012-09-16 Martin Rudalics <rudalics@gmx.at>
745
746 * window.c (Fwindow_parameter, Fset_window_parameter):
747 Accept any window as argument (Bug#12452).
748
749 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
750
751 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
752 to ns_term_init to avoid memory leak.
753
754 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
755 explicit retain/release.
756 (ns_term_init): Only allow one display. Initialize outerpool and
757 ns_*_types.
758
759 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
760
761 Port _setjmp fix to POSIXish hosts as well as Microsoft.
762 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
763 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
764 the Microsoft problem in a different way, by altering ../nt/config.nt.
765
766 2012-09-15 Eli Zaretskii <eliz@gnu.org>
767
768 * w32xfns.c:
769 * w32uniscribe.c:
770 * w32term.c:
771 * w32select.c:
772 * w32reg.c:
773 * w32proc.c:
774 * w32menu.c:
775 * w32inevt.c:
776 * w32heap.c:
777 * w32font.c:
778 * w32fns.c:
779 * w32console.c:
780 * w32.c:
781 * w16select.c: Remove inclusion of setjmp.h, as it is now included
782 by lisp.h. This completes removal of setjmp.h inclusion
783 erroneously announced in the previous commit. (Bug#12446)
784
785 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
786 more accurate.
787
788 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
789 not defined as a macro. The latter happens on MS-Windows.
790 (Bug#12446)
791
792 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
793
794 Port better to POSIX hosts lacking _setjmp (Bug#12446).
795 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
796 Some instances of '#include <setjmp.h>' removed, if the
797 only reason for the instance was because "lisp.h" was included.
798 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
799 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
800 and _longjmp with the new symbols. Emacs already uses _setjmp if
801 available, so this change affects only POSIXish hosts that have
802 sigsetjmp but not _setjmp, such as some versions of Solaris and
803 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
804 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
805 (png_load_body) [HAVE_PNG]:
806 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
807 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
808 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
809 since PNG requires jmp_buf. This is the only exception to the
810 general rule that we now use sys_setjmp and sys_longjmp.
811 This exception is OK since this code does not change the signal
812 mask or longjmp out of a signal handler.
813
814 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
815
816 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
817 Include "syssignal.h", for 'main_thread'.
818
819 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
820
821 Avoid out-of-range marker position (Bug#12426).
822 * insdel.c (replace_range, replace_range_2):
823 Adjust markers before overlays, as suggested by comments.
824 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
825 Remove redundant check before calling offset_intervals.
826
827 2012-09-14 Martin Rudalics <rudalics@gmx.at>
828
829 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
830 current buffer (Bug#12387).
831
832 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
833
834 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
835
836 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
837
838 Use a more backwards-compatible timer format (Bug#12430).
839 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
840 vector element, not from the 4th, since PSECS is now at the end.
841 (Fcurrent_idle_time): Doc fix.
842
843 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
844
845 Function to mark objects and remove killed buffers at once.
846 * alloc.c (discard_killed_buffers): Rename to ...
847 (mark_discard_killed buffers) ... new name. Add marking
848 of remaining objects. Fix comment. Adjust users.
849 (mark_object): Do not touch frame buffer lists here.
850 * frame.c (delete_frame): Reset frame buffer lists here.
851
852 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
853
854 Better workaround for GNOME bug when --enable-gcc-warnings.
855 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
856 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
857 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
858
859 Simplify SIGIO usage (Bug#12408).
860 The code that dealt with SIGIO was crufty and confusing, e.g., it
861 played tricks like "#undef SIGIO" but these tricks were not used
862 consistently. Simplify mostly by not #undeffing standard symbols,
863 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
864 or not as we please) rather than "defined SIGIO" (standard symbol
865 that we probably shouldn't #undef).
866 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
867 Modules that need it can include it.
868 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
869 * dispextern.h (ignore_sigio): New decl.
870 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
871 unconditionally, since it's now a no-op if !USABLE_SIGIO.
872 * emacs.c (shut_down_emacs):
873 * keyboard.c (kbd_buffer_store_event_hold):
874 Use ignore_sigio rather than invoking 'signal' directly.
875 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
876 for FIONREAD.
877 (FIONREAD, SIGIO): Do not #undef.
878 (tty_read_avail_input): Use #error rather than a syntax error.
879 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
880 for I_PIPE, used by SETUP_SLAVE_PTY.
881 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
882 * sysdep.c (croak): Remove; no longer needed. This bit of
883 temporary code, with Fred N. Fish's comment that it's temporary,
884 has been in Emacs since at least 1992!
885 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
886 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
887 * syssignal.h (croak): Remove decl.
888 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
889 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
890 now that we're termios-only.
891 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
892 * term.c (dissociate_if_controlling_tty): Use #error rather than
893 a run-time error.
894
895 Work around GCC and GNOME bugs when --enable-gcc-warnings.
896 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
897 to work around GNOME bug 683906.
898 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
899 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
900 This works around GCC bug 54561.
901
902 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
903
904 More fixes for 'volatile' and setjmp/longjmp.
905 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
906 * image.c (struct png_load_context) [HAVE_PNG]: New type.
907 (png_load_body) [HAVE_PNG]:
908 (jpeg_load_body) [HAVE_JPEG]:
909 New function, with most of the old parent function's body.
910 (png_load) [HAVE_PNG]:
911 (jpeg_load) [HAVE_JPEG]:
912 Invoke the new function, to avoid longjmp munging our locals.
913 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
914 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
915 longjmp is passed 2, as the C standard doesn't guarantee this.
916 Instead, store the failure code into mgr->failure_code.
917
918 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
919
920 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
921 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
922 (syms_of_keyboard): Remove support for unread-command-char.
923
924 2012-09-12 Eli Zaretskii <eliz@gnu.org>
925
926 * w32proc.c (sys_kill): If PID is our process ID and the signal is
927 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
928 violation. (Bug#12426)
929
930 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
931
932 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
933
934 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
935
936 * eval.c: Add `inhibit-debugger'.
937 (Qinhibit_debugger): New symbol.
938 (call_debugger): Bind it instead of Qdebug_on_error.
939 (maybe_call_debugger): Test Vinhibit_debugger.
940 (syms_of_eval): Define inhibit-debugger.
941 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
942 (syms_of_xdisp): Remove inhibit-debug-on-message.
943
944 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
945
946 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
947 If a nonvolatile local variable is written before a _longjmp to
948 the frame containing the variable, and is read after the _longjmp,
949 the value read is indeterminate. Some local variables of type
950 'struct handler' and 'struct catchtag' are used in this way, so
951 mark each of their slots as volatile if the slot can be set before
952 _longjmp and read afterwards.
953 * lisp.h (struct handler): var and chosen_clause are now volatile.
954 (struct catchtag): val, next, and pdlcount are now volatile.
955
956 * bidi.c (bidi_push_it, bidi_pop_it):
957 * fns.c (copy_hash_table):
958 * image.c (define_image_type):
959 * keyboard.c (kbd_buffer_store_event_hold):
960 * process.c (Fprocess_send_eof):
961 * xfaces.c (x_create_gc) [HAVE_NS]:
962 * xgselect.c (xg_select):
963 Prefer assignment to memcpy when either will do.
964
965 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
966 Use pointer-to-a-pointer to simplify and avoid a NILP check each
967 time an item is removed. No need to mark this function 'inline';
968 the compiler knows better than we do.
969
970 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
971
972 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
973 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
974 to change_frame_size (Bug#12388).
975 (windowDidResize:): Pass YES to updateFrameSize.
976
977 * nsterm.h: Add delay parameter to updateFrameSize.
978
979 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
980
981 Discard killed buffers from deleted window and frame objects.
982 This reduces an amount of references to killed buffers and
983 helps GC to reclaim them faster.
984 * alloc.c (discard_killed_buffers): New function.
985 (mark_object): Use it for deleted windows and frames.
986 (mark_object): If symbol's value is set up for a killed buffer
987 or deleted frame, restore it's global binding.
988 * data.c (swap_in_global_binding): Add GC notice.
989 (swap_in_symval_forwarding): Use convenient set_blv_where.
990 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
991 * window.h: ... to here.
992
993 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
994
995 Convenient macro to check whether the buffer is live.
996 * buffer.h (BUFFER_LIVE_P): New macro.
997 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
998 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
999
1000 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1001
1002 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1003 composition cases (Bug#12364).
1004
1005 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1006 overhang of succeeding glyphs overlapping box cursor.
1007
1008 * w32term.c (x_draw_glyph_string): Likewise.
1009
1010 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1011
1012 Simplify, document, and port floating-point (Bug#12381).
1013 The porting part of this patch fixes bugs on non-IEEE platforms
1014 with frexp, ldexp, logb.
1015 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1016 Now static.
1017 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1018 support, by removing commented-out code and briefly listing the
1019 C89 functions excluded. The commented-out stuff was confusing
1020 maintenance, e.g., we thought we needed cbrt but it was commented out.
1021 (logb): Remove decl; no longer needed.
1022 (isfinite): New macro, if not already supplied.
1023 (isnan): Don't replace any existing macro.
1024 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1025 are present on all C89 platforms.
1026 (Ffrexp): Do not special-case zero, as frexp does the right thing
1027 for that case.
1028 (Flogb): Do not use logb, as it doesn't have the desired meaning
1029 on hosts that use non-base-2 floating point. Instead, stick with
1030 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1031 frexp, to avoid getting an unspecified result.
1032
1033 * xdisp.c (Qinhibit_debug_on_message): Now static.
1034
1035 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1036
1037 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1038 NSBezierPath (Bug#12131).
1039
1040 2012-09-10 Chong Yidong <cyd@gnu.org>
1041
1042 * fns.c (Fdelq, Fdelete): Doc fix.
1043
1044 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1045
1046 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1047 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1048
1049 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1050
1051 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1052 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1053 Use it.
1054
1055 2012-09-09 Eli Zaretskii <eliz@gnu.org>
1056
1057 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1058 left fringe if the window has a left margin. This avoids leaving
1059 traces of the cursor because its leftmost pixel is not drawn over.
1060
1061 * dispnew.c (update_window_line): When the left margin area of a
1062 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1063 that screen line. (Bug#12277)
1064
1065 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 Assume C89 or later for math functions (Bug#12381).
1068 This simplifies the code, and makes it a bit smaller and faster,
1069 and (most important) makes it easier to clean up signal handling
1070 since we can stop worring about floating-point exceptions in
1071 library code. That was a problem before C89, but the problem
1072 went away many years ago on all practical Emacs targets.
1073 * data.c, image.c, lread.c, print.c:
1074 Don't include <math.h>; no longer needed.
1075 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1076 might be autoconfigured, as that never happens.
1077 * data.c (fmod):
1078 * doprnt.c (DBL_MAX_10_EXP):
1079 * print.c (DBL_DIG):
1080 Remove. C89 or later always defines these.
1081 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1082 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1083 (arith_error, domain_error, domain_error2):
1084 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1085 no longer needed -- we simply return what C returns. All uses removed.
1086 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1087 the wrapped code.
1088 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1089 Remove. All uses expanded, as these macros are no longer used
1090 more than once and are now more trouble than they're worth.
1091 (Ftan): Use tan, not sin / cos.
1092 (Flogb): Assume C89 frexp.
1093 (fmod_float): Assume C89 fmod.
1094 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1095 (init_floatfns): Remove. All uses removed.
1096
1097 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1098
1099 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1100 compositeToPoint for OSX < 10.6 (Bug#12390).
1101
1102 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1103
1104 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1105 This produces more-accurate results.
1106
1107 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1108
1109 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1110 changes (Bug#12088).
1111
1112 2012-09-08 Chong Yidong <cyd@gnu.org>
1113
1114 * syntax.c (Fstring_to_syntax): Doc fix.
1115
1116 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1117
1118 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1119 in the internal border.
1120 (x_set_window_size): Remove static variables and their usage.
1121 (ns_redraw_scroll_bars): Fix NSTRACE arg.
1122 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1123 Remove fringe/internal border adjustment (Bug#11052).
1124 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1125 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1126 (ns_fix_rect_ibw): Remove.
1127 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1128 (ns_dumpglyphs_box_or_relief): Ditto.
1129 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1130 adjustment.
1131 (ns_dumpglyphs_image): Ditto.
1132 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
1133 border adjustment.
1134 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1135 their usage. Add fringe_extended_p and its use as in other terms.
1136 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1137 scroll bar was removed.
1138 (updateFrameSize): New function.
1139 (windowDidResize): Move code to updateFrameSize and call it.
1140
1141 * nsterm.h (EmacsView): Add updateFrameSize.
1142
1143 2012-09-07 Chong Yidong <cyd@gnu.org>
1144
1145 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1146
1147 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1148
1149 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1150
1151 More signal-handler cleanup (Bug#12327).
1152 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1153 Problem introduced when merging patches. Noted by Eli Zaretskii in
1154 <http://bugs.gnu.org/12327#67>.
1155 * floatfns.c: Comment fix.
1156 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1157 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1158 and anyway the declaration is harmless even if SIGDANGER is not defined.
1159 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1160 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1161 source files not surprisingly expected syssignal.h to define, or
1162 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1163 Include <sys/ioctl.h>, for FIONREAD.
1164 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1165 This eliminates a problem whereby other files mysteriously had
1166 to include "syssignal.h" before including "systty.h" if they
1167 wanted to use "#ifdef SIGIO".
1168
1169 2012-09-07 Eli Zaretskii <eliz@gnu.org>
1170
1171 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1172
1173 * w32.c (sigemptyset): Empty the set.
1174 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1175
1176 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1177
1178 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1179
1180 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1181 (mark_object): Likewise for frame objects.
1182
1183 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1184
1185 * syssignal.h (handle_on_main_thread): Always declare,
1186 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1187 This ports to platforms without HAVE_PTHREAD.
1188
1189 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1190
1191 Signal-handler cleanup (Bug#12327).
1192 Emacs's signal handlers were written in the old 4.2BSD style with
1193 sigblock and sigmask and so forth, and this led to some
1194 inefficiencies and confusion. Rewrite these to use
1195 pthread_sigmask etc. without copying signal sets around. Also,
1196 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1197 'signal', and instead use functions that do not attempt to take
1198 over the system name space. This patch causes Emacs's text
1199 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1200 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1201 Do not include <signal.h> or "syssignal.h", as these
1202 modules do not use signals.
1203 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1204 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1205 Do not include <signal.h>, as "syssignal.h" does that for us now.
1206 * atimer.c (sigmask_atimers): New function.
1207 (block_atimers, unblock_atimers): New functions,
1208 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1209 All uses replaced.
1210 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1211 no longer needed here.
1212 * emacs.c (main): Inspect existing signal handler with sigaction,
1213 so that there's no need to block and unblock SIGHUP.
1214 * sysdep.c (struct save_signal): New member 'action', replacing
1215 old member 'handler'.
1216 (save_signal_handlers, restore_signal_handlers):
1217 Use sigaction instead of 'signal' to save and restore.
1218 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1219 New function. All users of 'signal' modified to use set_sighandler
1220 if they're writeonly, and to use sys_signal if they're read+write.
1221 (emacs_sigaction_init, forwarded_signal): New functions.
1222 (sys_signal): Remove. All uses replaced by calls to sigaction
1223 and emacs_sigaction_init, or by direct calls to 'signal'.
1224 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1225 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1226 all uses replaced by pthread_sigmask etc. calls.
1227 * syssignal.h: Include <signal.h>.
1228 (emacs_sigaction_init, forwarded_signal): New decls.
1229 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1230 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1231 (sigmask, sys_sigmask): Remove; no longer needed.
1232 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1233 (sigblock, sigunblock, sigfree):
1234 (sigsetmask) [!defined sigsetmask]:
1235 Remove. All uses replaced by pthread_sigmask.
1236 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1237 no longer need to be replaced, and its typical old uses
1238 are now done via emacs_sigaction_init and sigaction.
1239 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1240 (sys_sigdel): Remove; unused.
1241 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1242
1243 2012-09-06 Eli Zaretskii <eliz@gnu.org>
1244
1245 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1246 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1247
1248 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1249
1250 Explicitly mark buffer_defaults and buffer_local_symbols.
1251 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1252 mark_local_symbols here.
1253 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1254 since special buffers aren't marked here any more.
1255 (allocate_buffer): Chain new buffer with all_buffers here...
1256 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1257 not here.
1258 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1259 (syms_of_buffer): Remove staticpro of the above.
1260 (init_buffer_once): Set names for buffer_defaults and
1261 buffer_local_symbols.
1262
1263 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1264
1265 Use bool for booleans in font-related modules.
1266 * font.c (font_intern_prop, font_style_to_value)
1267 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1268 (generate_otf_features, font_check_otf_features, font_check_otf)
1269 (font_match_p, font_list_entities, font_at):
1270 * fontset.c (fontset_id_valid_p, reorder_font_vector
1271 (fontset_find_font, Fset_fontset_font)
1272 (face_suitable_for_char_p) [0]:
1273 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1274 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1275 (m17n_flt_initialized, ftfont_shape_by_flt):
1276 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1277 * nsfont.m (nsfont_draw):
1278 * w32font.c (w32font_draw):
1279 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1280 Use bool for booleans.
1281 * font.h: Adjust to above API changes.
1282 (struct font, struct font_driver, struct font_driver_list):
1283 Use bool for booleans.
1284 (struct font): Remove useless member encoding_type.
1285 All users removed.
1286 * fontset.c, xftfont.c: Omit unnecessary static decls.
1287
1288 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1289
1290 * alloc.c (mark_object): Revert window marking code
1291 since it's unsafe for the Fset_window_configuration.
1292
1293 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1294
1295 Fix race conditions with signal handlers and errno (Bug#12327).
1296 Be more systematic about preserving errno whenever a signal
1297 handler returns, even if it's not in the main thread. Do this by
1298 renaming signal handlers to distinguish between signal delivery
1299 and signal handling. All uses changed.
1300 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1301 * data.c (deliver_arith_signal): Rename from arith_error.
1302 * dispnew.c (deliver_window_change_signal): Rename from
1303 window_change_signal.
1304 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1305 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1306 * keyboard.c (deliver_input_available_signal): Rename from
1307 input_available_signal.
1308 (deliver_user_signal): Rename from handle_user_signal.
1309 (deliver_interrupt_signal): Rename from interrupt_signal.
1310 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1311 (deliver_child_signal): Rename from sigchld_handler.
1312 * atimer.c (handle_alarm_signal):
1313 * data.c (handle_arith_signal):
1314 * dispnew.c (handle_window_change_signal):
1315 * emacs.c (handle_fatal_signal, handle_danger_signal):
1316 * keyboard.c (handle_input_available_signal):
1317 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1318 * process.c (handle_pipe_signal, handle_child_signal):
1319 New functions, with the actual signal-handling code taken from the
1320 original respective signal handlers, sans the sporadic attempts to
1321 preserve errno, since that's now done by handle_on_main_thread.
1322 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1323 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1324 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1325 Move to sysdep.c.
1326 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1327 Move initialization of main_thread to sysdep.c's init_signals.
1328 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1329 our usage, and simplifies the mainline code.
1330 (record_child_status_change): New static function, as a helper
1331 for handle_child_signal, and with most of the old child handler's
1332 contents.
1333 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1334 (handle_child_signal): Use the above.
1335 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1336 Moved here from emacs.c.
1337 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1338 code moved here from emacs.c's main function.
1339 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1340 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1341 This lets callers save and restore errno properly.
1342
1343 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1344
1345 Remove redundant or unused things here and there.
1346 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1347 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1348 * editfns.c (Fcompare_buffer_substrings): Likewise.
1349 * frame.h (struct terminal, struct font_driver_list):
1350 Remove redundant declarations.
1351 * window.h (Qleft, Qright): Likewise.
1352
1353 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1354
1355 Do not mark objects from deleted buffers, windows and frames.
1356 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1357 (mark_object): Likewise for windows and frames.
1358
1359 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1360
1361 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1362 buffer_defaults and buffer_local_symbols as valid objects.
1363 Return special value to denote them.
1364
1365 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1366
1367 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1368 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1369 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1370 (file_name_absolute_p, Fsubstitute_in_file_name):
1371 (check_executable, check_writable, Ffile_accessible_directory_p)
1372 (Fset_file_selinux_context, Fdefault_file_modes)
1373 (Finsert_file_contents, choose_write_coding_system)
1374 (Fwrite_region, build_annotations, a_write, e_write)
1375 (Fdo_auto_save):
1376 * filelock.c (boot_time_initialized, get_boot_time)
1377 (get_boot_time_1, lock_file_1, within_one_second):
1378 * floatfns.c (in_float):
1379 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1380 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1381 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1382 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1383 * window.c (compare_window_configurations):
1384 Use bool for booleans.
1385 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1386 (Fdefault_file_modes): Now mode_t, not int, for modes.
1387 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1388 (internal_delete_file): Now returns void, not a (boolean) int,
1389 since nobody was looking at the return value.
1390 * lisp.h, window.h: Adjust to above API changes.
1391
1392 * xdisp.c (set_message): Simplify and reindent last change.
1393
1394 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
1395
1396 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1397
1398 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1399
1400 * eval.c (call_debugger): Make the function non-static so that we
1401 can call it from set_message.
1402
1403 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1404 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1405
1406 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1407
1408 Give more-useful info on a fatal error (Bug#12328).
1409 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1410 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1411 of doing the work ourselves.
1412 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1413 do most of the work.
1414 (fatal_error_backtrace): New function, taken from the guts
1415 of the old fatal_error_signal, but with a new option to output
1416 a backtrace.
1417 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1418 info about the signal than just its number.
1419 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1420 * sysdep.c: Include <execinfo.h>
1421 (emacs_backtrace): New function, taken partly from the previous
1422 code of the 'die' function.
1423 (emacs_abort): Call fatal_error_backtrace rather than abort.
1424
1425 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1426
1427 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1428 eager (load-time) macro-expansion.
1429 * lisp.mk (lisp): Add macroexp.
1430
1431 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1432
1433 Simplify redefinition of 'abort' (Bug#12316).
1434 Do not try to redefine the 'abort' function. Instead, redo
1435 the code so that it calls 'emacs_abort' rather than 'abort'.
1436 This removes the need for the NO_ABORT configure-time macro
1437 and makes it easier to change the abort code to do a backtrace.
1438 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1439 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1440 Remove; sysdep.c's emacs_abort now takes its place.
1441 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1442 'abort' changed to use 'emacs_abort'.
1443 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1444 (abort) [!defined abort]: Rename to ...
1445 (emacs_abort): ... new name.
1446 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1447 the place of the old 'abort' in emacs.c.
1448 * w32.c, w32fns.c (abort): Do not #undef.
1449 * w32.c (emacs_abort): Rename from w32_abort.
1450
1451 2012-09-04 Eli Zaretskii <eliz@gnu.org>
1452
1453 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1454 offsets[j].dv, since the y axis of the screen coordinates points
1455 down, while the y axis of the font definition coordinates points
1456 up. This fixes display of Arabic diacritics such as KASRA and
1457 KASRATAN. (Bug#11860)
1458
1459 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1460
1461 Be more systematic about _setjmp vs setjmp.
1462 * alloc.c (test_setjmp, mark_stack):
1463 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1464 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1465 (png_load, my_error_exit, jpeg_load):
1466 * process.c (send_process_trap, send_process):
1467 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1468 The underscored versions are up to 30x faster on some hosts.
1469 Formerly, the code used setjmp+longjmp sometimes and
1470 _setjmp+_longjmp at other times, with no particular reason to
1471 prefer setjmp+longjmp.
1472
1473 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1474
1475 Fix minor problem found by static checking.
1476 * buffer.c (Fdelete_all_overlays): Return nil.
1477
1478 2012-09-03 Martin Rudalics <rudalics@gmx.at>
1479
1480 * buffer.c (Fdelete_all_overlays): New function.
1481
1482 2012-09-03 Chong Yidong <cyd@gnu.org>
1483
1484 * gtkutil.c: Add extern decl for Qxft.
1485
1486 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1487
1488 * emacs.c, eval.c: Use bool for boolean.
1489 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1490 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1491 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1492 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1493 (main, decode_env_path, Fdaemon_initialized):
1494 * eval.c (call_debugger, Finteractive_p, interactive_p):
1495 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1496 (maybe_call_debugger, Fbacktrace):
1497 * process.c (read_process_output, exec_sentinel):
1498 Use bool for booleans.
1499 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1500 All callers changed.
1501 * eval.c (interactive_p): Omit always-true boolean argument
1502 EXCLUDE_SUBRS_P. All callers changed.
1503 * dispextern.h, lisp.h: Reflect above API changes.
1504 * firstfile.c (dummy): Use the address of 'main', whose signature
1505 won't change, instead of the address of 'initialize', whose
1506 signature just changed from int to bool.
1507 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1508 * msdos.c (fatal_error_in_progress): ... from here.
1509 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1510 of incrementing it.
1511 (redisplay_internal, unwind_redisplay): Simply clear
1512 REDISPLAYING_P when unwinding, instead of saving its previous,
1513 always-false value and then restoring it.
1514
1515 Clean up some extern decls.
1516 Mostly, this hoists extern decls out of .c files and into .h files.
1517 That way, we're more likely to catch errors if the interfaces change.
1518 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1519 declare xg_mark_data.
1520 * dispextern.h (x_frame_parm_handlers):
1521 * font.h (Qxft):
1522 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1523 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1524 (Qultra_bold, Qoblique, Qitalic):
1525 Move extern decl here from .c file.
1526 * alloc.c (xg_mark_data) [USE_GTK]:
1527 * doc.c (Qclosure):
1528 * eval.c (Qlexical_binding):
1529 * fns.c (time) [!HAVE_UNISTD_H]:
1530 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1531 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1532 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1533 * lread.c (Qinternal_interpreter_environment):
1534 * minibuf.c (Qbuffer):
1535 * process.c (QCfamily, QCfilter):
1536 * widget.c (free_frame_faces):
1537 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1538 * xfont.c (x_clear_errors):
1539 * xterm.c (x_frame_parm_handlers):
1540 Remove now-redundant extern decls.
1541 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1542 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1543 Now static.
1544 * xfaces.c: Remove unnecessary static decls.
1545 * xterm.c (updating_frame): Remove decl of nonexistent object.
1546
1547 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1548 when building globals.h, as the objects that are not built on
1549 this host are not needed to compile C files on this host.
1550
1551 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1552
1553 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1554
1555 * frame.h: Add missing prototype for x_wm_set_size_hint.
1556
1557 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1558
1559 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1560 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1561 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1562 (Fsubstitute_command_keys):
1563 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1564 (save_excursion_save, save_excursion_restore)
1565 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1566 (format_time_string, general_insert_function)
1567 (make_buffer_string, make_buffer_string_both)
1568 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1569 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1570 (copy_text, insert_1, insert_1_both, insert_from_string)
1571 (insert_from_string_before_markers, insert_from_string_1)
1572 (insert_from_buffer, insert_from_buffer_1, replace_range)
1573 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1574 (del_range_2, modify_region):
1575 * intervals.c (intervals_equal, balance_possible_root_interval)
1576 (adjust_intervals_for_insertion, merge_properties_sticky)
1577 (graft_intervals_into_buffer, lookup_char_property)
1578 (adjust_for_invis_intang, set_point_both)
1579 (get_property_and_range, compare_string_intervals)
1580 (set_intervals_multibyte_1, set_intervals_multibyte):
1581 * keyboard.c (decode_timer):
1582 Use bool for boolean.
1583 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1584 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1585
1586 2012-09-02 Chong Yidong <cyd@gnu.org>
1587
1588 * keymap.c (push_key_description): Print M-TAB as C-M-i
1589 (Bug#11758).
1590
1591 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1592
1593 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1594 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1595 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1596 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1597 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1598 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1599 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1600
1601 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1602
1603 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1604 more than one grapheme cluster passed to the shaper: compute the
1605 offset adjustment values separately for each cluster. (Bug#11860)
1606
1607 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1608 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1609 about implicit conversions from integer to pointer.
1610
1611 2012-09-01 Daniel Colascione <dancol@dancol.org>
1612
1613 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1614 system used too early.
1615
1616 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1617
1618 Better seed support for (random).
1619 * emacs.c (main): Call init_random.
1620 * fns.c (Frandom): Set the seed from a string argument, if given.
1621 Remove long-obsolete Gentzel cruft.
1622 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1623 (init_random): New function.
1624
1625 2012-09-01 Daniel Colascione <dancol@dancol.org>
1626
1627 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1628 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1629 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1630 x_wm_set_size_hint, x_query_colors, x_real_positions,
1631 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1632 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1633 all of which have been moved to common code.
1634
1635 * xfaces.c: Include TERM_HEADER instead of listing all possible
1636 window-system headers.
1637
1638 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1639 to match header.
1640
1641 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1642 directly accessing frame internals.
1643
1644 * w32font.h: Include font.h. Define syms_of_w32font and
1645 globals_of_w32font.
1646
1647 * process.c: Include TERM_HEADER instead of listing all possible
1648 window-system headers.
1649
1650 * nsterm.h: Remove declarations now in frame.h.
1651 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
1652
1653 * menu.c: Include TERM_HEADER instead of listing all possible
1654 window-system headers.
1655
1656 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1657 window system.
1658
1659 * keyboard.c: Include TERM_HEADER instead of listing all possible
1660 window-system headers.
1661
1662 * image.c: Include TERM_HEADER instead of listing all possible
1663 window-system headers. Declare Vlibrary_cache when compiling for
1664 Windows.
1665
1666 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1667 window system declarations.
1668
1669 * frame.h: Move common functions here: set_frame_menubar,
1670 x_set_window_size, x_sync, x_get_focus_frame,
1671 x_set_mouse_position, x_set_mouse_pixel_position,
1672 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1673 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1674 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1675 x_activate_menubar, x_real_positions, x_bitmap_icon,
1676 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1677 and x_query_colors.
1678
1679 * frame.c: Include TERM_HEADER instead of listing all possible
1680 window-system headers.
1681
1682 * font.c: Include TERM_HEADER instead of listing all possible
1683 window-system headers.
1684
1685 * emacs.c: Include TERM_HEADER.
1686
1687 * dispnew.c: Include TERM_HEADER instead of listing all possible
1688 window-system headers.
1689
1690 * ccl.h: Include character.h.
1691
1692 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1693 the current window system; include in list of objects to link into
1694 Emacs.
1695
1696 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1697
1698 Remove mark_ttys function and fix tty_display_info initialization.
1699 * lisp.h (mark_ttys): Remove prototype.
1700 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1701 to mark_ttys because all possible values of 'top_frame' slot are
1702 the frames which are reachable from Vframe_list.
1703 * term.c (mark_ttys): Remove.
1704 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1705
1706 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1707
1708 Change struct frame bitfields from unsigned char to unsigned.
1709 * frame.h (struct frame): Change type of 'display_preempted',
1710 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1711 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1712 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1713 bitfields from unsigned char to unsigned.
1714
1715 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1716
1717 Remove unused member of struct x_output and struct w32_output.
1718 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1719 * w32term.h (struct w32_output): Likewise.
1720
1721 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1722
1723 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1724 does not become zero (Bug#12234).
1725
1726 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1727
1728 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1729 for GCC 4.7.1 x86-64.
1730
1731 2012-08-30 Glenn Morris <rgm@gnu.org>
1732
1733 * lread.c (init_lread): For out-of-tree builds, only add the
1734 source directory's site-lisp dir to the load-path if it exists,
1735 consistent with in-tree builds. (Bug#12302)
1736
1737 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1738
1739 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1740 button_values to NULL. Call setStykeMask so dialogs get a close button.
1741 (windowShouldClose:): Set window_closed.
1742 (dealloc): New member, free button_values.
1743 (process_dialog:): Make member function. Remove window argument,
1744 replace window with self. Count buttons and allocate and store values
1745 in button_values.
1746 (addButton:value:row:): value is int with the name tag. Call setTag
1747 with tag. Remove return self, declare return value as void.
1748 (addString:row:): Remove return self, declare return value as void.
1749 (addSplit): Remove return self, declare return value as void.
1750 (clicked:): Remove return self, declare return value as void.
1751 Set dialog_return to button_values[seltag]. Code formatting change.
1752 (initFromContents:isQuestion:): Adjust call to process_dialog.
1753 Code formatting change.
1754 (timeout_handler:): Set timer_fired to YES.
1755 (runDialogAt:): Set timer_fired to NO.
1756 Handle click on close button as quit.
1757
1758 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1759 Add window_closed and button_values. Add void as return value for
1760 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1761 Add process_dialog as new member.
1762
1763 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1764
1765 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1766 is not one of the heaps we manage. (Bug#12242)
1767
1768 2012-08-28 Glenn Morris <rgm@gnu.org>
1769
1770 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1771
1772 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1773
1774 * window.c (Fset_window_configuration): Remove handling of
1775 auto-buffer-name window parameter. Install revision of reverted
1776 fix.
1777
1778 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1779
1780 Do not allow to set major mode for a dead buffer.
1781 * buffer.c (Fset_buffer_major_mode): Signal an error
1782 if the buffer is dead.
1783 (Fother_buffer, other_buffer_safely): Remove redundant
1784 nested declaration.
1785
1786 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1787
1788 Always use set_buffer_if_live to restore original buffer at unwind.
1789 * buffer.h (record_unwind_current_buffer): New function.
1790 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1791 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1792 * undo.c, window.c: Adjust users.
1793 * buffer.c (set_buffer_if_live): Fix comment.
1794
1795 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1796
1797 Fix usage of set_buffer_internal.
1798 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1799 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1800 * coding.c (decode_coding): Omit redundant test.
1801 * fileio.c (decide_coding_unwind): Likewise.
1802 * fns.c (secure_hash): Likewise.
1803 * insdel.c (modify_region): Likewise.
1804 * keyboard.c (command_loop_1): Likewise.
1805 * print.c (PRINTFINISH): Likewise.
1806 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1807
1808 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1809
1810 * dispnew.c: Use bool for boolean.
1811 (frame_garbaged, display_completed, delayed_size_change)
1812 (fonts_changed_p, add_window_display_history)
1813 (add_frame_display_history, verify_row_hash)
1814 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1815 (row_equal_p, realloc_glyph_pool)
1816 (allocate_matrices_for_frame_redisplay)
1817 (showing_window_margins_p)
1818 (adjust_frame_glyphs_for_frame_redisplay)
1819 (build_frame_matrix_from_leaf_window, make_current)
1820 (mirrored_line_dance, mirror_line_dance, update_frame)
1821 (update_window_tree, update_single_window)
1822 (check_current_matrix_flags, update_window, update_text_area)
1823 (update_window_line, set_window_update_flags, scrolling_window)
1824 (update_frame_1, scrolling, buffer_posn_from_coords)
1825 (do_pending_window_change, change_frame_size)
1826 (change_frame_size_1, sit_for):
1827 Use bool for boolean.
1828 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1829 and remove last int (actually boolean) argument, which was always 0.
1830 All callers changed.
1831 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1832 * dispextern.h (struct composition_it): Use bool for boolean.
1833 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1834 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1835 * dired.c (file_name_completion):
1836 Use bool for boolean. (This was missed in an earlier change.)
1837
1838 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1839
1840 * window.c (Fset_window_configuration): Revert first part of
1841 last change.
1842
1843 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1844
1845 * nsterm.h (NSPanel): New class variable dialog_return.
1846
1847 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1848 Initialize dialog_return.
1849 (windowShouldClose:): Use stop instead of stopModalWithCode.
1850 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1851 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1852 event.
1853 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1854 modal loop returns.
1855
1856 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1857
1858 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1859 * composite.c (find_composition, composition_gstring_p)
1860 (composition_reseat_it, find_automatic_composition):
1861 * data.c (let_shadows_buffer_binding_p)
1862 (let_shadows_global_binding_p, set_internal, make_blv)
1863 (Fmake_variable_buffer_local, Fmake_local_variable)
1864 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1865 (cons_to_signed, arith_driver):
1866 * dbusbind.c (xd_in_read_queued_messages):
1867 * dired.c (directory_files_internal, file_name_completion):
1868 Use bool for booleans.
1869 * dired.c (file_name_completion):
1870 * process.h (fd_callback):
1871 Omit int (actually boolean) argument. It wasn't being used.
1872 All uses changed.
1873 * composite.h, lisp.h: Reflect above API changes.
1874
1875 * cmds.c, coding.c: Use bool for booleans.
1876 * cmds.c (move_point, Fself_insert_command):
1877 * coding.h (struct composition status, struct coding_system):
1878 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1879 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1880 (emacs_mule_char, decode_coding_emacs_mule)
1881 (encode_coding_emacs_mule, detect_coding_iso_2022)
1882 (decode_coding_iso_2022, encode_invocation_designation)
1883 (encode_designation_at_bol, encode_coding_iso_2022)
1884 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1885 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1886 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1887 (encode_coding_raw_text, detect_coding_charset)
1888 (decode_coding_charset, encode_coding_charset, detect_eol)
1889 (detect_coding, get_translation_table, produce_chars)
1890 (consume_chars, reused_workbuf_in_use)
1891 (make_conversion_work_buffer, code_conversion_save)
1892 (decode_coding_object, encode_coding_object)
1893 (detect_coding_system, char_encodable_p)
1894 (Funencodable_char_position, code_convert_region)
1895 (code_convert_string, code_convert_string_norecord)
1896 (Fset_coding_system_priority):
1897 * fileio.c (Finsert_file_contents):
1898 Use bool for booleans.
1899 * coding.h, lisp.h: Reflect above API changes.
1900 * coding.c: Remove unnecessary static function decls.
1901 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1902 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1903 not a boolean 'int', since callers never look at the return value.
1904 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1905 * coding.h (decoding_buffer_size, encoding_buffer_size)
1906 (emacs_mule_string_char): Remove unused extern decls.
1907 (struct iso_2022_spec, struct coding_system):
1908 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1909 (struct emacs_mule_spec): Remove unused field 'full_support'.
1910 All initializations removed.
1911 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1912
1913 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1914
1915 Fix spare memory change (Bug#12286).
1916 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1917 (valid_lisp_object_p): Likewise.
1918
1919 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1920
1921 * window.c (Fset_window_configuration): Record any window's old
1922 buffer if it's replaced (see Bug#8789). If the new current
1923 buffer doesn't appear in the selected window, go to its old
1924 point (Bug#12208).
1925
1926 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1927
1928 Special MEM_TYPE_SPARE to denote reserved memory.
1929 * alloc.c (enum mem_type): New memory type.
1930 (refill_memory_reserve): Use new type for spare memory.
1931 This prevents live_cons_p and live_string_p from incorrect
1932 detection of uninitialized objects from spare memory as live.
1933
1934 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1935
1936 Spelling fixes.
1937 * Makefile.in (.PHONY): versioclean -> versionclean.
1938
1939 Remove unused external symbols.
1940 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1941 * window.c (Qwindow_valid_p, decode_valid_window):
1942 Now static, not extern.
1943 * data.c (Qinterval): Remove; unused.
1944 (syms_of_data): Do not define 'interval'.
1945 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1946 * window.h (decode_valid_window):
1947 Remove decls.
1948
1949 * character.c, charset.c, chartab.c: Use bool for booleans.
1950 * character.c (lisp_string_width, string_count_byte8)
1951 (string_escape_byte8):
1952 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1953 (load_charset_map_from_file, map_charset_chars)
1954 (Fdefine_charset_internal, define_charset_internal)
1955 (Fdeclare_equiv_charset, find_charsets_in_text)
1956 (Ffind_charset_region, char_charset, Fiso_charset):
1957 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1958 (sub_char_table_set, sub_char_table_set_range)
1959 (char_table_set_range, optimize_sub_char_table)
1960 (map_sub_char_table):
1961 Use bool for boolean.
1962 * character.c (str_to_unibyte): Omit last boolean argument; it was
1963 always 0. All callers changed.
1964 * character.h, charset.h: Adjust to match previous changes.
1965 * character.h (char_printable_p): Remove decl of nonexistent function.
1966 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1967 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1968 are all boolean, so make them single-bit bitfields.
1969
1970 * lisp.h (ASET): Remove attempt to detect side effects.
1971 It was meant to be temporary and it often doesn't work,
1972 because when IDX has side effects the behavior of IDX==IDX
1973 is undefined. See Stefan Monnier in
1974 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1975
1976 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1977
1978 * lisp.h (functionp): New function (extracted from Ffunctionp).
1979 (FUNCTIONP): Use it.
1980 * eval.c (Ffunctionp): Use it.
1981
1982 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1983
1984 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1985 as that's faster and simpler than static storage. Don't bother
1986 with the g_main_context_query overhead if g_main_context_pending
1987 says no events are pending.
1988 (gfds, gfds_size): Remove these static vars.
1989 (xgselect_initialize): Remove; no longer needed.
1990 All uses and decls removed.
1991
1992 * emacs.c (fatal_error_signal_hook): Remove.
1993 All uses removed. This leftover from old code was always 0.
1994
1995 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1996 * casefiddle.c (casify_object, casify_region):
1997 * casetab.c (set_case_table):
1998 * category.c, category.h (word_boundary_p):
1999 * category.h (CHAR_HAS_CATEGORY):
2000 Use bool for booleans, instead of int.
2001
2002 2012-08-25 Eli Zaretskii <eliz@gnu.org>
2003
2004 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2005
2006 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2007
2008 On assertion failure, print backtrace if available.
2009 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2010 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2011 * Makefile.in (LIB_EXECINFO): New macro.
2012 (LIBES): Use it.
2013
2014 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2015 * bytecode.c (exec_byte_code):
2016 * callint.c (check_mark, Fcall_interactively):
2017 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2018 (getenv_internal, sync_process_alive, call_process_exited):
2019 * lisp.h (USE_SAFE_ALLOCA):
2020 Use bool for booleans, instead of int.
2021 * lisp.h, process.h: Adjust prototypes to match above changes.
2022 * callint.c (Fcall_interactively): Don't assume the mark's
2023 offset fits in 'int'.
2024
2025 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2026
2027 * buffer.c, buffer.h: Use bool for boolean.
2028 * buffer.c (reset_buffer_local_variables)
2029 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2030 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2031 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2032 (overlay_touches_p, overlay_strings, Foverlay_put)
2033 (report_overlay_modification, call_overlay_mod_hooks):
2034 (mmap_enlarge, mmap_set_vars):
2035 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2036 Use bool for booleans, instead of int.
2037 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2038 since the 1-or-0 return value is always ignored anyway.
2039 (mmap_initialized_p):
2040 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2041 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2042
2043 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2044
2045 * bidi.c: Use bool for boolean.
2046 This is a bit more readable, and makes the text segment of bidi.o
2047 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2048 Presumably it's faster too.
2049 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2050 Now bool.
2051 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2052 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2053 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2054 (bidi_explicit_dir_char, bidi_level_of_next_char)
2055 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2056 Use bool for booleans, instead of int.
2057 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2058 (bidi_unshelve_cache): Adjust decls to match code.
2059
2060 2012-08-23 Martin Rudalics <rudalics@gmx.at>
2061
2062 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2063 argument.
2064
2065 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2066
2067 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2068 * atimer.h: Include <stdbool.h>.
2069
2070 2012-08-22 Dan Nicolaescu <dann@gnu.org>
2071
2072 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2073 compile time tests instead of run time tests on systems that do
2074 not use them.
2075 (FRAME_MAC_P): Remove leftover from deleted code.
2076 * frame.c (syms_of_frame): Remove leftover from deleted code.
2077
2078 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2079
2080 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2081
2082 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2083
2084 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2085 Otherwise, the compiler complains about (A?B:C) where B is void
2086 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
2087 (fontset_add): Return void, for FONTSET_ADD.
2088
2089 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2090
2091 * alloc.c: Use bool for booleans.
2092 (gc_in_progress, abort_on_gc)
2093 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2094 (dont_register_blocks) [GC_MALLOC_CHECK]:
2095 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2096 (check_string_bytes, make_specified_string, memory_full)
2097 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2098 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2099 (mark_stack, valid_pointer_p, make_pure_string)
2100 (Fgarbage_collect, survives_gc_p, gc_sweep):
2101 Use bool for booleans, instead of int.
2102 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2103 Remove unused local.
2104 * alloc.c (PURE_POINTER_P):
2105 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2106 * editfns.c (Fformat):
2107 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2108 (Fdo_auto_save):
2109 * fns.c (sweep_weak_table):
2110 * lisp.h (suppress_checking, push_message, survives_gc_p)
2111 (make_pure_string, gc_in_progress, abort_on_gc):
2112 * lread.c (readchar, read1):
2113 * print.c (Fprin1_to_string):
2114 * xdisp.c (push_message):
2115 Use bool for booleans affected directly or indirectly by
2116 alloc.c's changes.
2117
2118 Make recently-introduced setters macros.
2119 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2120 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2121 (set_fontset_default, set_fontset_fallback): Rename from their
2122 upper-case counterparts, and make them functions rather than macros.
2123 This is more consistent with the other recently-introduced setters.
2124 These don't need to be inline, since they're local.
2125
2126 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2127
2128 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2129 the loop (Bug#12247).
2130
2131 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2132
2133 * lisp.h (vcopy): Use memcpy rather than our own loop.
2134 This fixes a performance regression introduced by the recent
2135 addition of vcopy. This means 'vcopy' will need to be modified
2136 for a copying collector, but that's OK. Also, tighten the
2137 checking in the assertion.
2138
2139 2012-08-21 Eli Zaretskii <eliz@gnu.org>
2140
2141 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2142 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2143 non-base glyph for the width of the base character, according to
2144 what x_draw_composite_glyph_string_foreground expects.
2145 Generate WADJUST value according to composition_gstring_width's
2146 expectations, to produce correct width of the composed character.
2147 Reverse the sign of the DU offset produced by ScriptPlace.
2148
2149 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2150
2151 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2152
2153 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2154
2155 Avoid direct writes to contents member of struct Lisp_Vector.
2156 * lisp.h (vcopy): New function to copy data into vector.
2157 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2158 * fns.c (Ffillarray): Use ASET.
2159 * keyboard.c (timer_check_2): Use AREF and ASET.
2160 (append_tool_bar_item, Frecent_keys): Use vcopy.
2161 * lread.c (read_vector): Use ASET.
2162 * msdos.c (Frecent_doskeys): Use vcopy.
2163 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2164 (Finternal_merge_in_global_face): Use ASET and vcopy.
2165 * xfont.c (xfont_list_pattern): Likewise.
2166
2167 2012-08-21 Martin Rudalics <rudalics@gmx.at>
2168
2169 * window.c (Fwindow_point): For the selected window always return
2170 the position of its buffer's point.
2171 (Fset_window_point): For the selected window always go in its
2172 buffer to the specified position.
2173
2174 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2175
2176 Setter macros for fontsets.
2177 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2178 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2179 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2180 Adjust users.
2181
2182 2012-08-20 Glenn Morris <rgm@gnu.org>
2183
2184 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2185 Don't assume that `ln -f' works.
2186
2187 2012-08-20 Eli Zaretskii <eliz@gnu.org>
2188
2189 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2190 and later about non-assignments with no effect. See discussion at
2191 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2192 details.
2193
2194 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2195
2196 Inline setter functions for Lisp_Objects slots of struct specbinding.
2197 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2198 Adjust users.
2199
2200 2012-08-20 Martin Rudalics <rudalics@gmx.at>
2201
2202 * window.c (select_window): Always make selected window's buffer
2203 current.
2204
2205 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2206
2207 Use AREF and ASET for docstrings of category tables.
2208 * category.h (CATEGORY_DOCSTRING): Use AREF.
2209 (SET_CATEGORY_DOCSTRING): Use ASET.
2210 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2211
2212 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2213
2214 Inline setter functions for hash table members.
2215 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2216 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2217 (set_hash_key_and_value, set_hash_index, set_hash_next)
2218 (set_hash_hash): New functions.
2219 * charset.c, fns.c: Adjust users.
2220
2221 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2222
2223 Inline getter and setter functions for per-buffer values.
2224 * buffer.h (per_buffer_default, set_per_buffer_default)
2225 (per_buffer_value, set_per_buffer_value): New functions.
2226 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2227 * buffer.c, data.c: Adjust users.
2228
2229 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
2230
2231 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2232
2233 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2234
2235 Rely on <config.h> + <unistd.h> to declare 'environ',
2236 as gnulib does this if the system doesn't.
2237 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
2238 Remove declaration. MS-Windows declares it on stdlib.h which is
2239 included by conf_post.h.
2240 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2241 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2242 * vm-limit.c: Include <unistd.h>, for 'environ'.
2243
2244 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2245 (start_of_data): Remove decl; mem-limits.h provides it.
2246
2247 * xdisp.c (handle_invisible_prop): Make it a bit faster
2248 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2249
2250 2012-08-19 Chong Yidong <cyd@gnu.org>
2251
2252 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2253 ends (Bug#3874).
2254
2255 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2256
2257 * .gdbinit: Use call instead of set when calling a function in the
2258 inferior.
2259
2260 * data.c (set_internal): Don't use set_blv_found.
2261 (Fkill_local_variable): Likewise.
2262
2263 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2264
2265 * nsfont.m (ns_ascii_average_width): Ensure the string
2266 ascii_printable is initialized with a null-terminated character
2267 array. Otherwise, it can contain undesired extra characters.
2268
2269 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2270
2271 port new setting code to Sun C 5.8 2005/10/13
2272 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2273 Return void, not Lisp_Object. Otherwise, the compiler
2274 complains about (A?B:C) where B is void and C is Lisp_Object
2275 when compiling CHAR_TABLE_SET, due to the recent change to
2276 the API of sub_char_table_set_contents.
2277
2278 2012-08-18 Chong Yidong <cyd@gnu.org>
2279
2280 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2281 for the string case (Bug#3874).
2282
2283 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2284
2285 * buffer.h (BSET): Remove (Bug#12215).
2286 Replace all uses with calls to new setter functions.
2287 (bset_bidi_paragraph_direction, bset_case_canon_table)
2288 (bset_case_eqv_table, bset_directory, bset_display_count)
2289 (bset_display_time, bset_downcase_table)
2290 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2291 (bset_last_selected_window, bset_local_var_alist)
2292 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2293 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2294 (bset_width_table):
2295 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2296 (bset_auto_fill_function, bset_auto_save_file_format)
2297 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2298 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2299 (bset_cache_long_line_scans, bset_case_fold_search)
2300 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2301 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2302 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2303 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2304 (bset_header_line_format, bset_indicate_buffer_boundaries)
2305 (bset_indicate_empty_lines, bset_invisibility_spec)
2306 (bset_left_fringe_width, bset_major_mode, bset_mark)
2307 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2308 (bset_name, bset_overwrite_mode, bset_pt_marker)
2309 (bset_right_fringe_width, bset_save_length)
2310 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2311 (bset_scroll_up_aggressively, bset_selective_display)
2312 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2313 (bset_word_wrap, bset_zv_marker):
2314 * category.c (bset_category_table):
2315 * syntax.c (bset_syntax_table):
2316 New setter functions.
2317
2318 * process.h (PSET): Remove (Bug#12215).
2319 Replace all uses with calls to new setter functions.
2320 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2321 (PROCESS_INLINE): New macro.
2322 (pset_childp): New setter function.
2323 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2324 * process.c (PROCESS_INLINE):
2325 Define to EXTERN_INLINE, so that the corresponding functions
2326 are compiled into code.
2327 (pset_buffer, pset_command, pset_decode_coding_system)
2328 (pset_decoding_buf, pset_encode_coding_system)
2329 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2330 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2331 (pset_type, pset_write_queue): New setter functions.
2332
2333 * window.h (WSET): Remove (Bug#12215).
2334 Replace all uses with calls to new setter functions.
2335 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2336 (WINDOW_INLINE): New macro.
2337 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2338 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2339 (wset_total_lines, wset_vertical_scroll_bar)
2340 (wset_window_end_pos, wset_window_end_valid)
2341 (wset_window_end_vpos): New setter functions.
2342 * window.c (WINDOW_INLINE):
2343 Define to EXTERN_INLINE, so that the corresponding functions
2344 are compiled into code.
2345 (wset_combination_limit, wset_dedicated, wset_display_table)
2346 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2347 (wset_new_normal, wset_new_total, wset_next_buffers)
2348 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2349 (wset_prev_buffers, wset_right_fringe_width)
2350 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2351 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2352 (wset_window_parameters):
2353 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2354 (wset_column_number_displayed, wset_region_showing):
2355 New setter functions.
2356
2357 * termhooks.h (TSET): Remove (Bug#12215).
2358 Replace all uses with calls to new setter functions.
2359 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2360 (TERMHOOKS_INLINE): New macro.
2361 (tset_charset_list, tset_selection_alist): New setter functions.
2362 * terminal.c (TERMHOOKS_INLINE):
2363 Define to EXTERN_INLINE, so that the corresponding functions
2364 are compiled into code.
2365 (tset_param_alist): New setter function.
2366
2367 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2368
2369 * keyboard.h (KSET): Remove (Bug#12215).
2370 Replace all uses with calls to new setter functions.
2371 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2372 (KEYBOARD_INLINE): New macro.
2373 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2374 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2375 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2376 New setter functions.
2377 * keyboard.c (KEYBOARD_INLINE):
2378 Define to EXTERN_INLINE, so that the corresponding functions
2379 are compiled into code.
2380 (kset_echo_string, kset_kbd_queue)
2381 (kset_keyboard_translate_table, kset_last_prefix_arg)
2382 (kset_last_repeatable_command, kset_local_function_key_map)
2383 (kset_overriding_terminal_local_map, kset_real_last_command)
2384 (kset_system_key_syms): New setter functions.
2385
2386 * frame.h (FSET): Remove (Bug#12215).
2387 Replace all uses with calls to new setter functions.
2388 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2389 (FRAME_INLINE): New macro.
2390 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2391 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2392 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2393 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2394 (fset_param_alist, fset_root_window, fset_scroll_bars)
2395 (fset_selected_window, fset_title, fset_tool_bar_items)
2396 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2397 * frame.c (FRAME_INLINE):
2398 Define to EXTERN_INLINE, so that the corresponding functions
2399 are compiled into code.
2400 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2401
2402 A few more naming-convention fixes for getters and setters.
2403 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2404 and rename from buffer_overlays_set_before.
2405 (set_buffer_overlays_after): Move here from buffer.h, and rename
2406 from buffer_overlays_set_after.
2407 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2408 All uses changed.
2409 (set_buffer_intervals): Rename from buffer_set_intervals.
2410 * intervals.c (set_interval_object): Move here from intervals.h,
2411 and rename from interval_set_object.
2412 (set_interval_left): Move here from intervals.h, and rename from
2413 interval_set_left.
2414 (set_interval_right): Move here from intervals.h, and rename from
2415 interval_set_right.
2416 (copy_interval_parent): Move here from intervals.h, and rename from
2417 interval_copy_parent.
2418 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2419 (set_interval_plist): Rename from interval_set_plist.
2420 Return void, not Lisp_Object, since no caller uses the result.
2421 * lisp.h (string_intervals): Rename from string_get_intervals.
2422 (set_string_intervals): Rename from string_set_intervals.
2423
2424 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2425 (set_char_table_contents): Rename from char_table_set_contents.
2426 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
2427 All uses changed. See the end of
2428 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2429
2430 * lisp.h (CSET): Remove (Bug#12215).
2431 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2432 (set_char_table_purpose): New functions,
2433 replacing CSET. All uses changed. For example, replace
2434 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
2435 "set_char_table_parent (char_table, parent);".
2436 The old version was confusing because it used the same name
2437 'parent' for two different things.
2438
2439 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2440
2441 Functions to get and set Lisp_Object fields of buffer-local variables.
2442 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2443 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2444 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2445 * data.c, eval.c, frame.c: Adjust users.
2446
2447 2012-08-17 Chong Yidong <cyd@gnu.org>
2448
2449 * xfaces.c (merge_face_vectors): If the target font specfies a
2450 font spec, make the font's attributes take precedence over
2451 directly-specified attributes.
2452 (merge_face_ref): Recognize :font.
2453
2454 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2455
2456 Do not use memcpy for copying intervals.
2457 * intervals.c (reproduce_interval): New function.
2458 (reproduce_tree, reproduce_tree_obj): Use it.
2459 (reproduce_tree_obj): Remove prototype.
2460
2461 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2462
2463 * lisp.h (duration_to_sec_usec): Remove unused decl.
2464
2465 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2466
2467 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2468 to an allocated instance of NSString, not to the class itself.
2469
2470 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
2471
2472 * makefile.w32-in (C_CTYPE_H): New macro.
2473 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2474 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2475 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2476
2477 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2478
2479 Use ASCII tests for character types.
2480 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2481 * xfns.c, xterm.c:
2482 Don't include <ctype.h>; was not needed.
2483 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2484 * sysdep.c, xfaces.c:
2485 Include <c-ctype.h> instead of <ctype.h>.
2486 * nsterm.m: Include <c-ctype.h>.
2487 * charset.c (read_hex):
2488 * doc.c (Fsnarf_documentation):
2489 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2490 (DRIVE_LETTER) [DOS_NT]:
2491 (Ffile_name_directory, Fexpand_file_name)
2492 (Fsubstitute_in_file_name):
2493 * font.c (font_parse_xlfd, font_parse_fcname):
2494 * frame.c (x_set_font_backend):
2495 * gtkutil.c (xg_get_font):
2496 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2497 * nsimage.m (hexchar):
2498 * nsterm.m (ns_xlfd_to_fontname):
2499 * sysdep.c (system_process_attributes):
2500 * xfaces.c (hash_string_case_insensitive):
2501 Use C-locale tests instead of locale-specific tests for character
2502 types, since we want the ASCII interpretation here, not the
2503 interpretation suitable for whatever happens to be the current locale.
2504
2505 2012-08-16 Martin Rudalics <rudalics@gmx.at>
2506
2507 Consistently check windows for validity/liveness
2508 (Bug#11984, Bug#12025, Bug#12026).
2509 * lisp.h (CHECK_VALID_WINDOW): New macro.
2510 * window.c (decode_window): Rename to decode_live_window.
2511 (decode_valid_window, Fwindow_valid_p): New functions.
2512 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2513 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2514 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2515 (Fwindow_prev_sibling, Fwindow_combination_limit)
2516 (Fset_window_combination_limit, Fwindow_use_time)
2517 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2518 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2519 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2520 (Fwindow_hscroll, Fset_window_hscroll)
2521 (Fwindow_redisplay_end_trigger)
2522 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2523 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2524 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2525 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2526 (Fwindow_end, Fset_window_point, Fset_window_start)
2527 (Fpos_visible_in_window_p, Fwindow_line_height)
2528 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2529 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2530 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2531 (Fset_window_parameter, Fwindow_display_table)
2532 (Fset_window_display_table, Fdelete_other_windows_internal)
2533 (Fset_window_buffer, Fset_window_new_total)
2534 (Fset_window_new_normal, Fdelete_window_internal)
2535 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2536 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2537 (Fwindow_scroll_bars): Check whether argument window is a valid or
2538 live window. Update doc-strings.
2539 (syms_of_window): New symbol Qwindow_valid_p.
2540 * keyboard.c (Fposn_at_x_y): Check whether argument
2541 frame_or_window denotes a valid window.
2542
2543 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2544
2545 Fix previous char table change.
2546 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2547 * chartab.c (optimize_sub_char_table): Likewise.
2548
2549 2012-08-16 Chong Yidong <cyd@gnu.org>
2550
2551 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2552
2553 * xfont.c (xfont_open):
2554 * xftfont.c (xftfont_open): Set the font's max_width field.
2555
2556 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2557 min_width to space_width and average_width to the average over
2558 printable ASCII characters.
2559 (ns_char_width): Code cleanup.
2560 (ns_ascii_average_width): New utility function.
2561
2562 * font.h (struct font): Update comments.
2563
2564 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2565
2566 Simple interface to set Lisp_Object fields of character tables.
2567 * lisp.h (CSET): New macro.
2568 (char_table_set_extras, char_table_set_contents)
2569 (sub_char_table_set_contents): New function.
2570 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2571 * syntax.c: Adjust users.
2572
2573 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2574
2575 * eval.c (eval_sub): Bind lexical-binding.
2576 * lread.c (Qlexical_binding): Make non-static.
2577
2578 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2579
2580 * nsmenu.m (popupSession): Remove.
2581 (pop_down_menu): Remove endModalSession.
2582 (timeout_handler:): New method.
2583 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2584 Call runModalForWindow. Check timer_fired when it returns.
2585 If not set, cancel timer and break out of loop.
2586 Otherwise loop again, with a new timeout.
2587
2588 * nsterm.m: Include fcntl.h if present.
2589 (fd_entry, t_readfds, inNsSelect): Remove.
2590 (select_writefds, select_valid, select_timeout, selfds)
2591 (select_mutex, apploopnr): Add.
2592 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2593 Otherwise call kbd_buffer_store_event.
2594 (ns_send_appdefined): Remove release of fd_entry.
2595 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2596 Increment and decrement apploopnr.
2597 (ns_select): If no file descriptors, just do a NSTimer.
2598 Otherwise copy read/write masks and start select thread (fd_handler).
2599 Start main loop and wait for application defined event.
2600 Inform select thread to stop selecting after main loop is exited.
2601 (ns_term_init): Create selfds pipe and set non-blocking.
2602 Initialize select_mutex. Start the select thread (fd_handler).
2603 (fd_handler:): Loop forever, wait for info from the main thread
2604 to either start or stop selecting. When select returns, send
2605 and appdefined event.
2606 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2607 If not call kbd_buffer_store_event.
2608
2609 * nsterm.h (EmacsApp): fd_handler takes id argument.
2610 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2611
2612 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2613
2614 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2615
2616 * region-cache.c (move_cache_gap): Update gap_len using the actual
2617 growth of the boundaries array. Do not change cache_len.
2618 (Bug#12196)
2619
2620 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2621
2622 Generalize and cleanup font subsystem checks.
2623 * font.h (FONT_DEBUG, font_assert): Remove.
2624 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2625 Change font_assert to eassert. Use eassert where appropriate.
2626
2627 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2628
2629 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2630
2631 2012-08-15 Chong Yidong <cyd@gnu.org>
2632
2633 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2634 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2635 extract the font descriptor instead of just the font name.
2636 In that case, return a font spec instead of a string.
2637 (x_last_font_name): Move to this file from xfns.c.
2638
2639 * xfns.c (Fx_select_font): The return value can also be a font
2640 spec. Move x_last_font_name management to gtkutil.c.
2641
2642 * xfaces.c: Make font weight and style symbols non-static.
2643
2644 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2645
2646 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2647 (bug#12117).
2648
2649 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2650
2651 * alloc.c (Fgarbage_collect): Use plural form consistently.
2652
2653 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2654
2655 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2656 iteration through the command loop. Fixes a problem whereby mouse
2657 movements are ignored until the first mouse click.
2658
2659 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2660
2661 Use bool, not int, for Lisp booleans.
2662 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2663 makes Emacs a bit smaller and presumably a bit faster.
2664 * lisp.h: Include <stdbool.h>.
2665 (struct Lisp_Boolfwd, defvar_bool):
2666 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2667 * regex.c [!emacs]: Include <stdbool.h>.
2668 (false, true): Remove; <stdbool.h> does this for us now.
2669
2670 2012-08-14 Chong Yidong <cyd@gnu.org>
2671
2672 * character.c (Fcharacterp): Doc fix (Bug#12076).
2673
2674 * data.c (Findirect_variable): Doc fix (Bug#11040).
2675
2676 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2677
2678 * editfns.c (Fformat): Doc fix (Bug#12059).
2679 (Fsave_current_buffer): Doc fix (Bug#11542).
2680
2681 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2682
2683 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2684 (bug#12022).
2685
2686 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2687
2688 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2689 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2690 * minibuf.c (choose_minibuf_frame, read_minibuf):
2691 * w32fns.c (x_create_tip_frame):
2692 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2693 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2694
2695 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2696
2697 * intervals.c (offset_intervals): Remove obsolete comment.
2698
2699 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2700
2701 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2702
2703 2012-08-14 Gergely Risko <gergely@risko.hu>
2704
2705 * coding.c (decode_coding): Record buffer modification before
2706 disabling undo_list (Bug#11773).
2707
2708 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2709
2710 Revert and cleanup some recent overlay changes.
2711 * buffer.h (enum overlay_type): Remove.
2712 (buffer_get_overlays, buffer_set_overlays): Likewise.
2713 (buffer_set_overlays_before, buffer_set_overlays_after):
2714 New function. Adjust users.
2715 (unchain_both): Add eassert.
2716
2717 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2718
2719 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2720
2721 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2722
2723 * gtkutil.c (xg_mark_data): Don't assume C99.
2724
2725 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2726
2727 * gtkutil.c (xg_frame_tb_info): New struct.
2728 (TB_INFO_KEY): New define.
2729 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2730 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2731 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2732 if not present.
2733 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2734 is up to date. Otherwise store new data.
2735 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2736
2737 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2738
2739 Use KSET for write access to Lisp_Object members of struct kboard.
2740 * keyboard.h (KSET): New macro.
2741 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2742 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2743 * xterm.c: Adjust users.
2744
2745 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2746
2747 Use BSET for write access to Lisp_Object members of struct buffer.
2748 * buffer.h (BSET): New macro.
2749 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2750 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2751 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2752 * window.c, xdisp.c, xfns.c: Adjust users.
2753
2754 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2755
2756 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2757
2758 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2759
2760 * nsterm.m (not_in_argv): New function.
2761 (application:openFile, application:openTempFile:):
2762 (application:openFileWithoutUI:, application:openFiles:): Open file
2763 if not_in_argv returns non-zero (bug#12171).
2764
2765 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2766 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2767 Define for Gtk+ versions less than 3.2.
2768 (xg_get_font_name): Use those functions/macros here.
2769 Reported by Frans Oilinki <moilinki@gmail.com>.
2770
2771 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2772
2773 * unexmacosx.c (copy_data_segment): Copy initialized data in
2774 statically linked libraries from input file rather than memory.
2775
2776 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2777 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2778 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2779
2780 2012-08-10 Glenn Morris <rgm@gnu.org>
2781
2782 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2783 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2784
2785 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2786
2787 Fix last change to allow compilation with low optimization levels.
2788 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2789 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2790
2791 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2792
2793 Use common inline syntax in intervals.h.
2794 * intervals.h (INTERVALS_INLINE): New macro.
2795 Change all users from LISP_INLINE.
2796
2797 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2798
2799 Define Qnone once for all platforms.
2800 * frame.c (Qnone): Define here.
2801 (syms_of_frame): DEFSYM it.
2802 * lisp.h (Qnone): New declaration.
2803 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2804 * xfns.c: Remove duplication. Adjust users.
2805
2806 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2807
2808 Remove unused macros from intervals.h.
2809 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2810 * intervals.c: Adjust comment.
2811
2812 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2813
2814 * w32fns.c <w32_unicode_gui>: New static variable.
2815 (globals_of_w32fns): Initialize it according to os_subtype.
2816 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2817 testing os_subtype.
2818
2819 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2820 Eli Zaretskii <eliz@gnu.org>
2821
2822 Fix bug #10299 with Unicode characters sent by customized
2823 keyboards created by MSKLC.
2824 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2825 (w32_init_class): Use it to initialize the Emacs class with either
2826 ANSI or Unicode API calls.
2827 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2828 later.
2829 (w32_wnd_proc): If the character code sent by WM_CHAR or
2830 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2831 original message. Call DefWindowProcW on NT and later.
2832
2833 2012-08-10 Glenn Morris <rgm@gnu.org>
2834
2835 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2836
2837 * lisp.h (DIRECTORY_SEP): Let configure set it.
2838
2839 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2840
2841 Use TSET for write access to Lisp_Object slots of struct terminal.
2842 * termhooks.h (TSET): New macro.
2843 * coding.c, terminal.c, xselect.c: Adjust users.
2844
2845 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2846
2847 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2848 the failing expression, include them in the error message.
2849 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2850 * lisp.h (internal_condition_case_n): Update declaration.
2851
2852 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2853
2854 Inline functions to examine and change buffer overlays.
2855 * buffer.c (unchain_both): New function.
2856 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2857 (buffer_has_overlays): New function.
2858 (enum overlay_type): New enum.
2859 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2860 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2861
2862 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2863
2864 Inline functions to examine and change buffer intervals.
2865 * alloc.c (mark_interval_tree): Remove.
2866 (MARK_INTERVAL_TREE): Simplify.
2867 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2868 * intervals.c (buffer_balance_intervals): New function.
2869 (graft_intervals_into_buffer): Adjust indentation.
2870 (set_intervals_multibyte): Simplify.
2871 * buffer.h (BUF_INTERVALS): Remove.
2872 (buffer_get_intervals, buffer_set_intervals): New function.
2873 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2874 * intervals.c, textprop.c: Adjust users.
2875
2876 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2877
2878 Inline functions to examine and change string intervals.
2879 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2880 (string_get_intervals, string_set_intervals): New function.
2881 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2882 * lread.c, print.c, textprop.c: Adjust users.
2883
2884 2012-08-08 Glenn Morris <rgm@gnu.org>
2885
2886 * lisp.mk (lisp): Remove language/persian.elc.
2887
2888 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2889
2890 Cleanup intervals.
2891 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2892 (NULL_INTERVAL_P): Likewise. Adjust users.
2893 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2894 Adjust comment. Move under #if 0.
2895 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2896 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2897
2898 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2899
2900 Check total length of intervals with eassert.
2901 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2902 * intervals.c: Change all users to eassert.
2903
2904 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2905
2906 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2907 Rename fields to match removal of FGET and WGET and disuse of
2908 INTERNAL_FIELD in Lisp_Cons.
2909
2910 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2911
2912 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2913 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2914 name since all xname users are fixed long time ago. Do not
2915 use INTERNAL_FIELD.
2916 (set_symbol_name, set_symbol_function, set_symbol_plist):
2917 (set_symbol_next, set_overlay_plist): New function.
2918 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2919 (struct Lisp_Overlay): Likewise.
2920 (CVAR, MVAR, SVAR): Remove.
2921 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2922 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2923 * xterm.c: Adjust users.
2924 * .gdbinit: Change to use name field of struct Lisp_Symbol
2925 where appropriate.
2926
2927 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2928
2929 Basic functions to set Lisp_Object and pointer slots of intervals.
2930 * intervals.h (interval_set_parent, interval_set_object):
2931 (interval_set_left, interval_set_right, interval_set_plist):
2932 (interval_copy_parent): New function.
2933 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2934 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2935 Adjust indentation.
2936 (INTERVAL_SIZE): Remove. Adjust users.
2937 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2938
2939 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2940
2941 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2942 * process.h (PGET): Remove.
2943 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2944 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2945
2946 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2947
2948 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2949 * window.h (WGET): Remove.
2950 (struct window): Do not use INTERNAL_FIELD.
2951 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2952 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2953 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2954 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2955 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2956 Adjust users.
2957
2958 2012-08-07 Chong Yidong <cyd@gnu.org>
2959
2960 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2961 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2962 (Fdelete_window_internal): Signal an error if the window is not on
2963 a live frame (Bug#12025).
2964
2965 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2966
2967 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2968 * frame.h (FGET): Remove.
2969 (struct frame): Do not use INTERNAL_FIELD.
2970 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2971 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2972 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2973 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2974
2975 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2976
2977 * w32.c: Silence compiler warnings.
2978 (map_w32_filename): Remove unused variable `is_fat'.
2979 (chase_symlinks): Add parentheses around expression.
2980
2981 2012-08-06 Glenn Morris <rgm@gnu.org>
2982
2983 * sysdep.c: Respect BROKEN_GETWD.
2984
2985 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2986 Let configure handle it.
2987 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2988
2989 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2990
2991 Use GCALIGNMENT where appropriate.
2992 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2993 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2994 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2995
2996 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2997
2998 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2999 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
3000
3001 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3002
3003 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3004 that should be sufficient for everyone.
3005
3006 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3007
3008 * keyboard.c (timer_check_2): Add break so timer_check returns next
3009 timeout.
3010
3011 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3012
3013 Fix Windows build errors introduced after converting to WGET and WSET.
3014 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3015 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3016
3017 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3018
3019 * nsterm.m (ns_frame_rehighlight): Use FSET.
3020
3021 * nsmenu.m (ns_update_menubar): Use FSET.
3022
3023 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3024
3025 Separate read and write access to Lisp_Object slots of Lisp_Process.
3026 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3027 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3028
3029 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3030
3031 Separate read and write access to Lisp_Object slots of struct window.
3032 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3033 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3034 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3035 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3036 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3037 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3038 Adjust users.
3039
3040 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3041
3042 Fix Windows build errors introduced after converting to FGET and FSET.
3043 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3044 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3045 (w32_judge_scroll_bars): Change to use FSET.
3046 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3047
3048 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3049
3050 Fix replacement typo.
3051 * window.c (replace_window): Set root_window instead of
3052 selected_window. This fixes a total window subsystem
3053 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3054
3055 2012-08-06 Glenn Morris <rgm@gnu.org>
3056
3057 * lisp.mk (lisp): Add language/persian.elc.
3058
3059 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3060
3061 Separate read and write access to Lisp_Object slots of struct frame.
3062 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3063 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3064 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3065 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3066 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3067
3068 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3069
3070 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3071
3072 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3073
3074 Generalize common compile-time constants.
3075 * lisp.h (header_size, bool_header_size, word_size): Now here.
3076 (struct Lisp_Vector): Add comment.
3077 (struct Lisp_Bool_Vector): Move up to define handy constants.
3078 (VECSIZE, PSEUDOVECSIZE): Simplify.
3079 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3080 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3081 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3082 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3083 * xfont.c, xmenu.c: Use word_size where appropriate.
3084
3085 2012-08-05 Lawrence Mitchell <wence@gmx.li>
3086
3087 * search.c (Freplace_match): Treat \? in the replacement text
3088 literally (Bug#8161).
3089
3090 2012-08-05 Chong Yidong <cyd@gnu.org>
3091
3092 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3093 * frame.c (Vdelete_frame_functions):
3094 * emacs.c (Vkill_emacs_hook): Doc fix.
3095
3096 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3097
3098 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3099 --with-x-toolkit=no builds.
3100 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3101
3102 2012-08-04 Chong Yidong <cyd@gnu.org>
3103
3104 * syntax.c (Fmodify_syntax_entry): Doc fix.
3105
3106 2012-08-04 Eli Zaretskii <eliz@gnu.org>
3107
3108 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3109 * w32.c (init_environment): Change the default values of many
3110 environment variables in dflt_envvars[] to NULL, to avoid pushing
3111 them into environment when they were not already defined.
3112 Remove the code that deletes site-lisp subdirectories from the default
3113 value of EMACSLOADPATH, as it is no longer needed.
3114 (check_windows_init_file): Now external, not static.
3115 Use Vload_path as is, without adding anything, as this function is now
3116 called when Vload_path is already set up.
3117
3118 * w32.h (check_windows_init_file): Add prototype.
3119
3120 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3121 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3122 compatibility with Posix platforms.
3123 (main): Move the call to check_windows_init_file to here from
3124 w32.c.
3125 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3126 any, in the DEFALT argument into the root of the Emacs build or
3127 installation tree, as appropriate.
3128
3129 * callproc.c (init_callproc_1): Call decode_env_path instead of
3130 doing its equivalent by hand.
3131 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3132 the code that sets Vexec_path run on MS-Windows.
3133
3134 * lread.c (init_lread): Add comments to #ifdef's.
3135
3136 * msdos.c (dos_set_window_size, IT_update_begin)
3137 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3138 instead of direct references.
3139
3140 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3141
3142 Export DEFAULT_REHASH_* to GDB.
3143 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3144 Now constants, not macros.
3145
3146 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3147
3148 Remove unnecessary casts involving pointers.
3149 These casts are no longer needed now that we assume C89 or later,
3150 since they involve casting to or from void *.
3151 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3152 (make_pure_float, make_pure_vector):
3153 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3154 * macros.c (Fstart_kbd_macro):
3155 * menu.c (find_and_return_menu_selection):
3156 * minibuf.c (read_minibuf_noninteractive):
3157 * sysdep.c (closedir):
3158 * xdisp.c (x_produce_glyphs):
3159 * xfaces.c (compare_fonts_by_sort_order):
3160 * xfns.c (x_real_positions, select_visual):
3161 * xselect.c (x_stop_queuing_selection_requests)
3162 (x_get_window_property, x_get_window_property_as_lisp_data):
3163 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3164 Remove unnecessary pointer casts.
3165 * alloc.c (record_xmalloc): New function.
3166 * lisp.h (record_xmalloc): New decl.
3167 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3168 more like a function. This is because the pointer cast is not
3169 needed. All uses changed.
3170 * print.c (print_string, print_error_message): Avoid length recalc.
3171
3172 Improve fix for macroexp crash with debugging (Bug#12118).
3173 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3174 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3175 not supposed to be invoked from the garbage collector.
3176 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3177 (gc_aset): New function, which is like ASET but can be
3178 used in the garbage collector.
3179 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3180 (set_hash_index): Use it instead of ASET.
3181
3182 2012-08-03 Eli Zaretskii <eliz@gnu.org>
3183
3184 Support symlinks on latest versions of MS-Windows.
3185 * w32.c: Include winioctl.h and aclapi.h.
3186 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3187 (revert_to_self): Forward declarations of static functions.
3188 <static BOOL g_b_init_get_security_info>:
3189 <g_b_init_create_symbolic_link>: New static flags.
3190 (globals_of_w32): Initialize them to zero.
3191 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3192 (map_w32_filename): Improve commentary. Simplify switch.
3193 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3194 headers (most versions of MinGW w32api don't).
3195 (get_security_info, create_symbolic_link)
3196 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3197 New functions.
3198 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3199 in the argument file name.
3200 (sys_access): Call unc_volume_file_attributes only if
3201 GetFileAttributes fails with network-related error codes.
3202 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3203 have the required privileges.
3204 (get_file_security_desc_by_name): Rename from
3205 get_file_security_desc.
3206 (stat_worker): New function, with most of the guts of 'stat', and
3207 with addition of handling of symlinks and support for 'lstat'.
3208 If possible, get file's attributes and security information by
3209 handle, not by name. Produce S_IFLNK bit for symlinks, when
3210 called from 'lstat'.
3211 (stat, lstat): New functions, call 'stat_worker'.
3212 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3213 symlinks when the underlying filesystem supports them.
3214
3215 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3216
3217 Fix macroexp crash on Windows with debugging (Bug#12118).
3218 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3219 checking subscripts; problem introduced with the recent
3220 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3221 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3222 since it's used in non-static inline functions now.
3223
3224 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3225 Don't assume buffer size fits in 'int'. Remove unused local.
3226
3227 Use C99-style 'extern inline' if available.
3228 * buffer.h (BUFFER_INLINE):
3229 * category.h (CATEGORY_INLINE):
3230 * character.h (CHARACTER_INLINE):
3231 * charset.h (CHARSET_INLINE):
3232 * composite.h (COMPOSITE_INLINE):
3233 * dispextern.h (DISPEXTERN_INLINE):
3234 * lisp.h (LISP_INLINE):
3235 * systime.h (SYSTIME_INLINE):
3236 New macro, replacing 'static inline' in this header.
3237 * buffer.h, category.h, character.h, charset.h, composite.h:
3238 * dispextern.h, lisp.h, systime.h:
3239 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3240 * alloc.c (LISP_INLINE):
3241 * buffer.c (BUFFER_INLINE):
3242 * category.c (CATEGORY_INLINE):
3243 * character.c (CHARACTER_INLINE):
3244 * charset.c (CHARSET_INLINE):
3245 * composite.c (COMPOSITE_INLINE):
3246 * dispnew.c (DISPEXTERN_INLINE):
3247 * sysdep.c (SYSTIME_INLINE):
3248 Define to EXTERN_INLINE, so that the corresponding functions
3249 are compiled into code.
3250 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3251 (INLINE_HEADER_END): New macros.
3252 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3253 since it's used in non-static inline functions now.
3254 (VALMASK) [!USE_LSB_TAG]: Likewise.
3255
3256 2012-08-02 Glenn Morris <rgm@gnu.org>
3257
3258 * s/: Remove empty directory.
3259
3260 * s/ms-w32.h: Move to ../nt/inc.
3261 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3262 Update for new ms-w32.h location.
3263
3264 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3265
3266 Port to Solaris 8.
3267 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3268
3269 2012-08-02 Glenn Morris <rgm@gnu.org>
3270
3271 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3272 hard-coding the path separator.
3273
3274 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3275
3276 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3277 This how ASET and AREF are supposed to work, and makes
3278 it easier to think about future improvements. See
3279 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3280 * charset.h (set_charset_attr): New function.
3281 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3282 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3283 (aref_addr): New function. All uses of &AREF(...) changed.
3284 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3285 (set_hash_index): New functions. All lvalue-style uses of
3286 HASH_KEY etc. changed.
3287 * keyboard.c (set_prop): New function. All lvalue-style uses
3288 of PROP changed.
3289
3290 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3291
3292 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3293 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3294 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3295 * nsfns.m (ns_set_name_as_filename): Likewise.
3296 * nsmenu.m (ns_update_menubar): Likewise.
3297 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3298
3299 2012-08-01 Eli Zaretskii <eliz@gnu.org>
3300
3301 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3302 Adapt to latest changes in field names of the corresponding Lisp
3303 objects.
3304
3305 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3306
3307 2012-08-01 Glenn Morris <rgm@gnu.org>
3308
3309 * s/msdos.h: Remove file.
3310 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3311 * Makefile.in (S_FILE): Remove.
3312 (config_h): Remove S_FILE.
3313
3314 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3315
3316 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3317 Remove; moved to nt/config.nt.
3318
3319 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3320
3321 Use INTERNAL_FIELD for conses and overlays.
3322 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3323 Remove obsolete comment.
3324 (MVAR): New macro.
3325 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3326 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3327
3328 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3329
3330 Use INTERNAL_FIELD for symbols.
3331 * lisp.h (SVAR): New macro. Adjust users.
3332 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3333 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3334
3335 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3336
3337 Use INTERNAL_FIELD for processes.
3338 * process.h (PVAR): New macro. Adjust style.
3339 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3340 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3341
3342 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3343
3344 Use INTERNAL_FIELD for windows.
3345 * window.h (WVAR): New macro.
3346 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3347 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3348 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3349 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3350 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3351 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3352
3353 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3354
3355 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3356
3357 2012-08-01 Glenn Morris <rgm@gnu.org>
3358
3359 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3360 Move to configure.ac.
3361
3362 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
3363
3364 * makefile.w32-in (CONFIG_H): Update dependencies.
3365 (CONF_POST_H): New macro.
3366
3367 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3368
3369 2012-07-31 Glenn Morris <rgm@gnu.org>
3370
3371 * Makefile.in (S_FILE): No longer set by configure.
3372
3373 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3374 is available.
3375 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3376
3377 * process.h (NULL_DEVICE):
3378 * emacs.c (SEPCHAR):
3379 * editfns.c (USER_FULL_NAME): Let configure set them.
3380
3381 * s/README, s/template.h: Remove files.
3382
3383 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3384
3385 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3386 Move to configure.ac.
3387
3388 2012-07-31 Eli Zaretskii <eliz@gnu.org>
3389
3390 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3391 resulting renaming of 'struct frame' members.
3392
3393 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3394
3395 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3396 after introduction of FVAR.
3397
3398 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3399
3400 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3401
3402 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3403 instead of compositeToPoint.
3404 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3405
3406 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
3407
3408 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3409
3410 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3411 * lisp.h (INTERNAL_FIELD): New macro.
3412 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
3413 (BVAR): Change to use INTERNAL_FIELD.
3414 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3415 (KVAR): Change to use INTERNAL_FIELD.
3416 * frame.h (FVAR): New macro.
3417 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3418 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3419 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3420 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3421 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3422
3423 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3424
3425 Miscellaneous fixes for non-default X toolkits.
3426 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3427 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3428 Move under #ifdef USE_LUCID.
3429 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3430 definition and usage to avoid warnings.
3431
3432 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3433
3434 * nsterm.m (openFiles): Fix previous checkin.
3435
3436 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3437
3438 * indent.c (compute_motion): Remove unused local.
3439
3440 2012-07-31 Glenn Morris <rgm@gnu.org>
3441
3442 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3443
3444 * conf_post.h [USG5_4]:
3445 Move remaining contents of s/usg5-4-common.h here.
3446 * s/usg5-4-common.h: Remove file.
3447
3448 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3449 * s/irix6-5.h: Remove file.
3450
3451 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3452 * s/darwin.h: Remove file.
3453
3454 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3455 * s/hpux10-20.h: Remove file, which is now empty.
3456
3457 2012-07-30 Glenn Morris <rgm@gnu.org>
3458
3459 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3460 * Makefile.in (config_h): Add conf_post.h.
3461 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3462
3463 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3464
3465 * nsterm.m (ns_do_open_file): New variable.
3466 (ns_term_init): Set ns_do_open_file to YES after run returns.
3467 (openFile, openTempFile, openFileWithoutUI, openFiles):
3468 Open files only if ns_do_open_file.
3469
3470 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3471
3472 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3473 This no-op macro hasn't been needed for many years.
3474 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3475
3476 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3477 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3478 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3479 gdb_make_enums_visible.
3480 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3481 (DIRECTORY_SEP): Now a constant, not a macro.
3482
3483 2012-07-30 Eli Zaretskii <eliz@gnu.org>
3484
3485 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3486 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3487
3488 * w32term.c <w32_keyboard_codepage>: Renamed from
3489 keyboard_codepage and now external. All users changed.
3490
3491 * w32term.h: Add declaration of w32_keyboard_codepage.
3492
3493 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3494 the codepage to translate keys to Unicode. If this argument is
3495 -1, use the value returned by GetConsoleCP. All callers changed.
3496
3497 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3498
3499 Update .PHONY listings in makefiles.
3500 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3501 bootstrap-clean, distclean, maintainer-clean, versioclean,
3502 extraclean, frc.
3503
3504 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3505 This is a bit clearer. Fix some commentary typos.
3506
3507 2012-07-30 Glenn Morris <rgm@gnu.org>
3508
3509 * s/netbsd.h: Let configure include signal.h if needed.
3510 Remove file, which is now empty.
3511
3512 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3513 Let configure set them.
3514 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3515 No more need to undefine.
3516
3517 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3518
3519 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3520 non-single-byte char when adding meta modifier. (Bug#12090)
3521
3522 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3523
3524 Convert safe_call to use variable number of arguments.
3525 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3526 (safe_call2): Fix comment.
3527 * lisp.h (safe_call): Adjust prototype.
3528 * coding.c (encode_coding_object): Change to use safe_call2.
3529 * xfaces.c (merge_face_heights): Change to use safe_call1.
3530
3531 2012-07-30 Glenn Morris <rgm@gnu.org>
3532
3533 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
3534 does that unconditionally. Remove file, which is now empty.
3535
3536 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3537 Remove empty files.
3538
3539 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3540
3541 Export to GDB most of lisp.h's remaining object-like macros.
3542 * lisp.h (min, max): Move earlier, because they're used earlier now.
3543 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3544 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3545 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3546 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3547 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3548 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3549 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3550 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3551 Now constants, for GDB. They need not be macros.
3552 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3553 Now constants, for GDB, as well as macros, for static initializers.
3554 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3555 Move to after the definition of struct Lisp_Char_Table,
3556 since the former now needs that type defined.
3557 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3558 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3559 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3560 New enums, for gdb_make_enums_visible.
3561 (GLYPH_MODE_LINE_FACE): Remove; unused.
3562 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3563 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3564 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3565 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3566 enum maxargs, enum MAX_ALLOCA.
3567 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3568 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3569 no longer needed, now that they are done in lisp.h.
3570
3571 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3572
3573 Cleanup string bytes checking.
3574 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3575 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3576 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3577 (check_sblock, compact_small_strings): Simplify.
3578
3579 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3580
3581 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3582 These macros are confusing and no longer need to be defined, as
3583 the enum values now suffice. All uses replaced with definiens.
3584 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3585
3586 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3587
3588 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3589 ($(BLD)/w32console.$(O)): Update dependencies.
3590
3591 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3592
3593 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3594 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3595 time. Adjust users.
3596 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3597
3598 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3599
3600 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3601 setting sitelisp (Bug#12010).
3602
3603 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3604
3605 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3606
3607 * w32heap.c (cache_system_info):
3608 * w32.c (sys_rename):
3609 * w32proc.c (find_child_console, sys_kill): All users changed.
3610
3611 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3612
3613 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3614
3615 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3616
3617 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3618
3619 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3620
3621 Cleanup statistics calculation in Fgarbage_collect.
3622 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3623 Fix zombies percentage calculation. Simplify elapsed time calculation.
3624
3625 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3626
3627 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3628 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3629 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3630 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3631 (replace_range, replace_range_2, del_range_2): Change to eassert.
3632 * marker.c (byte_char_debug_check): Adjust style.
3633
3634 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3635
3636 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3637 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3638 long-ago-commented-out code that talks about "WIN32".
3639 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3640 All uses changed.
3641
3642 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3643
3644 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3645 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3646 Simplify by using alignof.
3647 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3648 * lisp.h: Include <stdalign.h>.
3649 (GCALIGNMENT): New macro and constant.
3650 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3651 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3652 (stdalign): New macro, if not already defined.
3653
3654 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3655
3656 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3657 * w32inevt.c: Include w32inevt.h.
3658 (w32_read_console_input): New inline function, calls either
3659 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3660 w32_console_unicode_input.
3661 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3662 (w32_kbd_patch_key, key_event): Use the codepage returned by
3663 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3664 (key_event): use uChar.UnicodeChar only if
3665 w32_console_unicode_input is non-zero.
3666
3667 * w32console.c: Include w32heap.h.
3668 <w32_console_unicode_input>: New global variable.
3669 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3670 family of Windows, zero otherwise.
3671
3672 * w32inevt.h: Declare w32_console_unicode_input.
3673
3674 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3675 --without-x. (Bug#11742)
3676
3677 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3678
3679 Adjust GDB to reflect pvec_type changes (Bug#12036).
3680 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3681 2012-07-04 changes to pseudovector representation.
3682 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3683
3684 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3685
3686 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3687 bus address.
3688 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3689
3690 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3691
3692 * alloc.c (listn): Fix the order the arguments are consed onto the
3693 list.
3694
3695 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3696 enumeration constants, as PURE and HEAP are too general, and clash
3697 with other headers and sources, such as gmalloc.c and the
3698 MS-Windows system headers. All users changed.
3699
3700 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3701
3702 Revert last save_excursion_save and save_excursion_restore changes.
3703 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3704 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3705
3706 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3707
3708 Fix recently-introduced typos in Windows port.
3709 Reported by Martin Rudalics <rudalics@gmx.at>.
3710 * w32.c (init_environment): Replace comma with semicolon.
3711 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3712
3713 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3714
3715 Improve GDB symbol export (Bug#12036).
3716 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3717 arms of an 'if', not using conditional expressions; otherwise GDB
3718 complains about the types in the unevaluated arm when the argument
3719 is an integer literal.
3720 (xgetint): Simplify expression.
3721 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3722 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3723 Zaretskii in <http://bugs.gnu.org/12036#13>.
3724 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3725 needed now that we have gdb_make_enums_visible.
3726 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3727 (enum enum_USE_LSB_TAG):
3728 New enum types, packaging up enums that need to be exported to GDB.
3729
3730 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3731
3732 Utility function to make a list from specified amount of objects.
3733 * lisp.h (enum constype): New datatype.
3734 (listn): New prototype.
3735 * alloc.c (listn): New function.
3736 (Fmemory_use_count, syms_of_alloc): Use it.
3737 * buffer.c (syms_of_buffer): Likewise.
3738 * callint.c (syms_of_callint): Likewise.
3739 * charset.c (define_charset_internal): Likewise.
3740 * coding.c (syms_of_coding): Likewise.
3741 * keymap.c (syms_of_keymap): Likewise.
3742 * search.c (syms_of_search): Likewise.
3743 * syntax.c (syms_of_syntax): Likewise.
3744 * w32.c (init_environment): Likewise.
3745 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3746 * xdisp.c (syms_of_xdisp): Likewise.
3747 * xfns.c (syms_of_xfns): Likewise.
3748
3749 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3750
3751 Fast save_excursion_save and save_excursion_restore.
3752 * lisp.h (struct Lisp_Excursion): New data type.
3753 (PVEC_EXCURSION): New pseudovector type.
3754 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3755 to deal with it. Adjust comments.
3756 (init_marker, attach_marker): New prototype.
3757 (unchain_marker): Adjust prototype.
3758 * marker.c (attach_marker): Change to global.
3759 (init_marker): New function.
3760 * alloc.c (Fmake_marker, build_marker): Use it.
3761 (build_marker): More easserts.
3762 (mark_object): Handle struct Lisp_Excursion.
3763 * editfns.c (save_excursion_save, save_excursion_restore):
3764 Reimplement to use struct Lisp_Excursion. Add comments.
3765
3766 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3767
3768 Fix export of symbols to GDB (Bug#12036).
3769 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3770 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3771 emacs.c, as this is a more-suitable home. Had this been done earlier
3772 the fix for 12036 would have avoided some of the problems noted in
3773 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3774 would have been more obvious.
3775 * emacs.c: Do not include <verify.h>; no longer needed.
3776 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3777 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3778 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3779 Remove; now done in lisp.h.
3780 * lisp.h (PUBLISH_TO_GDB): New macro.
3781 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3782 (DATA_SEG_BITS): Use it.
3783 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3784 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3785 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3786 not be usable in #if. This simplifies things.
3787
3788 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3789
3790 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3791
3792 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3793
3794 Simplify export of symbols to GDB (Bug#12036).
3795 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3796 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3797 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3798 Adjust to changes in lisp.h and emacs.c, by using
3799 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3800 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3801 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3802 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3803 instead of gdb_valbits.
3804 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3805 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3806 instead of gdb_array_mark_flag.
3807 (xboolvector): Get size from $->size, not $->header.size.
3808 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3809 (xreload, hook-run, hookpost-run): Remove.
3810 * emacs.c: Include <verify.h>.
3811 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3812 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3813 Remove.
3814 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3815 (gdb_USE_LSB_TAG): New enum constants.
3816 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3817 Also define these as enum constants, so they're visible to GDB.
3818 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3819 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3820 as constants, so they're visible to GDB.
3821 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3822 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3823 Now enum constants, not macros, so they're visible to GDB.
3824 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3825 more convenient now. All uses changed.
3826 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3827 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3828
3829 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3830
3831 Explicitly free restriction data that are not needed anymore.
3832 * editfns.c (save_restriction_restore): Free restriction data.
3833
3834 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3835
3836 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3837 add argument, tune behavior, and adjust all callers.
3838
3839 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3840
3841 Use typedef for EMACS_INT, EMACS_UINT.
3842 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3843 than macros. This simplifies debugging in the usual case, since
3844 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3845 and it allows expressions involving EMACS_INT casts.
3846 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3847
3848 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3849
3850 * nsterm.m (ns_read_socket): Return early if there is a modal
3851 window (Bug#12043).
3852
3853 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3854
3855 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3856 that FOCUS-FRAME can be omitted.
3857
3858 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3859
3860 Adjust buffer text indirection counters at the end of Fkill_buffer.
3861 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3862 buffer is definitely dead. This should really fix an issue reported
3863 by Christoph Scholtes again. (Bug#12007).
3864 (init_buffer_once): Initialize indirection counters of
3865 buffer_defaults and buffer_local_symbols (for sanity and safety).
3866
3867 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3868
3869 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3870 and continuation glyphs on tooltip frames, leave them at zero.
3871 Avoids continued lines in tooltips. (Bug#11832)
3872
3873 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3874
3875 Simplify copy_overlay.
3876 * buffer.c (copy_overlay): Simplify. Use build_marker.
3877 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3878
3879 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3880
3881 * print.c (print_object): Don't crash when a frame's name is nil
3882 or invalid. (Bug#12025)
3883
3884 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3885 it signals an error when a tooltip frame is being created.
3886
3887 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3888
3889 Cleanup miscellaneous objects allocation and initialization.
3890 * alloc.c (allocate_misc): Change to static. Add argument to
3891 specify the subtype. Adjust comment and users.
3892 (build_overlay): New function.
3893 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3894 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3895 (allocate_misc): Remove prototype.
3896 (build_overlay): Add prototype.
3897
3898 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3899
3900 Swap buffer text indirection counters in Fbuffer_swap_text.
3901 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3902 This avoids crash reported by Christoph Scholtes at
3903 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3904
3905 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3906
3907 * nsmenu.m (Popdown_data): New struct.
3908 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3909 free Popdown_data.
3910 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3911 (initWithContentRect): Make imgView and contentView non-static
3912 and autorelease them. Also autorelease img and matrix (Bug#12005).
3913 (dealloc): Remove (Bug#12005).
3914
3915 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3916
3917 Adjust consing_since_gc when objects are explicitly freed.
3918 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3919 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3920 (free_cons, free_misc): Subtract object size from consing_since_gc.
3921
3922 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3923
3924 Simplify and cleanup markers positioning code.
3925 * marker.c (attach_marker): More useful eassert.
3926 (live_buffer, set_marker_internal): New function.
3927 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3928 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3929
3930 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3931
3932 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3933 as it's limited by the amount of memory, not by INT_MAX.
3934
3935 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3936
3937 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3938 in special-event-map. See the discussion at
3939 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3940 for the reasons.
3941
3942 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3943 info.dwItemData. Fixes crashes on 64-bit Windows.
3944 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3945
3946 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3947
3948 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3949 (conversationIdentifier): Return value is NSInteger.
3950 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3951
3952 2012-07-21 Chong Yidong <cyd@gnu.org>
3953
3954 * window.c (decode_any_window): Signal an error if the window is
3955 on a dead frame (Bug#11984).
3956
3957 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3958
3959 Add indirection counting to speed up Fkill_buffer.
3960 * buffer.h (struct buffer): New member.
3961 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3962 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3963 base buffer indirection counter.
3964 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3965 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3966 through buffer list if indirection counter is 0.
3967
3968 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3969
3970 Extend the value returned by Fgarbage_collect with heap statistics.
3971 * alloc.c (Qheap): New symbol.
3972 (syms_of_alloc): DEFSYM it.
3973 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3974 (Fmemory_free): Remove.
3975 (syms_of_alloc): Don't defsubr it.
3976 * buffer.c (Fcompact_buffer): Remove.
3977 (syms_of_buffer): Don't defsubr it.
3978
3979 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3980
3981 Make maybe_gc inline.
3982 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3983 * lisp.h (consing_since_gc, gc_relative_threshold)
3984 (memory_full_cons_threshold): Revert declaration.
3985 (maybe_gc): Remove prototype, define as inline.
3986 * alloc.c: Remove old commented-out code.
3987 (consing_since_gc, gc_relative_threshold)
3988 (memory_full_cons_threshold): Revert to global.
3989 (maybe_gc): Remove.
3990
3991 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3992
3993 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3994 * lisp.h (build_unibyte_string): New function.
3995 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3996 * sysdep.c, w32fns.c, xfns.c: Use it.
3997 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3998 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3999 Adjust users accordingly.
4000 * font.h (font_open_by_name): Adjust prototype.
4001
4002 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4003
4004 Cleanup calls to Fgarbage_collect.
4005 * lisp.h (maybe_gc): New prototype.
4006 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4007 Remove declarations.
4008 * alloc.c (maybe_gc): New function.
4009 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4010 Make them static.
4011 * bytecode.c (MAYBE_GC): Use maybe_gc.
4012 * eval.c (eval_sub, Ffuncall): Likewise.
4013 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4014 to avoid dependency from auto-save feature.
4015
4016 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4017
4018 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4019 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4020 'for_each_per_buffer_object_at'.
4021 All uses changed. It's better to use upper-case for macros that
4022 cannot be implemented as functions, to give the reader a clue
4023 that they're special.
4024
4025 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4026
4027 * alloc.c (Fgarbage_collect): Tweak docstring.
4028
4029 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4030
4031 Tweak the value returned from Fgarbage_collect again.
4032 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4033 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4034 Adjust documentation.
4035 (total_vector_bytes): Rename to total_vector_slots, adjust
4036 accounting.
4037 (total_free_vector_bytes): Rename to total_free_vector_slots,
4038 adjust accounting.
4039 (Qstring_bytes, Qvector_slots): New symbols.
4040 (syms_of_alloc): DEFSYM them.
4041
4042 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4043
4044 Buffer compaction primitive which may be used from Lisp.
4045 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4046 (syms_of_buffer): Register Fcompact_buffer.
4047 * alloc.c (Fgarbage_collect): Use compact_buffer.
4048 * buffer.h (compact_buffer): New prototype.
4049 (struct buffer_text): New member.
4050
4051 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4052
4053 New macro to iterate over all buffers, miscellaneous cleanups.
4054 * lisp.h (all_buffers): Remove declaration.
4055 * buffer.h (all_buffers): Add declaration, with comment.
4056 (for_each_buffer): New macro.
4057 * alloc.c (Fgarbage_collect, mark_object): Use it.
4058 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4059 (init_buffer): Likewise.
4060 * data.c (Fset_default): Likewise.
4061 * coding.c (code_conversion_restore): Remove redundant check
4062 for dead buffer.
4063 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4064
4065 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4066
4067 Fix bug that created negative-length intervals.
4068 * intervals.c (merge_interval_right, merge_interval_left):
4069 Do not zero out this interval if it is absorbed by its children,
4070 as this interval's total length doesn't change in that case. See
4071 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4072
4073 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4074
4075 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4076 when invoking (make-bool-vector N t) and N is a positive
4077 multiple of 8 -- the last 8 bits were mistakenly cleared.
4078
4079 Remove some struct layout assumptions in bool vectors.
4080 * alloc.c (bool_header_size): New constant.
4081 (header_size, word_size): Move earlier, as they're now used earlier.
4082 Use 'word_size' in a few more places, where it's appropriate.
4083 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4084 padding before the data member of a bool vector.
4085 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4086 than doing the check by hand with an abort ().
4087
4088 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4089
4090 * eval.c (Fdefvar): Don't check constants since we only set the var if
4091 it's not yet defined anyway (bug#11904).
4092
4093 * lisp.h (last_undo_boundary): Declare new var.
4094 * keyboard.c (command_loop_1): Set it.
4095 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4096 were auto-added by the command loop (bug#11774).
4097
4098 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4099
4100 * w32font.c (Qsymbol): Remove local definition.
4101 (syms_of_w32font): Don't DEFSYM it.
4102
4103 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4104
4105 Fix sweep_vectors to handle large bool vectors correctly.
4106 * alloc.c (sweep_vectors): Account total_vector_bytes for
4107 bool vectors larger than VBLOCK_BYTES_MAX.
4108
4109 2012-07-18 Chong Yidong <cyd@gnu.org>
4110
4111 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4112 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4113
4114 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4115
4116 Return more descriptive data from Fgarbage_collect.
4117 Suggested by Stefan Monnier in
4118 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4119 * alloc.c (bounded_number): New function.
4120 (total_buffers, total_vectors): New variable.
4121 (total_string_size): Rename to total_string_bytes, adjust users.
4122 (total_vector_size): Rename to total_vector_bytes, adjust users.
4123 (sweep_vectors): Account total_vectors and total_vector_bytes.
4124 (Fgarbage_collect): New return value. Adjust documentation.
4125 (gc_sweep): Account total_buffers.
4126 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4127 (VECTOR_SIZE): Remove.
4128 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4129 (Qinterval, Qmisc): New symbols.
4130 (syms_of_data): Initialize them.
4131 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4132 (Qcons, Qbuffer): New declarations.
4133
4134 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4135
4136 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4137 Round up, not down. Improve doc.
4138
4139 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4140
4141 Restore old code in allocate_string_data to avoid Faset breakage.
4142 Reported by Julien Danjou <julien@danjou.info> in
4143 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4144 * alloc.c (allocate_string_data): Restore old code with minor
4145 adjustments, fix comment to explain this subtle issue.
4146
4147 2012-07-17 Eli Zaretskii <eliz@gnu.org>
4148
4149 Remove FILE_SYSTEM_CASE.
4150 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4151
4152 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4153 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4154 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4155 call-process-region passes it through expand-file-name.
4156
4157 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4158
4159 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4160
4161 Fix crash when creating indirect buffer (Bug#11917)
4162 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4163 Don't handle unbound variables specially if non-zero.
4164 (Fbuffer_local_variables): Pass zero.
4165 (clone_per_buffer_values): Pass non-zero.
4166
4167 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4168
4169 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4170 to make the loop interruptible.
4171
4172 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4173
4174 * gnutls.c (emacs_gnutls_handshake): Only retry if
4175 GNUTLS_E_INTERRUPTED.
4176
4177 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4178
4179 Cleanup and convert miscellaneous checks to eassert.
4180 * alloc.c (mark_interval): Fix comment, partially rephrase
4181 old comment from intervals.h (see below).
4182 * intervals.c (find_interval, adjust_intervals_for_insertion)
4183 (delete_interval, adjust_intervals_for_deletion)
4184 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4185 Convert to eassert.
4186 (adjust_intervals_for_insertion, make_new_interval):
4187 Remove obsolete and unused code.
4188 * intervals.h (struct interval): Remove obsolete comment.
4189 * textprotp.c (erase_properties): Remove unused code.
4190 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4191 (Fremove_list_of_text_properties): Convert to eassert.
4192
4193 2012-07-17 Chong Yidong <cyd@gnu.org>
4194
4195 * editfns.c (Finsert_char): Doc fix.
4196
4197 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4198
4199 Fix previous change to make Fmemory_free always accurate.
4200 * alloc.c (make_interval): Update total_free_intervals.
4201 (make_float): Likewise for total_free_floats.
4202 (free_cons, Fcons): Likewise for total_free_conses.
4203 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4204 Likewise for total_free_vector_bytes.
4205 (Fmake_symbol): Likewise for total_free_symbols.
4206 (bytes_free): Remove.
4207
4208 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4209
4210 Simple free memory accounting feature.
4211 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4212 (sweep_vectors): Accumulate size of free vectors.
4213 (Fgarbage_collect): Setup bytes_free.
4214 (Fmemory_free): New function.
4215 (syms_of_alloc): Register it.
4216
4217 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4218
4219 Cleanup overlays checking.
4220 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4221 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4222 eassert and OVERLAYP.
4223 (sort_overlays): Change to use OVERLAYP.
4224
4225 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4226
4227 * editfns.c (Finsert_char): Make it interactive, and make the
4228 second arg optional. Copy interactive spec and docstring from
4229 ucs-insert.
4230
4231 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4232
4233 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4234 Unlike the other wrapped functions, fabs has an unspecified
4235 effect on errno.
4236
4237 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4238
4239 * nsterm.m (keyDown): Interpret flags without left/right bits
4240 as the left key (Bug#11670).
4241
4242 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4243
4244 Remove empty and useless init functions.
4245 * lisp.h (init_character_once, init_fns, init_image)
4246 (init_filelock, init_sound): Remove prototype.
4247 * character.c (init_character_once): Remove.
4248 * filelock.c (init_filelock): Likewise.
4249 * fns.c (init_fns): Likewise.
4250 * image.c (init_image): Likewise.
4251 * sound.c (init_sound): Likewise.
4252 * emacs.c (main): Adjust accordingly.
4253
4254 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4255
4256 * gtkutil.h: Tiny cleanups.
4257 (use_old_gtk_file_dialog): Remove useless declaration.
4258 (xg_uses_old_file_dialog): Add suggested const attribute.
4259
4260 2012-07-15 Eli Zaretskii <eliz@gnu.org>
4261
4262 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4263 (bidi_paragraph_init): Use it to limit search forward for a strong
4264 directional character in abnormally large paragraphs full of
4265 neutral or weak characters. (Bug#11943)
4266
4267 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4268
4269 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4270 the toolbar (Bug#9451).
4271 (xg_make_tool_item): Give the widget event box a transparent
4272 background.
4273
4274 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4275
4276 Cleanup basic allocation variables and functions.
4277 * alloc.c (ignore_warnings, init_intervals, init_float)
4278 (init_cons, init_symbol, init_marker): Remove.
4279 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4280 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4281 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4282 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4283 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4284 (staticidx, init_alloc_once, init_strings, free_ablock):
4285 Remove redundant initialization.
4286 * fns.c (init_weak_hash_tables): Remove.
4287 * lisp.h (init_weak_hash_tables): Remove prototype.
4288
4289 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4290
4291 Use zero_vector where appropriate.
4292 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4293 accordingly.
4294 * lisp.h (zero_vector): New declaration.
4295 * font.c (null_vector): Remove.
4296 (syms_of_font): Remove initialization and staticpro.
4297 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4298 * keymap.c (Faccessible_keymaps): Likewise.
4299
4300 2012-07-15 Leo Liu <sdl.web@gmail.com>
4301
4302 * fringe.c: Fix typo in comments.
4303
4304 2012-07-14 Leo Liu <sdl.web@gmail.com>
4305
4306 * fringe.c: Add a new bitmap exclamation-mark.
4307
4308 2012-07-14 Eli Zaretskii <eliz@gnu.org>
4309
4310 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4311
4312 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4313 (HAVE_MENUS): Don't define, defined by editing config.in with
4314 msdos/sed2v2.inp.
4315 (GMALLOC_INHIBIT_VALLOC): Don't define.
4316 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4317
4318 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
4319
4320 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4321
4322 2012-07-14 Glenn Morris <rgm@gnu.org>
4323
4324 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4325 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4326 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4327
4328 2012-07-13 Glenn Morris <rgm@gnu.org>
4329
4330 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4331
4332 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4333 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4334
4335 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4336
4337 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4338 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4339 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4340 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4341 where appropriate.
4342 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4343 as boolean expression.
4344 (x_set_window_size): Remove unused variable toolbar.
4345 (ns_get_color_default, ns_mod_to_lisp): Remove.
4346 (ns_mouse_position): Remove unused variables xchar and ychar.
4347 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4348 (ns_set_vertical_scroll_bar): Remove unused variable count.
4349 (ns_delete_terminal): Remove unused variable i.
4350 (ns_term_init): Remove unused variables r, g and b.
4351 (mouseDown): Remove unused variable window.
4352 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4353 (initFrameFromEmacs): Remove unused variable vbextra.
4354 (mouseEntered): Remove unused variables p and dpyinfo.
4355 (mouseExited): Remove unused variables p and r.
4356 (ns_define_frame_cursor, ns_clear_frame_area)
4357 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4358 (menuDown): Assign [sender tag] to variable and cast the variable.
4359
4360 * nsterm.h (menuDown): Add id as type to argument sender.
4361 (ns_display_info_for_name): Add Lisp_Object argument.
4362 (ns_term_init): Add Lisp_Object argument.
4363 (ns_map_event_to_object): Add void argument.
4364 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4365 prototype with arguments and only declare if __OBJC__.
4366 (nxatoms_of_nsselect): Add void argument.
4367 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4368 (ns_alloc_autorelease_pool): Add void argument.
4369 (ns_release_autorelease_pool): Add void* argument.
4370 (ns_get_defaults_value): Add const char* argument.
4371
4372 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4373 (initFromContents): Use SSDATA where appropriate.
4374 (ns_update_menubar): Add braces to ambigous if-else.
4375 (initWithTitle): Put () around assignment in if statement.
4376 (ns_menu_show): Remove unused variables window and keymap.
4377 (update_frame_tool_bar): Remove unused variable selected_p.
4378 (initWithContentRect): Remove unused variable this_cmd_name.
4379
4380 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4381 appropriate.
4382 (setXBMColor): Remove unused variable len.
4383 (setPixmapData): Put () around assignment in loop statement.
4384
4385 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4386 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4387 where appropriate.
4388 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4389 around assignment in loop statement.
4390 (nsfont_open): Remove unused variable i.
4391 (nsfont_open): Remove unused variable len.
4392 (nsfont_draw): Remove unused variable cs.
4393
4394 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4395 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4396 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4397 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4398 (Fns_font_name, Fns_perform_service)
4399 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4400 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4401 (ns_set_name): Remove unused variable view.
4402 (x_set_menu_bar_lines): Remove unused variable olines.
4403 (x_set_tool_bar_lines): Remove unused variable root_window.
4404 (Fns_list_colors): Put () around assignment in while statement.
4405 (Fns_perform_service): Remove unused variable len.
4406 (Fns_display_usable_bounds): Remove unused variable top.
4407 (syms_of_nsfns): Remove unused variable i.
4408
4409 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4410 memcpy (Bug#11907).
4411
4412 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
4413
4414 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4415 and free it with DestroyExceptionInfo (Bug#11558).
4416
4417 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
4418
4419 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4420 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4421 Set here, not in nt/config.nt.
4422
4423 2012-07-13 Eli Zaretskii <eliz@gnu.org>
4424
4425 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4426 cursor overflow into the last glyph on display line when the right
4427 fringe is off. (Bug#11832)
4428
4429 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4430
4431 * xdisp.c (produce_special_glyphs): Now static.
4432 * dispextern.h (produce_special_glyphs): Remove decl.
4433
4434 2012-07-13 Glenn Morris <rgm@gnu.org>
4435
4436 * s/bsd-common.h, s/cygwin.h: Remove empty files.
4437 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4438
4439 * s/usg5-4-common.h (USG, USG5):
4440 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4441 * s/sol2-6.h (SOLARIS2):
4442 * s/irix6-5.h (IRIX6_5):
4443 * s/hpux10-20.h (USG, USG5, HPUX):
4444 * s/gnu-linux.h (USG, GNU_LINUX):
4445 * s/freebsd.h (BSD_SYSTEM):
4446 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4447 * s/cygwin.h (CYGWIN):
4448 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4449 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4450
4451 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
4452
4453 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
4454
4455 2012-07-13 Glenn Morris <rgm@gnu.org>
4456
4457 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4458
4459 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4460
4461 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4462 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4463
4464 2012-07-12 Glenn Morris <rgm@gnu.org>
4465
4466 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
4467
4468 * process.c (init_process_emacs): Rename from init_process.
4469 The old name is also the name of a Mach system call.
4470 * lisp.h, emacs.c: Update for this name change.
4471 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4472 longer needed.
4473
4474 2012-07-12 Eli Zaretskii <eliz@gnu.org>
4475
4476 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4477 memmove call that removes glyphs covered by the left truncation
4478 glyph. Improve commentary.
4479 (display_line): Fix display of continuation glyphs on GUI frames
4480 when the right fringe is turned off and variable-size fonts are
4481 used in the window. Move the code that appends a stretch glyph to
4482 produce_special_glyphs, so that it could be used for truncation
4483 and continuation glyphs alike.
4484 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4485 glyph of a suitably computed width, to align the special glyphs at
4486 the window margin. Code moved from display_line. (Bug#11832)
4487
4488 2012-07-12 Glenn Morris <rgm@gnu.org>
4489
4490 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4491
4492 * s/gnu-linux.h, s/hpux10-20.h:
4493 Do not unconditionally define HAVE_XRMSETDATABASE.
4494
4495 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4496
4497 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4498
4499 Fix typos that broke OS X build.
4500 Reported by Randal L. Schwartz in
4501 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4502 * nsterm.m (ns_timeout): Add missing local decl.
4503 (ns_get_color): snprintf -> sprintf, to fix typo.
4504
4505 2012-07-12 Glenn Morris <rgm@gnu.org>
4506
4507 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4508 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4509 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4510 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4511
4512 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4513 Move PTY_OPEN to configure.
4514
4515 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4516 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4517 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4518
4519 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4520
4521 Use empty_unibyte_string where applicable.
4522 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4523 * lread.c (read1): Likewise.
4524 * xsettings.c (syms_of_xsettings): Likewise.
4525
4526 2012-07-12 Glenn Morris <rgm@gnu.org>
4527
4528 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4529 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
4530 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4531 * s/hpux10-20.h (RUN_TIME_REMAP):
4532 * s/bsd-common.h (TABDLY): Move to configure.
4533
4534 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4535
4536 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4537
4538 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4539 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
4540
4541 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
4542
4543 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4544 * s/template.h: Move NARROWPROTO to configure.
4545
4546 2012-07-11 Glenn Morris <rgm@gnu.org>
4547
4548 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4549 unused since 2011-01-17 change to systty.h.
4550
4551 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4552 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4553 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4554
4555 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4556
4557 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4558
4559 2012-07-11 Glenn Morris <rgm@gnu.org>
4560
4561 * s/darwin.h, s/gnu-linux.h, s/template.h:
4562 Move INTERRUPT_INPUT to configure.
4563
4564 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4565
4566 Minor adjustments to interning code.
4567 * lisp.h (intern, intern_c_string): Redefine as static inline
4568 wrappers for intern_1 and intern_c_string_1, respectively.
4569 (intern_1, intern_c_string_1): Rename prototypes.
4570 * lread.c (intern_1, intern_c_string_1, oblookup):
4571 Simplify Vobarray checking.
4572 * font.c (font_intern_prop): Likewise. Adjust comment.
4573 * w32font.c (intern_font_name): Likewise.
4574
4575 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4576
4577 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4578
4579 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4580 of Fcar/Fcdr if possible.
4581 * font.c (check_otf_features): Likewise.
4582 * fontset.c (Fnew_fontset): Likewise.
4583 * gnutls.c (Fgnutls_boot): Likewise.
4584 * minibuf.c (read_minibuf): Likewise.
4585 * msdos.c (IT_set_frame_parameters): Likewise.
4586 * xmenu.c (Fx_popup_dialog): Likewise.
4587 * w32menu.c (Fx_popup_dialog): Likewise.
4588
4589 2012-07-11 Glenn Morris <rgm@gnu.org>
4590
4591 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4592 since nothing has defined it on these platforms.
4593
4594 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4595 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4596
4597 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4598 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4599 Move CLASH_DETECTION to configure.
4600
4601 * s/gnu.h: Remove file, which is now empty.
4602
4603 * s/gnu.h, s/gnu-linux.h:
4604 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4605
4606 2012-07-11 John Wiegley <johnw@newartisans.com>
4607
4608 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4609 function attribute, so we only use it if it exists in the
4610 compiler.
4611
4612 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4613
4614 Avoid call to strlen in fast_c_string_match_ignore_case.
4615 * search.c (fast_c_string_match_ignore_case): Change to use
4616 length argument. Adjust users accordingly.
4617 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4618
4619 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4620
4621 Assume mkdir, rmdir.
4622 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4623 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4624
4625 Assume rename.
4626 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4627
4628 Assume perror.
4629 * s/hpux10-20.h (HAVE_PERROR): Remove.
4630 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4631 Remove dummy definition, as this problem was obsolete long ago.
4632
4633 Assume strerror.
4634 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4635
4636 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4637
4638 Avoid calls to strlen in font processing functions.
4639 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4640 (font_open_by_name): Change to use length argument.
4641 Adjust users accordingly.
4642 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4643 Adjust prototypes.
4644 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4645 Change to return ptrdiff_t.
4646 (xfont_list_pattern, xfont_match): Use length returned by
4647 xfont_decode_coding_xlfd.
4648 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4649
4650 2012-07-11 Glenn Morris <rgm@gnu.org>
4651
4652 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4653 Move DONT_REOPEN_PTY to configure.
4654
4655 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4656 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4657
4658 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4659
4660 Remove "#define unix" that is no longer needed (Bug#11905).
4661 * s/aix4-2.h (unix): Remove; no longer needed.
4662
4663 EMACS_TIME simplification (Bug#11875).
4664 This replaces macros (which typically do not work in GDB)
4665 with functions, typedefs and enums, making the code easier to debug.
4666 The functional style also makes code easier to read and maintain.
4667 * systime.h: Include <sys/time.h> on all hosts, not just if
4668 WINDOWSNT, since 'struct timeval' is needed in general.
4669 (EMACS_TIME): Now a typedef, not a macro.
4670 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4671 not macros.
4672 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4673 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4674 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4675 (EMACS_TIME_LE): Now functions, not macros.
4676 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4677 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4678 which are not functions. All uses rewritten to use:
4679 (make_emacs_time): New function.
4680 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4681 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4682 not functions. All uses rewritten to use the following, respectively:
4683 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4684 (add_emacs_time, sub_emacs_time): New functions.
4685 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4686 * fileio.c (Fcopy_file):
4687 * xterm.c (XTflash): Get the current time closer to when it's used.
4688 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4689
4690 * bytecode.c (targets): Suppress -Woverride-init warnings.
4691
4692 Simplify by avoiding confusing use of strncpy etc.
4693 * doc.c (Fsnarf_documentation):
4694 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4695 * frame.c (Fmake_terminal_frame):
4696 * gtkutil.c (get_utf8_string):
4697 * lread.c (openp):
4698 * nsmenu.m (ns_update_menubar):
4699 * regex.c (regerror):
4700 Prefer memcpy to strncpy and strncat when either will do.
4701 * fileio.c (Fsubstitute_in_file_name):
4702 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4703 (menu_separator_name_p):
4704 * nsmenu.m (ns_update_menubar):
4705 Prefer memcmp to strncmp when either will do.
4706 * nsterm.m: Include <ftoastr.h>.
4707 (ns_get_color):
4708 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4709 Prefer snprintf to strncpy.
4710 * nsterm.m (ns_term_init):
4711 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4712 * nsterm.m (ns_term_init):
4713 Avoid the need for strncpy, by using build_string or
4714 make_unibyte_string directly. Use dtoastr, not snprintf.
4715 * process.c (Fmake_network_process): Diagnose service names that
4716 are too long, rather than silently truncating them or creating
4717 non-null-terminated names.
4718 (Fnetwork_interface_info): Likewise, for interface names.
4719 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4720 Prefer sprintf to strncat.
4721 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4722 Prefer vsnprintf to vsprintf + strncpy.
4723
4724 2012-07-10 Glenn Morris <rgm@gnu.org>
4725
4726 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4727 Clarify fallback case.
4728
4729 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4730
4731 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4732 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4733 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4734 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4735 where argument type is known to be a Lisp_Cons.
4736
4737 2012-07-10 Tom Tromey <tromey@redhat.com>
4738
4739 * bytecode.c (BYTE_CODE_THREADED): New macro.
4740 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4741 (enum byte_code_op): New type.
4742 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4743 (exec_byte_code): Use them. Use token threading when applicable.
4744
4745 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4746
4747 Optimize pure C strings initialization.
4748 * lisp.h (make_pure_string): Fix prototype.
4749 (build_pure_c_string): New function, defined as static inline. This
4750 provides a better opportunity to optimize away calls to strlen when
4751 the function is called with compile-time constant argument.
4752 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4753 argument, adjust users accordingly. Use build_pure_c_string where
4754 appropriate.
4755 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4756 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4757 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4758
4759 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4760
4761 Avoid calls to strlen in miscellaneous functions.
4762 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4763 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4764 * lread.c (openp): Likewise.
4765
4766 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4767
4768 Avoid calls to strlen in path processing functions.
4769 * fileio.c (file_name_as_directory): Add comment. Change to add
4770 srclen argument and return the length of result. Adjust users
4771 accordingly.
4772 (directory_file_name): Fix comment. Change to add srclen argument,
4773 swap 1st and 2nd arguments to obey the common convention.
4774 Adjust users accordingly.
4775 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4776
4777 2012-07-10 Glenn Morris <rgm@gnu.org>
4778
4779 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4780 Move PENDING_OUTPUT_COUNT definition to configure.
4781
4782 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4783 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4784 * s/gnu.h (DATA_START): Move definitions to configure.
4785
4786 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4787 We include usg5-4-common.h, which defines them both.
4788
4789 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4790 O_RDONLY already includes it).
4791
4792 Stop ns builds setting the EMACSLOADPATH environment variable.
4793 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4794 Now it does not set EMACSLOADPATH, just returns the load-path string.
4795 * nsterm.h: Update accordingly.
4796 * lread.c [HAVE_NS]: Include nsterm.h.
4797 (init_lread) [HAVE_NS]: Use ns_load_path.
4798 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4799
4800 2012-07-09 Glenn Morris <rgm@gnu.org>
4801
4802 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4803 since the included bsd-common.h does so.
4804
4805 Stop ns builds setting the EMACSPATH environment variable.
4806 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4807 (ns_init_paths): Do not set EMACSPATH.
4808 * nsterm.h (ns_exec_path): Add it.
4809 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4810 Use ns_exec_path.
4811
4812 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4813
4814 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4815
4816 * process.c (wait_reading_process_output): 'waitchannels' was unset
4817 when read_kbd || !NILP (wait_for_cell); fix this.
4818
4819 Add GCC-style 'const' attribute to functions that can use it.
4820 * character.h (char_resolve_modifier_mask):
4821 * keyboard.h (make_ctrl_char):
4822 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4823 (init_character_once, next_almost_prime, init_fns, init_image)
4824 (flush_pending_output, init_sound):
4825 * mem-limits.h (start_of_data):
4826 * menu.h (finish_menu_items):
4827 Add ATTRIBUTE_CONST.
4828 * emacs.c (DEFINE_DUMMY_FUNCTION):
4829 Declare the dummy function with ATTRIBUTE_CONST.
4830 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4831 Add decls with ATTRIBUTE_CONST.
4832
4833 Minor improvements to make_formatted_string.
4834 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4835 where int is good enough, as vsprintf returns an int.
4836 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4837
4838 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4839
4840 Use make_formatted_string to avoid double length calculation.
4841 * lisp.h (make_formatted_string): New prototype.
4842 * alloc.c (make_formatted_string): New function.
4843 * buffer.c (Fgenerate_new_buffer_name): Use it.
4844 * dbus.c (syms_of_dbusbind): Likewise.
4845 * editfns.c (Fcurrent_time_zone): Likewise.
4846 * filelock.c (get_boot_time): Likewise.
4847 * frame.c (make_terminal_frame, set_term_frame_name)
4848 (x_report_frame_params): Likewise.
4849 * image.c (gs_load): Likewise.
4850 * minibuf.c (get_minibuffer): Likewise.
4851 * msdos.c (dos_set_window_size): Likewise.
4852 * process.c (make_process): Likewise.
4853 * xdisp.c (ensure_echo_area_buffers): Likewise.
4854 * xsettings.c (apply_xft_settings): Likewise.
4855
4856 2012-07-09 Glenn Morris <rgm@gnu.org>
4857
4858 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4859 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4860 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4861 * nsterm.h (ns_etc_directory): Add it.
4862 * callproc.c [HAVE_NS]: Include nsterm.h.
4863 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4864
4865 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4866
4867 Move marker debugging code under MARKER_DEBUG.
4868 * marker.c (MARKER_DEBUG): Move marker debugging code under
4869 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4870 for bootstrap with --enable-checking (~3x slowdown reported
4871 by Juanma Barranquero <lekktu@gmail.com>).
4872 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4873
4874 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4875
4876 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4877 See <http://bugs.gnu.org/11825#29>.
4878
4879 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4880
4881 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4882 has no font, use the frame's font. (Bug#11813)
4883 (display_line): Add commentary about displaying truncation glyphs
4884 on GUI frames.
4885 (produce_special_glyphs): Move here from term.c.
4886
4887 * term.c (produce_special_glyphs): Move to xdisp.c.
4888
4889 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4890 section.
4891
4892 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4893
4894 * xdisp.c (display_line): Avoid warning about implicit declaration
4895 of FRAME_FONT.
4896
4897 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4898
4899 * lisp.h: Remove empty conditional.
4900
4901 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4902
4903 * lread.c (load_path_check): Now static.
4904
4905 Fix some minor --with-ns problems found by static checking.
4906 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4907 (x_set_font) [!HAVE_X_WINDOWS]:
4908 * image.c (xpm_load_image) [HAVE_NS]:
4909 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4910 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4911 Remove unused local.
4912 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4913 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4914 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4915 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4916 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4917 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4918 Fix pointer signedness problem.
4919 * xfaces.c (FRAME_X_FONT_TABLE):
4920 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4921
4922 2012-07-07 Glenn Morris <rgm@gnu.org>
4923
4924 * lread.c (load_path_check): New function, split from init_lread.
4925 (init_lread): Reorganize. Motivation:
4926 If EMACSLOADPATH is set, check/warn about that rather than the
4927 defaults, which we are not going to use. Hence we can remove
4928 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4929 Don't warn if site-lisp directories are missing.
4930 If not installed, start from a blank load-path, since
4931 PATH_LOADSEARCH refers to the eventual installation directories.
4932
4933 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4934
4935 Support truncation and continuation glyphs on GUI frames, when
4936 fringes are disabled. (Bug#11832)
4937 * xdisp.c (init_iterator): Get dimensions of truncation and
4938 continuation glyphs even if on GUI frames.
4939 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4940 or both, are absent.
4941 (start_display, move_it_in_display_line_to): Handle the case of a
4942 GUI frame without a fringe to display continuation or truncation
4943 glyphs.
4944 (insert_left_trunc_glyphs): Support GUI frames: make sure
4945 truncation glyphs overwrite enough glyphs from the current line to
4946 have sufficient space in pixels.
4947 (display_line): Support truncation and continuation glyphs on GUI
4948 frames. If some spare pixels are left on the line after inserting
4949 the truncation glyphs, fill that space with a stretch glyph of a
4950 suitably computed width.
4951
4952 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4953 produce_glyphs, to support GUI sessions.
4954
4955 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4956
4957 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4958
4959 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4960
4961 Do not require float-time's arg to fit in time_t (Bug#11825).
4962 This works better on hosts where time_t is unsigned, and where
4963 float-time is applied to the (negative) difference between two times.
4964 * editfns.c (decode_time_components): Last arg is now double *,
4965 not int *, and means to store all the result as a double, without
4966 worrying about whether the seconds part fits in time_t.
4967 All callers changed.
4968 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4969 All callers changed.
4970 (Ffloat_time): Do not fail merely because the specified time falls
4971 outside of time_t range.
4972
4973 2012-07-07 Glenn Morris <rgm@gnu.org>
4974
4975 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4976 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4977 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4978
4979 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4980
4981 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4982 Update dependencies.
4983
4984 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4985
4986 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4987
4988 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4989 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4990 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4991 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4992 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4993 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4994
4995 * xfont.c (compare_font_names): Redo to omit the need for casts.
4996
4997 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4998
4999 * xfns.c (Fx_change_window_property): Doc fix.
5000 * w32fns.c (Fx_change_window_property): Doc fix.
5001
5002 * w32fns.c (Fx_window_property): Accept the same arguments as the
5003 X Windows version. Doc fix.
5004 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5005
5006 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
5007 Eli Zaretskii <eliz@gnu.org>
5008
5009 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5010 Windows-specific code from nt/config.nt moved here.
5011 Obsolete settings removed.
5012
5013 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5014
5015 * process.c: Avoid unnecessary calls to gettime.
5016 (wait_reading_process_output): Don't get the time of day
5017 when gobbling data immediately and not waiting, as there's no need
5018 for it in that case. This removes a FIXME.
5019
5020 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5021
5022 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5023 is defined (Bug#11768).
5024
5025 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5026
5027 Fix marker debugging code.
5028 * marker.c (byte_char_debug_check): Do not perform the check
5029 if buffer is not multibyte.
5030 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5031 Call byte_char_debug_check with correct arguments.
5032
5033 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5034
5035 Compile marker debugging code only if ENABLE_CHECKING is defined.
5036 * marker.c (byte_char_debug_check, count_markers):
5037 Use only if ENABLE_CHECKING is defined.
5038 (byte_debug_flag): Remove.
5039 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5040 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5041
5042 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5043
5044 Avoid code repetition in marker-related functions.
5045 * marker.c (attach_marker): New function.
5046 (Fset_marker, set_marker_restricted, set_marker_both)
5047 (set_marker_restricted_both): Use it.
5048 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5049 Consistently rename charno to charpos.
5050 (marker_position): Add eassert.
5051 (marker_byte_position): Convert to eassert.
5052
5053 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5054
5055 Simplify list operations in unchain_overlay and unchain_marker.
5056 * buffer.c (unchain_overlay): Simplify. Add comment.
5057 * marker.c (unchain_marker): Simplify. Fix comments.
5058
5059 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5060
5061 Introduce fast path for the widely used marker operation.
5062 * alloc.c (build_marker): New function.
5063 * lisp.h (build_marker): New prototype.
5064 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5065 * composite.c (autocmp_chars): Likewise.
5066 * editfns.c (buildmark): Remove.
5067 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5068 (save_restriction_save): Use build_marker.
5069 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5070 * window.c (save_window_save): Likewise.
5071
5072 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5073
5074 Do not use Fdelete_overlay in delete_all_overlays
5075 to avoid redundant calls to unchain_overlay.
5076 * buffer.c (drop_overlay): New function.
5077 (delete_all_overlays, Fdelete_overlay): Use it.
5078 * minibuf.c (get_minibuffer): Fix comment.
5079
5080 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5081
5082 Port to OpenBSD 5.1 amd64.
5083 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5084 This is needed for OpenBSD, and should be harmless on all BSD systems.
5085 Also, include <sys/sysctl.h>, as it should be available on all
5086 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5087 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5088 use p_pid member, not kp_proc.pid.
5089
5090 2012-07-06 Glenn Morris <rgm@gnu.org>
5091
5092 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5093
5094 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5095
5096 More xmalloc and related cleanup.
5097 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5098 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5099 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5100 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5101 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5102 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5103 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5104 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5105 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5106 * xterm.c:
5107 Omit needless casts involving void * pointers and allocation.
5108 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5109 as the former is more robust if P's type is changed.
5110 Prefer xzalloc to xmalloc + memset 0.
5111 Simplify malloc-or-realloc to realloc.
5112 Don't worry about xmalloc returning a null pointer.
5113 Prefer xstrdup to xmalloc + strcpy.
5114 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5115 growing it.
5116 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5117 alloca of a constant.
5118
5119 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5120
5121 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5122 hscroll is larger than the line width. Fixes long and futile
5123 looping inside extend_face_to_end_of_line (on a TTY) producing
5124 glyphs that are not needed and thrown away.
5125
5126 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5127
5128 * marker.c (set_marker_restricted_both): Simplify by using
5129 clip_to_bounds.
5130
5131 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5132
5133 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5134
5135 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5136
5137 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5138 not defined (Bug#11768).
5139 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5140 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5141 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5142 followed by gtk_box_set_homogeneous (Bug#11768).
5143 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
5144 (update_theme_scrollbar_width, xg_create_scroll_bar):
5145 Use gtk_scrollbar_new (Bug#11768).
5146 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5147 (is_box_type): New function (Bug#11768).
5148 (xg_tool_item_stale_p): Call is_box_type.
5149 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
5150 with default display (Bug#11768).
5151
5152 2012-07-05 Eli Zaretskii <eliz@gnu.org>
5153
5154 * xdisp.c (window_hscroll_limited): New function.
5155 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5156 coordinates when window's hscroll is set to insanely large
5157 values. (Bug#11857)
5158
5159 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
5160
5161 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5162 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5163
5164 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5165
5166 Cleanup xmalloc.
5167 * lisp.h (xzalloc): New prototype. Omit needless casts.
5168 * alloc.c (xzalloc): New function. Omit needless casts.
5169 * charset.c: Omit needless casts. Convert all calls to
5170 xmalloc with following memset to xzalloc.
5171 * dispnew.c: Likewise.
5172 * fringe.c: Likewise.
5173 * image.c: Likewise.
5174 * sound.c: Likewise.
5175 * term.c: Likewise.
5176 * w32fns.c: Likewise.
5177 * w32font.c: Likewise.
5178 * w32term.c: Likewise.
5179 * xfaces.c: Likewise.
5180 * xfns.c: Likewise.
5181 * xterm.c: Likewise.
5182 * atimer.c: Omit needless casts.
5183 * buffer.c: Likewise.
5184 * callproc.c: Likewise.
5185 * ccl.c: Likewise.
5186 * coding.c: Likewise.
5187 * composite.c: Likewise.
5188 * doc.c: Likewise.
5189 * doprnt.c: Likewise.
5190 * editfns.c: Likewise.
5191 * emacs.c: Likewise.
5192 * eval.c: Likewise.
5193 * filelock.c: Likewise.
5194 * fns.c: Likewise.
5195 * gtkutil.c: Likewise.
5196 * keyboard.c: Likewise.
5197 * lisp.h: Likewise.
5198 * lread.c: Likewise.
5199 * minibuf.c: Likewise.
5200 * msdos.c: Likewise.
5201 * print.c: Likewise.
5202 * process.c: Likewise.
5203 * region-cache.c: Likewise.
5204 * search.c: Likewise.
5205 * sysdep.c: Likewise.
5206 * termcap.c: Likewise.
5207 * terminal.c: Likewise.
5208 * tparam.c: Likewise.
5209 * w16select.c: Likewise.
5210 * w32.c: Likewise.
5211 * w32reg.c: Likewise.
5212 * w32select.c: Likewise.
5213 * w32uniscribe.c: Likewise.
5214 * widget.c: Likewise.
5215 * xdisp.c: Likewise.
5216 * xmenu.c: Likewise.
5217 * xrdb.c: Likewise.
5218 * xselect.c: Likewise.
5219
5220 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5221
5222 * fileio.c (time_error_value): Check the right error number.
5223 Problem reported by Troels Nielsen in
5224 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5225
5226 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5227
5228 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5229 This should be fixed in a better way; see Eli Zaretskii in
5230 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5231 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5232
5233 * fileio.c (time_error_value): Rename from special_mtime.
5234 The old name's problems were noted by Eli Zaretskii in
5235 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5236
5237 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5238 This variable's comment says Emacs needs at least one GDB-visible
5239 symbol of type enum pvec_type, to work around GDB problems.
5240 The symbol's value doesn't matter.
5241
5242 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5243 that causes compilation to fail on pre-C99 compilers.
5244
5245 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
5246
5247 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5248 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5249
5250 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5251
5252 * buffer.c (init_buffer_once): Fix initialization of
5253 headers for buffer_defaults and buffer_local_symbols.
5254 Reported by Juanma Barranquero <lekktu@gmail.com>.
5255
5256 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5257
5258 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5259 * lisp.h (enum pvec_type): Use fewer bits.
5260 (PSEUDOVECTOR_SIZE_BITS): New constant.
5261 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5262 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5263 change in pvec_type.
5264 (PSEUDOVECTOR_TYPEP): New macro.
5265 (TYPED_PSEUDOVECTORP): Use it.
5266 * fns.c (internal_equal): Adapt code to extract pvectype.
5267 * emacs.c (gdb_pvec_type): Update type.
5268 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5269 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5270 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5271 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5272 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5273 abusing vector->header.next.nbytes.
5274 (live_vector_p): Use PVEC_TYPE.
5275 (mark_object): Adapt code to extract pvectype. Use switch.
5276
5277 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5278
5279 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5280 Tighten new eassert a bit.
5281
5282 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5283
5284 Fix compilation with --enable-gcc-warnings and -O1
5285 optimization level.
5286 * doprnt.c (doprnt): Change type of tem to int, initialize
5287 to avoid compiler warning. Add eassert.
5288 * search.c (simple_search): Initialize match_byte to avoid
5289 compiler warning. Add eassert.
5290
5291 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5292
5293 Avoid weird behavior with large horizontal scrolls.
5294 Without this change, for example, large hscroll values would
5295 mess up Emacs's display on Fedora 15 x86, presumably due to
5296 overflows in int calculations in the display code.
5297 Also, if buffers had long lines, Emacs would freeze.
5298 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5299 (set_window_hscroll): New function, containing the old guts of
5300 Fset_window_hscroll. Return the clipped value.
5301 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5302 This avoids the need to check against PTRDIFF_MAX.
5303
5304 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5305
5306 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5307
5308 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5309
5310 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5311
5312 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5313 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5314 since GCC 4.4.6 issues a bogus warning for them.
5315
5316 Fix bugs in file timestamp newness comparisons.
5317 * fileio.c (Ffile_newer_than_file_p):
5318 * lread.c (Fload): Use full timestamp resolution of files,
5319 not just the 1-second resolution, so that files that are only
5320 slightly newer still count as newer.
5321 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5322 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5323
5324 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5325
5326 * fileio.c: Improve handling of file time marker. (Bug#11852)
5327 (special_mtime): New function.
5328 (Finsert_file_contents, Fverify_visited_file_modtime):
5329 Use it to set special mtime values consistently.
5330
5331 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5332
5333 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5334 marker for non-existing file. (Bug#11852)
5335
5336 2012-07-03 Glenn Morris <rgm@gnu.org>
5337
5338 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5339 and did not make it into globals.h).
5340
5341 2012-07-03 Tom Tromey <tromey@redhat.com>
5342
5343 * window.c (Fset_window_margins, Fset_window_fringes)
5344 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5345 * textprop.c (Fprevious_property_change): No longer static.
5346 * syntax.c (Fsyntax_table_p): No longer static.
5347 * process.c (Fget_process, Fprocess_datagram_address): No longer
5348 static.
5349 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5350 * keyboard.c (Fcommand_execute): No longer static.
5351 Remove EXFUN.
5352 * insdel.c (Fcombine_after_change_execute): No longer static.
5353 * image.c (Finit_image_library): No longer static.
5354 * fileio.c (Fmake_symbolic_link): No longer static.
5355 * eval.c (Ffetch_bytecode): No longer static.
5356 * editfns.c (Fuser_full_name): No longer static.
5357 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5358 No longer static.
5359 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5360 static.
5361 * dired.c (Ffile_attributes): No longer static.
5362 * composite.c (Fcomposition_get_gstring): No longer static.
5363 * callproc.c (Fgetenv_internal): No longer static.
5364
5365 * ccl.h: Remove EXFUNs.
5366 * buffer.h: Remove EXFUNs.
5367 * dispextern.h: Remove EXFUNs.
5368 * intervals.h: Remove EXFUNs.
5369 * fontset.h: Remove EXFUN.
5370 * font.h: Remove EXFUNs.
5371 * dosfns.c (system_process_attributes): Remove EXFUN.
5372 * keymap.h: Remove EXFUNs.
5373 * lisp.h: Remove EXFUNs.
5374 * w32term.h: Remove EXFUNs.
5375 * window.h: Remove EXFUNs.
5376 * xsettings.h: Remove EXFUN.
5377 * xterm.h: Remove EXFUN.
5378
5379 2012-07-03 Glenn Morris <rgm@gnu.org>
5380
5381 * lisp.h (Frandom): Make it visible to C.
5382 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5383 buffer for invisible buffers. (Bug#1229)
5384
5385 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5386
5387 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5388 values which aren't power of 2.
5389 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5390 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
5391 accordingly.
5392
5393 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5394
5395 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5396
5397 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5398
5399 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5400
5401 * alloc.c (allocate_vector_block): Remove redundant
5402 calls to mallopt if DOUG_LEA_MALLOC is defined.
5403 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5404 avoid calls to mallopt if zero_vector is returned.
5405
5406 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5407
5408 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5409 is enabled, avoid dereferencing NULL current_sblock if
5410 running undumped.
5411
5412 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5413
5414 Cleanup basic buffer management.
5415 * buffer.h (struct buffer): Change layout to use generic vector
5416 marking code. Fix some comments. Change type of 'clip_changed'
5417 to bitfield. Remove unused #ifndef old.
5418 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5419 (GET_OVERLAYS_AT): Fix indentation.
5420 (for_each_per_buffer_object_at): New macro.
5421 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5422 (Fbuffer_local_variables): Use it.
5423 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5424 * alloc.c (allocate_buffer): Adjust to match new layout of
5425 struct buffer. Fix comment.
5426 (mark_overlay): New function.
5427 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5428 Lisp area of struct buffer.
5429 (mark_object): Use it. Adjust marking of misc objects
5430 and related comments.
5431
5432 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5433
5434 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5435 wrapper that is not needed because the wrapped code is a no-op (zero
5436 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5437 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5438
5439 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5440
5441 * alloc.c (mark_buffer): Simplify. Remove prototype.
5442 (mark_object): Add comment. Reorganize marking of vector-like
5443 objects. Use CHECK_LIVE for all vector-like objects except buffers
5444 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5445 Avoid redundant calls to mark_vectorlike for bool vectors.
5446
5447 2012-06-30 Glenn Morris <rgm@gnu.org>
5448
5449 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5450
5451 * epaths.in (PATH_SITELOADSEARCH): New.
5452 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5453 This is rather than relying on --enable-locallisppath elements
5454 having "site-lisp" in their names. (Bug#10208#25, 11658)
5455
5456 2012-06-30 Eli Zaretskii <eliz@gnu.org>
5457
5458 * w32proc.c (sys_select): Accept and ignore one more argument.
5459
5460 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5461
5462 * sysselect.h [DOS_NT]: Don't include sys/select.h.
5463 (pselect) [!MS_DOS]: Redirect to sys_select.
5464
5465 * sysdep.c: Don't include dos.h and dosfns.h.
5466
5467 * process.c (sys_select):
5468 * msdos.c (sys_select): Accept one more argument and ignore it.
5469
5470 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5471 adapt data types and code to that.
5472
5473 * dosfns.c:
5474 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5475 which clashes with the gnulib function of the same name.
5476
5477 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5478
5479 * font.c (font_style_to_value, font_style_symbolic)
5480 (font_prop_validate_style): Add type checks for values in
5481 font_style_table.
5482
5483 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5484 argument.
5485 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5486 uses.
5487
5488 2012-06-29 Eli Zaretskii <eliz@gnu.org>
5489
5490 * xdisp.c (try_window_id): Undo last change.
5491
5492 * w32.c (getwd): Adjust commentary about startup_dir.
5493 (init_environment): Always call sys_access, even in non-MSVC
5494 builds. Don't chdir to the directory of the Emacs executable.
5495 This undoes code from 1997 which was justified by the need to
5496 "avoid conflicts when removing and renaming directories". But its
5497 downside was that every relative file name was being interpreted
5498 relative to the directory of the Emacs executable, which can never
5499 be TRT. In particular, it broke sys_access when called with
5500 relative file names.
5501 (sys_access): Map GetLastError to errno.
5502
5503 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5504
5505 * window.h (struct window): Change type of 'fringes_outside_margins'
5506 to bitfield. Fix comment. Adjust users accordingly.
5507 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
5508 Adjust comment.
5509 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5510 to ptrdiff_t.
5511
5512 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
5513
5514 * gnutls.c (emacs_gnutls_handshake):
5515 Add QUIT to make the loop interruptible.
5516
5517 2012-06-29 Glenn Morris <rgm@gnu.org>
5518
5519 * charset.c (init_charset): Make lack of etc/charsets fatal.
5520
5521 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5522
5523 * editfns.c (region_limit): Fix type mismatch.
5524
5525 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5526
5527 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5528 undefined. Convert from xassert to eassert.
5529 * nsmenu.m: Convert from xassert to eassert.
5530 * nsterm.m: Likewise.
5531
5532 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5533
5534 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5535
5536 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5537
5538 Avoid integer overflow on scroll-left and scroll-right.
5539 * window.c (HSCROLL_MAX): New macro.
5540 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5541 overflow when requested scroll falls outside ptrdiff_t range.
5542
5543 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5544
5545 * window.h (struct window): Change type of 'hscroll',
5546 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5547 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5548 Adjust users accordingly.
5549 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5550 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5551 from EMACS_INT to ptrdiff_t.
5552 (make_window): Omit redundant initialization.
5553
5554 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5555
5556 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5557
5558 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5559
5560 * window.h (struct window): Change type of 'use_time' and
5561 'sequence_number' from Lisp_Object to int.
5562 * frame.c (make_frame): Adjust users accordingly.
5563 * print.c (print_object): Likewise.
5564 * window.c (select_window, Fwindow_use_time, make_parent_window)
5565 (make_window): Likewise.
5566
5567 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5568
5569 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5570 enabled with --enable-checking=[all,glyphs] configure option.
5571 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5572 adjust comments accordingly.
5573 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5574 undefined, adjust comments accordingly.
5575 * image.c: Likewise.
5576 * scroll.c: Likewise.
5577 * w32fns.c: Likewise.
5578 * w32term.c: Likewise.
5579 * xdisp.c: Likewise.
5580 * xfaces.c: Likewise.
5581 * xfns.c: Likewise.
5582 * xterm.c: Likewise.
5583
5584 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5585
5586 Generalize run-time debugging checks.
5587 * dispextern.h (XASSERTS): Remove.
5588 * fontset.c (xassert): Remove.
5589 Convert from xassert to eassert.
5590 * alloc.c: Convert from xassert to eassert.
5591 * bidi.c: Likewise.
5592 * dispnew.c: Likewise.
5593 * fns.c: Likewise.
5594 * fringe.c: Likewise.
5595 * ftfont.c: Likewise.
5596 * gtkutil.c: Likewise.
5597 * image.c: Likewise.
5598 * keyboard.c: Likewise.
5599 * menu.c: Likewise.
5600 * process.c: Likewise.
5601 * scroll.c: Likewise.
5602 * sound.c: Likewise.
5603 * term.c: Likewise.
5604 * w32console.c: Likewise.
5605 * w32fns.c: Likewise.
5606 * w32term.c: Likewise.
5607 * window.c: Likewise.
5608 * xdisp.c: Likewise.
5609 * xfaces.c: Likewise.
5610 * xfns.c: Likewise.
5611 * xselect.c: Likewise.
5612 * xterm.c: Likewise.
5613
5614 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5615
5616 * fns.c (maybe_resize_hash_table): Output message when growing the
5617 purify-hashtable.
5618
5619 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5620
5621 * alloc.c (allocate_string_data): Remove dead code.
5622 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5623 avoid GCC warning about unused macro.
5624
5625 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5626
5627 * alloc.c (allocate_string): Omit intervals initialization.
5628 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5629 as in make_pure_string and make_pure_c_string.
5630
5631 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5632
5633 * alloc.c (allocate_string): Fix last change.
5634
5635 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5636
5637 * alloc.c (allocate_string): Remove two redundant calls
5638 to memset, add explicit initialization where appropriate.
5639
5640 2012-06-27 Glenn Morris <rgm@gnu.org>
5641
5642 * lisp.mk (lisp): Remove paths.elc.
5643
5644 2012-06-27 Chong Yidong <cyd@gnu.org>
5645
5646 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5647
5648 2012-06-26 John Wiegley <johnw@newartisans.com>
5649
5650 * unexmacosx.c (copy_data_segment): Add two section names used
5651 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5652
5653 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5654 when building with Clang.
5655
5656 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5657
5658 * eval.c (Fapply): Allow calling it with a single argument.
5659
5660 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5661
5662 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5663 _stricmp and _strnicmp.
5664 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5665
5666 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5667
5668 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5669 allocated window.
5670 (allocate_process): Likewise for new process.
5671 (allocate_terminal): Change to use offsetof.
5672 (allocate_frame): Likewise.
5673 * frame.c (make_frame): Omit redundant initialization.
5674 * window.c (make_parent_window): Use memset.
5675 (make_window): Omit redundant initialization.
5676 * process.c (make_process): Omit redundant initialization.
5677 * terminal.c (create_terminal): Likewise.
5678
5679 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5680
5681 * term.c (delete_tty): Remove redundant call to memset.
5682
5683 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5684
5685 * alloc.c: Remove build_string.
5686 * lisp.h: Define build_string as static inline. This provides
5687 a better opportunity to optimize away calls to strlen when the
5688 function is called with compile-time constant argument.
5689 * image.c (imagemagick_error): Convert to build_string.
5690 * w32proc.c (sys_spawnve): Likewise.
5691 * xterm.c (x_term_init): Likewise.
5692
5693 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 Use sprintf return value instead of invoking strlen on result.
5696 In the old days this wasn't portable, since some sprintf
5697 implementations returned char *. But they died out years ago and
5698 Emacs already assumes sprintf returns int.
5699 Similarly for float_to_string.
5700 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5701 * ccl.c (ccl_driver):
5702 * character.c (string_escape_byte8):
5703 * data.c (Fnumber_to_string):
5704 * doprnt.c (doprnt):
5705 * print.c (print_object):
5706 * xdisp.c (message_dolog):
5707 * xfns.c (syms_of_xfns):
5708 Use sprintf or float_to_string result to avoid need to call strlen.
5709 * data.c (Fnumber_to_string):
5710 Use make_unibyte_string, since the string must be ASCII.
5711 * lisp.h, print.c (float_to_string): Now returns int length.
5712 * term.c (produce_glyphless_glyph):
5713 Use sprintf result rather than recomputing it.
5714
5715 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5716 * Makefile.in (ALL_CFLAGS):
5717 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5718 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5719
5720 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5721
5722 * dispextern.h (xstrcasecmp): Define to library function
5723 strcasecmp if available.
5724 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5725
5726 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5727
5728 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5729 Avoid comma operator.
5730 * menu.c (push_submenu_start, push_submenu_end)
5731 (push_left_right_boundary, push_menu_pane): Likewise.
5732 * msdos.c (dos_rawgetc): Likewise.
5733
5734 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5735
5736 * xfns.c (xic_create_fontsetname): Remove redundant calls
5737 to memset.
5738
5739 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5740
5741 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5742 sprintf already null-terminates its output.
5743
5744 * xfns.c (x_window): Remove redundant cast.
5745
5746 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5747
5748 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5749 `const char *' to `char *' to avoid compiler warning.
5750
5751 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5752
5753 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5754 instead of truncating it to 63 (admittedly a generous limit).
5755
5756 * process.c: Fix spelling and caps in comments.
5757
5758 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5759
5760 * emacs.c (setpgrp): Remove definition, unused.
5761 * sysdep.c (setpgrp): Remove definition, not used in this file.
5762
5763 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5764
5765 * makefile.w32-in: Update dependencies.
5766
5767 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5768
5769 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5770 (SYSTIME_H): Add nt/inc/sys/time.h.
5771
5772 * systime.h [WINDOWSNT]: Include sys/time.h.
5773
5774 * s/ms-w32.h (struct timespec): Definition moved from
5775 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5776
5777 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5778
5779 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5780 * buffer.h (buffer_slot_type_mismatch):
5781 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5782 * eval.c (unwind_to_catch):
5783 * image.c (my_png_error, my_error_exit):
5784 * keyboard.c (quit_throw_to_read_char, user_error)
5785 (Fexit_recursive_edit, Fabort_recursive_edit):
5786 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5787 (wrong_type_argument, buffer_overflow, __executable_start)
5788 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5789 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5790 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5791 (fatal):
5792 (child_setup) [!DOS_NT]:
5793 * lread.c (end_of_file_error, invalid_syntax):
5794 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5795 * puresize.h (pure_write_error):
5796 * search.c (matcher_overflow):
5797 * sound.c (sound_perror, alsa_sound_perror):
5798 * sysdep.c, syssignal.h (croak):
5799 * term.c (maybe_fatal, vfatal):
5800 * textprop.c (text_read_only):
5801 * undo.c (user_error):
5802 * unexmacosx.c (unexec_error):
5803 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5804 Use _Noreturn rather than NO_RETURN.
5805 No need for separate decl merely because of _Noreturn.
5806 * sound.c (sound_warning, parse_sound):
5807 Remove unnecessary forward decls.
5808
5809 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5810
5811 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5812 * lisp.h (WAIT_READING_MAX): New macro.
5813 * dispnew.c (Fsleep_for, sit_for):
5814 * keyboard.c (kbd_buffer_get_event):
5815 * process.c (Faccept_process_output):
5816 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5817 This improves on the previous patch, which introduced a bug
5818 when time_t is unsigned and as wide as intmax_t.
5819 See <http://bugs.gnu.org/9000#51>.
5820
5821 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5822
5823 * dispnew.c (sit_for, Fsleep_for):
5824 * keyboard.c (kbd_buffer_get_event):
5825 * process.c (Faccept_process_output): Avoid compiler warnings when
5826 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5827
5828 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5829
5830 * makefile.w32-in: Update dependencies.
5831
5832 * w32.c (ltime): Add return type and declare static.
5833 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5834
5835 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5836
5837 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5838 Privately reported by Herbert J. Skuhra.
5839 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5840 All uses changed.
5841 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5842 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5843
5844 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5845
5846 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5847 last argument of make_unibyte_string.
5848
5849 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5850 language ID in the event parameters.
5851
5852 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5853 event.code, not the obscure "character set ID".
5854
5855 2012-06-23 Chong Yidong <cyd@gnu.org>
5856
5857 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5858
5859 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5860
5861 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5862 * w32.c (fdutimens): New function.
5863
5864 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5865
5866 * s/ms-w32.h (pselect): Redirect to sys_select.
5867
5868 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5869
5870 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5871 in the logic of incrementing and decrementing the value of
5872 use_relocatable_buffers.
5873
5874 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5875
5876 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5877 Privately reported by Herbert J. Skuhra.
5878 [__FreeBSD__]: Remove "*/" typo after "#include".
5879 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5880 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5881 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5882 Don't assume EMACS_TIME and struct timeval are the same type.
5883
5884 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5885
5886 Support higher-resolution time stamps (Bug#9000).
5887 The time stamps are only nanosecond-resolution at the C level,
5888 since that's the best that any real-world system supports now.
5889 But they are picosecond-resolution at the Lisp level, as that's
5890 easy, and leaves room for future OS improvements.
5891
5892 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5893 (LIBES): Use it.
5894
5895 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5896 Don't get current time unless it's needed.
5897
5898 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5899 now provides it if it's absent.
5900 (start_atimer): Port to higher-res time stamps.
5901 Check for time stamp overflow. Don't get current time more
5902 often than is needed.
5903
5904 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5905 Include systime.h, not time.h.
5906 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5907
5908 * dired.c: Include stat-time.h.
5909 (Ffile-attributes): File times now have higher resolution.
5910
5911 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5912 (struct image): Timestamp now has higher resolution.
5913
5914 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5915 has at least microseconds now. All uses removed.
5916 (update_frame, update_single_window, update_window, update_frame_1)
5917 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5918 (duration_to_sec_usec): Remove; no longer needed.
5919
5920 * editfns.c (time_overflow): Now extern.
5921 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5922 (float-time, Fformat_time_string, Fcurrent_time_string)
5923 (Fcurrent_time_zone): Accept and generate higher-resolution
5924 time stamps.
5925 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5926 (decode_time_components, lisp_seconds_argument): New functions.
5927 (make_time): Now static.
5928 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5929 Report an error if the time is invalid, rather than having the caller
5930 do that.
5931
5932 * fileio.c: Include <stat-time.h>
5933 (Fcopy_file): Copy higher-resolution time stamps.
5934 Prefer to set the time stamp via a file descriptor if that works.
5935 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5936 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5937 (Fvisited_file_modtime, Fset_visited_file_modtime):
5938 Support higher-resolution time stamps.
5939
5940 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5941
5942 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5943
5944 * image.c (prepare_image_for_display, clear_image_cache)
5945 (lookup_image): Port to higer-resolution time stamps.
5946
5947 * keyboard.c (start_polling, bind_polling_period):
5948 Check for time stamp overflow.
5949 (read_char, kbd_buffer_get_event, timer_start_idle)
5950 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5951 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5952 Port to higher-resolution time stamps. Do not assume time_t is signed.
5953 (decode_timer): New function. Timers are now vectors of length 9,
5954 not 8, to accommodate the picosecond component.
5955 (timer_check_2): Use it.
5956
5957 * nsterm.m (select_timeout, timeval_subtract): Remove.
5958 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5959 as they're a bit more accurate and handle overflow better.
5960 (ns_select): Change prototype to be compatible with pselect.
5961 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5962 * nsterm.h (ns_select): Adjust prototype.
5963
5964 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5965 us-resolution time stamps.
5966 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5967
5968 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5969
5970 * lisp.h (time_overflow): New decl.
5971 (wait_reading_process_output): First arg is now intmax_t, not int,
5972 to accommodate larger waits.
5973
5974 * process.h (struct Lisp_Process.read_output_delay):
5975 Now counts nanoseconds, not microseconds.
5976 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5977 EMACS_HAS_USECS.
5978 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5979 (wait_reading_process_output):
5980 Port to ns-resolution time stamps.
5981 (Faccept_process_output, wait_reading_process_output):
5982 Check for time stamp overflow. Do not assume time_t is signed.
5983 (select_wrapper): Remove; we now use pselect.
5984 (Fprocess_attributes): Now generates ns-resolution time stamps.
5985
5986 * sysdep.c: Include utimens.h. Don't include utime.h
5987 or worry about struct utimbuf; gnulib does that for us now.
5988 (gettimeofday): Remove; gnulib provides a substitute.
5989 (make_timeval): New function.
5990 (set_file_times): Now sets ns-resolution time stamps.
5991 New arg FD; all uses changed.
5992 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5993 (system_process_attributes):
5994 Now returns ns-resolution time stamp. All uses changed.
5995 Check for time stamp overflow.
5996
5997 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5998 provides a substitute now.
5999
6000 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6001 since it guarantees struct timespec.
6002 (EMACS_TIME): Now struct timespec, so that we can support
6003 ns-resolution time stamps.
6004 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6005 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6006 (EMACS_USECS): Remove.
6007 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6008 so multiply the arg by 1000 before storing it.
6009 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6010 New macros.
6011 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6012 Port to ns-resolution time stamps.
6013 (EMACS_TIME_NEG_P): Remove; replaced by....
6014 (EMACS_TIME_SIGN): New macro.
6015 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6016 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6017 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6018 (make_timeval, make_lisp_time, decode_time_components): New decls.
6019 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6020 that it mishandled time_t overflow. You can't compare by subtracting!
6021 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6022 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6023
6024 * term.c: Include <sys/time.h>.
6025 (timeval_to_Time): New function, for proper overflow wraparound.
6026 (term_mouse_position, term_mouse_click): Use it.
6027
6028 * undo.c (record_first_change): Support higher-resolution time stamps
6029 in the undo buffer.
6030 (Fprimitive_undo): Use them when restoring time stamps.
6031
6032 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6033 (w32_get_internal_run_time):
6034 Port to higher-resolution Emacs time stamps.
6035 (ltime): Now accepts single 64-bit integer, as that's more convenient
6036 for callers.
6037
6038 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6039
6040 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6041 for compatibility with pselect. Support ns-resolution time stamps.
6042
6043 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6044
6045 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6046 Check for time stamp overflow, and support ns-resolution time stamps.
6047
6048 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6049 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6050 (timeval_subtract): Remove; no longer needed.
6051 (XTflash, XTring_bell, x_wait_for_event):
6052 Port to ns-resolution time stamps. Don't assume time_t is signed.
6053
6054 2012-06-22 Chong Yidong <cyd@gnu.org>
6055
6056 * xdisp.c (x_consider_frame_title): Revert last change.
6057
6058 2012-06-22 Eli Zaretskii <eliz@gnu.org>
6059
6060 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6061 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6062 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6063 staticidx goes up to 1597 out of 1600 = 0x640.)
6064
6065 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6066
6067 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6068 Otherwise, the umask might be mistakenly 0 while handling input signals.
6069
6070 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6071
6072 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6073
6074 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6075
6076 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6077 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6078 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6079 access to `contents' member of Lisp_Vector objects with AREF and ASET
6080 where appropriate.
6081
6082 2012-06-19 Chong Yidong <cyd@gnu.org>
6083
6084 * frame.c (delete_frame): When selecting a frame on a different
6085 text terminal, do not alter the terminal's top-frame.
6086
6087 * xdisp.c (format_mode_line_unwind_data): Record the target
6088 frame's selected window and its terminal's top-frame.
6089 (unwind_format_mode_line): Restore them.
6090 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6091 Callers changed.
6092 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6093 since tty frames can be explicitly named.
6094 (prepare_menu_bars): Likewise.
6095
6096 * term.c (Ftty_top_frame): New function.
6097
6098 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6099
6100 Port byte-code-meter to modern targets.
6101 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6102 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
6103 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
6104 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6105 (METER_1, METER_2): Simplify.
6106
6107 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6108
6109 * data.c (Fdefalias): Return `symbol' (bug#11686).
6110
6111 2012-06-18 Martin Rudalics <rudalics@gmx.at>
6112
6113 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
6114 gets killed during executing of this function (Bug#11665).
6115 Try to always return Qt when the buffer has been actually killed.
6116 (Vkill_buffer_query_functions): In doc-string say that functions
6117 run by this hook should not change the current buffer.
6118
6119 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 Fix recently-introduced process.c problems found by static checking.
6122 * process.c (write_queue_push, write_queue_pop, send_process):
6123 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6124 (write_queue_pop): Fix pointer signedness problem.
6125 (send_process): Remove unused local.
6126
6127 2012-06-17 Chong Yidong <cyd@gnu.org>
6128
6129 * xdisp.c (redisplay_internal): No need to redisplay terminal
6130 frames that are not on top.
6131
6132 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
6133
6134 * process.c (make_process): Initialize write_queue.
6135 (write_queue_push, write_queue_pop): New functions.
6136 (send_process): Use them to maintain correct ordering of process
6137 writes (Bug#10815).
6138
6139 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6140
6141 * lisp.h (eassert): Assume C89 or later.
6142 This removes the need for CHECK.
6143 (CHECK): Remove. Its comments about always evaluating its
6144 argument were confusing, as 'eassert' typically does not evaluate
6145 its argument.
6146
6147 * coding.c (produce_chars): Use ptrdiff_t, not int.
6148
6149 * xterm.c (x_draw_underwave): Check for integer overflow.
6150 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6151
6152 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
6153
6154 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6155 referenced (Bug#11583).
6156
6157 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6158
6159 Implement wave-style variant of underlining.
6160 * dispextern.h (face_underline_type): New enum.
6161 (face): Add field for underline type.
6162 * nsterm.m (ns_draw_underwave): New function.
6163 (ns_draw_text_decoration): Use it.
6164 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6165 New functions.
6166 (x_draw_glyph_string): Use them.
6167 * xfaces.c (Qline, Qwave): New Lisp objects.
6168 (check_lface_attrs, merge_face_ref)
6169 (Finternal_set_lisp_face_attribute, realize_x_face):
6170 Handle wave-style underline face attributes.
6171 * xterm.c (x_draw_underwave): New function.
6172 (x_draw_glyph_string): Use it.
6173
6174 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
6175
6176 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6177 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6178 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6179 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6180 ($(BLD)/w32select.$(O)): Update dependencies.
6181
6182 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6183
6184 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6185 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6186 * character.c (_fetch_multibyte_char_p): Remove.
6187 * alloc.c: Include "character.h" before "buffer.h".
6188 * bidi.c: Likewise.
6189 * buffer.c: Likewise.
6190 * bytecode.c: Likewise.
6191 * callint.c: Likewise.
6192 * callproc.c: Likewise.
6193 * casefiddle.c: Likewise.
6194 * casetab.c: Likewise.
6195 * category.c: Likewise.
6196 * cmds.c: Likewise.
6197 * coding.c: Likewise.
6198 * composite.c: Likewise.
6199 * dired.c: Likewise.
6200 * dispnew.c: Likewise.
6201 * doc.c: Likewise.
6202 * dosfns.c: Likewise.
6203 * editfns.c: Likewise.
6204 * emacs.c: Likewise.
6205 * fileio.c: Likewise.
6206 * filelock.c: Likewise.
6207 * font.c: Likewise.
6208 * fontset.c: Likewise.
6209 * fringe.c: Likewise.
6210 * indent.c: Likewise.
6211 * insdel.c: Likewise.
6212 * intervals.c: Likewise.
6213 * keyboard.c: Likewise.
6214 * keymap.c: Likewise.
6215 * lread.c: Likewise.
6216 * macros.c: Likewise.
6217 * marker.c: Likewise.
6218 * minibuf.c: Likewise.
6219 * nsfns.m: Likewise.
6220 * nsmenu.m: Likewise.
6221 * print.c: Likewise.
6222 * process.c: Likewise.
6223 * regex.c: Likewise.
6224 * region-cache.c: Likewise.
6225 * search.c: Likewise.
6226 * syntax.c: Likewise.
6227 * term.c: Likewise.
6228 * textprop.c: Likewise.
6229 * undo.c: Likewise.
6230 * unexsol.c: Likewise.
6231 * w16select.c: Likewise.
6232 * w32fns.c: Likewise.
6233 * w32menu.c: Likewise.
6234 * window.c: Likewise.
6235 * xdisp.c: Likewise.
6236 * xfns.c: Likewise.
6237 * xmenu.c: Likewise.
6238 * xml.c: Likewise.
6239 * xselect.c: Likewise.
6240
6241 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6242
6243 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6244 If all the glyphs of the glyph row came from strings, and we have no
6245 cursor positioning clues, put the cursor on the first glyph of the
6246 row.
6247 (handle_face_prop): Use chunk-relative overlay string index when
6248 indexing into it->string_overlays array. (Bug#11653)
6249 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6250 the rightmost. (Bug#11720)
6251
6252 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6253
6254 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6255 (CATEGORY_MEMBER): Enforce 1/0 value.
6256 * category.c (_temp_category_set): Remove.
6257
6258 2012-06-16 Eli Zaretskii <eliz@gnu.org>
6259
6260 * window.c (Fdelete_other_windows_internal)
6261 (Fdelete_window_internal): Don't access frame's mouse highlight
6262 info of the initial frame. (Bug#11677)
6263
6264 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6265
6266 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6267 Assume USE_2_TAGS_FOR_INTS.
6268 (xreload): Adjust $tagmask width to match recent lisp.h change.
6269
6270 Simplify lisp.h in minor ways that should not affect code.
6271 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6272 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6273 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6274 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6275 (INTTYPEBITS): New macro, for clarity.
6276 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
6277 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6278 Simplify now that USE_LSB_TAG is always defined.
6279 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6280 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6281
6282 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
6283
6284 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6285
6286 2012-06-13 Glenn Morris <rgm@gnu.org>
6287
6288 * s/bsd-common.h (BSD4_3):
6289 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6290
6291 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6292
6293 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6294 instead of union.
6295 (XLI, XIL): Define.
6296 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6297 Use them.
6298 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
6299 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
6300 * alloc.c (widen_to_Lisp_Object): Remove.
6301 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6302 * frame.c (delete_frame): Remove outdated comment.
6303 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6304 USE_LISP_UNION_TYPE.
6305 (Fw32_unregister_hot_key): Likewise.
6306 (Fw32_toggle_lock_key): Likewise.
6307 * w32menu.c (add_menu_item): Likewise.
6308 (w32_menu_display_help): Use XIL instead of checking
6309 USE_LISP_UNION_TYPE.
6310 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6311 (init_heap): Likewise.
6312 * w32term.c (w32_read_socket): Update comment.
6313
6314 2012-06-13 Glenn Morris <rgm@gnu.org>
6315
6316 * s/usg5-4-common.h, src/s/unixware.h:
6317 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6318
6319 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6320
6321 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6322
6323 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6324 * alloc.c (make_number) [!defined make_number]:
6325 Remove, as lisp.h always defines this now.
6326 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6327 (roundup_size): Verify that it is a power of 2.
6328 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6329 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6330 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6331 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6332 USE_LSB_TAG now is always defined to be either 0 or 1.
6333 All uses changed.
6334 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6335 code works fine either way, and efficiency is not a concern here,
6336 as the union type is for debugging, not for production.
6337 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6338 Use an inline function on all platforms when using the union type,
6339 since this is simpler and 'static inline' can be used portably
6340 within Emacs now.
6341 (LISP_INITIALLY_ZERO): New macro.
6342 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6343 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6344
6345 2012-06-12 Glenn Morris <rgm@gnu.org>
6346
6347 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6348
6349 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
6350
6351 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6352 Move BROKEN_SIGIO to configure.
6353
6354 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6355 Move NO_TERMIO to configure.
6356
6357 2012-06-12 Chong Yidong <cyd@gnu.org>
6358
6359 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6360 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6361 MagickExportImagePixels is undefined.
6362
6363 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6364
6365 * image.c (imagemagick_load_image): Remove unused label.
6366
6367 2012-06-11 Glenn Morris <rgm@gnu.org>
6368
6369 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6370 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6371 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6372 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6373
6374 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6375
6376 * alloc.c (make_byte_code): New function.
6377 (Fmake_byte_code): Use it. Don't purify here.
6378 * lread.c (read1): Use it as well to avoid extra allocation.
6379
6380 2012-06-11 Chong Yidong <cyd@gnu.org>
6381
6382 * image.c (imagemagick_load_image): Implement transparency.
6383
6384 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6385
6386 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6387 account for preceding backslashes. (Bug#11663)
6388
6389 2012-06-09 Chong Yidong <cyd@gnu.org>
6390
6391 * term.c: Support italics in capable terminals (Bug#9652).
6392 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6393 (turn_on_face): Output using TS_enter_italic_mode if available.
6394 Don't handle unused blinking and alt-charset cases.
6395 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6396 and tty_alt_charset_p cases.
6397 (tty_capable_p, init_tty): Support italics.
6398
6399 * termchar.h (struct tty_display_info): Add field for italics.
6400 Remove unused blink field.
6401
6402 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6403 Handle slant.
6404
6405 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6406 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6407 tty_alt_charset_p. Add tty_italic_p.
6408
6409 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
6410
6411 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6412 dbus_type_is_basic if available.
6413 (xd_extract_signed, xd_extract_unsigned): Rename from
6414 extract_signed and extract_unsigned, respectively. Adapt callers.
6415
6416 2012-06-09 Chong Yidong <cyd@gnu.org>
6417
6418 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6419
6420 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6421 case (Bug#9752).
6422
6423 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6424
6425 * xdisp.c (vmessage): Treat frame message as multibyte.
6426 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6427 would generate the diagnostic "Making \302\247 buffer-local while
6428 let-bound!".
6429
6430 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6431
6432 * dispnew.c (showing_window_margins_p): Undo last change, which
6433 was done due to an inadvertent commit.
6434 (adjust_frame_glyphs_for_frame_redisplay): Do call
6435 showing_window_margins_p.
6436
6437 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6438
6439 * eval.c (Fmake_var_non_special): New primitive.
6440 (syms_of_eval): Defsubr it.
6441 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6442
6443 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
6444
6445 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6446 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6447
6448 2012-06-08 Eli Zaretskii <eliz@gnu.org>
6449
6450 * alloc.c (allocate_vectorlike): Fix last change.
6451
6452 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6453
6454 Block-based vector allocation of small vectors.
6455 * lisp.h (struct vectorlike_header): New field `nbytes',
6456 adjust comment accordingly.
6457 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
6458 to denote vector blocks. Adjust users (live_vector_p,
6459 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6460 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6461 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6462 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6463 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6464 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6465 (roundup_size): New constant.
6466 (struct vector_block): New data type.
6467 (vector_blocks, vector_free_lists, zero_vector): New variables.
6468 (all_vectors): Rename to `large_vectors'.
6469 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6470 (sweep_vectors): New functions.
6471 (allocate_vectorlike): Return `zero_vector' as the only vector of
6472 0 items. Allocate new vector from block if vector size is less than
6473 or equal to VBLOCK_BYTES_MAX.
6474 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6475 (init_alloc_once): Add call to init_vectors.
6476
6477 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6478
6479 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6480
6481 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6482
6483 * doprnt.c (doprnt): Truncate multibyte char correctly.
6484 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6485 would mishandle a string argument "Xc" if X was a multibyte
6486 character of length 2: it would truncate after X's first byte
6487 rather than including all of X.
6488
6489 2012-06-06 Chong Yidong <cyd@gnu.org>
6490
6491 * buffer.c (word_wrap): Doc fix.
6492
6493 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6494
6495 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6496
6497 2012-06-03 Glenn Morris <rgm@gnu.org>
6498
6499 * xdisp.c (tool-bar-style): Doc fix.
6500
6501 2012-06-03 Ulrich Müller <ulm@gentoo.org>
6502
6503 * Makefile.in (PAXCTL): Define.
6504 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6505 binary via PaX flags if the paxctl utility is available.
6506 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6507 Restore PaX flags to their default. (Bug#11398)
6508
6509 2012-06-03 Chong Yidong <cyd@gnu.org>
6510
6511 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6512 buffer (Bug#11226).
6513
6514 2012-06-03 Chong Yidong <cyd@gnu.org>
6515
6516 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6517 (note_mode_line_or_margin_highlight): If there is no help echo,
6518 use mode-line-default-help-echo. Handle the case where the mouse
6519 position is past the end of the mode line string.
6520
6521 * buffer.c (buffer_local_value_1): New function, split from
6522 Fbuffer_local_value; can return Qunbound.
6523 (Fbuffer_local_value): Use it.
6524 (Vmode_line_format): Docstring tweaks.
6525
6526 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6527
6528 * sysdep.c (system_process_attributes): Improve comment.
6529
6530 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6531
6532 * keyboard.c: Export real-this-command to Elisp.
6533 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6534 and DEFVAR it. Update all users.
6535
6536 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6537
6538 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6539
6540 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6541 Convert pctcpu and pctmem to Lisp float properly.
6542 Let the compiler fold better, as 100.0/0x8000 is exact.
6543
6544 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6545
6546 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6547 cons_block.
6548
6549 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6550
6551 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6552
6553 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6554
6555 For a 'struct window', replace some Lisp_Object fields to
6556 bitfields where appropriate, remove unused fields.
6557 * window.h (struct window): Remove unused 'last_mark_x' and
6558 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6559 change it's type from Lisp_Object to bitfield.
6560 Change type of 'force_start', 'optional_new_start',
6561 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6562 fields from Lisp_Object to bitfield. Adjust users accordingly.
6563
6564 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6565
6566 Pacify gcc -Wdouble-precision when using Xaw.
6567 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6568 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6569 Use 'float' consistently, rather than 'float' in most places
6570 and 'double' in a couple of places.
6571
6572 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6573
6574 * xdisp.c (handle_stop): Detect whether we have overlay strings
6575 loaded by testing it->current.overlay_string_index to be
6576 non-negative, instead of checking whether n_overlay_strings is
6577 positive. (Bug#11587)
6578
6579 2012-05-31 Chong Yidong <cyd@gnu.org>
6580
6581 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6582
6583 * doc.c (Fsubstitute_command_keys): Doc fix.
6584
6585 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6586
6587 * search.c (search_buffer): Remove calls to
6588 r_alloc_inhibit_buffer_relocation, as it is now called by
6589 maybe_unify_char, which was the cause of relocation of buffer text
6590 in bug#11519.
6591
6592 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6593
6594 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6595 for the duration of call to load_charset, to avoid problems with
6596 callers of maybe_unify_char that access buffer text through C
6597 pointers.
6598
6599 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6600 decrement the inhibition flag, instead of just setting or
6601 resetting it.
6602
6603 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6604
6605 Remove obsolete '#define static' cruft.
6606 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6607 This #undef was "temporary" in 2000; it is no longer needed
6608 now that '#define static' has gone away.
6609 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6610 (gray_bitmap_bits): Remove; no longer needed.
6611 All uses replaced with definiens.
6612 * xterm.c: Include "bitmaps/gray.xbm".
6613
6614 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6615
6616 Clean up __executable_start, monstartup when --enable-profiling.
6617 The following changes affect the code only when profiling.
6618 * dispnew.c (__executable_start): Rename from safe_bcopy.
6619 Define only on platforms that need it.
6620 * emacs.c: Include <sys/gmon.h> when profiling.
6621 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6622 (__executable_start): Remove decl, since lisp.h does it now.
6623 (safe_bcopy): Remove decl; no longer has that name.
6624 (main): Coalesce #if into single bit of code, for simplicity.
6625 Cast pointers to uintptr_t, since standard libraries want integers
6626 and not pointers.
6627 * lisp.h (__executable_start): New decl.
6628
6629 2012-05-31 Glenn Morris <rgm@gnu.org>
6630
6631 * image.c (Fimagemagick_types): Doc fix.
6632
6633 2012-05-30 Jim Meyering <meyering@redhat.com>
6634
6635 * callproc.c (Fcall_process_region): Include directory component
6636 in mkstemp error message (Bug#11586).
6637
6638 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6639
6640 * alloc.c, lisp.h (make_pure_vector): Now static.
6641
6642 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6643
6644 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6645 Move to byte-run.el.
6646 (Fautoload): Do the hash-doc more carefully.
6647 * data.c (Fdefalias): Purify definition, except for keymaps.
6648 (Qdefun): Move from eval.c.
6649 * lisp.h (Qdefun): Remove.
6650 * lread.c (read1): Tiny simplification.
6651
6652 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6653
6654 Do not create empty overlays with the evaporate property (Bug#9642).
6655 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6656 Bug#9642, but explicitly check that the buffer the overlay would
6657 be moved to is live and rearrange lines to make sure that errors
6658 will not put the overlay in an inconsistent state.
6659 (Fdelete_overlay): Cosmetics.
6660
6661 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6662
6663 * w32term.c (my_bring_window_to_top): New function.
6664 (x_raise_frame): Use handle returned by DeferWindowPos, which
6665 could be different from the original one.
6666 Call my_bring_window_to_top instead of my_set_foreground_window.
6667 (Bug#11513)
6668
6669 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6670 by calling BringWindowToTop.
6671
6672 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6673 (WM_EMACS_END): Increase by one.
6674
6675 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6676
6677 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6678 This avoids undefined behavior that might cause the eassert
6679 to not catch an out-of-range value.
6680
6681 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6682
6683 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6684 Update dependencies.
6685
6686 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6687
6688 * bidi.c (bidi_mirror_char): Fix last change.
6689
6690 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6691
6692 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6693 when referring to sectname field in printf format.
6694
6695 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6696
6697 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6698 Only r_alloc_inhibit_buffer_relocation needed to be added;
6699 the others were already declared.
6700
6701 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6702 before checking whether it's out of range. Put the check inside
6703 eassert. See
6704 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6705
6706 2012-05-27 Ken Brown <kbrown@cornell.edu>
6707
6708 * callproc.c (Fcall_process): Restore a line that was accidentally
6709 commented out in the 2011-02-13 change (bug#11547).
6710
6711 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6712
6713 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6714 defined on ralloc.c.
6715
6716 * buffer.c [REL_ALLOC]: Remove prototypes of
6717 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6718 they are now on lisp.h.
6719
6720 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6721
6722 * search.c (search_buffer): Use it to inhibit relocation of buffer
6723 text while re_search_2 is doing its job, because re_search_2 is
6724 passed C pointers to buffer text. (Bug#11519)
6725
6726 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6727 Update value to 24.
6728
6729 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6730 state after an additional call to move_it_in_display_line_to, keep
6731 the values of it->max_ascent and it->max_descent found for the
6732 entire line.
6733 (pos_visible_p): Revert the comparison against bottom_y to what it
6734 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6735 (Bug#11464)
6736
6737 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6738
6739 Fix coding-related core dumps with gcc -ftrapv.
6740 The code was computing A - B, where A and B are pointers, and B is
6741 random garbage. This can lead to core dumps on platforms that
6742 have special pointer registers, and it also leads to core dumps on
6743 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6744 A - B only when B is initialized properly.
6745 * coding.c (coding_set_source, coding_set_destination): Return void.
6746 (coding_change_source, coding_change_destinations): New functions,
6747 with the old behaviors of coding_set_source and coding_set_destination.
6748 All callers that need an offset changed to use these new functions.
6749
6750 2012-05-26 Glenn Morris <rgm@gnu.org>
6751
6752 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6753
6754 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6755
6756 Extend mouse support on W32 text-mode console.
6757 * xdisp.c (draw_row_with_mouse_face):
6758 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6759
6760 * w32console.c: Include window.h.
6761 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6762 New functions.
6763 (initialize_w32_display): Initialize mouse-highlight data.
6764
6765 * w32inevt.c: Include termchar.h and window.h.
6766 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6767 moves, call note_mouse_highlight. If help_echo changed, call
6768 gen_help_event to produce help-echo message in the echo area.
6769 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6770 highlight info.
6771
6772 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6773
6774 * lread.c (read1): Simplify slightly to avoid an overflow warning
6775 with GCC 4.7.0 on x86-64.
6776
6777 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6778
6779 * bidi.c (bidi_mirror_char): Revert last change: an int is
6780 definitely wide enough here.
6781
6782 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6783
6784 Fix integer width and related bugs (Bug#9874).
6785 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6786 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6787 (string_bytes, check_sblock, allocate_string_data):
6788 (compact_small_strings, Fmake_bool_vector, make_string)
6789 (make_unibyte_string, make_multibyte_string)
6790 (make_string_from_bytes, make_specified_string)
6791 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6792 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6793 (mark_vectorlike):
6794 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6795 (allocate_pseudovector):
6796 Use int, not EMACS_INT, where int is wide enough.
6797 (inhibit_garbage_collection, Fgarbage_collect):
6798 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6799 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6800 int might not be wide enough.
6801 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6802 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6803 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6804 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6805 (bidi_level_of_next_char, bidi_move_to_visually_next):
6806 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6807 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6808 (Fkill_buffer, Fset_buffer_major_mode)
6809 (advance_to_char_boundary, Fbuffer_swap_text)
6810 (Fset_buffer_multibyte, overlays_at, overlays_in)
6811 (overlay_touches_p, struct sortvec, record_overlay_string)
6812 (overlay_strings, recenter_overlay_lists)
6813 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6814 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6815 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6816 (Foverlay_recenter, last_overlay_modification_hooks_used)
6817 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6819 (validate_region): Omit unnecessary test for b <= e,
6820 since that's guaranteed by the previous test.
6821 (adjust_overlays_for_delete): Avoid pos + length overflow.
6822 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6823 (report_overlay_modification):
6824 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6825 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6826 Omit pointer cast, which isn't needed anyway, and doesn't work
6827 after the EMACS_INT -> ptrdiff_t change.
6828 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6829 * buffer.h: Adjust decls to match defn changes elsewhere.
6830 (struct buffer_text, struct buffer):
6831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6832 Use EMACS_INT, not int, where int might not be wide enough.
6833 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6834 not int, to avoid needless 32-bit limit on 64-bit hosts.
6835 (exec_byte_code): Use tighter memory-full test, one that checks
6836 for alloca overflow. Don't compute the address of the object just
6837 before an array, as that's not portable. Use EMACS_INT, not
6838 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6839 * callint.c (Fcall_interactively):
6840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6841 * callproc.c (call_process_kill, Fcall_process):
6842 Don't assume pid_t fits into an Emacs fixnum.
6843 (call_process_cleanup, Fcall_process, child_setup):
6844 Don't assume pid_t fits into int.
6845 (call_process_cleanup, Fcall_process, delete_temp_file)
6846 (Fcall_process_region):
6847 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6848 (Fcall_process): Simplify handling of volatile integers.
6849 Use int, not EMACS_INT, where int will do.
6850 * casefiddle.c (casify_object, casify_region, operate_on_word)
6851 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6852 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6853 (casify_object): Avoid integer overflow when overallocating buffer.
6854 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6855 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6856 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6857 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6858 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6859 integers are now checked earlier. All uses replaced with XINT.
6860 (ccl_driver):
6861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6862 For CCL_MapSingle, check that content and value are in int range.
6863 (ccl_driver, Fregister_code_conversion_map):
6864 Check that Vcode_version_map_vector is a vector.
6865 (resolve_symbol_ccl_program): Check that vector header is in range.
6866 Always copy the vector, so that we can check its contents reliably
6867 now rather than having to recheck each instruction as it's being
6868 executed. Check that vector words fit in 'int'.
6869 (ccl_get_compiled_code, Fregister_ccl_program)
6870 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6871 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6872 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6873 contents are in range.
6874 (Fccl_execute_on_string): Check that status is in range.
6875 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6876 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6877 Accept and return EMACS_INT, not int, because callers can pass values
6878 out of 'int' range.
6879 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6880 (multibyte_chars_in_text, parse_str_as_multibyte)
6881 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6882 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6883 (string_escape_byte8, Fget_byte):
6884 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6885 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6886 avoid mishandling large integers.
6887 * character.h: Adjust decls to match defn changes elsewhere.
6888 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6889 (Ffind_charset_region):
6890 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6891 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6892 (load_charset_map_from_vector, Fdefine_charset_internal):
6893 Don't assume fixnum fits in int.
6894 (load_charset_map_from_vector, Fmap_charset_chars):
6895 Remove now-unnecessary CHECK_NATNUMs.
6896 (Fdefine_charset_internal): Check ranges here, more carefully.
6897 Don't rely on undefined behavior with signed left shift overflow.
6898 Don't assume unsigned int fits into fixnum, or that fixnum fits
6899 into unsigned int. Don't require max_code to be a valid fixnum;
6900 that's not true for gb10830 4-byte on a 32-bit host. Allow
6901 invalid_code to be a cons, for the same reason. Require code_offset
6902 to be a character. Avoid int overflow if max_char is close
6903 to INT_MAX.
6904 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6905 this is intended anyway and avoids some undefined behavior.
6906 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6907 INDEX_TO_CODE_POINT, as that's what it expects.
6908 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6909 * charset.h (DECODE_CHAR): Return int, not unsigned;
6910 this is what was intended anyway, and it avoids undefined behavior.
6911 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6912 integer-overflow issues.
6913 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6914 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6915 where the argument is EMACS_INT, and this behavior is not intended.
6916 * chartab.c (Fmake_char_table, Fset_char_table_range)
6917 (uniprop_get_decoder, uniprop_get_encoder):
6918 Don't assume fixnum fits in int.
6919 * cmds.c (move_point): New function, that does the gist of
6920 Fforward_char and Fbackward_char, but does so while checking
6921 for integer overflow more accurately.
6922 (Fforward_char, Fbackward_char): Use it.
6923 (Fforward_line, Fend_of_line, internal_self_insert)
6924 (internal_self_insert):
6925 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6926 Fix a FIXME, by checking for integer overflow when calculating
6927 target_clm and actual_clm.
6928 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6929 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6930 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6931 (coding_alloc_by_making_gap, alloc_destination)
6932 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6933 (encode_coding_utf_16, detect_coding_emacs_mule)
6934 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6935 (detect_coding_iso_2022, decode_coding_iso_2022)
6936 (encode_invocation_designation, encode_designation_at_bol)
6937 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6938 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6939 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6940 (encode_coding_ccl, encode_coding_raw_text)
6941 (detect_coding_charset, decode_coding_charset)
6942 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6943 (produce_composition, produce_charset, produce_annotation)
6944 (decode_coding, handle_composition_annotation)
6945 (handle_charset_annotation, consume_chars, decode_coding_gap)
6946 (decode_coding_object, encode_coding_object, detect_coding_system)
6947 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6948 (code_convert_region, code_convert_string)
6949 (Fdefine_coding_system_internal)
6950 (coding_set_source, coding_set_destination):
6951 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6952 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6953 (Fdefine_coding_system_internal):
6954 Don't assume fixnums fit in int.
6955 (decode_coding_gap, decode_coding_object, encode_coding_object)
6956 (Fread_coding_system, Fdetect_coding_region)
6957 (Funencodable_char_position, Fcheck_coding_systems_region)
6958 (get_translation, handle_composition_annotation, consume_chars):
6959 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6960 (consume_chars): Rewrite to not calculate an address outside buffer.
6961 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6962 Don't access memory outside of the args array.
6963 (Fdefine_coding_system_internal): Check for charset-id overflow.
6964 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6965 result of ENCODE_CHAR.
6966 * coding.h: Adjust decls to match defn changes elsewhere.
6967 (struct coding_system):
6968 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6969 * composite.c (get_composition_id, find_composition)
6970 (run_composition_function, update_compositions)
6971 (compose_text, composition_gstring_put_cache)
6972 (composition_gstring_p, composition_gstring_width)
6973 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6974 (composition_compute_stop_pos, composition_reseat_it)
6975 (composition_update_it, struct position_record)
6976 (find_automatic_composition, composition_adjust_point)
6977 (Fcomposition_get_gstring, Ffind_composition_internal):
6978 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6979 (update_compositions):
6980 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6981 * composite.h: Adjust decls to match defn changes elsewhere.
6982 (struct composition):
6983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6984 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6985 Do not attempt to compute the address of the object just before a
6986 buffer; this is not portable.
6987 (Faref, Faset):
6988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6989 (Faset): Use int, not EMACS_INT, where int is wide enough.
6990 (Fstring_to_number): Don't assume fixnums fit in int.
6991 (Frem): Don't assume arg is nonnegative.
6992 * dbusbind.c (xd_append_arg): Check for integers out of range.
6993 (Fdbus_call_method): Don't overflow the timeout int.
6994 (extract_signed, extract_unsigned): New functions.
6995 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6996 (xd_get_connection_references): Return ptrdiff_t, not int.
6997 All uses changed.
6998 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6999 (xd_read_message_1):
7000 Use int, not unsigned, where the dbus API uses int.
7001 (Fdbus_message_internal): Don't overflow mtype.
7002 (syms_of_dbusbind): Allocate right-sized buffer for integers.
7003 * dired.c (directory_files_internal, file_name_completion, scmp)
7004 (file_name_completion_stat):
7005 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7006 (file_name_completion): Don't overflow matchcount.
7007 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7008 * dispextern.h: Adjust decls to match defn changes elsewhere.
7009 (struct text_pos, struct glyph, struct bidi_saved_info)
7010 (struct bidi_string_data, struct bidi_it, struct composition_it)
7011 (struct it):
7012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7013 (struct display_pos, struct composition_it, struct it):
7014 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7015 * dispnew.c (increment_matrix_positions)
7016 (increment_row_positions, mode_line_string)
7017 (marginal_area_string):
7018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7019 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
7020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7021 (duration_to_sec_usec): New function, to check for overflow better.
7022 (Fsleep_for, sit_for): Use it.
7023 * doc.c (get_doc_string, store_function_docstring):
7024 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7025 (get_doc_string, Fsnarf_documentation):
7026 Use int, not EMACS_INT, where int is wide enough.
7027 (get_doc_string):
7028 Use SAFE_ALLOCA, not alloca.
7029 Check for overflow when converting EMACS_INT to off_t.
7030 * doprnt.c (doprnt):
7031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7032 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7033 Don't assume uid_t fits into fixnum.
7034 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7035 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7036 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7037 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7038 (general_insert_function)
7039 (Finsert_char, make_buffer_string, make_buffer_string_both)
7040 (update_buffer_properties, Fbuffer_substring)
7041 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7042 (Fsubst_char_in_region, check_translation)
7043 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7044 (transpose_markers, Ftranspose_regions):
7045 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7046 (clip_to_bounds): Move to lisp.h as an inline function).
7047 (Fconstrain_to_field): Don't assume integers are nonnegative.
7048 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7049 (Fsubst_char_in_region, Fsave_restriction):
7050 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7051 (Femacs_pid): Don't assume pid_t fits into fixnum.
7052 (lo_time): Use int, not EMACS_INT, when int suffices.
7053 (lisp_time_argument): Check for usec out of range.
7054 (Fencode_time): Don't assume fixnum fits in int.
7055 (Fuser_login_name, Fuser_full_name): Signal an error
7056 if a uid argument is out of range, rather than relying on
7057 undefined behavior.
7058 (Fformat_time_string): Remove now-unnecessary check.
7059 lisp_time_argument checks for out-of-range usec now.
7060 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
7061 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7062 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7063 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7064 (init_cmdargs, Fdump_emacs):
7065 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7066 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7067 the bottom (typically) 32 bits of the fixnum.
7068 * eval.c (specpdl_size, call_debugger):
7069 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7070 (when_entered_debugger, Fbacktrace_debug):
7071 Don't assume fixnum can fit in int.
7072 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7073 the object just before a buffer; this is not portable.
7074 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7075 (grow_specpdl, unbind_to):
7076 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7077 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7078 (grow_specpdl): Simplify allocation by using xpalloc.
7079 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
7080 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7081 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7083 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7084 (a_write, e_write):
7085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7086 (Fcopy_file, non_regular_nbytes, read_non_regular)
7087 (Finsert_file_contents):
7088 Use int, not EMACS_INT, where int is wide enough.
7089 (READ_BUF_SIZE): Verify that it fits in int.
7090 (Finsert_file_contents): Check that counts are in proper range,
7091 rather than assuming fixnums fit into ptrdiff_t etc.
7092 Don't assume fixnums fit into int.
7093 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
7094 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7095 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
7096 (string_char_to_byte, string_byte_to_char)
7097 (string_make_multibyte, string_to_multibyte)
7098 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7099 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7100 (substring_both, Fdelete, internal_equal, Ffillarray)
7101 (Fclear_string, mapcar1)
7102 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7103 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7104 (larger_vector, make_hash_table, maybe_resize_hash_table)
7105 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7106 (Fmaphash, secure_hash):
7107 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7108 (concat): Check for string index and length overflow.
7109 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7110 (Frequire):
7111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7112 (larger_vector): New API (vec, incr_min, size_max) replaces old
7113 one (vec, new_size, init). This catches size overflow.
7114 INIT was removed because it was always Qnil.
7115 All callers changed.
7116 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7117 the upper bound on a hash table index size.
7118 (make_hash_table, maybe_resize_hash_table): Use it.
7119 (secure_hash): Computer start_byte and end_byte only after
7120 they're known to be in ptrdiff_t range.
7121 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7122 (Ffont_get_glyphs, Ffont_at):
7123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7124 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7125 (Flist_fonts, Fopen_font):
7126 Don't assume fixnum can fit in int.
7127 (check_gstring): Don't assume index can fit in int.
7128 (font_match_p): Check that fixnum is a character, not a nonnegative
7129 fixnum, since the later code needs to stuff it into an int.
7130 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7131 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7132 conversion overflow issues.
7133 (Fopen_font): Check for integer out of range.
7134 (Ffont_get_glyphs): Don't assume index can fit in int.
7135 * font.h: Adjust decls to match defn changes elsewhere.
7136 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7137 integer overflow.
7138 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7139 printmax_t, where ptrdiff_t is wide enough.
7140 (Finternal_char_font):
7141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7142 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7143 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7144 (Fset_frame_position, x_set_frame_parameters)
7145 (x_set_line_spacing, x_set_border_width)
7146 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7147 Check that fixnums are in proper range for system types.
7148 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7149 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7150 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7151 Use SAFE_ALLOCA_LISP, not alloca.
7152 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7153 intptr_t is wide enough.
7154 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7155 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7156 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7157 Check for fixnum out of range.
7158 * ftfont.c (ftfont_list): Don't assume index fits in int.
7159 Check that fixnums are in proper range for system types.
7160 (ftfont_shape_by_flt):
7161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7162 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7164 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7165 Check that fixnums are in proper range for system types.
7166 * gnutls.h: Adjust decls to match defn changes elsewhere.
7167 * gtkutil.c (xg_dialog_run):
7168 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7169 (update_frame_tool_bar):
7170 Check that fixnums are in proper range for system types.
7171 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
7172 (lookup_image): Check that fixnums are in range for system types.
7173 * indent.c (last_known_column, last_known_column_point):
7174 (current_column_bol_cache):
7175 (skip_invisible, current_column, check_display_width):
7176 (check_display_width, scan_for_column, current_column_1)
7177 (Findent_to, Fcurrent_indentation, position_indentation)
7178 (indented_beyond_p, Fmove_to_column, compute_motion):
7179 (Fcompute_motion, Fvertical_motion):
7180 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7181 (last_known_column_modified): Use EMACS_INT, not int.
7182 (check_display_width):
7183 (Fcompute_motion):
7184 Check that fixnums and floats are in proper range for system types.
7185 (compute_motion): Don't assume index or fixnum fits in int.
7186 (compute_motion, Fcompute_motion):
7187 Use int, not EMACS_INT, when it is wide enough.
7188 (vmotion): Omit local var start_hpos that is always 0; that way
7189 we don't need to worry about overflow in expressions involving it.
7190 * indent.h: Adjust decls to match defn changes elsewhere.
7191 (struct position):
7192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7193 Use int, not EMACS_INT, where int is wide enough.
7194 Remove unused members ovstring_chars_done and tab_offset;
7195 all uses removed.
7196 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7197 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7198 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7199 (make_gap, copy_text, insert, insert_and_inherit)
7200 (insert_before_markers, insert_before_markers_and_inherit)
7201 (insert_1, count_combining_before, count_combining_after)
7202 (insert_1_both, insert_from_string)
7203 (insert_from_string_before_markers, insert_from_string_1)
7204 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7205 (adjust_after_replace, adjust_after_insert, replace_range)
7206 (replace_range_2, del_range, del_range_1, del_range_byte)
7207 (del_range_both, del_range_2, modify_region)
7208 (prepare_to_modify_buffer, signal_before_change)
7209 (signal_after_change, Fcombine_after_change_execute):
7210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7211 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7212 (balance_an_interval, split_interval_right, split_interval_left)
7213 (find_interval, next_interval, update_interval)
7214 (adjust_intervals_for_insertion, delete_node, delete_interval)
7215 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7216 (static_offset_intervals, offset_intervals)
7217 (merge_interval_right, merge_interval_left, make_new_interval)
7218 (graft_intervals_into_buffer, temp_set_point_both)
7219 (temp_set_point, set_point, adjust_for_invis_intang)
7220 (set_point_both, move_if_not_intangible, get_property_and_range)
7221 (get_local_map, copy_intervals, copy_intervals_to_string)
7222 (compare_string_intervals, set_intervals_multibyte_1):
7223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7224 * intervals.h: Adjust decls to match defn changes elsewhere.
7225 (struct interval):
7226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7227 * keyboard.c (this_command_key_count, this_single_command_key_start)
7228 (before_command_key_count, before_command_echo_length, echo_now)
7229 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7230 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7231 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7232 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7233 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7234 (last_non_minibuf_size, last_point_position, echo_truncate)
7235 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7236 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7237 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7238 (stuff_buffered_input):
7239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7240 (last_auto_save, command_loop_1, read_char):
7241 Use EMACS_INT, not int, to avoid integer overflow.
7242 (record_char): Avoid overflow in total_keys computation.
7243 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7244 * keyboard.h: Adjust decls to match defn changes elsewhere.
7245 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7246 (Fkey_description, Fdescribe_vector, Flookup_key):
7247 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7248 (click_position): New function, to check that positions are in range.
7249 (Fcurrent_active_maps):
7250 (describe_command):
7251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7252 (Faccessible_keymaps, Fkey_description):
7253 (preferred_sequence_p):
7254 Don't assume fixnum can fit into int.
7255 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7256 Check for integer overflow in size calculations.
7257 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7258 avoid mishandling large integers.
7259 * lisp.h: Adjust decls to match defn changes elsewhere.
7260 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7261 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7262 (struct Lisp_Marker):
7263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7264 (clip_to_bounds): Now an inline function, moved here from editfns.c.
7265 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7266 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7267 All callers changed.
7268 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7269 Assume the arg has valid form, since it always does.
7270 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7271 unsigned integer system type.
7272 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7273 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7275 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7276 (duration_to_sec_usec): New decl.
7277 * lread.c (read_from_string_index, read_from_string_index_byte)
7278 (read_from_string_limit, readchar, unreadchar, openp)
7279 (read_internal_start, read1, oblookup):
7280 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7281 (Fload, readevalloop, Feval_buffer, Feval_region):
7282 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7283 (openp): Check for out-of-range argument to 'access'.
7284 (read1): Use int, not EMACS_INT, where int is wide enough.
7285 Don't assume fixnum fits into int.
7286 Fix off-by-one error that can read outside a buffer.
7287 (read_filtered_event): Use duration_to_sec_usec
7288 to do proper overflow checking on durations.
7289 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7290 in size calculation.
7291 (Fexecute_kbd_macro):
7292 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7293 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7294 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7295 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7296 (set_marker_both, set_marker_restricted_both, marker_position)
7297 (marker_byte_position, Fbuffer_has_markers_at):
7298 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7299 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
7300 * menu.c (ensure_menu_items): Rename from grow_menu_items.
7301 It now merely ensures that the menu is large enough, without
7302 necessarily growing it, as this avoids some integer overflow issues.
7303 All callers changed.
7304 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7305 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7306 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7307 Use SAFE_ALLOCA_LISP, not alloca.
7308 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7309 to EMACS_INT. Check that fixnums are in proper range for system types.
7310 * minibuf.c (minibuf_prompt_width, string_to_object)
7311 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7312 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7314 (get_minibuffer, read_minibuf_unwind):
7315 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7316 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7317 this simplifies overflow checking. All callers changed.
7318 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7319 (Ftest_completion):
7320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7321 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7322 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7323 Check that fixnums are in proper range for system types.
7324 (Fx_create_frame, Fx_show_tip):
7325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7326 * nsfont.m (ns_findfonts, nsfont_list_family):
7327 Don't assume fixnum fits in long.
7328 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7329 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7330 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7331 wide enough.
7332 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
7333 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7334 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7335 (PRINTDECLARE, PRINTPREPARE):
7336 (strout, print_string):
7337 (print, print_preprocess, print_check_string_charset_prop)
7338 (print_object):
7339 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7340 (PRINTDECLARE):
7341 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7342 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7343 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
7344 (printchar, strout): Use xpalloc to catch size calculation overflow.
7345 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
7346 (print_error_message): Use SAFE_ALLOCA, not alloca.
7347 (print_object): Use int, not EMACS_INT, where int is wide enough.
7348 (print_depth, new_backquote_output, print_number_index):
7349 Use ptrdiff_t, not int, where int might not be wide enough.
7350 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7351 (Fset_process_window_size, Fformat_network_address)
7352 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
7353 (sigchld_handler):
7354 Check that fixnums are in proper range for system types.
7355 (Fsignal_process): Simplify by avoiding a goto.
7356 Check for process-ids out of pid_t range rather than relying on
7357 undefined behavior.
7358 (process_tick, update_tick): Use EMACS_INT, not int.
7359 (Fformat_network_address, read_process_output, send_process)
7360 (Fprocess_send_region, status_notify):
7361 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7362 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7363 (wait_reading_process_output, read_process_output, exec_sentinel):
7364 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7365 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7366 (Faccept_process_output): Use duration_to_sec_usec to do proper
7367 overflow checking on durations.
7368 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7369 Don't assume pid_t fits in int.
7370 * process.h (struct Lisp_Process): Members tick and update_tick
7371 are now of type EMACS_INT, not int.
7372 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7373 configured --with-wide-int.
7374 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7375 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7376 * search.c (looking_at_1, string_match_1):
7377 (fast_string_match, fast_c_string_match_ignore_case)
7378 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7379 (scan_newline, find_before_next_newline, search_command)
7380 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7381 (set_search_regs, wordify):
7382 (Freplace_match):
7383 (Fmatch_data):
7384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7385 (string_match_1, search_buffer, set_search_regs):
7386 (Fmatch_data):
7387 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7388 (wordify): Check for overflow in size calculation.
7389 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7390 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7391 Check that fixnums are in proper range for system types.
7392 * sound.c (struct sound_device)
7393 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7395 (Fplay_sound_internal):
7396 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7397 * syntax.c (struct lisp_parse_state, find_start_modiff)
7398 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7399 (Fparse_partial_sexp):
7400 Don't assume fixnums can fit in int.
7401 (struct lisp_parse_state, find_start_pos, find_start_value)
7402 (find_start_value_byte, find_start_begv)
7403 (update_syntax_table, char_quoted, dec_bytepos)
7404 (find_defun_start, prev_char_comend_first, back_comment):
7405 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7406 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7408 (Finternal_describe_syntax_value): Check that match_lisp is a
7409 character, not an integer, since the code stuffs it into int.
7410 (scan_words, scan_sexps_forward):
7411 Check that fixnums are in proper range for system types.
7412 (Fforward_word):
7413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7414 (scan_sexps_forward):
7415 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7416 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7417 * syntax.h: Adjust decls to match defn changes elsewhere.
7418 (struct gl_state_s):
7419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7420 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7421 MOST_POSITIVE_FIXNUM.
7422 * sysdep.c (wait_for_termination_1, wait_for_termination)
7423 (interruptible_wait_for_termination, mkdir):
7424 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7425 (emacs_read, emacs_write):
7426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7427 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7428 and double all fit in int.
7429 * term.c (set_tty_color_mode):
7430 Check that fixnums are in proper range for system types.
7431 * termhooks.h (struct input_event):
7432 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7433 * textprop.c (validate_interval_range, interval_of)
7434 (Fadd_text_properties, set_text_properties_1)
7435 (Fremove_text_properties, Fremove_list_of_text_properties)
7436 (Ftext_property_any, Ftext_property_not_all)
7437 (copy_text_properties, text_property_list, extend_property_ranges)
7438 (verify_interval_modification):
7439 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7440 (Fnext_single_char_property_change)
7441 (Fprevious_single_char_property_change):
7442 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7443 (copy_text_properties):
7444 Check for integer overflow in index calculation.
7445 * undo.c (last_boundary_position, record_point, record_insert)
7446 (record_delete, record_marker_adjustment, record_change)
7447 (record_property_change):
7448 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7449 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7450 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7451 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7452 (Fx_hide_tip, Fx_file_dialog):
7453 * w32menu.c (set_frame_menubar):
7454 Use ptrdiff_t, not int, for consistency with rest of code.
7455 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7456 (select_window, Fdelete_other_windows_internal)
7457 (window_scroll_pixel_based, window_scroll_line_based)
7458 (Frecenter, Fset_window_configuration):
7459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7460 (Fset_window_hscroll, run_window_configuration_change_hook)
7461 (set_window_buffer, temp_output_buffer_show, scroll_command)
7462 (Fscroll_other_window, Frecenter):
7463 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7464 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7465 Don't assume fixnum fits in int.
7466 (Fset_window_scroll_bars):
7467 Check that fixnums are in proper range for system types.
7468 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7469 (string_pos, c_string_pos, number_of_chars, init_iterator)
7470 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7471 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7472 (compute_display_string_end, handle_face_prop)
7473 (face_before_or_after_it_pos, handle_invisible_prop)
7474 (handle_display_prop, handle_display_spec, handle_single_display_spec)
7475 (display_prop_intangible_p, string_buffer_position_lim)
7476 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7477 (get_overlay_strings_1, get_overlay_strings)
7478 (iterate_out_of_display_property, forward_to_next_line_start)
7479 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7480 (get_next_display_element, set_iterator_to_next)
7481 (get_visually_first_element, compute_stop_pos_backwards)
7482 (handle_stop_backwards, next_element_from_buffer)
7483 (move_it_in_display_line_to, move_it_in_display_line)
7484 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7485 (add_to_log, message_dolog, message_log_check_duplicate)
7486 (message2, message2_nolog, message3, message3_nolog
7487 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7488 (current_message_1, truncate_echo_area, truncate_message_1)
7489 (set_message, set_message_1, store_mode_line_noprop)
7490 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7491 (text_outside_line_unchanged_p, check_point_in_composition)
7492 (reconsider_clip_changes)
7493 (redisplay_internal, set_cursor_from_row, try_scrolling)
7494 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7495 (redisplay_window, find_last_unchanged_at_beg_row)
7496 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7497 (trailing_whitespace_p, find_row_edges, display_line)
7498 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7499 (display_mode_element, store_mode_line_string)
7500 (pint2str, pint2hrstr, decode_mode_spec)
7501 (display_count_lines, display_string, draw_glyphs)
7502 (x_produce_glyphs, x_insert_glyphs)
7503 (rows_from_pos_range, mouse_face_from_buffer_pos)
7504 (fast_find_string_pos, mouse_face_from_string_pos)
7505 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7507 (safe_call, init_from_display_pos, handle_fontified_prop)
7508 (handle_single_display_spec, load_overlay_strings)
7509 (with_echo_area_buffer, setup_echo_area_for_printing)
7510 (display_echo_area, echo_area_display)
7511 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7512 (update_tool_bar, hscroll_window_tree, redisplay_internal)
7513 (redisplay_window, dump_glyph_row, display_mode_line)
7514 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
7515 (handle_display_spec, display_prop_string_p):
7516 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7517 (handle_single_display_spec, build_desired_tool_bar_string)
7518 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7519 (get_specified_cursor_type):
7520 Check that fixnums are in proper range for system types.
7521 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7522 (Flookup_image_map):
7523 Don't assume fixnums fit in int.
7524 (compare_overlay_entries):
7525 Avoid mishandling comparisons due to subtraction overflow.
7526 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7527 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7528 (handle_tool_bar_click):
7529 Use int, not unsigned, since we prefer signed and the signedness
7530 doesn't matter here.
7531 (get_next_display_element, next_element_from_display_vector):
7532 Use int, not EMACS_INT, when int is wide enough.
7533 (start_hourglass): Use duration_to_sec_usec to do proper
7534 overflow checking on durations.
7535 * xfaces.c (Fbitmap_spec_p):
7536 Check that fixnums are in proper range for system types.
7537 (compare_fonts_by_sort_order):
7538 Avoid mishandling comparisons due to subtraction overflow.
7539 (Fx_family_fonts, realize_basic_faces):
7540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7541 (Fx_family_fonts):
7542 Don't assume fixnum fits in int.
7543 Use SAFE_ALLOCA_LISP, not alloca.
7544 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7545 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7546 (face_at_buffer_position, face_for_overlay_string)
7547 (face_at_string_position):
7548 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7549 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7550 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7551 (Fx_show_tip):
7552 Check that fixnums are in proper range for system types.
7553 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7554 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7555 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7556 (Fx_change_window_property): Don't assume fixnums fit in int.
7557 * xfont.c (xfont_chars_supported):
7558 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7559 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7560 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7561 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7562 * xml.c (parse_region):
7563 * xrdb.c (magic_file_p):
7564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7565 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7566 (x_get_local_selection, x_reply_selection_request)
7567 (x_handle_selection_request, wait_for_property_change):
7568 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7569 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7570 short is wide enough.
7571 (x_send_client_event): Don't assume fixnum fits in int.
7572 * xterm.c (x_x_to_emacs_modifiers):
7573 Don't assume EMACS_INT overflows nicely into int.
7574 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7575 may come from Lisp.
7576 (handle_one_xevent): NATNUMP can eval its arg twice.
7577 (x_connection_closed):
7578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7579 * xterm.h: Adjust decls to match defn changes elsewhere.
7580 (struct scroll_bar): Use struct vectorlike_header
7581 rather than rolling our own approximation.
7582 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7583
7584 2012-05-25 Glenn Morris <rgm@gnu.org>
7585
7586 * lisp.mk (lisp): Update for more files being compiled now.
7587
7588 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7589
7590 * lread.c: Remove `read_pure' which makes no difference.
7591 (read_pure): Remove var.
7592 (unreadpure): Remove function.
7593 (readevalloop): Don't call read_list with -1 flag.
7594 (read1, read_vector): Don't test read_pure any more.
7595 (read_list): Simplify.
7596
7597 * fileio.c, character.h: Minor style tweaks.
7598
7599 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7600
7601 * window.h (clip_changed): Remove useless declaration.
7602
7603 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7604
7605 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7606 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7607
7608 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7609
7610 Remove src/m/*.
7611 This directory predates autoconf and is no longer needed nowadays.
7612 Move its few remaining bits of functionality to where they're needed.
7613 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7614 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7615 * m/template.h: Remove.
7616 * Makefile.in (M_FILE): Remove. All uses removed.
7617 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7618 * lisp.h (USE_LSB_TAG):
7619 * mem-limits.h (EXCEEDS_LISP_PTR):
7620 Use VAL_MAX, not VALBITS, in #if.
7621 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7622 (EMACS_UINT): Define unconditionally now.
7623 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7624 (BITS_PER_EMACS_INT): New constants, replacing
7625 what used to be in config.h, but not useful in #if.
7626 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7627 define them any more.
7628 (VAL_MAX): New macro.
7629 (VALMASK): Use it.
7630 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7631 BITS_PER_EMACS_INT, in #if.
7632 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7633 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7634 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7635 * s/ms-w32.h (DATA_START):
7636 Move here from removed file m/intel386.h.
7637 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7638 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7639
7640 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7641
7642 Assume C89 or later.
7643 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7644 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7645 (xrealloc):
7646 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7647 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7648 * textprop.c, tparam.c (NULL): Remove.
7649 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7650 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7651 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7652 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7653 * xterm.c (input_signal_count): Assume volatile works.
7654
7655 2012-05-21 Ken Brown <kbrown@cornell.edu>
7656
7657 * xgselect.c (xg_select): Fix first argument in call to 'select'
7658 (bug#11508).
7659
7660 2012-05-20 Ken Brown <kbrown@cornell.edu>
7661
7662 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7663 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7664
7665 2012-05-19 Ken Brown <kbrown@cornell.edu>
7666
7667 * xfns.c (x_in_use): Remove `static' qualifier.
7668 * xterm.h (x_in_use): Declare.
7669 * xgselect.c: Include xterm.h.
7670 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7671 and `display_arg' (bug#9754).
7672
7673 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7674
7675 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7676
7677 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7678 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7679
7680 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7681
7682 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7683
7684 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7685 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7686
7687 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7688 reference to image_cache->refcount.
7689 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7690
7691 2012-05-17 Juri Linkov <juri@jurta.org>
7692
7693 * search.c (Fword_search_regexp, Fword_search_backward)
7694 (Fword_search_forward, Fword_search_backward_lax)
7695 (Fword_search_forward_lax): Move functions to isearch.el
7696 (bug#10145, bug#11381).
7697
7698 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7699
7700 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7701
7702 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7703
7704 * lread.c (init_obarray): Declare Qt and Qnil as special.
7705
7706 2012-05-14 Glenn Morris <rgm@gnu.org>
7707
7708 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7709 Put "libexec" before "bin", for the sake of init_callproc_1.
7710
7711 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7712
7713 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7714
7715 * unexaix.c: Port to more-recent AIX compilers.
7716 (report_error, report_error_1, make_hdr, copy_sym)
7717 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7718 Make arguments const char *, not char *, to avoid violations of C
7719 standard and to fix some AIX warnings reported by Gilles Pion.
7720
7721 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7722
7723 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7724 already have overlays loaded.
7725 (handle_single_display_spec): Before returning without displaying
7726 fringe bitmap, synchronize the bidi iterator with the main display
7727 iterator, by calling iterate_out_of_display_property.
7728 (iterate_out_of_display_property): Detect buffer iteration by
7729 testing that it->string is a Lisp string.
7730 (get_next_display_element): When the current object is exhausted,
7731 and there's something on it->stack, call set_iterator_to_next to
7732 proceed with what's on the stack, instead of returning zero.
7733 (set_iterator_to_next): If called at the end of a Lisp string,
7734 proceed to consider_string_end without incrementing string
7735 position. Don't increment display vector index past the end of
7736 the display vector. (Bug#11417)
7737 (pos_visible_p): Don't report a position visible when move_it_to
7738 stopped at the last line of window, which happens to be scanned
7739 backwards by the bidi iteration. (Bug#11464)
7740
7741 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7742
7743 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7744 and right-margin display specs even if the spec is invalid or we
7745 are on a TTY, and thus unable to display on the fringes.
7746 That's because the text with the property will not be displayed anyway,
7747 so we need to signal to the caller that this is a "replacing"
7748 display spec. This fixes display when the spec is invalid or we
7749 are on a TTY.
7750
7751 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7752
7753 * unexaix.c (make_hdr): Fix typo in prototype.
7754 This bug broke the build on AIX. Problem reported by Gilles Pion.
7755
7756 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7757
7758 * keyboard.c (kbd_buffer_get_event): Read special events also in
7759 batch mode. (Bug#11415)
7760
7761 2012-05-12 Glenn Morris <rgm@gnu.org>
7762
7763 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7764
7765 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7766
7767 * lisp.mk (lisp): Add newcomment.elc.
7768
7769 2012-05-12 Glenn Morris <rgm@gnu.org>
7770
7771 * Makefile.in (MKDIR_P): New, set by configure.
7772 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7773
7774 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7775
7776 Remove unused function hourglass_started.
7777 * dispextern.h (hourglass_started):
7778 * w32fns.c (hourglass_started):
7779 * xdisp.c (hourglass_started): Remove.
7780
7781 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7782
7783 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7784 Update dependencies.
7785
7786 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7787
7788 * xgselect.c (xg_select): Put maxfds+1 into a var.
7789 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7790
7791 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7792
7793 2012-05-10 Dave Abrahams <dave@boostpro.com>
7794
7795 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7796 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7797
7798 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7799
7800 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7801 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7802 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7803 Initialize xd_registered_buses.
7804
7805 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7806
7807 Untag more efficiently if USE_LSB_TAG.
7808 This is based on a proposal by YAMAMOTO Mitsuharu in
7809 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7810 For an admittedly artificial (nth 8000 longlist) benchmark on
7811 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7812 Emacs's overall text size by 1%.
7813 * lisp.h (XUNTAG): New macro.
7814 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7815 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7816 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7817 * eval.c (Fautoload):
7818 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7819 * frame.h (XFRAME): Use XUNTAG.
7820
7821 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7822 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7823 Remove unportable assumptions about print widths of types like
7824 dbus_uint32_t.
7825 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7826 intptr_t when converting between pointer and integer, to avoid GCC
7827 warnings about wrong width.
7828
7829 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7830
7831 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7832 stack for each reader_thread, instead of defaulting to 8MB
7833 determined by the linker. This avoids failures in creating
7834 subprocesses on Windows 7, see the discussion in this thread:
7835 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7836
7837 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7838
7839 Fix up display of the *Minibuf-0* buffer in the mini window.
7840 * keyboard.c (read_char): Don't clear the echo area if there's no
7841 message to clear.
7842 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7843 contents of *Minibuf-0*) if there's no message displayed in its stead.
7844
7845 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7846
7847 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7848 batch mode.
7849
7850 2012-05-06 Chong Yidong <cyd@gnu.org>
7851
7852 * lisp.mk (lisp): Update.
7853
7854 2012-05-05 Jim Meyering <meyering@redhat.com>
7855
7856 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7857
7858 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7859
7860 * data.c (PUT_ERROR): New macro.
7861 (syms_of_data): Use it. Add new error type `user-error'.
7862 * undo.c (user_error): New function.
7863 (Fprimitive_undo): Use it.
7864 * print.c (print_error_message): Adjust print style for `user-error'.
7865 * keyboard.c (user_error): New function.
7866 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7867
7868 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7869
7870 Do not limit current-time-string to years 1000..9999.
7871 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7872 (Fcurrent_time_string): Support any year that is supported by the
7873 underlying localtime representation. Don't use asctime, as it
7874 has undefined behavior for years outside the range -999..9999.
7875
7876 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7877
7878 Fix race conditions involving setenv, gmtime, localtime, asctime.
7879 Without this fix, interrupts could mess up code that uses these
7880 nonreentrant functions, since setting TZ invalidates existing
7881 tm_zone or tzname values, and since most of these functions return
7882 pointers to static storage.
7883 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7884 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7885 Grow the critical sections to include not just invoking
7886 localtime/gmtime, but also accessing these functions' results
7887 including their tm_zone values if any, and any related TZ setting.
7888 (format_time_string): Last arg is now struct tm *, not struct tm **,
7889 so that the struct tm is saved in the critical section.
7890 All callers changed. Simplify allocation of initial buffer, partly
7891 motivated by the fact that memory allocation needs to be outside
7892 the critical section.
7893
7894 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7895
7896 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7897 with RESET_INTERVAL.
7898
7899 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7900 Remove duplicated buffer name initialization.
7901
7902 2012-05-02 Jim Meyering <jim@meyering.net>
7903
7904 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7905
7906 * xfns.c (x_window): Use xstrdup (Bug#11375).
7907
7908 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7909
7910 * xdisp.c (pos_visible_p): If already at a newline from the
7911 display string before the 'while' loop, don't walk back the glyphs
7912 from it3.glyph_row. Solves assertion violation when the display
7913 string begins with a newline (egg.el). (Bug#11367)
7914
7915 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7916
7917 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7918 Move to simple.el.
7919
7920 2012-05-01 Glenn Morris <rgm@gnu.org>
7921
7922 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7923 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7924 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7925 All were removed before 23.1.
7926
7927 * dispnew.c: Remove HAVE_LIBNCURSES test;
7928 it is always true on relevant platforms.
7929
7930 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7931 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7932
7933 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7934
7935 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7936
7937 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7938 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7939 Remove.
7940
7941 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7942
7943 Do not avoid creating empty evaporating overlays (Bug#9642).
7944 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7945 That is, do not delete an evaporating overlay if it becomes
7946 empty after its bounds are adjusted to fit within its buffer.
7947 This fix caused other problems, and I'm reverting it until we get
7948 to the bottom of them.
7949
7950 2012-04-27 Chong Yidong <cyd@gnu.org>
7951
7952 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7953
7954 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7955
7956 * xdisp.c (pos_visible_p): If the window start position is beyond
7957 ZV, start the display from buffer beginning. Prevents assertion
7958 violation in init_iterator when the minibuffer window is scrolled
7959 via the scroll bar.
7960
7961 * window.c (window_scroll_pixel_based): Likewise.
7962
7963 2012-04-27 Chong Yidong <cyd@gnu.org>
7964
7965 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7966
7967 2012-04-27 Glenn Morris <rgm@gnu.org>
7968
7969 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7970 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7971
7972 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7973
7974 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7975 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7976
7977 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7978
7979 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7980 display element, check also the underlying string or buffer
7981 character. (Bug#11341)
7982
7983 * w32menu.c: Include w32heap.h.
7984 (add_menu_item): If the call to AppendMenuW (via
7985 unicode_append_menu) fails, disable Unicode menus only if we are
7986 running on Windows 9X/Me.
7987
7988 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7989
7990 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7991 (xgetint): Add missing shift for LSB tags.
7992
7993 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7994
7995 * keyboard.c (read_char): Don't wipe echo area for select window
7996 events: These might get delayed via `mouse-autoselect-window'
7997 (Bug#11304).
7998
7999 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
8000
8001 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8002 manipulation of :loaded-from data.
8003
8004 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
8005
8006 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8007 now a cons (bug#11311).
8008
8009 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8010
8011 Do not create empty overlays with the evaporate property (Bug#9642).
8012 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8013 if it becomes empty after its bounds are adjusted to fit within
8014 its buffer. Without this fix, in a nonempty buffer (let ((o
8015 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8016 yields an empty overlay that has the evaporate property, which is
8017 not supposed to happen.
8018
8019 Fix minor GTK3 problems found by static checking.
8020 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8021 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8022 (struct _EmacsFixedClass, emacs_fixed_get_type):
8023 Move decls here from emacsgtkfixed.h, since they needn't be public.
8024 (emacs_fixed_get_type): Now static.
8025 (emacs_fixed_class_init): Omit unused local.
8026 (emacs_fixed_child_type): Remove; unused.
8027 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8028 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8029 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8030 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8031 (EMACS_FIXED_GET_CLASS): Remove; unused.
8032 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8033
8034 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8035 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8036
8037 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8038
8039 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
8040 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
8041 (__malloc_size_t, __malloc_ptrdiff_t):
8042 Remove. All uses removed, replaced by the definiens if needed,
8043 since we can assume C89 or better now.
8044 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8045 (protect_malloc_state, align, get_contiguous_space)
8046 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8047 (malloc_atfork_handler_child, malloc_enable_thread)
8048 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8049 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8050 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8051 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8052 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8053 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8054 Define using prototypes, not old style.
8055 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8056 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8057 (align): Don't assume that signed integer overflow wraps around.
8058 Omit unused local var.
8059 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8060 (_free_internal_nolock, memalign, mallochook, reallochook):
8061 Omit no-longer-needed casts.
8062 (valloc): Use getpagesize, not __getpagesize.
8063 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8064 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8065
8066 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8067
8068 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
8069
8070 Move functions from C to Lisp. Make non-blocking method calls
8071 the default. Implement further D-Bus standard interfaces.
8072
8073 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8074 (QCdbus_request_name_allow_replacement)
8075 (QCdbus_request_name_replace_existing)
8076 (QCdbus_request_name_do_not_queue)
8077 (QCdbus_request_name_reply_primary_owner)
8078 (QCdbus_request_name_reply_in_queue)
8079 (QCdbus_request_name_reply_exists)
8080 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8081 (QCdbus_registered_serial, QCdbus_registered_method)
8082 (QCdbus_registered_signal): New Lisp objects.
8083 (XD_DEBUG_MESSAGE): Use sizeof.
8084 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8085 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8086 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8087 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8088 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8089 (xd_signature, xd_append_arg): Allow float for integer types.
8090 (xd_get_connection_references): New function.
8091 (xd_get_connection_address): Rename from xd_initialize.
8092 Return cached address.
8093 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8094 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8095 level.
8096 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
8097 Return number of refcounts.
8098 (Fdbus_get_unique_name): Make stronger parameter check.
8099 (Fdbus_message_internal): New defun.
8100 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8101 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8102 (Fdbus_send_signal, Fdbus_register_service)
8103 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8104 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8105 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8106 (Vdbus_compiled_version, Vdbus_runtime_version)
8107 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8108 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8109 (Vdbus_message_type_signal): New defvars.
8110 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8111 Adapt docstring.
8112
8113 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8114
8115 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8116 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8117 Do not assume ptrdiff_t is the same width as 'int'.
8118
8119 * alloc.c: Handle unusual debugging option combinations.
8120 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8121 since the two debugging options are incompatible.
8122 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8123 is defined.
8124 (mem_init, mem_insert, mem_insert_fixup):
8125 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8126 (NEED_MEM_INSERT): Remove; no longer needed.
8127
8128 2012-04-22 Leo Liu <sdl.web@gmail.com>
8129
8130 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8131
8132 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8133
8134 * sysdep.c [__FreeBSD__]: Minor cleanups.
8135 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8136 Use Emacs indenting style more consistently. Avoid some casts.
8137 Use 'double' consistently rather than mixing 'float' and 'double'.
8138
8139 2012-04-21 Eduard Wiebe <usenet@pusto.de>
8140
8141 * sysdep.c (list_system_processes, system_process_attributes):
8142 Add implementation for FreeBSD (Bug#5243).
8143
8144 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8145
8146 * lisp.mk (lisp): Update.
8147
8148 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8149
8150 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8151 It is never used otherwise.
8152
8153 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8154
8155 * print.c (print_preprocess): Only check print_depth if print-circle
8156 is nil.
8157 (print_object): Check for cycles even when print-circle is nil and
8158 print-gensym is t, but only check print_depth if print-circle is nil.
8159
8160 2012-04-20 Chong Yidong <cyd@gnu.org>
8161
8162 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8163 set the status to "failed" and ensure that sentinel is run.
8164
8165 2012-04-20 Glenn Morris <rgm@gnu.org>
8166
8167 * process.c (Fset_process_inherit_coding_system_flag)
8168 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
8169 (Fmake_network_process, Fmake_serial_process): Doc fix.
8170
8171 2012-04-20 Eli Zaretskii <eliz@gnu.org>
8172
8173 * xdisp.c (string_buffer_position_lim): Limit starting position to
8174 BEGV.
8175 (set_cursor_from_row): If called for a mode-line or header-line
8176 row, return zero immediately.
8177 (try_cursor_movement): If inside continuation line, don't back up
8178 farther than the first row after the header line, if any.
8179 Don't consider the header-line row as "partially visible", even if
8180 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8181
8182 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8183
8184 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8185 (bug#11238).
8186
8187 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
8188 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
8189
8190 configure: new option --enable-gcc-warnings (Bug#11207)
8191 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8192 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8193 (ALL_CFLAGS): Use new macros rather than old.
8194 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8195 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8196 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8197 -Wunused-result, -Wunused-variable. This should go away once
8198 the Emacs and Gnulib regex code is merged.
8199 (xmalloc, xrealloc): Now static.
8200
8201 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8202
8203 * dired.c (Fsystem_groups): Remove unused local.
8204
8205 2012-04-17 Glenn Morris <rgm@gnu.org>
8206
8207 * dired.c (Fsystem_users): Doc fix.
8208
8209 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8210
8211 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8212 (syms_of_dired): Add them.
8213
8214 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8215
8216 Fix minor alloc.c problems found by static checking.
8217 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8218 New extern decls, to avoid calling undeclared functions.
8219 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8220 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8221 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8222 (NEED_MEM_INSERT): New macro.
8223 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
8224 Remove one incorrect comment and fix another.
8225
8226 Fix minor ralloc.c problems found by static checking.
8227 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8228 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8229 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8230 (r_alloc_sbrk): Now static.
8231
8232 Improve ralloc.c interface checking.
8233 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8234 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8235 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8236 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8237 [REL_ALLOC]: ... to here, to check interface.
8238 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8239 Remove decls. This fixes an "It stinks!".
8240
8241 * alloc.c (which_symbols): Fix alignment issue / type clash.
8242
8243 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8244
8245 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8246 (struct Lisp_Misc_Any): Likewise.
8247 (struct Lisp_Free): Likewise.
8248 * alloc.c (union aligned_Lisp_Symbol): Define.
8249 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8250 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8251 (union aligned_Lisp_Misc): Define.
8252 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8253 aligned_Lisp_Misc instead of union Lisp_Misc.
8254 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
8255
8256 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8259 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8260 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8261 * s/netbsd.h, s/sol2-6.h:
8262 Remove definition of GC_MARK_STACK, since the default now works.
8263 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8264 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8265 no longer the default.
8266 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8267
8268 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
8269
8270 * lread.c (lisp_file_lexically_bound_p):
8271 Fix hang at ";-*-\n" (bug#11238).
8272
8273 2012-04-14 Eli Zaretskii <eliz@gnu.org>
8274
8275 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8276 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8277
8278 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8279
8280 * nsterm.m (constrainFrameRect): Always constrain when there is only
8281 one screen (Bug#10962).
8282
8283 2012-04-13 Ken Brown <kbrown@cornell.edu>
8284
8285 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8286
8287 2012-04-13 Reuben Thomas <rrt@sc3d.org>
8288
8289 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8290
8291 2012-04-11 Daniel Colascione <dancol@dancol.org>
8292
8293 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8294 against is gone. It's better to use vfork now so that when Cygwin
8295 gains a new, working vfork, we use it automatically (bug#10398).
8296
8297 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8298
8299 * window.c (save_window_save): Obey window-point-insertion-type.
8300
8301 2012-04-11 Glenn Morris <rgm@gnu.org>
8302
8303 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8304
8305 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8306
8307 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8308
8309 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
8310
8311 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8312 (force_quit_count): New var.
8313 (handle_interrupt): Use it.
8314
8315 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
8316
8317 * w32.c (w32_delayed_load): Record the full path of the library
8318 being loaded (bug#10424).
8319
8320 2012-04-09 Glenn Morris <rgm@gnu.org>
8321
8322 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8323 not just in the obarray, before snarfing them. (Bug#11036)
8324
8325 * Makefile.in ($(leimdir)/leim-list.el):
8326 Pass EMACS rather than BUILT_EMACS.
8327
8328 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8329
8330 * process.c (make_process):
8331 * process.h: Add integer `gnutls_handshakes_tried' member to
8332 process struct.
8333
8334 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8335 Add convenience `GNUTLS_LOG2i' macro.
8336
8337 * gnutls.c (gnutls_log_function2i): Convenience log function.
8338 (emacs_gnutls_read): Use new log functions,
8339 `gnutls_handshakes_tried' process member, and
8340 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8341 attempts per process (connection).
8342
8343 2012-04-09 Chong Yidong <cyd@gnu.org>
8344
8345 * eval.c (Fuser_variable_p, user_variable_p_eh)
8346 (lisp_indirect_variable): Functions deleted.
8347 (Fdefvar): Caller changed.
8348
8349 * callint.c (Finteractive, Fcall_interactively):
8350 * minibuf.c (Fread_variable): Callers changed.
8351
8352 2012-04-09 Eli Zaretskii <eliz@gnu.org>
8353
8354 * xdisp.c (set_cursor_from_row): If the display string appears in
8355 the buffer at position that is closer to point than the position
8356 after the display string, display the cursor on the first glyph of
8357 the display string. Fixes cursor display when a 'display' text
8358 property immediately follows invisible text. (Bug#11094)
8359
8360 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8361
8362 composite.c: use 'double' consistently
8363 * composite.c (get_composition_id): Use 'double' consistently
8364 instead of converting 'float' to 'double' and vice versa; this is
8365 easier to understand and avoids a GCC warning.
8366
8367 2012-04-09 Glenn Morris <rgm@gnu.org>
8368
8369 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8370 preparation for dumping it with emacs. (Bug#4789)
8371 (leimdir): New variable.
8372 ($(leimdir)/leim-list.el): New rule.
8373 (emacs$(EXEEXT)): Depend on leim-list.el.
8374
8375 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8376 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8377 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8378
8379 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8380
8381 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8382 proper alignment.
8383
8384 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
8385
8386 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8387 Remove unused local variable.
8388
8389 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8390
8391 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8392 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8393 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8394 objects, as mark_maybe_pointer will catch them otherwise.
8395 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8396 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8397
8398 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8399
8400 Fix typo that broke non-Windows builds.
8401 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8402
8403 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8404
8405 Support building on MS-Windows with libxml2.
8406
8407 * makefile.w32-in (OBJ2): Add xml.$(O).
8408 (GLOBAL_SOURCES): Add xml.c.
8409 ($(BLD)/xml.$(O)): New dependency list.
8410
8411 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8412 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8413 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8414 [!WINDOWSNT]: New macros.
8415 (init_libxml2_functions, libxml2_loaded_p): New functions.
8416 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8417 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8418 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8419 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8420 linked in).
8421 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8422 Call init_libxml2_functions before calling libxml2 functions.
8423 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8424
8425 * emacs.c: Don't include libxml/parser.h.
8426 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8427 xmlCleanupParser directly.
8428
8429 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8430
8431 2012-04-07 Eli Zaretskii <eliz@gnu.org>
8432
8433 * indent.c (Fvertical_motion): If there is a display string at
8434 point, use it.vpos to compute how many lines to backtrack after
8435 move_it_to point. (Bug#11133)
8436
8437 2012-04-06 Eli Zaretskii <eliz@gnu.org>
8438
8439 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8440 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8441 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8442 macros related to unification of CJK characters. For the details,
8443 see the discussion following the message here:
8444 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8445
8446 2012-04-04 Chong Yidong <cyd@gnu.org>
8447
8448 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8449
8450 2012-04-01 Eli Zaretskii <eliz@gnu.org>
8451
8452 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8453 instead of alloca. (Bug#11138)
8454
8455 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8456
8457 * w32menu.c (is_simple_dialog): Properly check lisp types.
8458 (Bug#11141)
8459
8460 2012-03-31 Eli Zaretskii <eliz@gnu.org>
8461
8462 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8463 position we get to after a call to move_it_to fails the
8464 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8465 only if we wind up in a string from display property. (Bug#11063)
8466
8467 * window.c (Fdelete_other_windows_internal): Invalidate the row
8468 and column information about mouse highlight, so that redisplay
8469 restores it after reallocating the glyph matrices. (Bug#7464)
8470
8471 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8472 string comes from a `display' text property, use the buffer
8473 position of that property as if we actually saw that position in
8474 the row's glyphs.
8475 (move_it_by_lines): Remove the assertion that
8476 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8477 violated when there's a before-string at the beginning of a line.
8478 (Bug#11063)
8479
8480 2012-03-30 Eli Zaretskii <eliz@gnu.org>
8481
8482 * xdisp.c (append_space_for_newline): If the default face was
8483 remapped, use the remapped face for the appended newline.
8484 (extend_face_to_end_of_line): Use the remapped default face for
8485 extending the face to the end of the line.
8486 (display_line): Call extend_face_to_end_of_line when the default
8487 face was remapped. (Bug#11068)
8488
8489 2012-03-29 Eli Zaretskii <eliz@gnu.org>
8490
8491 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8492
8493 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8494
8495 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8496
8497 2012-03-27 Glenn Morris <rgm@gnu.org>
8498
8499 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8500 Doc fixes.
8501
8502 2012-03-26 Kenichi Handa <handa@m17n.org>
8503
8504 * dispextern.h (struct glyph): Fix previous change. Change the
8505 bit length of glyphless.ch to 25 (Bug#11082).
8506
8507 2012-03-26 Chong Yidong <cyd@gnu.org>
8508
8509 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8510 (command_loop_1): Use it; inhibit selection update for
8511 handle-select-window too (Bug#8996).
8512
8513 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8514
8515 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
8516
8517 2012-03-25 Kenichi Handa <handa@m17n.org>
8518
8519 * dispextern.h (struct glyph): Change the bit length of
8520 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8521
8522 2012-03-24 Eli Zaretskii <eliz@gnu.org>
8523
8524 * s/ms-w32.h (tzname): Include time.h before redirecting to
8525 _tzname. Fixes the MSVC build. (Bug#9960)
8526
8527 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8528
8529 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8530 characters.
8531
8532 * xterm.c (XTread_socket): Only modify handling_signal if
8533 !SYNC_INPUT. (Bug#11080)
8534
8535 2012-03-23 Eli Zaretskii <eliz@gnu.org>
8536
8537 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8538 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8539 when fetching a multibyte character consumes more bytes than
8540 CHAR_BYTES returns, due to unification of CJK characters in
8541 string_char. (Bug#11073)
8542
8543 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8544
8545 * process.c (wait_reading_process_output): Handle pty disconnect
8546 by refraining from sending oneself a SIGCHLD (bug#10933).
8547
8548 2012-03-22 Chong Yidong <cyd@gnu.org>
8549
8550 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8551
8552 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8553 Mark string as coming from a prefix property.
8554 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8555 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8556
8557 2012-03-21 Chong Yidong <cyd@gnu.org>
8558
8559 * xfaces.c (Vface_remapping_alist): Doc fix.
8560
8561 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8562
8563 * w32proc.c (Fw32_set_console_codepage)
8564 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8565 Doc fixes.
8566
8567 2012-03-20 Chong Yidong <cyd@gnu.org>
8568
8569 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8570 to reflect default non-nil value of redisplay-dont-pause.
8571
8572 2012-03-19 Kenichi Handa <handa@m17n.org>
8573
8574 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8575 it fit in a valid range (Bug#11003).
8576
8577 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8578
8579 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8580 that is not from display property, accept the row as a "cursor
8581 row" if one of the string's character has a non-nil `cursor'
8582 property. Fixes cursor positioning when there are newlines in
8583 overlay strings, e.g. in icomplete.el. (Bug#11035)
8584
8585 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8586
8587 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8588
8589 2012-03-12 Chong Yidong <cyd@gnu.org>
8590
8591 * eval.c (inhibit_lisp_code): Rename from
8592 inhibit_window_configuration_change_hook; move from window.c.
8593
8594 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8595 * window.c (run_window_configuration_change_hook)
8596 (syms_of_window): Callers changed.
8597
8598 2012-03-11 Chong Yidong <cyd@gnu.org>
8599
8600 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8601
8602 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8603
8604 2012-03-10 Chong Yidong <cyd@gnu.org>
8605
8606 * frame.c (other_visible_frames): Don't assume the selected frame
8607 is visible (Bug#10955).
8608
8609 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8610
8611 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8612
8613 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8614
8615 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8616 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8617 zero (Bug#10954).
8618
8619 2012-03-03 Glenn Morris <rgm@gnu.org>
8620
8621 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8622
8623 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8624
8625 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8626 position past the first glyph_row that ends at ZV. (Bug#10902)
8627 (redisplay_window, next_element_from_string): Fix typos in
8628 comments.
8629 (redisplay_window): Pass to move_it_vertically the margin in
8630 pixels, not in screen lines.
8631
8632 2012-03-02 Glenn Morris <rgm@gnu.org>
8633
8634 * buffer.c (buffer-list-update-hook): Doc fix.
8635
8636 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8637
8638 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8639 push_it before setting up the iterator for the first overlay
8640 string, even if we have an empty string loaded.
8641 (next_overlay_string): If there's an empty string on the iterator
8642 stack, pop the stack. (Bug#10903)
8643
8644 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8645
8646 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8647 Suggested by Stefan Monnier in
8648 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8649 * alloc.c (widen_to_Lisp_Object): New static function.
8650 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8651 and widening them to Lisp_Objects. This would work even if
8652 USE_LSB_TAG is defined and wide integers are used, which might
8653 happen in a future version of Emacs.
8654
8655 2012-02-25 Chong Yidong <cyd@gnu.org>
8656
8657 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8658 Doc fix.
8659
8660 * xselect.c (Fx_selection_exists_p): Doc fix.
8661 (x_clipboard_manager_save_all): Print an informative message
8662 before saving to clipboard manager.
8663
8664 2012-02-24 Chong Yidong <cyd@gnu.org>
8665
8666 * keyboard.c (process_special_events): Handle all X selection
8667 requests in kbd_buffer, not just the next one (Bug#8869).
8668
8669 2012-02-23 Chong Yidong <cyd@gnu.org>
8670
8671 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8672 call when setting menu-bar-lines and tool-bar-lines parameters.
8673 (unwind_create_frame_1): New helper function.
8674
8675 * window.c (inhibit_window_configuration_change_hook): New var.
8676 (run_window_configuration_change_hook): Obey it.
8677 (syms_of_window): Initialize it.
8678
8679 2012-02-22 Chong Yidong <cyd@gnu.org>
8680
8681 * xterm.c (x_draw_image_relief): Add missing type check for
8682 Vtool_bar_button_margin (Bug#10743).
8683
8684 2012-02-21 Chong Yidong <cyd@gnu.org>
8685
8686 * fileio.c (Vfile_name_handler_alist): Doc fix.
8687
8688 * buffer.c (Fget_file_buffer): Protect against invalid file
8689 handler return value.
8690
8691 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8692
8693 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8694 when computing $valmask.
8695
8696 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8697 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8698 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8699 It's useless in that case, and it can cause problems on hosts
8700 that allocate halves of EMACS_INT values separately.
8701 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8702 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8703 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8704 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8705 it avoids undefined behavior on hosts where shifting right by more
8706 than the word width has undefined behavior.
8707
8708 2012-02-19 Chong Yidong <cyd@gnu.org>
8709
8710 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8711 (Funhandled_file_name_directory, Ffile_name_as_directory)
8712 (Fdirectory_file_name, Fexpand_file_name)
8713 (Fsubstitute_in_file_name): Protect against invalid file handler
8714 return values (Bug#10845).
8715
8716 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8717
8718 * .gdbinit (pitx): Fix incorrect references to fields of the
8719 iterator stack.
8720
8721 2012-02-17 Chong Yidong <cyd@gnu.org>
8722
8723 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8724
8725 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8726
8727 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8728 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8729
8730 2012-02-15 Chong Yidong <cyd@gnu.org>
8731
8732 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8733 marked as special. Also, starting docstrings with * is obsolete.
8734
8735 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8736
8737 * gnutls.c (emacs_gnutls_write): Fix last change.
8738
8739 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8740
8741 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8742 send_process.
8743
8744 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8745
8746 * keymap.c (Fsingle_key_description): Handle char ranges.
8747
8748 2012-02-12 Chong Yidong <cyd@gnu.org>
8749
8750 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8751 as that creates a dangerous corner case.
8752
8753 * window.c (Fdelete_window_internal): Invalidate the mouse
8754 highlight (Bug#9904).
8755
8756 2012-02-12 Glenn Morris <rgm@gnu.org>
8757
8758 * xselect.c (Fx_own_selection_internal)
8759 (Fx_get_selection_internal, Fx_disown_selection_internal)
8760 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8761 * nsselect.m (Fx_own_selection_internal)
8762 (Fx_disown_selection_internal, Fx_selection_exists_p)
8763 (Fx_selection_owner_p, Fx_get_selection_internal):
8764 Sync docs and argument specs with the xselect.c versions.
8765
8766 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8767
8768 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8769
8770 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8771
8772 * w32select.c (Fx_selection_exists_p): Sync doc string and
8773 argument list with xselect.c. (Bug#10783)
8774
8775 * w16select.c (Fx_selection_exists_p): Sync doc string and
8776 argument list with xselect.c. (Bug#10783)
8777
8778 2012-02-10 Glenn Morris <rgm@gnu.org>
8779
8780 * fns.c (Fsecure_hash): Doc fix.
8781
8782 2012-02-09 Kenichi Handa <handa@m17n.org>
8783
8784 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8785
8786 2012-02-07 Chong Yidong <cyd@gnu.org>
8787
8788 * buffer.c (Fbuffer_local_variables)
8789 (buffer_lisp_local_variables): Handle unbound vars correctly;
8790 don't let Qunbound leak into Lisp.
8791
8792 2012-02-07 Glenn Morris <rgm@gnu.org>
8793
8794 * image.c (Fimagemagick_types): Doc fix.
8795
8796 * image.c (imagemagick-render-type): Change it from a lisp object
8797 to an integer. Move the doc here from the lisp manual.
8798 Treat all values not equal to 0 the same.
8799
8800 2012-02-06 Chong Yidong <cyd@gnu.org>
8801
8802 * doc.c (store_function_docstring): Avoid applying docstring of
8803 alias to base function (Bug#2603).
8804
8805 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8806
8807 * .gdbinit (pp1, pv1): Remove redundant defines.
8808 (pr): Use pp.
8809
8810 2012-02-04 Chong Yidong <cyd@gnu.org>
8811
8812 * nsterm.m: Declare a global (Bug#10694).
8813
8814 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8815
8816 * w32.c (get_emacs_configuration_options):
8817 Include --enable-checking, if specified, in the return value.
8818
8819 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8820
8821 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8822 after rounding frame sizes. (Bug#9723)
8823
8824 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8825
8826 * keyboard.c (adjust_point_for_property): Don't position point
8827 before BEGV. (Bug#10696)
8828
8829 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8830
8831 Handle overflow when computing char display width (Bug#9496).
8832 * character.c (char_width): Return EMACS_INT, not int.
8833 (char_width, c_string_width): Check for overflow when
8834 computing the width; this is possible now that individual
8835 characters can have unbounded width. Problem introduced
8836 by merge from Emacs 23 on 2012-01-19.
8837
8838 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8839
8840 * dbusbind.c (Fdbus_register_method): Mention the return value
8841 :ignore in the docstring.
8842
8843 2012-02-02 Glenn Morris <rgm@gnu.org>
8844
8845 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8846
8847 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8848 Unconditionally set to t. (Bug#10673)
8849 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8850 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8851 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8852
8853 2012-02-02 Kenichi Handa <handa@m17n.org>
8854
8855 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8856 0, do not call append_composite_glyph.
8857
8858 2012-02-02 Kenichi Handa <handa@m17n.org>
8859
8860 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8861 NULL (Bug#6988).
8862 (x_produce_glyphs): If the component of a composition is a null
8863 string, set it->pixel_width to 1 to avoid zero-width glyph.
8864
8865 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8866
8867 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8868 first 2 arguments are identical. This makes inserting large
8869 output from a subprocess an order of magnitude faster on
8870 MS-Windows, where all sbrk'ed memory is always contiguous.
8871
8872 2012-01-31 Glenn Morris <rgm@gnu.org>
8873
8874 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8875 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8876 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8877
8878 2012-01-29 Glenn Morris <rgm@gnu.org>
8879
8880 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8881
8882 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8883
8884 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8885
8886 2012-01-28 Chong Yidong <cyd@gnu.org>
8887
8888 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8889
8890 2012-01-26 Chong Yidong <cyd@gnu.org>
8891
8892 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8893
8894 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8895 repeat counts (Bug#10507).
8896
8897 2012-01-26 Glenn Morris <rgm@gnu.org>
8898
8899 * lread.c (syms_of_lread): Doc fix.
8900
8901 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8902
8903 * coding.c (encode_designation_at_bol): Change return value to
8904 EMACS_INT.
8905
8906 2012-01-25 Chong Yidong <cyd@gnu.org>
8907
8908 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8909
8910 2012-01-21 Chong Yidong <cyd@gnu.org>
8911
8912 * floatfns.c (Fcopysign): Make the second argument non-optional,
8913 since nil is not allowed anyway.
8914
8915 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8916
8917 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8918 (send_process): Likewise.
8919
8920 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8921
8922 * window.c (save_window_save, Fcurrent_window_configuration)
8923 (Vwindow_persistent_parameters): Do not use Qstate.
8924 Rewrite doc-strings.
8925
8926 2012-01-19 Kenichi Handa <handa@m17n.org>
8927
8928 * character.c (char_width): New function.
8929 (Fchar_width, c_string_width, lisp_string_width):
8930 Use char_width (Bug#9496).
8931
8932 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8933
8934 * window.c (Vwindow_persistent_parameters): New variable.
8935 (Fset_window_configuration, save_window_save): Handle persistent
8936 window parameters.
8937
8938 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8939
8940 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8941 thrashing the stack of the thread. (Bug#9087)
8942
8943 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8944
8945 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8946
8947 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8948
8949 * xdisp.c (rows_from_pos_range): Handle the case where the
8950 highlight ends on a newline. (Bug#10464)
8951 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8952 he end column for display of highlight that ends on a newline
8953 before a R2L line.
8954
8955 2012-01-11 Glenn Morris <rgm@gnu.org>
8956
8957 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8958 from load-path also when installation-directory is nil. (Bug#10208)
8959
8960 2012-01-10 Glenn Morris <rgm@gnu.org>
8961
8962 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8963
8964 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8965 Update template values to be closer to their typical values these days.
8966
8967 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8968
8969 * xdisp.c (rows_from_pos_range): Accept additional argument
8970 DISP_STRING, and accept any glyph in a row whose object is that
8971 string as eligible for mouse highlight. Fixes mouse highlight of
8972 display strings from overlays. (Bug#10464)
8973
8974 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8975
8976 emacs: fix an auto-save permissions race condition (Bug#10400)
8977 * fileio.c (auto_saving_dir_umask): New static var.
8978 (Fmake_directory_internal): Use it.
8979 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8980 creating the directory. The old code temporarily assigns
8981 too-generous permissions to the directory.
8982 (do_auto_save_eh): Clear it.
8983 (Fdo_auto_save): Catch all errors, not just file errors, so
8984 that the var is always cleared.
8985
8986 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8987
8988 * search.c (scan_buffer): Pass character positions to
8989 know_region_cache, not byte positions. (Bug#6540)
8990
8991 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8992
8993 * w32.c (sys_rename): Report EXDEV when rename of a directory
8994 fails because the target is on another logical disk. (Bug#10284)
8995
8996 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8997
8998 * xterm.c (x_embed_request_focus): New function.
8999
9000 * xterm.h: Add prototype.
9001
9002 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9003
9004 2012-01-05 Glenn Morris <rgm@gnu.org>
9005
9006 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9007
9008 2012-01-01 Eli Zaretskii <eliz@gnu.org>
9009
9010 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9011 Load gnutls_transport_set_lowat only if GnuTLS version is below
9012 2.11.1.
9013 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9014 GnuTLS versions below 2.11.1.
9015
9016 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9017
9018 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9019 to the doc string advising against its use for altering the way
9020 windows are scrolled.
9021
9022 2011-12-28 Kenichi Handa <handa@m17n.org>
9023
9024 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9025 coding-system ASCII compatible only when it does not produce BOM
9026 on encoding (Bug#10383).
9027
9028 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9029
9030 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9031 can scroll.
9032 (create_and_show_popup_menu): Always use menu_position_func for
9033 Gtk3 (Bug#10361).
9034
9035 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9036
9037 * callint.c (Fcall_interactively): Don't truncate prompt string.
9038
9039 2011-12-23 Eli Zaretskii <eliz@gnu.org>
9040
9041 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9042 property that ends at ZV, so that the bidi iteration could be
9043 resumed from there (after widening). (Bug#10360)
9044
9045 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9046
9047 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9048
9049 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9050
9051 * nsterm.m (x_free_frame_resources):
9052 Release f->output_data.ns->miniimage.
9053 (ns_index_color): Fix indentation. Do not retain
9054 color_table->colors[i].
9055
9056 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9057 before returning.
9058
9059 * nsfns.m (x_set_background_color): Assign return value from
9060 ns_index_color to face-background instead of NSColor*.
9061 (ns_implicitly_set_icon_type): Fix indentation.
9062 Change assignment in for loop to comparison.
9063
9064 * emacs.c (ns_pool): New variable.
9065 (main): Assign ns_pool.
9066 (Fkill_emacs): Call ns_release_autorelease_pool.
9067
9068 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9069 autorelease fdesc, release fdAttrs and tdict.
9070 (ns_get_covering_families): Release charset.
9071 (ns_findfonts): Release NSFontDescriptor created with new.
9072 (ns_uni_to_glyphs): Fix indentation.
9073 (setString): Release attrStr before assigning new value.
9074
9075 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9076
9077 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9078 and NS_IMPL_COCOA.
9079 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9080 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9081
9082 2011-12-18 David Reitter <reitter@cmu.edu>
9083
9084 * nsterm.m (ns_term_init): Subscribe for notifications
9085 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9086 to method trackingNotification in EmacsMenu.
9087
9088 * nsmenu.m (trackingMenu): New variable.
9089 (trackingNotification): New method (from Aquamacs).
9090 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
9091 from Aquamacs (Bug#7030).
9092
9093 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9094
9095 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9096 (symbol_to_nsstring): Fix indentation.
9097 (ns_symbol_to_pb): New function.
9098 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9099 (Fns_rotate_cut_buffers_internal): Remove.
9100 (Fns_store_selection_internal): Rename from
9101 Fns_store_cut_buffer_internal.
9102 (ns_get_foreign_selection, Fx_own_selection_internal)
9103 (Fx_disown_selection_internal, Fx_selection_exists_p)
9104 (Fns_get_selection_internal, Fns_store_selection_internal):
9105 Use ns_symbol_to_pb and check if return value is nil.
9106 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9107 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
9108 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9109 renamed to Sns_store_selection_internal.
9110 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9111 and remove this function.
9112 (ns_handle_selection_clear): Remove, never used.
9113 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9114 here.
9115
9116 2011-12-17 Ken Brown <kbrown@cornell.edu>
9117
9118 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9119 GID is unknown (Bug#10257).
9120
9121 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9124 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9125 which caused a build failure on GNU/Linux IA-64. This problem was
9126 introduced by my 2011-10-07 patch.
9127
9128 2011-12-15 Juri Linkov <juri@jurta.org>
9129
9130 * image.c (imagemagick_error): New function. (Bug#10112)
9131 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9132 Use `imagemagick_error' where ImageMagick functions return
9133 `MagickFalse'.
9134 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9135 proper order.
9136
9137 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9138
9139 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9140 fill background (Bug#8992).
9141
9142 2011-12-13 Martin Rudalics <rudalics@gmx.at>
9143
9144 * window.c (Vwindow_combination_resize)
9145 (Vwindow_combination_limit): Use t instead of non-nil in
9146 doc-strings.
9147 (Vrecenter_redisplay): Add first sentence of doc-string on
9148 separate line.
9149 (Frecenter): Fix doc-string typo.
9150
9151 2011-12-11 Kenichi Handa <handa@m17n.org>
9152
9153 * coding.c (Funencodable_char_position): Pay attention to the
9154 buffer text relocation (Bug#9389).
9155
9156 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9157
9158 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9159 gtk_init (Bug#10100).
9160
9161 2011-12-10 Eli Zaretskii <eliz@gnu.org>
9162
9163 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9164 IT->string is nil. (Bug#10263)
9165
9166 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9167
9168 * nsterm.h (x_free_frame_resources): Declare.
9169
9170 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9171 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9172
9173 * nsterm.h (ns_get_defaults_value): Declare.
9174
9175 * nsterm.m (ns_default): Call ns_get_defaults_value.
9176
9177 2011-12-09 Eli Zaretskii <eliz@gnu.org>
9178
9179 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9180 (Bug#10170)
9181
9182 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9183
9184 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9185 that where the value of an _OBJC_* symbol points to is in the .bss
9186 section (Bug#10240).
9187
9188 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9189
9190 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
9191 after the loop to call ccl_driver at least once (Bug#8619).
9192
9193 2011-12-08 Kenichi Handa <handa@m17n.org>
9194
9195 * ftfont.c (get_adstyle_property): Fix previous change
9196 (Bug#10233).
9197
9198 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
9199
9200 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9201 dirs from the default value of EMACSLOADPATH (bug#10208).
9202
9203 2011-12-07 Glenn Morris <rgm@gnu.org>
9204
9205 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9206 installation and source directories as well. (Bug#10208)
9207
9208 2011-12-06 Chong Yidong <cyd@gnu.org>
9209
9210 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9211
9212 2011-12-06 Glenn Morris <rgm@gnu.org>
9213
9214 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9215 as an error, not just -1. (Bug#10217)
9216
9217 2011-12-05 Chong Yidong <cyd@gnu.org>
9218
9219 * keyboard.c (process_special_events): New function.
9220 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9221
9222 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9223
9224 * coding.c (encode_designation_at_bol): Don't use uninitialized
9225 local variable (Bug#9318).
9226
9227 2011-12-05 Kenichi Handa <handa@m17n.org>
9228
9229 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9230 return Qnil (Bug#8046, Bug#10193).
9231
9232 2011-12-05 Kenichi Handa <handa@m17n.org>
9233
9234 * coding.c (encode_designation_at_bol): New args charbuf_end and
9235 dst. Return the number of produced bytes. Callers changed.
9236 (coding_set_source): Return how many bytes coding->source was
9237 relocated.
9238 (coding_set_destination): Return how many bytes
9239 coding->destination was relocated.
9240 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
9241 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
9242
9243 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9244
9245 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9246 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9247 macro (Bug#9318).
9248
9249 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9250
9251 The following changes are to fix Bug#9318.
9252
9253 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
9254 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9255 (encode_coding_iso_2022, encode_coding_sjis)
9256 (encode_coding_big5, encode_coding_charset): Use the above macros.
9257
9258 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
9259
9260 * lisp.h (process_quit_flag): Fix external declaration.
9261
9262 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9263
9264 Don't macro-inline non-performance-critical code.
9265 * eval.c (process_quit_flag): New function.
9266 * lisp.h (QUIT): Use it.
9267
9268 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9269
9270 * nsfns.m (get_geometry_from_preferences): New function.
9271 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9272
9273 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9274
9275 * emacs.c (Qkill_emacs): Define.
9276 (syms_of_emacs): Initialize it.
9277 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9278 Qquit_flag to `kill-emacs' instead.
9279 (quit_throw_to_read_char): Add parameter `from_signal'.
9280 All callers changed. Call Fkill_emacs if requested and safe.
9281 * lisp.h (QUIT): Call Fkill_emacs if requested.
9282
9283 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9284
9285 * widget.c (update_wm_hints): Return if wmshell is null.
9286 (widget_update_wm_size_hints): New function.
9287
9288 * widget.h (widget_update_wm_size_hints): Declare.
9289
9290 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9291 widget_update_wm_size_hints (Bug#10104).
9292
9293 2011-12-03 Eli Zaretskii <eliz@gnu.org>
9294
9295 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9296 before a newline, prepare the bidi iterator for consuming the
9297 newline, and keep the current paragraph direction. (Bug#10183)
9298 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9299
9300 2011-12-02 Juri Linkov <juri@jurta.org>
9301
9302 * search.c (Fword_search_regexp): New Lisp function created from
9303 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9304 (Fword_search_backward, Fword_search_forward)
9305 (Fword_search_backward_lax, Fword_search_forward_lax):
9306 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9307 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9308
9309 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9310
9311 * fileio.c (Finsert_file_contents): Move after-change-function call
9312 to before the "handled:" label, since all "goto handled" appear in
9313 cases where the *-change-functions have already been properly called
9314 (bug#10117).
9315
9316 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9317
9318 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9319 waiting for input. (Bug#10169)
9320
9321 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9322
9323 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9324 verifies glyph row's hash code--we have just reallocated the
9325 glyphs, so their contents can be complete garbage. (Bug#10164)
9326
9327 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
9328
9329 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9330
9331 2011-11-30 Eli Zaretskii <eliz@gnu.org>
9332
9333 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9334 attributes are tested _before_ calling verify_row_hash, to protect
9335 against GCC re-ordering of the tests. (Bug#10164)
9336
9337 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9338
9339 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9340
9341 * xterm.c (handle_one_xevent): Only set async_visible and friends
9342 if net_wm_state_hidden_seen is non-zero (Bug#10002)
9343 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
9344 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9345
9346 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9347
9348 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9349 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9350 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9351 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9352 All uses changed to use GCPRO1 etc.
9353 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9354 Revert to old implementation (i.e., before 2011-03-11).
9355
9356 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9357
9358 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9359 of scroll runs so as to avoid assigning disabled bogus rows and
9360 unnecessary graphics copy operations.
9361
9362 2011-11-27 Eli Zaretskii <eliz@gnu.org>
9363
9364 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9365 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9366 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9367 (malloc, free, realloc, calloc): Redirect to e_* only when
9368 compiling Emacs.
9369
9370 * lisp.h (GCTYPEBITS): Move before first use.
9371 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9372 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9373 this macro definition.
9374
9375 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9376 _MSC_VER.
9377
9378 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9379
9380 * gtkutil.c (xg_create_frame_widgets):
9381 Call gtk_window_set_has_resize_grip (FALSE) if that function is
9382 present with Gtk+ 2.0.
9383
9384 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9385
9386 * fileio.c (Finsert_file_contents): Undo previous change; see
9387 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9388
9389 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9390
9391 Rename locals to avoid shadowing.
9392 * fileio.c (Finsert_file_contents):
9393 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9394 * process.c (wait_reading_process_output):
9395 Rename inner 'proc' to 'p' to avoid shadowing.
9396 Indent for consistency with usual Emacs style.
9397
9398 2011-11-25 Eli Zaretskii <eliz@gnu.org>
9399
9400 * xdisp.c (redisplay_window): If cursor row is not fully visible
9401 after recentering, and scroll-conservatively is set to a large
9402 number, scroll window by a few more lines to make the cursor fully
9403 visible and out of scroll-margin. (Bug#10105)
9404 (start_display): Don't move to the next line if the display should
9405 start at a newline that is part of a display vector or an overlay
9406 string. (Bug#10119)
9407
9408 2011-11-24 Juri Linkov <juri@jurta.org>
9409
9410 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9411 after the `MagickPingImage' call. (Bug#10112)
9412
9413 2011-11-23 Chong Yidong <cyd@gnu.org>
9414
9415 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9416
9417 2011-11-23 Martin Rudalics <rudalics@gmx.at>
9418
9419 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9420 making another buffer current. (Bug#10114)
9421
9422 2011-11-23 Glenn Morris <rgm@gnu.org>
9423
9424 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9425
9426 2011-11-23 Chong Yidong <cyd@gnu.org>
9427
9428 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9429 using it (Bug#5984).
9430
9431 2011-11-22 Eli Zaretskii <eliz@gnu.org>
9432
9433 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9434 and header-lines, as they don't have one computed for them.
9435 (Bug#10098)
9436
9437 * .gdbinit (prow): Make displayed values more self-explaining.
9438 Add row's hash code.
9439
9440 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9441
9442 * process.c (wait_reading_process_output): Fix asynchrounous
9443 GnuTLS socket handling on some versions of the GnuTLS library.
9444 (wait_reading_process_output): Add comment and URL.
9445
9446 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9447
9448 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9449
9450 2011-11-21 Chong Yidong <cyd@gnu.org>
9451
9452 * window.c (Fnext_window, Fprevious_window): Doc fix.
9453
9454 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9455
9456 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9457
9458 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9459
9460 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9461
9462 2011-11-20 Martin Rudalics <rudalics@gmx.at>
9463
9464 * window.c (Fset_window_combination_limit): Rename argument
9465 STATUS to LIMIT.
9466 (Vwindow_combination_limit): Remove "status" from doc-string.
9467
9468 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9469
9470 * m/ibms390.h: Remove.
9471 * m/ibms390x.h: Don't include "ibms390.h".
9472
9473 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9474
9475 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9476 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9477
9478 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
9479
9480 * casetab.c (Fset_case_table):
9481 * charset.c (Fcharset_after): Fix typos.
9482
9483 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
9484
9485 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9486 Otherwise, valgrind does not work on some platforms.
9487 Problem reported by Andreas Schwab in
9488 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9489 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9490 is set, removing the need for VIRT_ADDRESS_VARIES.
9491 (PURE_P): Use a more-efficient implementation that needs just one
9492 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9493 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9494 to 4 (xorl, subq, cmpq, setbe).
9495 * alloc.c (pure): Always extern now, since that's the
9496 VIRT_ADDR_VARIES behavior.
9497 (PURE_POINTER_P): Use a single comparison, not two, for
9498 consistency with the new puresize.h.
9499 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9500 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9501 Remove VIRT_ADDR_VARIES no longer needed.
9502
9503 2011-11-19 Eli Zaretskii <eliz@gnu.org>
9504
9505 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9506 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9507 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9508 behave as if the cursor position were at the window margin.
9509
9510 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9511 and the cursor position is out of bounds, behave as if the cursor
9512 position were at the window margin. (Bug#10075)
9513
9514 2011-11-18 Chong Yidong <cyd@gnu.org>
9515
9516 * window.c (Fwindow_combination_limit): Make first argument
9517 non-optional, since it is meaningless for live windows like the
9518 selected window.
9519
9520 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9521
9522 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9523
9524 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9525
9526 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9527 (graft_intervals_into_buffer): Simplify.
9528
9529 2011-11-18 Eli Zaretskii <eliz@gnu.org>
9530
9531 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9532 hash values of the two rows.
9533 (copy_row_except_pointers): Preserve the used[] arrays and the
9534 hash values of the two rows. (Bug#10035)
9535 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
9536
9537 * xdisp.c (row_hash): New function, body extracted from
9538 compute_line_metrics.
9539 (compute_line_metrics): Call row_hash, instead of computing the
9540 hash code inline.
9541
9542 * dispnew.c (verify_row_hash): Call row_hash for computing the
9543 hash code of a row, instead of duplicating code from xdisp.c.
9544
9545 * dispextern.h (row_hash): Add prototype.
9546
9547 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9548
9549 * frame.c (delete_frame): Don't delete the terminal when the last
9550 X frame is closed if emacs is built with GTK toolkit.
9551
9552 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9553
9554 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9555
9556 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9557
9558 * window.c (Vwindow_splits): Rename to
9559 Vwindow_combination_resize. Suggested by Juri Linkov.
9560 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9561 of Vwindow_splits.
9562
9563 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9564
9565 * nsfns.m (Fns_font_name):
9566 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9567
9568 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9569
9570 * window.h (window): Rename slot "nest" to "combination_limit".
9571 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9572 (Fset_window_nest): Rename to Fset_window_combination_limit.
9573 (Vwindow_nest): Rename to Vwindow_combination_limit.
9574 (recombine_windows, make_parent_window, make_window)
9575 (Fsplit_window_internal, saved_window)
9576 (Fset_window_configuration, save_window_save): Rename all
9577 occurrences of window_nest to window_combination_limit.
9578
9579 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9580
9581 * image.c (imagemagick_load_image): Fix typo.
9582
9583 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9584
9585 * xdisp.c (display_line): Move the call to
9586 highlight_trailing_whitespace before the call to
9587 compute_line_metrics, since the latter needs to see the final
9588 faces of all the glyphs to compute ROW's hash value.
9589 Fixes assertion violations in row_equal_p. (Bug#10035)
9590
9591 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9592
9593 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9594 just return (bug#10044).
9595
9596 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9597
9598 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9599 with user-defined heap size. Bump the default size of the temacs
9600 heap to 27MB, to avoid memory warning when running temacs.
9601 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9602
9603 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9604 current_matrix and desired_matrix. (Bug#9990)
9605 (verify_row_hash) [XASSERTS]: New function.
9606 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9607 that the hash value of glyph rows is correct.
9608
9609 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9610
9611 * window.h (window): Remove splits slot.
9612 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9613 (Fdelete_other_windows_internal, make_parent_window)
9614 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9615 (Fset_window_configuration, save_window_save): Don't deal with
9616 split status of windows.
9617 (saved_window): Remove splits slot.
9618 (Vwindow_splits): Rewrite doc-string.
9619
9620 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9621
9622 * xfns.c (unwind_create_frame):
9623 * nsfns.m (unwind_create_frame):
9624 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9625 Vframe_list (Bug#9999).
9626
9627 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9628
9629 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9630
9631 2011-11-11 Kenichi Handa <handa@m17n.org>
9632
9633 * callproc.c (Fcall_process): Set the member dst_multibyte of
9634 process_coding.
9635
9636 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9637
9638 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9639 avoid a crash (bug#9496).
9640
9641 2011-11-09 Chong Yidong <cyd@gnu.org>
9642
9643 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9644 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9645
9646 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9647
9648 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9649
9650 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9651
9652 Avoid some portability problems by eschewing 'extern inline' functions.
9653 The trivial performance wins aren't worth the portability hassles; see
9654 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9655 et seq.
9656 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9657 (window_box_width, window_box_left, window_box_left_offset)
9658 (window_box_right, window_box_right_offset): Undo previous change,
9659 by removing the "extern"s.
9660 * intervals.c (adjust_intervals_for_insertion)
9661 (adjust_intervals_for_deletion): Undo previous change,
9662 making these static again.
9663 (offset_intervals, temp_set_point_both, temp_set_point)
9664 (copy_intervals_to_string): No longer inline.
9665 * xdisp.c (window_text_bottom_y, window_box_width)
9666 (window_box_height, window_box_left_offset)
9667 (window_box_right_offset, window_box_left, window_box_right)
9668 (window_box): No longer inline.
9669
9670 2011-11-08 Chong Yidong <cyd@gnu.org>
9671
9672 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9673 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9674 Signal an error if not a live window.
9675 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9676 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9677
9678 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9679
9680 * lisp.h (syms_of_abbrev): Remove declaration.
9681 Reported by CHENG Gao <chenggao@royau.me>.
9682
9683 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9684
9685 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9686 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9687 of temacs in GUI mode.
9688
9689 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9690
9691 * window.h: Declare delete_all_child_windows instead of
9692 delete_all_subwindows.
9693 * window.c (Fwindow_nest, Fset_window_nest)
9694 (Fset_window_new_total, Fset_window_new_normal)
9695 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9696 (delete_all_subwindows): Rename to delete_all_child_windows.
9697 (Fdelete_other_windows_internal, Fset_window_configuration):
9698 Call delete_all_child_windows instead of delete_all_subwindows.
9699 * frame.c (delete_frame): Call delete_all_child_windows instead
9700 of delete_all_subwindows.
9701
9702 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9703
9704 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9705 This is also needed for porting to any host where GC_MARK_STACK is
9706 not GC_MAKE_GCPROS_NOOPS.
9707 (which_symbols): Use it.
9708
9709 2011-11-07 Kenichi Handa <handa@m17n.org>
9710
9711 * coding.c (coding_set_destination): Check coding->src_pos only
9712 when coding->src_object is a buffer (bug#9910).
9713
9714 * process.c (send_process): Set the member src_multibyte of coding
9715 to 0 (bug#9911) when sending a unibyte text.
9716
9717 * callproc.c (Fcall_process): Set the member src_multibyte of
9718 process_coding to 0 (bug#9912).
9719
9720 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9721
9722 * xmenu.c (cleanup_widget_value_tree): New function.
9723 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9724 calling free_menubar_widget_value_tree directly (Bug#9830).
9725
9726 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9727
9728 Fix some portability problems with 'inline'.
9729 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9730 (window_box_width, window_box_left, window_box_left_offset)
9731 (window_box_right, window_box_right_offset): Declare extern.
9732 Otherwise, these inline functions do not conform to C99 and
9733 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9734 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9735 * intervals.c (adjust_intervals_for_insertion)
9736 (adjust_intervals_for_deletion): Now extern, because otherwise the
9737 extern inline functions 'offset_intervals' couldn't refer to it.
9738 (static_offset_intervals): Remove.
9739 (offset_intervals): Rewrite using the old contents of
9740 static_offset_intervals. The old version didn't conform to C99
9741 because an extern inline function contained a reference to an
9742 identifier with static linkage.
9743
9744 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9745
9746 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9747 GC.
9748
9749 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9750
9751 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9752 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9753 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9754 return Qleft_to_right.
9755
9756 2011-11-06 Chong Yidong <cyd@gnu.org>
9757
9758 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9759 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9760 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9761 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9762 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9763 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9764 (Fwindow_vscroll): Doc fix.
9765 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9766 argument, since it makes no sense to pass a live window and for
9767 consistency with window-child.
9768
9769 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9770
9771 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9772 support MSVC.
9773
9774 2011-11-05 Jason Rumney <jasonr@gnu.org>
9775
9776 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9777 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9778 fonts (Bug#6029).
9779 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9780 bitwise arithmetic preventing use of unicode-sip and non-truetype
9781 opentype fonts.
9782
9783 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9784
9785 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9786 "emacs"-only part.
9787
9788 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9789 initialization code to keep similarity to xfns.c after changes
9790 from 2011-11-05.
9791
9792 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9793
9794 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9795 (unwind_create_frame): New function (Bug#9943).
9796 (Fx_create_frame): Restructure code to be more similar to the one in
9797 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9798 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9799 Move terminal->reference_count++ just before making the frame official
9800 (Bug#9943).
9801
9802 * nsterm.m (x_free_frame_resources): New function.
9803 (x_destroy_window): Move code to x_free_frame_resources.
9804
9805 * xfns.c (unwind_create_frame): Fix comment.
9806 (Fx_create_frame, x_create_tip_frame):
9807 Move terminal->reference_count++ just before making the frame
9808 official. Move initialization of image_cache_refcount and
9809 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9810
9811 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9812
9813 Support MSVC build with newer versions of Visual Studio.
9814 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9815 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9816 nt/gmake.defs.
9817
9818 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9819 which are not supported by MSVC.
9820 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9821 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9822 bitfields.
9823 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9824 types in bitfields.
9825 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9826
9827 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9828
9829 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9830
9831 Support MSVC build with newer versions of Visual Studio.
9832 * w32.c: Don't include w32api.h for MSVC.
9833 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9834
9835 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9836 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9837 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9838 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9839 e_* cousins.
9840 (alloca) [_MSC_VER]: Define to _alloca.
9841
9842 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9843
9844 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9845
9846 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9847
9848 * xdisp.c (note_mouse_highlight): If either of
9849 previous/next-single-property-change returns nil, treat that as
9850 the beginning or the end of the buffer. (Bug#9955)
9851
9852 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9853
9854 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9855 label is not null (Bug#9951).
9856 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9857 may be NULL.
9858
9859 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9860
9861 * window.c (Fwindow_body_size): Mention in the doc string that the
9862 return value is in frame's canonical units. (Bug#9949)
9863
9864 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9865
9866 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9867
9868 * w32fns.c (unwind_create_frame): If needed, free the glyph
9869 matrices of the partially constructed frame. (Bug#9943)
9870 * xfns.c (unwind_create_frame): Likewise.
9871
9872 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9873
9874 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9875 Don't stop backward scan on the continuation glyph, even though
9876 its CHARPOS is positive.
9877 (mouse_face_from_buffer_pos, note_mouse_highlight):
9878 Rename cover_string to disp_string.
9879
9880 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9881
9882 * window.c (temp_output_buffer_show): Don't use
9883 Vtemp_buffer_show_specifiers.
9884 (Vtemp_buffer_show_specifiers): Remove unused variable.
9885
9886 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9887
9888 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9889 past the beginning of the current glyph matrix.
9890
9891 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9892
9893 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9894 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9895 HAVE_GTK3 (Bug#9869).
9896
9897 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9898 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9899
9900 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9901
9902 * xterm.c: Declare x_handle_net_wm_state to return int.
9903 (handle_one_xevent): Check if we are iconified but don't have
9904 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9905 (get_current_wm_state): Return non-zero if not hidden,
9906 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9907 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9908 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9909 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9910
9911 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9912
9913 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9914 so that this new function doesn't get optimized away by a
9915 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9916
9917 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9918
9919 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9920
9921 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9922
9923 Fix the `xbytecode' command.
9924 * .gdbinit (xprintbytestr): New command.
9925 (xwhichsymbols): Rename from `which'; all callers changed.
9926 (xbytecode): Print the byte-code string as well.
9927
9928 2011-10-29 Kim Storm <storm@cua.dk>
9929
9930 * alloc.c (which_symbols): New function.
9931
9932 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9933
9934 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9935 line. (Bug#9903)
9936
9937 2011-10-29 Glenn Morris <rgm@gnu.org>
9938
9939 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9940 Not clear what it was for, and it causes various bugs. (Bug#9839)
9941
9942 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9943
9944 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9945 possible random value that matches one of those tested as
9946 condition to clear the mouse face.
9947
9948 2011-10-28 Chong Yidong <cyd@gnu.org>
9949
9950 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9951
9952 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9953
9954 * window.c (make_window): Initialize phys_cursor_on_p.
9955
9956 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9957
9958 * lisp.h (struct Lisp_Symbol): Update comments.
9959
9960 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9961
9962 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9963
9964 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9965
9966 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9967 <oslsachem@gmail.com> for helping to debug this.
9968
9969 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9970 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9971 (g_b_init_get_glyph_outline_w): New static variables.
9972 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9973 (GetGlyphOutlineW_Proc): New typedefs.
9974 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9975 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9976 New functions.
9977 (w32font_open_internal, compute_metrics):
9978 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9979 instead of calling the "wide" APIs directly.
9980
9981 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9982
9983 * w32.h (syms_of_w32font): Add prototype.
9984
9985 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9986
9987 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9988 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9989 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9990 (Fmove_to_window_line): Doc fix.
9991
9992 2011-10-27 Chong Yidong <cyd@gnu.org>
9993
9994 * process.c (make_process): Set gnutls_state to NULL.
9995
9996 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9997 non-NULL, regardless of GNUTLS_INITSTAGE.
9998 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9999 an error. Set process slots as soon as we allocate them.
10000
10001 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10002
10003 2011-10-27 Chong Yidong <cyd@gnu.org>
10004
10005 * gnutls.c (emacs_gnutls_deinit): New function.
10006 Deallocate credentials structures as well as calling gnutls_deinit.
10007 (Fgnutls_deinit, Fgnutls_boot): Use it.
10008
10009 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10010 (deactivate_process): Call emacs_gnutls_deinit.
10011
10012 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
10013
10014 * image.c (x_create_x_image_and_pixmap):
10015 * w32.c (sys_rename, w32_delayed_load):
10016 * w32font.c (fill_in_logfont):
10017 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10018
10019 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
10020
10021 * w32fns.c (w32_default_color_map): New function,
10022 extracted from Fw32_default_color_map.
10023 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
10024
10025 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10026
10027 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10028
10029 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10030
10031 * keyboard.c (test_undefined): New function (bug#9751).
10032 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10033
10034 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10035
10036 * sysdep.c (init_sys_modes): Fix the check for the controlling
10037 terminal (Bug#6649).
10038
10039 2011-10-20 Eli Zaretskii <eliz@gnu.org>
10040
10041 * dispextern.h (struct bidi_it): New member next_en_type.
10042
10043 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10044 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10045 current character, check also for next_en_type being WEAK_EN.
10046 (bidi_resolve_weak): Don't enter the expensive loop if the current
10047 position is before next_en_pos. Record the bidi type of the first
10048 non-ET, non-BN character we find, in addition to its position.
10049 (bidi_level_of_next_char): Invalidate next_en_type when
10050 next_en_pos is over-stepped.
10051
10052 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10053
10054 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10055 * editfns.c: Rewrite current-time-zone so that it invokes
10056 the equivalent of (format-time-string "%Z") to get the time zone name.
10057 This fixes a bug when the time zone name contains characters that
10058 need converting from the system time locale to Emacs internal format.
10059 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10060 that patch fixed format-time-string to do the conversion, but
10061 I forgot to fix current-time-zone.
10062 (format_time_string): New function, containing most of
10063 what Fformat_time_string used to contain.
10064 (Fformat_time_string): Rewrite in terms of format_time_string.
10065 This doesn't change this function's behavior.
10066 (current-time-zone): Rewrite to use format_time_string.
10067 This fixes the bug reported by Michael Schierl in
10068 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10069 Jason Rumney's 2007-06-07 change worked around this bug, but
10070 didn't fix it.
10071 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10072
10073 2011-10-19 Eli Zaretskii <eliz@gnu.org>
10074
10075 * xdisp.c (start_display): If the character at POS is displayed
10076 via a display vector, reset IT->current.dpvec_index to zero.
10077 (try_window_reusing_current_matrix): If a line ends in a display
10078 vector or the next line starts in a display vector, continue
10079 redrawing the window even though the character position of
10080 start_row was reached.
10081 (Bug#9771, part 2)
10082
10083 2011-10-18 Chong Yidong <cyd@gnu.org>
10084
10085 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10086 with nobreak-char-display too.
10087
10088 2011-10-18 Eli Zaretskii <eliz@gnu.org>
10089
10090 Fix part 3 of bug#9771.
10091 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10092 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10093 non-neutral characters if the current character is a paragraph
10094 separator (a.k.a. Newline). This avoids running the same
10095 expensive loop twice, once when we consume the preceding newline
10096 and the other time when the line actually needs to be displayed.
10097 Avoid the loop when we see neutrals on the base embedding level
10098 following a character whose directionality is the same as the
10099 paragraph's. This avoids running the expensive loop when a line
10100 ends in a long sequence of neutrals, like control characters.
10101 Add assertion against STRONG_AL type. Slightly rearrange code
10102 that determines the type of a neutral given the first non-neutral
10103 that follows it.
10104 (bidi_level_of_next_char): Set next_en_pos to zero when
10105 invalidating its info.
10106
10107 2011-10-17 Eli Zaretskii <eliz@gnu.org>
10108
10109 * xdisp.c (push_display_prop): Determine whether to record string
10110 or buffer position by IT->string, not by IT->method. Allow
10111 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
10112 (move_it_vertically_backward): Don't look for character position
10113 immediately after the newline when in a continuation line.
10114 (Bug#9771, part 1)
10115
10116 2011-10-15 Martin Rudalics <rudalics@gmx.at>
10117
10118 * window.c (coordinates_in_window): Rewrite and delabelize
10119 vertical border check. (Bug#5357) (Bug#9618)
10120
10121 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10122
10123 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10124 errors in XSetWindowBorder (bug#9310).
10125
10126 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10127
10128 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10129 avoid crash when xmalloc overrun checking is enabled.
10130
10131 2011-10-13 Eli Zaretskii <eliz@gnu.org>
10132
10133 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10134 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10135 cursor motion with <left> and <right> arrow keys.
10136
10137 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10138 some callers set that themselves.
10139
10140 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10141
10142 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10143 display string and the previous row comes from the same string and
10144 is empty. (Bug#9739) (Bug#9738)
10145
10146 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10147
10148 * doc.c (get_doc_string): Encode file name (bug#9735).
10149
10150 2011-10-12 Eli Zaretskii <eliz@gnu.org>
10151
10152 * bidi.c (bidi_level_of_next_char):
10153 * xdisp.c (get_visually_first_element): Remove old incorrect
10154 comments regarding the Unicode Line Separator character.
10155
10156 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10157
10158 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10159
10160 * alloc.c (Fgc_status): Do not access beyond zombies array
10161 boundary if nzombies > MAX_ZOMBIES.
10162 * alloc.c (dump_zombies): Add missing format specifier.
10163
10164 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10165
10166 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10167 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10168
10169 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10170 Some packages use them to denote characters with modifiers.
10171
10172 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10173
10174 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10175 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10176 matching a pp-number. Rename parameter var to var1.
10177
10178 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10179
10180 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10181
10182 2011-10-08 Glenn Morris <rgm@gnu.org>
10183
10184 * callint.c (Fcall_interactively): Give a more explicit error for the
10185 'c' case with a non-character input. (Bug#8479)
10186
10187 2011-10-08 Eli Zaretskii <eliz@gnu.org>
10188
10189 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10190 lines.
10191 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10192 lines that are hscrolled on the left.
10193
10194 * dispnew.c (buffer_posn_from_coords): Account for a possible
10195 presence of header-line. (Bug#4426)
10196
10197 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10198
10199 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10200 Don't advertise functionality which we discourage or doesn't work.
10201
10202 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10203
10204 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10205 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10206 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10207 this makes Emacs dump core during garbage collection on rare
10208 occasions. sizeof is obviously inferior to offsetof here, so
10209 stick with offsetof.
10210 (GC_POINTER_ALIGNMENT): New macro.
10211 (mark_memory): Omit 3rd (offset) arg; caller changed.
10212 Don't assume EMACS_INT alignment is the same as pointer alignment.
10213
10214 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10215
10216 * keyboard.c (read_key_sequence_remapped): New var.
10217 (read_key_sequence): Compute remapping in the right buffer.
10218 (command_loop_1): Use read_key_sequence's remapping directly.
10219
10220 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10221
10222 * dired.c (file_name_completion): Don't expand file name.
10223 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10224 before checking file name handler.
10225
10226 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10227 they've been requested explicitly (bug#9591).
10228
10229 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
10230
10231 * keymap.c (Fsingle_key_description): Use make_specified_string
10232 instead of build_string to build string from push_key_description.
10233 (Bug#5193)
10234
10235 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10236
10237 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10238 This fixes a Y2038 bug on 64-bit hosts.
10239 * buffer.c (reset_buffer):
10240 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10241 (Fclear_buffer_auto_save_failure):
10242 Use 0, not -1, to represent an unset failure time, since time_t
10243 might not be signed.
10244
10245 Remove dependency on glibc malloc internals.
10246 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10247 Move back here from lisp.h, but with their new implementations.
10248 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10249 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10250 * charset.c (charset_table_init): New static var.
10251 (syms_of_charset): Use it instead of xmalloc. This removes a
10252 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10253 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10254 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10255 Move back to alloc.c.
10256 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10257 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10258
10259 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10260
10261 * nsterm.m (windowDidResize): Call x_set_window_size only when
10262 ns_in_resize is true. Otherwise set pixelwidth/height and
10263 call change_frame_size (Bug#9628).
10264
10265 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10266
10267 Port --enable-checking=all to Fedora 14 x86-64.
10268 * charset.c (syms_of_charset): Also account for glibc malloc's
10269 internal overhead when calculating the initial malloc maximum.
10270
10271 Port --enable-checking=all to Fedora 14 x86.
10272 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10273 Move to lisp.h.
10274 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10275 (overrun_check_realloc, overrun_check_free):
10276 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10277 That way, xmalloc returns a properly-aligned pointer even if
10278 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10279 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10280 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10281 into account when calculating the initial malloc maximum.
10282 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10283 Move here from alloc.c, so that charset.c can use it too.
10284 Properly align; the old code wasn't right for common 32-bit hosts
10285 when configured with --enable-checking=all.
10286 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10287 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10288
10289 2011-09-29 Eli Zaretskii <eliz@gnu.org>
10290
10291 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
10292 use EDOM.
10293
10294 2011-09-28 Eli Zaretskii <eliz@gnu.org>
10295
10296 * xdisp.c (compute_display_string_end): If there's no display
10297 string at CHARPOS, return -1.
10298
10299 * bidi.c (bidi_fetch_char): When compute_display_string_end
10300 returns a negative value, treat the character as a normal
10301 character not covered by a display string. (Bug#9624)
10302
10303 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
10304
10305 * lread.c (Fread_from_string): Fix typo in docstring.
10306
10307 2011-09-27 Eli Zaretskii <eliz@gnu.org>
10308
10309 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10310 newline, reseat the iterator instead of bidi-iterating there one
10311 character at a time. (Bug#9610)
10312 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10313 TO_CHARPOS if the bidi iterator is at base embedding level.
10314
10315 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10316
10317 * lread.c (readevalloop): Use correct code for NBSP.
10318 (read1): Likewise. (Bug#9608)
10319
10320 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
10321
10322 * dbusbind.c (Fdbus_register_signal): When service is not
10323 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10324
10325 2011-09-25 Glenn Morris <rgm@gnu.org>
10326
10327 * buffer.c (truncate-lines): Doc fix.
10328
10329 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
10330
10331 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10332 (Fset_window_next_buffers): Doc fix.
10333
10334 2011-09-24 Glenn Morris <rgm@gnu.org>
10335
10336 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10337
10338 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10339
10340 Fix minor problems found by static checking.
10341 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
10342 * indent.c (Fvertical_motion): Fix == vs = typo.
10343
10344 2011-09-24 Eli Zaretskii <eliz@gnu.org>
10345
10346 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10347 Default value is now t. Doc fix.
10348
10349 * indent.c (Fvertical_motion): Compute and apply the overshoot
10350 logic when moving up, not only when moving down. Fix the
10351 confusing name and values of the it_overshoot_expected variable;
10352 logic changes accordingly. (Bug#9254) (Bug#9549)
10353
10354 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10355 CHARPOS is covered by a display string which includes newlines.
10356 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10357 is covered by a display string with embedded newlines.
10358
10359 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
10360
10361 * dbusbind.c (Fdbus_register_signal): Add match rule to
10362 Vdbus_registered_objects_table. (Bug#9581)
10363 (Fdbus_register_method, Vdbus_registered_objects_table):
10364 Fix docstring.
10365
10366 2011-09-24 Jim Meyering <meyering@redhat.com>
10367
10368 do not ignore write error for any output size
10369 The previous change was incomplete.
10370 While it makes emacs --batch detect the vast majority of stdout
10371 write failures, errors were still ignored whenever the output size is
10372 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10373 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10374 && echo FAIL: ignored write error
10375 FAIL: ignored write error
10376 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10377 && echo FAIL: ignored write error
10378 FAIL: ignored write error
10379 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10380
10381 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10382
10383 * emacs.c (Fkill_emacs): In noninteractive mode exit
10384 non-successfully if a write error occurred on stdout. (Bug#9574)
10385
10386 2011-09-21 Eli Zaretskii <eliz@gnu.org>
10387
10388 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10389 the xassert test.
10390
10391 * dispextern.h (struct it): Update the comment documenting what
10392 can it->OBJECT be.
10393
10394 2011-09-20 Eli Zaretskii <eliz@gnu.org>
10395
10396 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10397 a display string, extend search for cursor position to end of row.
10398 (find_row_edges): If the row ends in a newline from a display
10399 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10400 Handle the case of a display string with multiple newlines.
10401 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10402 non-empty line. Fixes confusing cursor motion with arrow keys at
10403 the beginning of a line that starts with whitespace.
10404
10405 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10406
10407 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10408 (bug#9493).
10409
10410 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
10411
10412 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10413 boolean (Bug#9154).
10414
10415 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10416
10417 * xdisp.c (display_line): Record maximum and minimum buffer
10418 positions even if no glyphs were produced (e.g., by a zero-width
10419 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10420 buffer positions that will be removed from the glyph row because
10421 they don't fit.
10422 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10423 column is beyond frame width: don't subtract 1 "pixel" when
10424 computing width of the stretch.
10425 (reseat_at_next_visible_line_start): Undo the change made on
10426 2011-09-17 that saved paragraph information and restored it after
10427 the call to `reseat'. (Bug#9545)
10428
10429 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10430
10431 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10432 and turn window cursor on if cleared (Bug#9415).
10433
10434 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
10435
10436 * search.c (boyer_moore): Take unibyte characters from pattern
10437 literally. (Bug#9458)
10438
10439 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10440
10441 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10442
10443 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10444
10445 Fix minor problem found by static checking.
10446 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10447 initialized, to pacify gcc -Wuninitialized.
10448
10449 * fileio.c: Report proper errno when syscall falls.
10450 (Finsert_file_contents): Save and restore errno,
10451 so that report_file_error outputs the correct diagnostic.
10452 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10453
10454 2011-09-18 Eli Zaretskii <eliz@gnu.org>
10455
10456 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10457
10458 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10459
10460 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10461 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10462
10463 2011-09-17 Eli Zaretskii <eliz@gnu.org>
10464
10465 * xdisp.c (reseat_at_next_visible_line_start): Keep information
10466 about the current paragraph and restore it after the call to reseat.
10467
10468 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10469 (bidi_find_paragraph_start): Search back for paragraph beginning
10470 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10471 (bidi_move_to_visually_next): Only trigger paragraph-related
10472 computations when the last character is a newline or at EOB, not
10473 just any NEUTRAL_B. (Bug#9470)
10474
10475 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10476 truncated lines if point is covered by a display string. (Bug#9524)
10477
10478 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10479
10480 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10481 (cons_to_x_long): New function.
10482 (lisp_data_to_selection_data): Use it. Correct the test for
10483 short-versus-long data; it was negated. Break out of vector
10484 loop, for efficiency, when a long datum is discovered.
10485
10486 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10487
10488 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10489
10490 2011-09-16 Eli Zaretskii <eliz@gnu.org>
10491
10492 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10493 GCC PR/17406) by declaring this function with external scope.
10494
10495 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10496
10497 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10498 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10499
10500 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10501
10502 * editfns.c (Fformat): Correctly handle text properties on "%%".
10503
10504 2011-09-15 Eli Zaretskii <eliz@gnu.org>
10505
10506 * xterm.c (x_draw_composite_glyph_string_foreground):
10507 * w32term.c (x_draw_composite_glyph_string_foreground):
10508 * term.c (encode_terminal_code):
10509 * composite.c (composition_update_it, get_composition_id):
10510 * xdisp.c (get_next_display_element)
10511 (fill_composite_glyph_string): Add comments about special meaning
10512 of TAB characters in a composition.
10513
10514 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10515
10516 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
10517 This occurs when processing a multibyte format.
10518 Problem reported by Wolfgang Jenker.
10519
10520 2011-09-15 Johan Bockgård <bojohan@gnu.org>
10521
10522 * xdisp.c (try_cursor_movement): Only check for exact match if
10523 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10524
10525 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10526
10527 Remove unused external symbols.
10528 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10529 * xdisp.c (calc_pixel_width_or_height): Now static.
10530 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10531 * indent.c (check_display_width):
10532 * w32term.c: Fix comment to match code.
10533 * xterm.c, xterm.h (x_catching_errors): Remove.
10534
10535 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10536
10537 * xselect.c: Use signed conversions more consistently (Bug#9498).
10538 (selection_data_to_lisp_data): Assume incoming selection data are
10539 signed integers, not unsigned. This is to be consistent with
10540 outgoing selection data, which was modified to use signed integers
10541 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10542 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10543 expects long, not unsigned long.
10544
10545 2011-09-14 Eli Zaretskii <eliz@gnu.org>
10546
10547 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10548 computation of loop end. Reported by Johan Bockgård
10549 <bojohan@gnu.org>.
10550
10551 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10552
10553 * frame.c (Fother_visible_frames_p): Function deleted.
10554
10555 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10556
10557 * indent.c (compute_motion): Process display vector front to back
10558 rather than the other way around. (Bug#2496)
10559
10560 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10561
10562 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10563
10564 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10565
10566 * minibuf.c (Fread_from_minibuffer): Doc fix.
10567
10568 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10569
10570 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10571 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10572
10573 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10574
10575 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10576 value for non-existent files.
10577
10578 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10579
10580 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10581 set its "size" to -1. This will set the modtime_size field of
10582 the corresponding buffer to -1, which is what
10583 verify-visited-file-modtime expects for files that do not exist.
10584 (Bug#9139)
10585
10586 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10587
10588 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10589 here ...
10590 * lisp.h: ... from here. push_key_description is no longer
10591 defined in keyboard.c, so its declaration should not be in
10592 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10593 logically belongs with push_key_description.
10594
10595 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10596
10597 * buffer.h: Include <sys/types.h> instead of <time.h>.
10598 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10599 Problem reported by Herbert J. Skuhra.
10600
10601 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10602
10603 * xml.c (parse_region): Make the parsing work for
10604 non-comment-starting XML files again (bug#9144).
10605
10606 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10607
10608 * image.c (gif_load): Fix calculation of bottom and right corner.
10609 (Bug#9468)
10610
10611 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10612
10613 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10614 redisplay in small windows.
10615
10616 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10617
10618 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10619
10620 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10621
10622 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10623 Operate on live windows only.
10624
10625 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10626
10627 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10628
10629 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10630
10631 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10632 only under bidi iteration.
10633
10634 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10635
10636 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10637
10638 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10639
10640 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10641 Without this fix, the command to link temacs failed due to an
10642 undefined symbol __builtin_isnan. This is because
10643 /usr/include/iso/math_c99.h #defines isnan(x) to
10644 __builtin_isnan(x), but the bundled gcc, which identifies itself
10645 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10646 a __builtin_isnan.
10647 * floatfns.c (isnan): #undef, and then #define to a clone of
10648 what's in data.c.
10649 (Fisnan): Always define, since it's always available now.
10650 (syms_of_floatfns): Always define isnan at the Lisp level.
10651
10652 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10653
10654 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10655
10656 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10657
10658 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10659 The previous code assumed that file offsets (off_t values) fit in
10660 EMACS_INT variables, which is not true on typical 32-bit hosts.
10661 The code messed up by falsely reporting buffer overflow in cases
10662 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10663 when "big" contains more than 2**29 bytes, even though this
10664 inserts just one byte and does not overflow the buffer.
10665 (Finsert_file_contents): Store file offsets as off_t
10666 values, not as EMACS_INT values. Check for overflow when
10667 converting between EMACS_INT and off_t. When checking for
10668 buffer overflow or for overlap, take the offsets into account.
10669 Don't use EMACS_INT for small values where int suffices.
10670 When checking for overlap, fix a typo: ZV was used where
10671 ZV_BYTE was intended.
10672 (Fwrite_region): Don't assume off_t fits into 'long'.
10673 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10674
10675 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10676
10677 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10678
10679 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10680
10681 sprintf-related integer and memory overflow issues (Bug#9412).
10682
10683 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10684 (esprintf, exprintf, evxprintf): New functions.
10685 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10686 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10687 (modify_event_symbol): Do not assume that the length of
10688 name_alist_or_stem is safe to alloca and fits in int.
10689 (Fexecute_extended_command): Likewise for function name and binding.
10690 (Frecursion_depth): Wrap around reliably on integer overflow.
10691 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10692 since some callers pass EMACS_INT values.
10693 (Fsingle_key_description): Don't crash if symbol name contains more
10694 than MAX_ALLOCA bytes.
10695 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10696 (get_minibuffer): Arg is now EMACS_INT, not int.
10697 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10698 (esprintf, exprintf, evxprintf): New decls.
10699 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10700
10701 * dbusbind.c (signature_cat): New function.
10702 (xd_signature, Fdbus_register_signal):
10703 Do not overrun buffer; instead, report string overflow.
10704
10705 * dispnew.c (add_window_display_history): Don't overrun buffer.
10706 Truncate instead; this is OK since it's just a log.
10707
10708 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10709 even if the time zone offset is outlandishly large.
10710 Don't mishandle offset == INT_MIN.
10711
10712 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10713 when creating daemon; the previous buffer-overflow check was incorrect.
10714
10715 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10716 which has the guts of the old verror function.
10717
10718 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10719 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10720
10721 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10722 (font_unparse_xlfd): Don't blindly alloca long strings.
10723 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10724 fits in int, when using sprintf. Use single snprintf to count
10725 length of string rather than counting it via multiple sprintfs;
10726 that's simpler and more reliable.
10727 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10728 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10729 sprintf, in case result does not fit in int.
10730
10731 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10732 (fontset_from_font): Print it.
10733
10734 * frame.c (tty_frame_count): Now printmax_t, not int.
10735 (make_terminal_frame, set_term_frame_name): Print it.
10736 (x_report_frame_params): In X, window IDs are unsigned long,
10737 not signed long, so print them as unsigned.
10738 (validate_x_resource_name): Check for implausibly long names,
10739 and don't assume name length fits in 'int'.
10740 (x_get_resource_string): Don't blindly alloca invocation name;
10741 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10742 not fit in int.
10743
10744 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10745 (xg_check_special_colors, xg_set_geometry):
10746 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10747
10748 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10749 Use esprintf, not sprintf, in case result does not fit in int.
10750
10751 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10752 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10753 it as a large positive number.
10754 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10755 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10756
10757 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10758 in case result does not fit in int.
10759
10760 * print.c (float_to_string): Detect width overflow more reliably.
10761 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10762 buffer overrun. Don't assume list length fits in 'int'. Treat
10763 print length of 0 as 0, not as infinity; to be consistent with other
10764 uses of print length in this function. Don't overflow print length
10765 index. Don't assume hash table size fits in 'long', or that
10766 vectorlike size fits in 'unsigned long'.
10767
10768 * process.c (make_process): Use printmax_t, not int, to format
10769 process-name gensyms.
10770
10771 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10772
10773 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10774 to avoid potential buffer overrun.
10775
10776 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10777 if X resource line is longer than 512 bytes.
10778
10779 * xfns.c (x_window): Make sprintf buffer a bit bigger
10780 to avoid potential buffer overrun.
10781
10782 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10783
10784 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10785
10786 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10787
10788 Integer overflow fixes for scrolling, etc.
10789 Without these, Emacs silently mishandles large integers sometimes.
10790 For example, "C-u 4294967297 M-x recenter" was treated as if
10791 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10792
10793 * xdisp.c (try_window_id): Check Emacs fixnum range before
10794 converting to 'int'.
10795
10796 * window.c (window_scroll_line_based, Frecenter):
10797 Check that an Emacs fixnum is in range before assigning it to 'int'.
10798 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10799 values converted from Emacs fixnums.
10800 (Frecenter): Don't wrap around a line count if it is out of 'int'
10801 range; instead, treat it as an extreme value.
10802 (Fset_window_configuration, compare_window_configurations):
10803 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10804
10805 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10806 that can exceed INT_MAX. Check that EMACS_INT value is in range
10807 before assigning it to the (possibly-narrower) index.
10808 (match_limit): Don't assume that a fixnum can fit in 'int'.
10809
10810 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10811 exceed INT_MAX.
10812
10813 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10814 (Fvertical_motion): Don't wrap around LINES values that don't fit
10815 in 'int'. Instead, treat them as extreme values. This is good
10816 enough for windows, which can't have more than INT_MAX lines anyway.
10817
10818 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10819
10820 * Require libxml/parser.h to avoid compilation warning.
10821
10822 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10823
10824 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10825 since this reportedly can destroy thread storage.
10826
10827 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10828
10829 * syntax.c (find_defun_start): Update all cache variables if
10830 exiting early (Bug#9401).
10831
10832 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10833
10834 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10835
10836 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10837 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10838 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10839
10840 * term.c (tty_append_glyph): New function.
10841 (produce_stretch_glyph): Static function and its prototype deleted.
10842
10843 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10844 Add prototypes.
10845
10846 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10847
10848 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10849 when checking :margin (Bug#9390).
10850 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10851 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10852 so that the name doesn't mislead. All uses changed.
10853
10854 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10855
10856 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10857 set_tty_hooks.
10858
10859 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10860
10861 * xdisp.c (move_it_to): Don't bail out early when reaching
10862 position beyond to_charpos, if we are scanning backwards.
10863 (move_it_vertically_backward): When DY == 0, make sure we get to
10864 the first character in the line after the newline.
10865
10866 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10867
10868 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10869 (ccl_driver): Do not generate an out-of-range pointer.
10870 (Fccl_execute_on_string): Remove unnecessary check for
10871 integer overflow, noted by Stefan Monnier in
10872 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10873 Remove a FIXME that didn't need fixing.
10874 Simplify the newly-introduced buffer reallocation code.
10875
10876 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10877
10878 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10879
10880 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10881
10882 Integer and memory overflow issues (Bug#9196).
10883
10884 * doc.c (get_doc_string): Rework so that
10885 get_doc_string_buffer_size is the actual buffer size, rather than
10886 being 1 less than the actual buffer size; this makes xpalloc more
10887 convenient.
10888
10889 * image.c (x_allocate_bitmap_record, cache_image):
10890 * xselect.c (Fx_register_dnd_atom):
10891 Simplify previous changes by using xpalloc.
10892
10893 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10894 since either will do and ptrdiff_t is convenient with xpalloc.
10895
10896 * charset.c (charset_table_size)
10897 (struct charset_sort_data.priority): Now ptrdiff_t.
10898 (charset_compare): Don't overflow if priorities differ greatly.
10899 (Fsort_charsets): Don't assume list length fits in int.
10900 Check for size-calculation overflow when allocating sort data.
10901 (syms_of_charset): Allocate an initial charset table that is
10902 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10903
10904 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10905
10906 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10907 The actual value is always <= INT_MAX, and leaving it unsigned made
10908 overflow checking harder.
10909
10910 * dispextern.h (struct glyph_matrix.rows_allocated)
10911 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10912 with xpalloc. The values are still always <= INT_MAX.
10913
10914 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10915
10916 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10917 (SAFE_NALLOCA): New macro.
10918
10919 * region-cache.c (struct boundary.pos, find_cache_boundary)
10920 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10921 (set_cache_region, invalidate_region_cache)
10922 (revalidate_region_cache, know_region_cache, region_cache_forward)
10923 (region_cache_backward, pp_cache):
10924 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10925 so that ptrdiff_t * can be passed to xpalloc.
10926 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10927 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10928 (pp_cache): Don't assume cache_len fits in int.
10929 * region-cache.h: Adjust extern decls to match.
10930
10931 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10932 EMACS_INT, since either will do, for xpalloc.
10933
10934 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10935 (xnmalloc, xnrealloc, xpalloc): New functions.
10936
10937 * bidi.c (bidi_shelve_header_size): New constant.
10938 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10939 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10940
10941 * bidi.c (bidi_cache_shrink):
10942 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10943 (overlay_strings):
10944 Don't update size of array until after memory allocation succeeds,
10945 because xmalloc/xrealloc may not return.
10946 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10947 now that we have proper integer overflow checking.
10948 (record_overlay_string, overlay_strings): Catch overflows when
10949 calculating size of overlay_str_buf.
10950
10951 * callproc.c (Fcall_process): Check for size overflow when
10952 calculating size of args2.
10953 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10954 Normally we prefer signed values, but sticking with ptrdiff_t would
10955 require adding more-complicated checks.
10956
10957 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10958 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10959 Redo buffer-overflow calculations to avoid integer overflow.
10960 Add a FIXME comment where memory seems to be over-allocated.
10961
10962 * character.c (Fstring): Check for size-calculation overflow.
10963
10964 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10965 unnecessary integer overflow. Check for size overflow.
10966 (encode_coding_object): Don't update size until xmalloc succeeds.
10967
10968 * composite.c (get_composition_id): Check for overflow in glyph
10969 length calculations.
10970
10971 Integer and memory overflow fixes for display code.
10972 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10973 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10974 (scrolling_window): Check for overflow in size calculations.
10975 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10976 Don't assume glyph table len fits in int.
10977 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10978 (row_table_size): Now ptrdiff_t, not int.
10979 (scrolling_window): Avoid overflow in size calculations.
10980 Don't update size until allocation succeeds.
10981 * fns.c (concat): Check for overflow in size calculations.
10982 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10983 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10984 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10985
10986 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10987 (get_doc_string): Check for size calculation overflow.
10988 Don't update size until allocation succeeds.
10989 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10990 EMACS_INT, where ptrdiff_t will do.
10991 (Fsubstitute_command_keys): Check for string overflow.
10992
10993 * editfns.c (set_time_zone_rule): Don't assume environment length
10994 fits in int.
10995 (message_length): Now ptrdiff_t, not int.
10996 (Fmessage_box): Don't update size until allocation succeeds.
10997 Don't assume message length fits in int.
10998 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10999
11000 * emacs.c (main): Do not reallocate argv, since there is a null at
11001 the end that can be overwritten, and this way there's no need to
11002 worry about size-calculation overflow.
11003 (sort_args): Check for size-calculation overflow.
11004
11005 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11006 alloc succeeds.
11007 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11008
11009 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11010 (x_set_scroll_bar_width, x_figure_window_size):
11011 Check for integer overflow.
11012 (x_set_alpha): Do not assume XINT fits in int.
11013
11014 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11015 This is for the members text_lines, text_cols, total_lines, total_cols,
11016 where the system imposes an 'int' limit.
11017
11018 * fringe.c (Fdefine_fringe_bitmap):
11019 Don't update size until alloc works.
11020
11021 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11022 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11023
11024 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11025 Check for size-calculation overflow.
11026 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11027 do, as we prefer signed integers.
11028 (id_to_widget.max_size, id_to_widget.used)
11029 (xg_store_widget_in_map, xg_remove_widget_from_map)
11030 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11031 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11032 Use and return ptrdiff_t, not int.
11033 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11034 * gtkutil.h: Change prototypes to match the above.
11035
11036 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11037 are duplicate now that they've been promoted to lisp.h.
11038 (x_allocate_bitmap_record, x_alloc_image_color)
11039 (make_image_cache, cache_image, xpm_load):
11040 Don't update size until alloc is done.
11041 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11042 (x_detect_edges):
11043 Check for size calculation overflow.
11044 (ct_colors_allocated_max): New constant.
11045 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11046 overflow.
11047
11048 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11049 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11050 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11051 Use ptrdiff_t, not int, to count maps.
11052 (read_char_minibuf_menu_prompt): Check for overflow in size
11053 calculations. Don't update size until allocation succeeds.
11054 Redo calculations to avoid overflow.
11055 * keyboard.h: Change prototypes to match the above.
11056
11057 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11058 to count maps.
11059 (current_minor_maps): Check for size calculation overflow.
11060 * keymap.h: Change prototypes to match the above.
11061
11062 * lread.c (read1, init_obarray): Don't update size until alloc done.
11063
11064 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11065 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11066
11067 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11068 Now ptrdiff_t, not int.
11069 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11070 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11071
11072 * process.c (Fnetwork_interface_list): Check for overflow
11073 in size calculation.
11074
11075 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11076
11077 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11078 overflow. Don't bother calling xmalloc when xrealloc will do.
11079
11080 * search.c (Freplace_match): Check for size calculation overflow.
11081 (Fset_match_data): Don't assume list lengths fit in 'int'.
11082
11083 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11084 for command line length. Do not attempt to address one before the
11085 beginning of an array, as that's not portable.
11086
11087 * term.c (max_frame_lines): Remove; unused.
11088 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11089 not int.
11090 (encode_terminal_code, calculate_costs): Check for size
11091 calculation overflow.
11092 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11093 table lengths and related sizes. Don't update size until alloc
11094 done. Redo calculations to avoid overflow.
11095 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11096
11097 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11098 subtracting pointers.
11099 (gobble_line): Check for overflow more carefully. Don't update size
11100 until alloc done.
11101
11102 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11103 Don't update size until alloc done.
11104 Redo size calculations to avoid overflow.
11105 Check for size calculation overflow.
11106 (main) [DEBUG]: Fix typo in invoking tparam1.
11107
11108 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11109 Use ptrdiff_t, not int, for sizes.
11110 (store_mode_line_noprop_char): Don't update size until alloc done.
11111
11112 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11113 Use ptrdiff_t, not int, for sizes.
11114 (Finternal_make_lisp_face, cache_face):
11115 Check for size calculation overflow.
11116 (cache_face): Treat size calculation overflows as if they were
11117 memory exhaustion (the usual treatment), rather than aborting.
11118
11119 * xfns.c (x_encode_text, x_set_name_internal)
11120 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11121 sizes, since they can exceed INT_MAX in size. Check for size
11122 calculation overflow.
11123
11124 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11125 (xg_select): Check for size calculation overflow.
11126 Don't update size until alloc done.
11127
11128 * xrdb.c (get_environ_db): Don't assume path length fits in int,
11129 as sprintf is limited to int lengths.
11130
11131 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11132 (X_LONG_MIN): New macros.
11133 Use them to make the following changes clearer.
11134 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11135 This change doesn't affect the value now, but it may help remind
11136 future maintainers not to raise the value too much later.
11137 (SELECTION_QUANTUM): Remove, replacing with ...
11138 (selection_quantum): ... new function, which avoids overflow.
11139 All uses changed.
11140 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11141 assumption that selection length fits in 'int'.
11142 (x_reply_selection_request, x_handle_selection_request)
11143 (x_get_window_property, receive_incremental_selection)
11144 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11145 (lisp_data_to_selection_data, clean_local_selection_data):
11146 Use ptrdiff_t, not int, to record length of selection.
11147 (x_reply_selection_request, x_get_window_property)
11148 (receive_incremental_selection, x_property_data_to_lisp):
11149 Redo calculations to avoid overflow.
11150 (x_reply_selection_request): When sending hint, ceiling it at
11151 X_LONG_MAX rather than relying on wraparound overflow to send
11152 something.
11153 (x_get_window_property, receive_incremental_selection)
11154 (lisp_data_to_selection_data, x_property_data_to_lisp):
11155 Check for size-calculation overflow.
11156 (x_get_window_property, receive_incremental_selection)
11157 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11158 Don't store size until memory allocation succeeds.
11159 (x_get_window_property): Plug memory leak on memory exhaustion.
11160 Don't double-block input; malloc is safe here. Don't assume 2**34
11161 - 4 fits in unsigned long. Add an xassert to check
11162 XGetWindowProperty overflow. Be more careful about overflow
11163 calculations, and distinguish size from memory overflow better.
11164 (receive_incremental_selection): When tracing, don't assume
11165 unsigned int is less than INT_MAX.
11166 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11167 harmful) conversions of unsigned short to int.
11168 (lisp_data_to_selection_data): Don't assume that integers
11169 in the range -65535 through -1 fit in an X unsigned short.
11170 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11171 result parameters unless successful. Rely on cons_to_unsigned
11172 to report problems with elements; the old code wasn't right anyway.
11173 (x_check_property_data): Check for int overflow; we cannot use
11174 a wider type due to X limits.
11175 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11176
11177 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
11178
11179 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11180 (x_term_init): Check for size calculation overflow.
11181 (x_color_cells): Don't store size until memory allocation succeeds.
11182 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
11183 Don't assume alloca size is less than MAX_ALLOCA.
11184 (x_term_init): Don't assume length fits in int (sprintf is limited
11185 to int size).
11186
11187 Use ptrdiff_t for composition IDs.
11188 * character.c (lisp_string_width):
11189 * composite.c (composition_table_size, n_compositions)
11190 (get_composition_id, composition_gstring_from_id):
11191 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11192 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11193 * window.c (Frecenter):
11194 Use ptrdiff_t, not int, for composition IDs.
11195 * composite.c (get_composition_id): Check for integer overflow.
11196 * composite.h: Adjust prototypes to match the above changes.
11197
11198 Use ptrdiff_t for hash table indexes.
11199 * category.c (hash_get_category_set):
11200 * ccl.c (ccl_driver):
11201 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11202 * coding.c (coding_system_charset_list, detect_coding_system):
11203 * coding.h (struct coding_system.id):
11204 * composite.c (get_composition_id, gstring_lookup_cache):
11205 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11206 * image.c (xpm_get_color_table_h):
11207 * lisp.h (hash_lookup, hash_put):
11208 * minibuf.c (Ftest_completion):
11209 Use ptrdiff_t for hash table indexes, not int (which is too
11210 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11211 32-bit --with-wide-int hosts).
11212
11213 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11214 Add a FIXME comment about memory leaks.
11215 (syms_of_charset): Don't assume xmalloc returns.
11216
11217 Don't assume that stated character widths fit in int.
11218 * character.c (Fchar_width, c_string_width, lisp_string_width):
11219 * character.h (CHAR_WIDTH):
11220 * indent.c (MULTIBYTE_BYTES_WIDTH):
11221 Use sanitize_char_width to avoid undefined and/or bad behavior
11222 with outlandish widths.
11223 * character.h (sanitize_tab_width): Rename from sanitize_width,
11224 now that we have two such functions. All uses changed.
11225 (sanitize_char_width): New inline function.
11226
11227 Don't assume that tab-width fits in int.
11228 * character.h (sanitize_width): New inline function.
11229 (SANE_TAB_WIDTH): New macro.
11230 (ASCII_CHAR_WIDTH): Use it.
11231 * indent.c (sane_tab_width): Remove. All uses replaced by
11232 SANE_TAB_WIDTH (current_buffer).
11233 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11234
11235 * fileio.c: Integer overflow issues with file modes.
11236 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11237
11238 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11239 Remove unreachable code.
11240 (read_hex, load_charset_map_from_file): Check for integer overflow.
11241
11242 * xterm.c: Don't go over XClientMessageEvent limit.
11243 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11244 (x_send_scroll_bar_event): Likewise. Check that the size does not
11245 exceed limits imposed by XClientMessageEvent, as well as the usual
11246 ptrdiff_t and size_t limits.
11247
11248 * keyboard.c: Overflow, signedness and related fixes.
11249 (make_lispy_movement): Use same integer type in forward decl
11250 that is used in the definition.
11251 (read_key_sequence, keyremap_step):
11252 Change bufsize argument back to int, undoing my 2011-03-30 change.
11253 We prefer signed types, and int is wide enough here.
11254 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11255 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11256 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11257 length, not size_t. Use ptrdiff_t for index, not int.
11258 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11259 possibility of integer overflow.
11260
11261 Overflow, signedness and related fixes for images.
11262
11263 * dispextern.h (struct it.stack[0].u.image.image_id)
11264 (struct_it.image_id, struct image.id, struct image_cache.size)
11265 (struct image_cache.used, struct image_cache.ref_count):
11266 * gtkutil.c (update_frame_tool_bar):
11267 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11268 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11269 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11270 * nsmenu.m (update_frame_tool_bar):
11271 * xdisp.c (calc_pixel_width_or_height):
11272 * xfns.c (image_cache_refcount):
11273 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11274 on typical 64-bit hosts.
11275
11276 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11277 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11278 Omit unnecessary casts to int.
11279 (parse_image_spec): Check that integers fall into 'int' range
11280 when the callers expect that.
11281 (image_ascent): Redo ascent calculation to avoid int overflow.
11282 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11283 (lookup_image): Remove unnecessary tests.
11284 (xbm_image_p): Locals are now of int, not EMACS_INT,
11285 since parse_image_check makes sure they fit into int.
11286 (png_load, gif_load, svg_load_image):
11287 Prefer int to unsigned where either will do.
11288 (tiff_handler): New function, combining the cores of the
11289 old tiff_error_handler and tiff_warning_handler.
11290 This function is rewritten to use vsnprintf and thereby avoid
11291 stack buffer overflows. It uses only the features of vsnprintf
11292 that are common to both POSIX and native Microsoft.
11293 (tiff_error_handler, tiff_warning_handler): Use it.
11294 (tiff_load, gif_load, imagemagick_load_image):
11295 Don't assume :index value fits in 'int'.
11296 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11297 (imagemagick_load_image): Check that crop parameters fit into
11298 the integer types that MagickCropImage accepts. Don't assume
11299 Vimagemagick_render_type has a nonnegative value. Don't assume
11300 size_t fits in 'long'.
11301 (gs_load): Use printmax_t to print the widest integers possible.
11302 Check for integer overflow when computing image height and width.
11303
11304 2011-08-26 Eli Zaretskii <eliz@gnu.org>
11305
11306 * xdisp.c (redisplay_window): Don't force window start if point
11307 will be invisible in the resulting window. (Bug#9324)
11308
11309 2011-08-25 Eli Zaretskii <eliz@gnu.org>
11310
11311 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11312 the display spec is of the form `(space ...)'.
11313 (handle_display_spec): Return the value returned by
11314 handle_single_display_spec, not just 1 or zero.
11315 (handle_single_display_spec): If the display spec is of the form
11316 `(space ...)', and specifies display in the text area, return 2
11317 rather than 1.
11318 (try_cursor_movement): Check for the need to scroll more
11319 accurately, and prefer exact match for point under bidi.
11320 Don't advance `row' beyond the last row of the window.
11321
11322 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11323 into disp_prop; all users changed.
11324
11325 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11326 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11327 for the text covered by the display property.
11328
11329 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
11330
11331 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11332 Change return value to nil.
11333 (Frecord_buffer): Delete unused function.
11334
11335 2011-08-24 Eli Zaretskii <eliz@gnu.org>
11336
11337 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11338 buffers, return left-to-right.
11339 (set_cursor_from_row): Consider candidate row a win if its glyph
11340 represents a newline and point is on that newline. Fixes cursor
11341 positioning on the newline at EOL of R2L text within L2R
11342 paragraph, and vice versa.
11343 (try_cursor_movement): Check continued rows, in addition to
11344 continuation rows. Fixes unwarranted scroll when point enters a
11345 continued line of R2L text within an L2R paragraph, or vice versa.
11346 (cursor_row_p): Consider the case of point being equal to
11347 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11348 from the end of a short line to the beginning of a continued line
11349 of R2L text within L2R paragraph.
11350 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11351 composed characters.
11352
11353 * bidi.c (bidi_check_type): Use xassert.
11354 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11355 members.
11356
11357 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11358
11359 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11360 a character.
11361
11362 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
11363
11364 * nsfont.m (ns_otf_to_script): Fix typo.
11365
11366 2011-08-22 Kenichi Handa <handa@m17n.org>
11367
11368 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11369 extra slot even if the purpose is char-code-property-table.
11370
11371 2011-08-23 Eli Zaretskii <eliz@gnu.org>
11372
11373 * xdisp.c (redisplay_window): When computing centering_position,
11374 account for the height of the header line. (Bug#8874)
11375
11376 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11377 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11378 candidate is selected by the mouse, and that candidate has a
11379 composed character under the mouse.
11380
11381 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11382 coordinates reported by pos-visible-in-window-p for a composed
11383 character in column zero.
11384
11385 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11386
11387 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11388
11389 2011-08-22 Eli Zaretskii <eliz@gnu.org>
11390
11391 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11392 consider it a hit if to_charpos is anywhere in the range of the
11393 composed buffer positions.
11394
11395 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
11396
11397 * image.c (gif_load): Don't assume that each subimage has the same
11398 dimensions as the base image. Handle disposal method that is
11399 "undefined" by the gif spec (Bug#9335).
11400
11401 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
11402
11403 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
11404 (Fcondition_case): Document `debug' symbol in error handler.
11405
11406 2011-08-19 Eli Zaretskii <eliz@gnu.org>
11407
11408 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11409 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11410 from an Org mode buffer to a Speedbar frame.
11411
11412 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11413 a composition, take its buffer position from IT->cmp_it.charpos.
11414 Fixes cursor positioning at the beginning of a line that begins
11415 with a composed character.
11416
11417 2011-08-18 Eli Zaretskii <eliz@gnu.org>
11418
11419 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11420 character bidirectional type, use STRONG_L instead. Fixes crashes
11421 in a buffer produced by `describe-categories'.
11422
11423 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11424 members before the level stack, so they would be saved and
11425 restored when copying iterator state. Fixes incorrect reordering
11426 around TABs covered by display properties.
11427
11428 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11429
11430 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
11431
11432 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
11433
11434 * eval.c (internal_condition_case, internal_condition_case_1)
11435 (internal_condition_case_2, internal_condition_case_n):
11436 Remove unnecessary aborts (Bug#9081).
11437
11438 2011-08-17 Eli Zaretskii <eliz@gnu.org>
11439
11440 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11441 has no `load' handler, try opening the file locally. (Bug#9311)
11442
11443 2011-08-16 Ken Brown <kbrown@cornell.edu>
11444
11445 * gmalloc.c: Expand comment.
11446
11447 2011-08-16 Eli Zaretskii <eliz@gnu.org>
11448
11449 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11450 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11451
11452 2011-08-16 Ken Brown <kbrown@cornell.edu>
11453
11454 Fix memory allocation problems in Cygwin build (Bug#9273).
11455
11456 * unexcw.c ( __malloc_initialized): Declare external variable.
11457 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11458
11459 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11460 New variables.
11461 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11462 dumped emacs.
11463 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11464 in the static heap.
11465 [CYGWIN] (special_realloc): New function.
11466 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11467 requests to realloc storage in the static heap.
11468
11469 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11470
11471 * bidi.c (bidi_initialize): Remove unused local.
11472
11473 2011-08-15 Eli Zaretskii <eliz@gnu.org>
11474
11475 * bidimirror.h:
11476 * biditype.h: Remove file.
11477 * makefile.w32-in ($(BLD)/bidi.$(O)):
11478 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
11479
11480 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11481
11482 * chartab.c: Improve commentary for the uniprop_table API.
11483
11484 * bidi.c (bidi_paragraph_init): Support zero value of
11485 bidi_ignore_explicit_marks_for_paragraph_level.
11486 (bidi_initialize): Use uniprop_table instead of including
11487 biditype.h and bidimirror.h.
11488
11489 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11490 coordinates of the iterator when restoring from ppos_it.
11491 (Bug#9296)
11492
11493 2011-08-14 Kenichi Handa <handa@m17n.org>
11494
11495 * process.c (create_process): Call setup_process_coding_systems
11496 after the pid of the process is set to -1 (Bug#8162).
11497
11498 2011-08-14 Eli Zaretskii <eliz@gnu.org>
11499
11500 * xdisp.c (move_it_in_display_line_to): Don't invoke
11501 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11502 ppos_it. Fixes vertical cursor motion when line beginning is
11503 covered by an image. (Bug#9296)
11504
11505 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11506
11507 * nsterm.h (ns_run_ascript): Declare.
11508 (NSAPP_DATA2_RUNASSCRIPT): Define.
11509
11510 * nsfns.m (as_script, as_result, as_status): New static variables.
11511 (ns_run_ascript): New function.
11512 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
11513 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11514 the event loop. Get status from as_status (Bug#7276).
11515
11516 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11517 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11518 the event loop (Bug#7276).
11519
11520 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11521
11522 * gnutls.c (QCgnutls_bootprop_priority)
11523 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11524 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11525 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11526 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11527 (QCgnutls_bootprop_verify_hostname_error)
11528 (QCgnutls_bootprop_callbacks_verify): Rename from
11529 Qgnutls_bootprop_..., all uses changed.
11530
11531 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11532 uses changed.
11533
11534 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11535
11536 * xfaces.c (Qframe_set_background_mode): Now static.
11537 * dispextern.h (Qframe_set_background_mode): Remove decl.
11538
11539 * process.c (Fnetwork_interface_info): Declare local only if needed.
11540
11541 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11542
11543 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11544 (Fnetwork_interface_list): Allocate in increments of bytes instead
11545 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11546 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11547 sockaddr.
11548 (struct ifflag_def): notrailers is smart on OSX.
11549 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11550 Get hardware address with getifaddrs if available.
11551
11552 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11553
11554 * xdisp.c (iterate_out_of_display_property): xassert that
11555 IT->position is set to within IT->object's boundaries. Break from
11556 the loop as soon as EOB is reached; avoids infloops in redisplay
11557 when IT->position is set up wrongly due to some bug.
11558 Set IT->current to match the bidi iterator unconditionally.
11559 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11560 entry. Force push_it to save on the stack the current
11561 buffer/string position, to be restored by pop_it. Fix flags in
11562 the iterator structure wrt the object coming from a display
11563 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11564 properties. (Bug#9284)
11565
11566 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11567
11568 * fontset.c (fontset_get_font_group): Add proper type checks.
11569 (Bug#9172)
11570
11571 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11572
11573 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11574 and LC_VERSION_MIN_MACOSX.
11575 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11576 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11577
11578 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11579
11580 * xdisp.c (forward_to_next_line_start): Allow to use the
11581 no-display-properties-and-no-overlays under bidi display.
11582 Set disp_pos in the bidi iterator to avoid searches for display
11583 properties and overlays.
11584
11585 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11586
11587 * editfns.c (Fset_time_zone_rule): Document relationship with the
11588 setenv function.
11589
11590 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11591 the font entity extracted from the cache (Bug#8109).
11592
11593 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11594
11595 * composite.c (autocmp_chars): Don't reset point. That is done by
11596 restore_point_unwind (Bug#5984).
11597
11598 2011-08-07 Juri Linkov <juri@jurta.org>
11599
11600 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11601 to show the arg `TIME' instead of `TIMEVAL'.
11602
11603 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11604
11605 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11606 display property strides EOL and includes a newline, as in
11607 longlines-mode. (Bug#9254)
11608 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11609 word-wrap under bidirectional display. (Bug#9224)
11610
11611 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11612 is non-zero, even if the data buffer is NULL. Fixes a crash in
11613 vertical-motion with longlines-mode. (Bug#9254)
11614
11615 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11616
11617 * bidi.c <bidi_cache_total_alloc>: Now static.
11618 (bidi_initialize): Initialize bidi_cache_total_alloc.
11619
11620 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11621 cache. (Bug#9221)
11622
11623 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11624 amount allocated this far in `bidi_cache_total_alloc'.
11625 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11626 non-zero, only free the data buffer without restoring the cache
11627 contents. All callers changed.
11628
11629 * dispextern.h (bidi_unshelve_cache): Update prototype.
11630
11631 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11632 (move_it_in_display_line, move_it_to)
11633 (move_it_vertically_backward, move_it_by_lines): Replace the call
11634 to xfree to an equivalent call to bidi_unshelve_cache.
11635 (move_it_in_display_line_to): Fix logic of returning
11636 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11637
11638 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11639
11640 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11641 came from a string character with a `cursor' property. (Bug#9229)
11642
11643 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11644
11645 * Makefile.in (LIB_PTHREAD): New variable.
11646 (LIBES): Add LIB_PTHREAD (Bug#9216).
11647
11648 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11649 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11650
11651 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11652
11653 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11654
11655 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11656
11657 * xterm.c (x_find_topmost_parent): New function.
11658 (x_set_frame_alpha): Find topmost parent window with
11659 x_find_topmost_parent and set the property there also (bug#9181).
11660 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11661
11662 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11663
11664 * callproc.c (Fcall_process): Avoid vfork clobbering
11665 the local vars buffer, coding_systems, current_dir.
11666
11667 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11668
11669 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11670
11671 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11672
11673 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11674 so that it is not optimized away.
11675
11676 * xdisp.c (compute_display_string_pos): Remove unused local.
11677
11678 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11679
11680 Fix slow cursor motion and scrolling in large buffers with
11681 selective display, like Org Mode buffers. (Bug#9218)
11682
11683 * dispextern.h (struct bidi_it): New member disp_prop_p.
11684
11685 * xdisp.c: Remove one-slot cache of display string positions.
11686 (compute_display_string_pos): Accept an additional argument
11687 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11688 for a display string or property. If found, set DISP_PROP_P
11689 non-zero.
11690
11691 * bidi.c (bidi_fetch_char): Accept an additional argument
11692 DISP_PROP_P, and pass it to compute_display_string_pos.
11693 Only handle text covered by a display string if DISP_PROP_P is returned
11694 non-zero. All callers of bidi_fetch_char changed.
11695
11696 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11697
11698 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11699
11700 2010-12-03 Don March <don@ohspite.net>
11701
11702 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11703 last character M-[char] is translated to ESC [char] (bug#7541).
11704
11705 2011-08-02 Kenichi Handa <handa@m17n.org>
11706
11707 * lisp.h (uniprop_table): Extern it.
11708
11709 * chartab.c (uniprop_table): Make it non-static.
11710
11711 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11712
11713 * xdisp.c (forward_to_next_line_start): Accept additional argument
11714 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11715 on the newline.
11716 (reseat_at_next_visible_line_start): Use the bidi iterator state
11717 returned by forward_to_next_line_start to restore the state of
11718 it->bidi_it after backing up to previous newline. (Bug#9212)
11719
11720 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11721
11722 * regex.c (re_comp): Protoize.
11723 (re_exec): Fix return type.
11724 (regexec): Fix type of `ret'. (Bug#9203)
11725
11726 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11727
11728 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11729 This is needed if max-image-size is a floating-point number.
11730
11731 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11732
11733 * print.c (print_object): Print empty symbol as ##.
11734
11735 * lread.c (read1): Read ## as empty symbol.
11736
11737 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11738
11739 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11740 setting frame foreground color (Bug#9175).
11741 (x_set_background_color): Likewise.
11742
11743 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11744 contents (Bug#9176).
11745 (EmacsTooltip -init): Remove bezels and add shadows to
11746 tooltip windows.
11747
11748 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11749 or scroll bar (Bug#8470).
11750
11751 * nsfont.m (nsfont_open): Remove assignment to voffset and
11752 unnecessary vars hshink, expand, hd, full_height, min_height.
11753 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11754
11755 * nsterm.h (nsfont_info): Remove voffset field.
11756
11757 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11758
11759 Implement strike-through and overline on NextStep (Bug#8863).
11760
11761 * nsfont.m (nsfont_open): Use underline position provided by font,
11762 instead of hard-coded value of 2.
11763 (nsfont_draw): Call ns_draw_text_decoration instead.
11764
11765 * nsterm.h: Add declaration for ns_draw_text_decoration.
11766
11767 * nsterm.m (ns_draw_text_decoration): New function for drawing
11768 underline, overline, and strike-through.
11769 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11770 ns_draw_text_decoration. Change treatment of cursor drawing to
11771 accommodate underlining, etc.
11772
11773 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11774
11775 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11776 default.
11777
11778 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11779
11780 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11781 Without this fix, if a signal arrives just after memory fills up,
11782 'malloc' might be invoked reentrantly.
11783
11784 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11785 In other words, assume that every image size is allowed, on non-X
11786 hosts. This assumption is probably wrong, but it lets Emacs compile.
11787
11788 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11789
11790 * regex.c (re_iswctype): Convert return values to boolean.
11791
11792 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11793
11794 * xdisp.c (compute_display_string_pos): Don't use cached display
11795 string position if the buffer had its restriction changed.
11796 (Bug#9184)
11797
11798 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11799
11800 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11801
11802 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11803
11804 Integer signedness and overflow and related fixes. (Bug#9079)
11805
11806 * bidi.c: Integer size and overflow fixes.
11807 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11808 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11809 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11810 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11811 (bidi_find_other_level_edge):
11812 Use ptrdiff_t instead of EMACS_INT where either will do.
11813 This works better on 32-bit hosts configured --with-wide-int.
11814 (bidi_cache_ensure_space): Check for size-calculation overflow.
11815 Use % rather than repeated addition, for better worst-case speed.
11816 Don't set bidi_cache_size until after xrealloc returns, because it
11817 might not return.
11818 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11819 (bidi_cache_ensure_space): Also check that the bidi cache size
11820 does not exceed that of the largest Lisp string or buffer. See Eli
11821 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11822
11823 * alloc.c (__malloc_size_t): Remove.
11824 All uses replaced by size_t. See Andreas Schwab's note
11825 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11826
11827 * image.c: Improve checking for integer overflow.
11828 (check_image_size): Assume that f is nonnull, since
11829 it is always nonnull in practice. This is one less thing to
11830 worry about when checking for integer overflow later.
11831 (x_check_image_size): New function, which checks for integer
11832 overflow issues inside X.
11833 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11834 This removes the need for a memory_full check.
11835 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11836 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11837 (xbm_read_bitmap_data): Change locals back to 'int', since
11838 their values must fit in 'int'.
11839 (xpm_load_image, png_load, tiff_load):
11840 Invoke x_create_x_image_and_pixmap earlier,
11841 to avoid much needless work if the image is too large.
11842 (tiff_load): Treat overly large images as if
11843 x_create_x_image_and_pixmap failed, not as malloc failures.
11844 (gs_load): Use x_check_image_size.
11845
11846 * gtkutil.c: Omit integer casts.
11847 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11848 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11849
11850 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11851
11852 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11853 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11854 would wrongly return t on a 64-bit host.
11855
11856 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11857 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11858 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11859 and therefore cause GCC to emit a bogus diagnostic in some cases.
11860
11861 * image.c: Integer signedness and overflow and related fixes.
11862 This is not an exhaustive set of fixes, but it's time to
11863 record what I've got.
11864 (lookup_pixel_color, check_image_size): Remove redundant decls.
11865 (check_image_size): Don't assume that arbitrary EMACS_INT values
11866 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11867 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11868 (tiff_load, imagemagick_load_image):
11869 Check for overflow in size calculations.
11870 (x_create_x_image_and_pixmap): Remove unnecessary test for
11871 xmalloc returning NULL; that can't happen.
11872 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11873 (xpm_color_bucket): Use better integer hashing function.
11874 (xpm_cache_color): Don't possibly over-allocate memory.
11875 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11876 (gif_memory_source):
11877 Use ptrdiff_t, not int or size_t, to record sizes.
11878 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11879 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11880 either works, as we prefer signed integers.
11881 (tiff_read_from_memory, tiff_write_from_memory):
11882 Return tsize_t, not size_t, since that's what the TIFF API wants.
11883 (tiff_read_from_memory): Don't fail simply because the read would
11884 go past EOF; instead, return a short read.
11885 (tiff_load): Omit no-longer-needed casts.
11886 (Fimagemagick_types): Don't assume size fits into 'int'.
11887
11888 Improve hashing quality when configured --with-wide-int.
11889 * fns.c (hash_string): New function, taken from sxhash_string.
11890 Do not discard information about ASCII character case; this
11891 discarding is no longer needed.
11892 (sxhash-string): Use it. Change sig to match it. Caller changed.
11893 * lisp.h: Declare it.
11894 * lread.c (hash_string): Remove, since we now use fns.c's version.
11895 The fns.c version returns a wider integer if --with-wide-int is
11896 specified, so this should help the quality of the hashing a bit.
11897
11898 * emacs.c: Integer overflow minor fix.
11899 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11900 Define only if GNU_LINUX.
11901 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11902
11903 * dispnew.c: Integer signedness and overflow fixes.
11904 Remove unnecessary forward decls, that were a maintenance hassle.
11905 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11906 All uses changed.
11907 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11908 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11909 (prepare_desired_row, line_draw_cost):
11910 Use int, not unsigned, where either works.
11911 (save_current_matrix, restore_current_matrix):
11912 Use ptrdiff_t, not size_t, where either works.
11913 (init_display): Check for overflow more accurately, and without
11914 relying on undefined behavior.
11915
11916 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11917 Remove, replacing with the new symbols in lisp.h. All uses changed.
11918 * fileio.c (make_temp_name):
11919 * filelock.c (lock_file_1, lock_file):
11920 * xdisp.c (message_dolog):
11921 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11922 Use pMd etc. instead.
11923 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11924 replacing the pWIDE etc. symbols removed from editfns.c.
11925
11926 * keyboard.h (num_input_events): Now uintmax_t.
11927 This is (very slightly) less likely to mess up due to wraparound.
11928 All uses changed.
11929
11930 * buffer.c: Integer signedness fixes.
11931 (alloc_buffer_text, enlarge_buffer_text):
11932 Use ptrdiff_t rather than size_t when either will do, as we prefer
11933 signed integers.
11934
11935 * alloc.c: Integer signedness and overflow fixes.
11936 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11937 (__malloc_size_t): Default to size_t, not to int.
11938 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11939 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11940 Prefer ptrdiff_t to size_t when either would do, as we prefer
11941 signed integers.
11942 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11943 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11944 Now const. Initialize with values that are in range even if char
11945 is signed.
11946 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11947 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11948 These functions do the right thing with sizes > 2**32.
11949 (check_depth): Now ptrdiff_t, not int.
11950 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11951 Adjust to new way of storing sizes. Check for size overflow bugs
11952 in rest of code.
11953 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11954 slightly wrong anyway, as it missed one instance of
11955 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11956 (refill_memory_reserve): Omit needless cast to size_t.
11957 (mark_object_loop_halt): Mark as externally visible.
11958
11959 * xselect.c: Integer signedness and overflow fixes.
11960 (Fx_register_dnd_atom, x_handle_dnd_message):
11961 Use ptrdiff_t, not size_t, since we prefer signed.
11962 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11963 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11964 x_dnd_atoms_size and x_dnd_atoms_length.
11965
11966 * doprnt.c: Prefer signed to unsigned when either works.
11967 * eval.c (verror):
11968 * doprnt.c (doprnt):
11969 * lisp.h (doprnt):
11970 * xdisp.c (vmessage):
11971 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11972 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11973 prefer signed arithmetic to avoid comparison confusion.
11974 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11975 but is a bit tricky.
11976
11977 Assume freestanding C89 headers, string.h, stdlib.h.
11978 * data.c, doprnt.c, floatfns.c, print.c:
11979 Include float.h unconditionally.
11980 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11981 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11982 * regex.c: Likewise for stddef.h, string.h.
11983 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11984 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11985 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11986 (STDC_HEADERS): Remove obsolete defines.
11987 * sysdep.c: Include limits.h unconditionally.
11988
11989 Assume support for memcmp, memcpy, memmove, memset.
11990 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11991 * regex.c (memcmp, memcpy):
11992 Remove; we assume C89 now.
11993
11994 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11995 (__malloc_safe_bcopy): Remove; no longer needed.
11996
11997 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11998 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11999 well either way, and we prefer signed to unsigned.
12000
12001 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12002
12003 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12004 closes the connection while we're reading (bug#9182).
12005
12006 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
12007
12008 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12009 are specified (Bug#9168).
12010
12011 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12012
12013 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12014 Found by GCC static checking and --with-wide-int on a 32-bit host.
12015
12016 2011-07-25 Eli Zaretskii <eliz@gnu.org>
12017
12018 * xdisp.c (compute_display_string_pos): Fix logic of caching
12019 previous display string position. Initialize cached_prev_pos to
12020 -1. Fixes slow-down at the beginning of a buffer.
12021
12022 2011-07-24 Eli Zaretskii <eliz@gnu.org>
12023
12024 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12025 for attrs[LFACE_FONTSET_INDEX].
12026
12027 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12028
12029 * xml.c (parse_region): Remove unused local
12030 that was recently introduced.
12031
12032 2011-07-23 Eli Zaretskii <eliz@gnu.org>
12033
12034 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12035 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12036
12037 * xdisp.c (move_it_in_display_line_to): Record the best matching
12038 position for TO_CHARPOS while scanning the line, and restore it on
12039 exit if none of the characters scanned was an exact match.
12040 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
12041 when exact match is impossible due to invisible text, and the
12042 lines are truncated.
12043
12044 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12045
12046 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12047 for OSX >= 10.7.
12048
12049 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12050
12051 Fix a significant slow-down of cursor motion with C-n, C-p,
12052 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12053 auto-repeat under bidi redisplay in fontified buffers.
12054 * xdisp.c (compute_stop_pos_backwards): New function.
12055 (next_element_from_buffer): Call compute_stop_pos_backwards to
12056 find a suitable prev_stop when we find ourselves before
12057 base_level_stop.
12058 (reseat): Don't look for prev_stop, as that could mean a very long
12059 run.
12060 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12061 <cached_disp_overlay_modiff>: Cache for last found display string
12062 position.
12063 (compute_display_string_pos): Return the cached position if asked
12064 about the same buffer in the same area of character positions, and
12065 the buffer wasn't changed since the time the display string
12066 position was cached.
12067
12068 2011-07-22 Eli Zaretskii <eliz@gnu.org>
12069
12070 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12071 is an integer, which is important for empty lines. (Bug#9149)
12072
12073 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
12074
12075 * frame.c (Fmodify_frame_parameters): In tty case, update the
12076 default face if necessary (Bug#4238).
12077
12078 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
12079
12080 * editfns.c (Fstring_to_char): No need to explain what a character
12081 is in the docstring (Bug#6576).
12082
12083 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12084
12085 * xml.c (parse_region): Make sure we always return a tree.
12086
12087 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12088
12089 * xml.c (parse_region): If a document contains only comments,
12090 return that, too.
12091
12092 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12093
12094 * xml.c (make_dom): Return comments, too.
12095
12096 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12097
12098 Port to OpenBSD.
12099 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12100 and the surrounding thread.
12101 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12102 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12103 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12104 timer goes off.
12105 * s/openbsd.h (BROKEN_SIGIO): Define.
12106 * unexelf.c (unexec) [__OpenBSD__]:
12107 Don't update the .mdebug section of the Alpha COFF symbol table.
12108
12109 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12110
12111 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12112 (bug#8460).
12113
12114 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12115
12116 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12117 This fixes some race conditions on the permissions of any newly
12118 created file.
12119
12120 * alloc.c (valid_pointer_p): Use pipe, not open.
12121 This fixes some permissions issues when debugging.
12122
12123 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12124 If fchown fails to set both uid and gid, try to set just gid,
12125 as that is sometimes allowed. Adjust the file's mode to eliminate
12126 setuid or setgid bits that are inappropriate if fchown fails.
12127
12128 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12129
12130 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12131 to compare Lisp_Objects.
12132 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12133 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12134 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12135
12136 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12137
12138 * lread.c (read_integer): Unread even EOF character.
12139 (read1): Likewise. Properly record start position of symbol.
12140
12141 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12142 symbol character follows.
12143
12144 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12145
12146 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12147 This works around a problem with the previous change to Fcopy_file.
12148 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12149 and without this change, GCC might complain about discarding
12150 fchown's return value.
12151
12152 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
12153
12154 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12155
12156 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12157
12158 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12159
12160 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12161
12162 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12163 it's used from the C level.
12164
12165 * process.c: Use the same condition for POLL_FOR_INPUT in both
12166 keyboard.c and process.c (bug#1858).
12167
12168 2011-07-09 Lawrence Mitchell <wence@gmx.li>
12169
12170 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12171 (Fgnutls_boot): Use it.
12172
12173 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12174
12175 * doc.c (Fsubstitute_command_keys): Revert last change.
12176
12177 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12178
12179 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12180 quotes the next character, and doesn't affect other longer
12181 sequences (bug#8935).
12182
12183 * lread.c (syms_of_lread): Clarify that is isn't only
12184 `eval-buffer' and `eval-defun' that's affected by
12185 `lexical-binding' (bug#8460).
12186
12187 2011-07-15 Eli Zaretskii <eliz@gnu.org>
12188
12189 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
12190 bidi redisplay when a line includes both an image and is truncated.
12191
12192 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12193
12194 Fix minor problems found by static checking.
12195 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12196 (elsz): Now a signed constant, not a size_t var. We prefer signed
12197 types to unsigned, to avoid integer comparison confusion. Without
12198 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12199 "cannot optimize loop, the loop counter may overflow", a symptom
12200 of the confusion.
12201 * indent.c (Fvertical_motion): Mark locals as initialized.
12202 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12203
12204 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12205
12206 * search.c (Fre_search_backward): Mention `case-fold-search' in
12207 all the re_search_* functions (bug#8138).
12208
12209 * keyboard.c (Fopen_dribble_file): Document when the file is
12210 closed (bug#8056).
12211
12212 2011-07-14 Eli Zaretskii <eliz@gnu.org>
12213
12214 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12215 bidi_cache_idx.
12216
12217 Support bidi reordering of display and overlay strings.
12218 * xdisp.c (compute_display_string_pos)
12219 (compute_display_string_end): Accept additional argument STRING.
12220 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12221 (reseat_to_string): Initialize bidi_it->string.s and
12222 bidi_it->string.schars.
12223 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
12224 NULL (avoids a crash in bidi_paragraph_init).
12225 Initialize itb.string.lstring.
12226 (init_iterator): Call bidi_init_it only of a valid
12227 buffer position was specified. Initialize paragraph_embedding to
12228 L2R.
12229 (reseat_to_string): Initialize the bidi iterator.
12230 (display_string): If we need to ignore text properties of
12231 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12232 original value of -1 will not work with bidi.)
12233 (compute_display_string_pos): First arg is now struct
12234 `text_pos *'; all callers changed. Support display properties on
12235 Lisp strings.
12236 (compute_display_string_end): Support display properties on Lisp
12237 strings.
12238 (init_iterator, reseat_1, reseat_to_string): Initialize the
12239 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12240 when iterating on a string not from display properties).
12241 (compute_display_string_pos, compute_display_string_end):
12242 Fix calculation of the object to scan. Fixes an error when using
12243 arrow keys.
12244 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
12245 base_level_stop; instead, set base_level_stop to BEGV.
12246 Fixes crashes in vertical-motion.
12247 (next_element_from_buffer): Improve commentary for when
12248 the iterator is before prev_stop.
12249 (init_iterator): Initialize bidi_p from the default value of
12250 bidi-display-reordering, not from buffer-local value. Use the
12251 buffer-local value only if initializing for buffer iteration.
12252 (handle_invisible_prop): Support invisible properties on strings
12253 that are being bidi-reordered.
12254 (set_iterator_to_next): Support bidi reordering of C strings and
12255 Lisp strings.
12256 (next_element_from_string): Support bidi reordering of Lisp
12257 strings.
12258 (handle_stop_backwards): Support Lisp strings as well.
12259 (display_string): Support display of R2L glyph rows.
12260 Use IT_STRING_CHARPOS when displaying from a Lisp string.
12261 (init_iterator): Don't initialize it->bidi_p for strings
12262 here.
12263 (reseat_to_string): Initialize it->bidi_p for strings here.
12264 (next_element_from_string, next_element_from_c_string)
12265 (next_element_from_buffer): Add xassert's for correspondence
12266 between IT's object being iterated and it->bidi_it.string
12267 structure.
12268 (face_before_or_after_it_pos): Support bidi iteration.
12269 (next_element_from_c_string): Handle the case of the first string
12270 character that is not the first one in the visual order.
12271 (get_visually_first_element): New function, refactored from common
12272 parts of next_element_from_buffer, next_element_from_string, and
12273 next_element_from_c_string.
12274 (tool_bar_lines_needed, redisplay_tool_bar)
12275 (display_menu_bar): Force left-to-right direction. Add a FIXME
12276 comment for making that be controlled by a user option.
12277 (push_it, pop_it): Save and restore the state of the
12278 bidi iterator. Save and restore the bidi_p flag.
12279 (pop_it): Iterate out of display property for string iteration as
12280 well.
12281 (iterate_out_of_display_property): Support iteration over strings.
12282 (handle_single_display_spec): Set up it->bidi_it for iteration
12283 over a display string, and call bidi_init_it.
12284 (handle_single_display_spec, next_overlay_string)
12285 (get_overlay_strings_1, push_display_prop): Set up the bidi
12286 iterator for displaying display or overlay strings.
12287 (forward_to_next_line_start): Don't use the shortcut if
12288 bidi-iterating.
12289 (back_to_previous_visible_line_start): If handle_display_prop
12290 pushed the iterator stack, restore the internal state of the bidi
12291 iterator by calling bidi_pop_it same number of times.
12292 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12293 and we are bidi-iterating, don't decrement the iterator position;
12294 instead, set the first_elt flag in the bidi iterator, to produce
12295 the same effect.
12296 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12297 (push_display_prop): xassert that we are iterating a buffer.
12298 (push_it, pop_it): Save and restore paragraph_embedding member.
12299 (handle_single_display_spec, next_overlay_string)
12300 (get_overlay_strings_1, reseat_1, reseat_to_string)
12301 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12302 correctly. Don't assume unibyte strings are not bidi-reordered.
12303 (compute_display_string_pos)
12304 (compute_display_string_end): Fix handling the case of C string.
12305 (push_it, pop_it): Save and restore from_disp_prop_p.
12306 (handle_single_display_spec, push_display_prop): Set the
12307 from_disp_prop_p flag.
12308 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12309 (pop_it): Call iterate_out_of_display_property only if we are
12310 popping after iteration over a string that came from a display
12311 property. Fix a typo in popping stretch info. Add an assertion
12312 for verifying that the iterator position is in sync with the bidi
12313 iterator.
12314 (handle_single_display_spec, get_overlay_strings_1)
12315 (push_display_prop): Fix initialization of paragraph direction for
12316 string when that of the parent object is not yet determined.
12317 (reseat_1): Call bidi_init_it to resync the bidi
12318 iterator with IT's position. (Bug#7616)
12319 (find_row_edges): If ROW->start.pos gives position
12320 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12321 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12322 Reset the from_disp_prop_p flag.
12323 (SAVE_IT, RESTORE_IT): New macros.
12324 (pos_visible_p, face_before_or_after_it_pos)
12325 (back_to_previous_visible_line_start)
12326 (move_it_in_display_line_to, move_it_in_display_line)
12327 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12328 (try_scrolling, redisplay_window, display_line): Use them when
12329 saving a temporary copy of the iterator and restoring it back.
12330 (back_to_previous_visible_line_start, reseat_1)
12331 (init_iterator): Empty the bidi cache "stack".
12332 (move_it_in_display_line_to): If iterator ended up at
12333 EOL, but we never saw any buffer positions smaller than
12334 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12335 motion in bidi-reordered lines.
12336 (move_it_in_display_line_to): Record prev_method and prev_pos
12337 immediately before the call to set_iterator_to_next. Fixes cursor
12338 motion in bidi-reordered lines with stretch glyphs and strings
12339 displayed in margins. (Bug#8133) (Bug#8867)
12340 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12341 TO_CHARPOS.
12342 (pos_visible_p): Support positions in bidi-reordered lines.
12343 Save and restore bidi cache.
12344
12345 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12346 (bidi_paragraph_info): Delete unused struct.
12347 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12348 (bidi_cache_start): New variable.
12349 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12350 to zero.
12351 (bidi_cache_fetch_state, bidi_cache_search)
12352 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12353 (bidi_cache_find, bidi_peek_at_next_level)
12354 (bidi_level_of_next_char, bidi_find_other_level_edge)
12355 (bidi_move_to_visually_next): Compare cache index with
12356 bidi_cache_start rather than with zero.
12357 (bidi_fetch_char): Accept new argument STRING; all callers
12358 changed. Support iteration over a string. Support strings with
12359 display properties. Support unibyte strings. Fix the type of
12360 `len' according to what STRING_CHAR_AND_LENGTH expects.
12361 (bidi_paragraph_init, bidi_resolve_explicit_1)
12362 (bidi_resolve_explicit, bidi_resolve_weak)
12363 (bidi_level_of_next_char, bidi_move_to_visually_next):
12364 Support iteration over a string.
12365 (bidi_set_sor_type, bidi_resolve_explicit_1)
12366 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12367 can now be zero (for strings); special values 0 and -1 were
12368 changed to -1 and -2, respectively.
12369 (bidi_char_at_pos): New function.
12370 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12371 Call it instead of FETCH_MULTIBYTE_CHAR.
12372 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12373 initialized to valid values.
12374 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12375 values.
12376 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12377 the test for valid cached positions. Fix the logic for looking up
12378 the sentinel state in the cache. GCPRO the Lisp string we are
12379 iterating.
12380 (bidi_push_it, bidi_pop_it): New functions.
12381 (bidi_initialize): Initialize the bidi cache start stack pointer.
12382 (bidi_cache_ensure_space): New function, refactored from part of
12383 bidi_cache_iterator_state. Don't assume the required size is just
12384 one BIDI_CACHE_CHUNK away.
12385 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12386 (bidi_count_bytes, bidi_char_at_pos): New functions.
12387 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12388 always valid if bidi_cache_idx is valid.
12389 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12390 is valid if it's going to be used.
12391 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12392 (bidi_cache_fetch_state, bidi_cache_search)
12393 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12394 (bidi_cache_iterator_state, bidi_cache_find)
12395 (bidi_find_other_level_edge, bidi_cache_start_stack):
12396 All variables related to cache indices are now EMACS_INT.
12397
12398 * dispextern.h (struct bidi_string_data): New structure.
12399 (struct bidi_it): New member `string'. Make flag members be 1-bit
12400 fields, and put them last in the struct.
12401 (compute_display_string_pos, compute_display_string_end):
12402 Update prototypes.
12403 (bidi_push_it, bidi_pop_it): Add prototypes.
12404 (struct iterator_stack_entry): New members bidi_p,
12405 paragraph_embedding, and from_disp_prop_p.
12406 (struct it): Member bidi_p is now a bit field 1 bit wide.
12407 (bidi_shelve_cache, bidi_unshelve_cache):
12408 Declare prototypes.
12409
12410 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12411 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12412 and vector-like objects.
12413
12414 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12415 cache around display iteration.
12416
12417 * window.c (Fwindow_end, window_scroll_pixel_based)
12418 (displayed_window_lines, Frecenter): Save and restore the bidi
12419 cache around display iteration.
12420
12421 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12422
12423 * editfns.c (Fdelete_region): Clarify the use of the named
12424 parameters (bug#6788).
12425
12426 2011-07-14 Martin Rudalics <rudalics@gmx.at>
12427
12428 * indent.c (Fvertical_motion): Set and restore w->pointm when
12429 saving and restoring the window's buffer (Bug#9006).
12430
12431 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12432
12433 * editfns.c (Fstring_to_char): Clarify just what is returned
12434 (bug#6576). Text by Eli Zaretskii.
12435
12436 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
12437
12438 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12439
12440 2011-07-13 Eli Zaretskii <eliz@gnu.org>
12441
12442 * buffer.c (mmap_find): Fix a typo.
12443
12444 2011-07-13 Johan Bockgård <bojohan@gnu.org>
12445
12446 Fix execution of x selection hooks.
12447 * xselect.c (Qx_lost_selection_functions)
12448 (Qx_sent_selection_functions): New vars.
12449 (syms_of_xselect): DEFSYM them.
12450 (x_handle_selection_request): Pass Qx_sent_selection_functions
12451 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12452 (x_handle_selection_clear,x_clear_frame_selections):
12453 Pass Qx_lost_selection_functions rather than
12454 Vx_lost_selection_functions to Frun_hook_with_args.
12455
12456 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12457
12458 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
12459 The old code sometimes used this field without initializing it.
12460
12461 * alloc.c (gc_sweep): Don't read past end of array.
12462 In theory, the old code could also have corrupted Emacs internals,
12463 though it'd be very unlikely.
12464
12465 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12466
12467 * character.c (Fcharacterp): Don't advertise optional ignored
12468 argument. (Bug#4026)
12469
12470 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12471
12472 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12473 key" (bug#4257).
12474
12475 * window.c (Fset_window_start): Doc fix (bug#4199).
12476 (Fset_window_hscroll): Ditto.
12477
12478 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12479
12480 Fix minor new problems caught by GCC 4.6.1.
12481 * term.c (init_tty): Remove unused local.
12482 * xsettings.c (store_monospaced_changed): Define this function only
12483 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
12484 not used otherwise.
12485
12486 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
12487
12488 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12489
12490 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12491
12492 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12493 are the mini-buffer and the echo area (bug#3320).
12494
12495 * term.c (init_tty): Remove support for supdup, c10 and perq
12496 terminals, which are no longer supported (bug#1482).
12497
12498 2011-07-10 Johan Bockgård <bojohan@gnu.org>
12499
12500 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12501
12502 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12503
12504 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12505 for non-popups (Bug#3642).
12506
12507 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12508
12509 * alloc.c (reset_malloc_hooks): Protoize.
12510 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
12511 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12512 * cm.c (losecursor): Likewise.
12513 * data.c (fmod): Likewise.
12514 * dispnew.c (swap_glyphs_in_rows): Likewise.
12515 * emacs.c (memory_warning_signal): Likewise.
12516 * floatfns.c (float_error): Likewise.
12517 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12518 (otf_open, font_otf_capability, generate_otf_features)
12519 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12520 Likewise.
12521 * image.c (pbm_read_file): Likewise.
12522 * indent.c (string_display_width): Likewise.
12523 * intervals.c (check_for_interval, search_for_interval)
12524 (inc_interval_count, count_intervals, root_interval)
12525 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12526 * lread.c (defalias): Likewise.
12527 * ralloc.c (r_alloc_check): Likewise.
12528 * regex.c (set_image_of_range_1, set_image_of_range)
12529 (regex_grow_registers): Likewise.
12530 * sysdep.c (strerror): Likewise.
12531 * termcap.c (valid_filename_p, tprint, main): Likewise.
12532 * tparam.c (main): Likewise.
12533 * unexhp9k800.c (run_time_remap, save_data_space)
12534 (update_file_ptrs, read_header, write_header, calculate_checksum)
12535 (copy_file, copy_rest, display_header): Likewise.
12536 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12537 Likewise.
12538 * xdisp.c (check_it): Likewise.
12539 * xfaces.c (register_color, unregister_color, unregister_colors):
12540 Likewise.
12541 * xfns.c (print_fontset_result): Likewise.
12542 * xrdb.c (member, fatal, main): Likewise.
12543
12544 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12545
12546 Fix minor problems found by static checking (Bug#9031).
12547 * chartab.c (char_table_set_range, map_sub_char_table):
12548 Remove unused locals.
12549 (uniprop_table): Now static.
12550 * composite.c (_work_char): Remove unused static var.
12551
12552 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12553
12554 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12555
12556 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12557
12558 * gtkutil.c (qttip_cb): Remove code without function.
12559
12560 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12561
12562 * w32.c (pthread_sigmask): New stub.
12563
12564 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12565
12566 Use pthread_sigmask, not sigprocmask (Bug#9010).
12567 sigprocmask is portable only for single-threaded applications, and
12568 Emacs can be multi-threaded when it uses GTK.
12569 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12570 (LIBES): Use it.
12571 * callproc.c (Fcall_process):
12572 * process.c (create_process):
12573 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12574 Use pthread_sigmask, not sigprocmask.
12575
12576 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12577
12578 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12579 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12580 wrong (Bug#8591).
12581
12582 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12583
12584 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12585 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12586 (xg_hide_tooltip): Fix comment.
12587
12588 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12589 in registerServicesMenuSendTypes.
12590 (validRequestorForSendType): Don't check ns_return_types.
12591
12592 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12593 ns_return_type.
12594
12595 2011-07-08 Jason Rumney <jasonr@gnu.org>
12596
12597 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12598 SH_SHOW for hidden windows (Bug#5482).
12599
12600 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12601 frame struct members of non-existent frames (Bug#6284).
12602
12603 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12604
12605 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12606 variable firstTime not needed on OSX >= 10.6.
12607 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12608 >= 10.5. Use setKnobProportion, setDoubleValue.
12609
12610 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12611 (MAC_OS_X_VERSION_10_5): Define if not defined.
12612 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12613 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12614 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12615
12616 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12617 cString and lossyCString on OSX >= 10.4.
12618
12619 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12620 sizeToFit on OSX >= 10.2.
12621
12622 * nsimage.m (allocInitFromFile): Don't use deprecated method
12623 bestRepresentationForDevice on OSX >= 10.6.
12624
12625 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12626 to avoid warning.
12627
12628 * emacs.c: Declare unexec_init_emacs_zone.
12629
12630 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12631
12632 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12633
12634 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12635 on svcsMenu (Bug#8842).
12636
12637 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12638 ns_return_types.
12639 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12640
12641 * nsterm.m (QUTF8_STRING): Declare.
12642 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12643 (validRequestorForSendType): Return type is (id).
12644 Change indexOfObjectIdenticalTo to indexOfObject.
12645 Check if we have local selection before returning self (Bug#8842).
12646 (writeSelectionToPasteboard): Put local selection into paste board
12647 if we have a local selection (Bug#8842).
12648 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12649
12650 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12651 (ns_get_local_selection): Declare.
12652
12653 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12654
12655 * keymap.c (describe_map_tree): Don't insert a double newline at
12656 the end of the buffer (bug#1169) and return whether we inserted
12657 something.
12658
12659 * callint.c (Fcall_interactively): Change "reading args" to
12660 "providing args" to try to clarify what it does (bug#1010).
12661
12662 2011-07-07 Kenichi Handa <handa@m17n.org>
12663
12664 * composite.c (composition_compute_stop_pos): Ignore a static
12665 composition starting before CHARPOS (Bug#8915).
12666
12667 * xdisp.c (handle_composition_prop): Likewise.
12668
12669 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12670
12671 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12672 (Bug#9015)
12673
12674 2011-07-07 Kenichi Handa <handa@m17n.org>
12675
12676 * character.h (unicode_category_t): New enum type.
12677
12678 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12679 (Qchar_code_property_table): New variable.
12680 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12681 (UNIPROP_COMPRESSED_FORM_P): New macros.
12682 (char_table_ascii): Uncompress the compressed values.
12683 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12684 Uncompress the compressed values.
12685 (sub_char_table_ref_and_range): Likewise.
12686 (char_table_ref_and_range): Uncompress the compressed values.
12687 (sub_char_table_set): New arg is_uniprop. Callers changed.
12688 Uncompress the compressed values.
12689 (sub_char_table_set_range): Args changed. Callers changed.
12690 (char_table_set_range): Adjuted for the above change.
12691 (map_sub_char_table): Delete args default_val and parent. Add arg
12692 top. Give decoded values to a Lisp function.
12693 (map_char_table): Adjust for the above change. Give decoded
12694 values to a Lisp function. Gcpro more variables.
12695 (uniprop_table_uncompress)
12696 (uniprop_decode_value_run_length): New functions.
12697 (uniprop_decoder, uniprop_decoder_count): New variables.
12698 (uniprop_get_decoder, uniprop_encode_value_character)
12699 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12700 New functions.
12701 (uniprop_encoder, uniprop_encoder_count): New variables.
12702 (uniprop_get_encoder, uniprop_table)
12703 (Funicode_property_table_internal, Fget_unicode_property_internal)
12704 (Fput_unicode_property_internal): New functions.
12705 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12706 Sunicode_property_table_internal, Sget_unicode_property_internal,
12707 and Sput_unicode_property_internal. Defvar_lisp
12708 char-code-property-alist.
12709
12710 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12711 Vunicode_category_table.
12712
12713 * font.c (font_range): Adjust for the change of
12714 Vunicode_category_table.
12715
12716 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12717
12718 * m/iris4d.h: Remove file, move contents ...
12719 * s/irix6-5.h: ... here.
12720
12721 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12722
12723 Remove unportable assumption about struct layout (Bug#8884).
12724 * alloc.c (mark_buffer):
12725 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12726 (clone_per_buffer_values): Don't assume that
12727 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12728 This isn't true in general, and it's particularly not true
12729 if Emacs is configured with --with-wide-int.
12730 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12731 New macros, used in the buffer.c change.
12732
12733 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12734
12735 * xsettings.c: Use both GConf and GSettings if both are available.
12736 (store_config_changed_event): Add comment.
12737 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12738 (store_tool_bar_style_changed): New functions.
12739 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12740 (struct xsettings): Move font inside HAVE_XFT.
12741 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12742 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12743 Move inside HAVE_XFT.
12744 (something_changed_gsettingsCB): Rename from something_changedCB.
12745 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12746 also.
12747 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12748 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12749 (something_changed_gconfCB): Rename from something_changedCB.
12750 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12751 (parse_settings): Move check for font inside HAVE_XFT.
12752 (read_settings, apply_xft_settings): Add comment.
12753 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12754 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12755 call store_font_name_changed.
12756 (xft_settings_event): Add comment.
12757 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12758 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12759 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12760 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12761 (xsettings_initialize): Call init_gsettings last.
12762 (xsettings_get_system_font, xsettings_get_system_normal_font):
12763 Add comment.
12764
12765 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12766
12767 Random fixes. E.g., (random) never returned negative values.
12768 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12769 subseconds part to the entropy, as that's a bit more random.
12770 Prefer signed to unsigned, since the signedness doesn't matter and
12771 in general we prefer signed. When given a limit, use a
12772 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12773 latter isn't right if USE_2_TAGS_FOR_INTS.
12774 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12775 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12776
12777 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12778
12779 * textprop.c (text_property_stickiness):
12780 Obey Vtext_property_default_nonsticky.
12781 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12782 * w32fns.c (syms_of_w32fns):
12783 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12784
12785 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12786
12787 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12788 This is more efficient than Ffile_directory_p and avoids a minor race.
12789
12790 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12791
12792 * buffer.c (Foverlay_put): Say what the return value is
12793 (bug#7835).
12794
12795 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12796 is a directory before asking whether to use the file name
12797 (bug#7564).
12798 (barf_or_query_if_file_exists): Make the "File is a directory"
12799 error be more correct.
12800
12801 * fns.c (Frequire): Remove the mention of the .gz files, since
12802 that's installation-specific, but keep the mention of
12803 `get-load-suffixes'.
12804
12805 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12806
12807 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12808 Report string overflow if the output is too long.
12809
12810 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12811
12812 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12813 (syms_of_gnutls): Remove duplicate DEFSYM for
12814 Qgnutls_bootprop_verify_hostname_error, an error for
12815 Qgnutls_bootprop_verify_error (which is no longer used).
12816
12817 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12818 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12819 Also (re)move comments that are misplaced or no longer relevant.
12820
12821 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12822
12823 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12824
12825 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12826
12827 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12828 and background color parameters if they have been changed.
12829
12830 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12831
12832 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12833
12834 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12835
12836 * xsettings.c (SYSTEM_FONT): Define only when used.
12837 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12838
12839 * keymap.c (access_keymap_1): Now static.
12840
12841 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12842
12843 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12844 leave any prefix arg for the up event (Bug#1586).
12845
12846 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12847
12848 * lread.c (syms_of_lread): Mention single symbols defined by
12849 `defvar' or `defconst' (bug#7154).
12850
12851 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12852 (Frequire): Mention get-load-suffixes.
12853
12854 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12855
12856 * window.h (window): Remove clone_number slot.
12857 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12858 Remove.
12859 (make_parent_window, make_window, saved_window)
12860 (Fset_window_configuration, save_window_save): Don't deal with
12861 clone numbers.
12862 * buffer.c (Qclone_number): Remove declaration.
12863 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12864
12865 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12866
12867 Add multiple inheritance to keymaps.
12868 * keymap.c (Fmake_composed_keymap): New function.
12869 (Fset_keymap_parent): Simplify.
12870 (fix_submap_inheritance): Remove.
12871 (access_keymap_1): New function extracted from access_keymap to handle
12872 embedded parents and handle lists of maps.
12873 (access_keymap): Use it.
12874 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12875 (Fcopy_keymap): Handle embedded parents.
12876 (Fcommand_remapping, define_as_prefix): Simplify.
12877 (Fkey_binding): Simplify.
12878 (syms_of_keymap): Move minibuffer-local-completion-map,
12879 minibuffer-local-filename-completion-map,
12880 minibuffer-local-must-match-map, and
12881 minibuffer-local-filename-must-match-map to Elisp.
12882 (syms_of_keymap): Defsubr make-composed-keymap.
12883 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12884 (parse_menu_item): Trivial simplification.
12885
12886 2011-07-01 Glenn Morris <rgm@gnu.org>
12887
12888 * Makefile.in (SETTINGS_LIBS): Fix typo.
12889
12890 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12891
12892 * coding.c (Fencode_coding_string): Record the last coding system
12893 used, as the function doc string says (bug#8738).
12894
12895 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12896
12897 * xsettings.c (store_monospaced_changed): Take new font as arg and
12898 check for change against current_mono_font.
12899 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12900 (emacs_settings_constructor, emacs_settings_get_property)
12901 (emacs_settings_set_property, emacs_settings_class_init)
12902 (emacs_settings_init, gsettings_obj): Remove.
12903 (something_changedCB): New function for HAVE_GSETTINGS.
12904 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12905 with value as argument.
12906 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12907 g_settings_new (Bug#8967). Do not create gsettings_obj.
12908 Remove calls to g_settings_bind. Connect something_changedCB to
12909 "changed".
12910
12911 * xgselect.c: Add defined (HAVE_GSETTINGS).
12912 (xgselect_initialize): Ditto.
12913
12914 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12915 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12916 xg_select.
12917
12918 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12919
12920 * eval.c (struct backtrace): Simplify and port the data structure.
12921 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12922 signed bit field, as this assumption is not portable and it makes
12923 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12924 "char debug_on_exit : 1" as this is not portable either; instead,
12925 use the portable "unsigned int debug_on_exit : 1". Remove unused
12926 member evalargs. Remove obsolete comments about cc bombing out.
12927
12928 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12929
12930 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12931 Let HAVE_GSETTINGS override HAVE_GCONF.
12932 (store_monospaced_changed): New function.
12933 (EMACS_SETTINGS): A new type derived from GObject to handle
12934 GSettings notifications.
12935 (emacs_settings_constructor, emacs_settings_get_property)
12936 (emacs_settings_set_property, emacs_settings_class_init):
12937 New functions.
12938 (gsettings_client, gsettings_obj): New variables.
12939 (GSETTINGS_SCHEMA): New define.
12940 (something_changedCB): Call store_monospaced_changed.
12941 (init_gsettings): New function.
12942 (xsettings_initialize): Call init_gsettings.
12943 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12944 to NULL.
12945
12946 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12947 GCONF_CFLAGS/LIBS.
12948
12949 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12950
12951 * window.c (resize_root_window, grow_mini_window)
12952 (shrink_mini_window): Rename Qresize_root_window to
12953 Qwindow_resize_root_window and Qresize_root_window_vertically to
12954 Qwindow_resize_root_window_vertically.
12955
12956 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12957
12958 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12959
12960 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12961
12962 * makefile.w32-in: Redesign dependencies so they reflect more
12963 clearly which files are directly included by each source file,
12964 and not through other includes.
12965
12966 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12967
12968 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12969 (sort_overlays, overlay_strings): When an overlay's clone number
12970 matches the window's clone number process the overlay even if
12971 the overlay's window property doesn't match the current window.
12972
12973 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12974 (Fwindow_hchild): Rename to Fwindow_left_child.
12975 (Fwindow_next): Rename to Fwindow_next_sibling.
12976 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12977 (resize_window_check): Rename to window_resize_check.
12978 (resize_window_apply): Rename to window_resize_apply.
12979 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12980 (Fdelete_other_windows_internal, resize_frame_windows)
12981 (Fsplit_window_internal, Fdelete_window_internal)
12982 (grow_mini_window, shrink_mini_window)
12983 (Fresize_mini_window_internal): Fix callers accordingly.
12984
12985 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12986
12987 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12988 (emacs_fixed_set_min_size): Remove.
12989 (emacs_fixed_new): Take frame as argument.
12990
12991 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12992 (_EmacsFixedPrivate): Remove minwidth/height.
12993 Add struct frame *f.
12994 (emacs_fixed_init): Initialize priv->f.
12995 (get_parent_class, emacs_fixed_set_min_size): Remove.
12996 (emacs_fixed_new): Set priv->f to argument.
12997 (emacs_fixed_get_preferred_width)
12998 (emacs_fixed_get_preferred_height): Use min_width/height from
12999 frames size_hint to set minimum and natural (Bug#8919).
13000 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13001 and use min_width/height from frames size_hint to set
13002 min_width/height (Bug#8919).
13003
13004 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
13005 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13006 Fix indentation.
13007
13008 2011-06-26 Eli Zaretskii <eliz@gnu.org>
13009
13010 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13011 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13012 called at ZV.
13013
13014 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
13015
13016 * process.c (wait_reading_process_output): Bypass select if
13017 waiting for a cell while ignoring keyboard input, and input is
13018 pending. Suggested by Jan Djärv (Bug#8869).
13019
13020 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13021
13022 Use gnulib's dup2 module instead of rolling our own.
13023 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13024
13025 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13026
13027 * dispnew.c (scrolling_window): Before scrolling, turn off a
13028 mouse-highlight in the window being scrolled.
13029
13030 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
13031
13032 Move DEFSYM to lisp.h and use everywhere.
13033
13034 * character.h (DEFSYM): Move declaration...
13035 * lisp.h (DEFSYM): ...here.
13036
13037 * gnutls.c:
13038 * minibuf.c:
13039 * w32menu.c:
13040 * w32proc.c:
13041 * w32select.c: Don't include character.h.
13042
13043 * alloc.c (syms_of_alloc):
13044 * buffer.c (syms_of_buffer):
13045 * bytecode.c (syms_of_bytecode):
13046 * callint.c (syms_of_callint):
13047 * casefiddle.c (syms_of_casefiddle):
13048 * casetab.c (init_casetab_once):
13049 * category.c (init_category_once, syms_of_category):
13050 * ccl.c (syms_of_ccl):
13051 * cmds.c (syms_of_cmds):
13052 * composite.c (syms_of_composite):
13053 * dbusbind.c (syms_of_dbusbind):
13054 * dired.c (syms_of_dired):
13055 * dispnew.c (syms_of_display):
13056 * doc.c (syms_of_doc):
13057 * editfns.c (syms_of_editfns):
13058 * emacs.c (syms_of_emacs):
13059 * eval.c (syms_of_eval):
13060 * fileio.c (syms_of_fileio):
13061 * fns.c (syms_of_fns):
13062 * frame.c (syms_of_frame):
13063 * fringe.c (syms_of_fringe):
13064 * insdel.c (syms_of_insdel):
13065 * keymap.c (syms_of_keymap):
13066 * lread.c (init_obarray, syms_of_lread):
13067 * macros.c (syms_of_macros):
13068 * msdos.c (syms_of_msdos):
13069 * print.c (syms_of_print):
13070 * process.c (syms_of_process):
13071 * search.c (syms_of_search):
13072 * sound.c (syms_of_sound):
13073 * syntax.c (init_syntax_once, syms_of_syntax):
13074 * terminal.c (syms_of_terminal):
13075 * textprop.c (syms_of_textprop):
13076 * undo.c (syms_of_undo):
13077 * w32.c (globals_of_w32):
13078 * window.c (syms_of_window):
13079 * xdisp.c (syms_of_xdisp):
13080 * xfaces.c (syms_of_xfaces):
13081 * xfns.c (syms_of_xfns):
13082 * xmenu.c (syms_of_xmenu):
13083 * xsettings.c (syms_of_xsettings):
13084 * xterm.c (syms_of_xterm): Use DEFSYM.
13085
13086 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13087
13088 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
13089
13090 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13091
13092 Integer and buffer overflow fixes (Bug#8873).
13093
13094 * print.c (printchar, strout): Check for string overflow.
13095 (PRINTPREPARE, printchar, strout):
13096 Don't set size unless allocation succeeds.
13097
13098 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13099 for sizes. Check for string overflow more accurately.
13100 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13101
13102 * macros.c: Integer and buffer overflow fixes.
13103 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13104 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13105 Use ptrdiff_t, not int, for sizes.
13106 Don't increment bufsize until after realloc succeeds.
13107 Check for size-calculation overflow.
13108 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13109
13110 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13111
13112 * lread.c: Integer overflow fixes.
13113 (read_integer): Radix is now EMACS_INT, not int,
13114 to improve quality of diagnostics for out-of-range radices.
13115 Calculate buffer size correctly for out-of-range radices.
13116 (read1): Check for integer overflow in radices, and in
13117 read-circle numbers.
13118 (read_escape): Avoid int overflow.
13119 (Fload, openp, read_buffer_size, read1)
13120 (substitute_object_recurse, read_vector, read_list, map_obarray):
13121 Use ptrdiff_t, not int, for sizes.
13122 (read1): Use EMACS_INT, not int, for sizes.
13123 Check for size overflow.
13124
13125 * image.c (cache_image): Check for size arithmetic overflow.
13126
13127 * lread.c: Integer overflow issues.
13128 (saved_doc_string_size, saved_doc_string_length)
13129 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13130 Now ptrdiff_t, not int.
13131 (read1): Don't assume doc string length fits in int. Check for
13132 out-of-range doc string lengths.
13133 (read_list): Don't assume file position fits in int.
13134 (read_escape): Check for hex character overflow.
13135
13136 2011-06-22 Leo Liu <sdl.web@gmail.com>
13137
13138 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13139 Move to minibuffer.el.
13140
13141 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13142
13143 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
13144 The following patches are for when GLYPH_DEBUG && !XASSERT.
13145 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13146 * dispnew.c (flush_stdout):
13147 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13148 Mark as externally visible.
13149 * dispnew.c (check_window_matrix_pointers): Now static.
13150 * dispnew.c (window_to_frame_vpos):
13151 * xfns.c (unwind_create_frame):
13152 * xterm.c (x_check_font): Remove unused local.
13153 * scroll.c (CHECK_BOUNDS):
13154 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13155 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13156 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13157 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13158 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13159 Now static.
13160 (debug_method_add): Use va_list and vsprintf rather than relying
13161 on undefined behavior with wrong number of arguments.
13162 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13163 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13164 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13165 since we're not interested in debugging glyphs with old libraries.
13166 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13167 GCC 4.6.0's static checking.
13168
13169 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13170
13171 Integer overflow and signedness fixes (Bug#8873).
13172 A few related buffer overrun fixes, too.
13173
13174 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13175
13176 * dispextern.h (struct face.stipple):
13177 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13178 (x_bitmap_mask, x_allocate_bitmap_record)
13179 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13180 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13181 (x_create_bitmap_from_xpm_data):
13182 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13183 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13184 (.bitmaps_last):
13185 * xfaces.c (load_pixmap):
13186 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13187 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13188 (.bitmaps_last, struct x_output.icon_bitmap):
13189 Use ptrdiff_t, not int, for bitmap indexes.
13190 (x_allocate_bitmap_record): Check for size overflow.
13191 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13192
13193 Use ptrdiff_t, not int, for overlay counts.
13194 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13195 * editfns.c (overlays_around, get_pos_property):
13196 * textprop.c (get_char_property_and_overlay):
13197 * xdisp.c (next_overlay_change, note_mouse_highlight):
13198 * xfaces.c (face_at_buffer_position):
13199 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13200 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13201 (Fnext_overlay_change, Fprevious_overlay_change)
13202 (mouse_face_overlay_overlaps, Foverlays_in):
13203 Use ptrdiff_t, not int, for sizes.
13204 (overlays_at, overlays_in): Check for size-calculation overflow.
13205
13206 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13207
13208 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13209 (x_session_initialize): Do not assume string length fits in int.
13210
13211 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13212 This is unlikely, but can occur if DPI is outlandish.
13213
13214 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
13215 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13216
13217 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13218 * xrdb.c (magic_file_p, search_magic_path):
13219 Omit last arg SUFFIX; it was always 0. All callers changed.
13220 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13221
13222 * xfont.c (xfont_match): Avoid need for strlen.
13223
13224 * xfns.c: Don't assume strlen fits in int.
13225 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13226
13227 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13228 not unsigned long, as we prefer signed integers. All callers changed.
13229 Detect integer overflow in repeat count.
13230 (message_dolog): Don't assume print length fits in 39 bytes.
13231 (display_mode_element): Don't assume strlen fits in int.
13232
13233 * termcap.c: Don't assume sizes fit in int and never overflow.
13234 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13235 (gobble_line): Check for size-calculation overflow.
13236
13237 * minibuf.c (Fread_buffer):
13238 * lread.c (intern, intern_c_string):
13239 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13240 Don't assume string length fits in int.
13241
13242 * keyboard.c (parse_tool_bar_item):
13243 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13244
13245 * font.c: Don't assume string length fits in int.
13246 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13247 Use ptrdiff_t, not int.
13248 (font_intern_prop): Don't assume string length fits in int.
13249 Don't assume integer property fits in fixnum.
13250 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
13251
13252 * filelock.c: Fix some buffer overrun and integer overflow issues.
13253 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
13254 Reformulate so as not to need the command string.
13255 Invoke gzip -cd rather than gunzip, as it's more portable.
13256 (lock_info_type, lock_file_1, lock_file):
13257 Don't assume pid_t and time_t fit in unsigned long.
13258 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13259 (current_lock_owner): Prefer signed type for sizes.
13260 Use memcpy, not strncpy, where memcpy is what is really wanted.
13261 Don't assume (via atoi) that time_t and pid_t fit in int.
13262 Check for time_t and/or pid_t out of range, e.g., via a network share.
13263 Don't alloca where an auto var works fine.
13264
13265 * fileio.c: Fix some integer overflow issues.
13266 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13267 Don't assume string length fits in int.
13268 (directory_file_name): Don't assume string length fits in long.
13269 (make_temp_name): Don't assume pid fits in int, or that its print
13270 length is less than 20.
13271
13272 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13273
13274 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13275
13276 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13277
13278 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13279 We prefer signed integers, even for size calculations.
13280
13281 * emacs.c: Don't assume string length fits in 'int'.
13282 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13283 (main): Don't invoke strlen when not needed.
13284
13285 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13286 (XD_DEBUG_MESSAGE): Don't waste a byte.
13287
13288 * callproc.c (getenv_internal_1, getenv_internal)
13289 (Fgetenv_internal):
13290 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13291
13292 * lread.c (invalid_syntax): Omit length argument.
13293 All uses changed. This doesn't fix a bug, but it simplifies the
13294 code away from its former Hollerith-constant appearance, and it's
13295 one less 'int' to worry about when looking at integer-overflow issues.
13296 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
13297
13298 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13299 This didn't break anything, but it didn't help either.
13300 It's confusing to put a bogus integer in a place where the actual
13301 value does not matter.
13302 (LIST_END_P): Remove unused macro and its bogus comment.
13303 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
13304
13305 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13306 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13307 implementation.
13308 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13309 We prefer signed types, and the value cannot exceed the EMACS_INT
13310 range anyway (because otherwise the length would not be representable).
13311 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13312 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13313 This avoids a GCC warning when WIDE_EMACS_INT.
13314
13315 * indent.c (sane_tab_width): New function.
13316 (current_column, scan_for_column, Findent_to, position_indentation)
13317 (compute_motion): Use it. This is just for clarity.
13318 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
13319
13320 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
13321
13322 * lisp.h (lint_assume): New macro.
13323 * composite.c (composition_gstring_put_cache):
13324 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13325
13326 * editfns.c, insdel.c:
13327 Omit unnecessary forward decls, to simplify future changes.
13328
13329 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13330
13331 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13332
13333 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
13334 Use much-faster test for byte-length change.
13335 Don't assume string byte-length fits in 'int'.
13336 Check that character arg fits in 'int'.
13337 (mapcar1): Declare byte as byte, for clarity.
13338
13339 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13340
13341 * fns.c (concat): Catch string overflow earlier.
13342 Do not rely on integer wraparound.
13343
13344 * dispextern.h (struct it.overlay_strings_charpos)
13345 (struct it.selective): Now EMACS_INT, not int.
13346 * xdisp.c (forward_to_next_line_start)
13347 (back_to_previous_visible_line_start)
13348 (reseat_at_next_visible_line_start, next_element_from_buffer):
13349 Don't arbitrarily truncate the value of 'selective' to int.
13350
13351 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13352
13353 * composite.c: Don't truncate sizes to 'int'.
13354 (composition_gstring_p, composition_reseat_it)
13355 (composition_adjust_point): Use EMACS_INT, not int.
13356 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13357 not EMACS_UINT, for indexes.
13358
13359 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13360
13361 * buffer.c: Include <verify.h>.
13362 (struct sortvec.priority, struct sortstr.priority):
13363 Now EMACS_INT, not int.
13364 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
13365 (struct sortstr.size, record_overlay_string)
13366 (struct sortstrlist.size, struct sortlist.used):
13367 Don't truncate size to int.
13368 (record_overlay_string): Check for size-calculation overflow.
13369 (init_buffer_once): Check at compile-time, not run-time.
13370
13371 2011-06-22 Jim Meyering <meyering@redhat.com>
13372
13373 Don't leak an XBM-image-sized buffer
13374 * image.c (xbm_load): Free the image buffer after using it.
13375
13376 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13377
13378 Port to Sun C.
13379 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13380 that Sun C diagnosed.
13381 * fns.c (secure_hash): Fix pointer signedness issue.
13382 * intervals.c (static_offset_intervals): New function.
13383 (offset_intervals): Use it.
13384
13385 2011-06-21 Leo Liu <sdl.web@gmail.com>
13386
13387 * deps.mk (fns.o):
13388 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13389 sha512.h.
13390
13391 * fns.c (secure_hash): Rename from crypto_hash_function and change
13392 the first arg to accept symbols.
13393 (Fsecure_hash): New primitive.
13394 (syms_of_fns): New symbols.
13395
13396 2011-06-20 Deniz Dogan <deniz@dogan.se>
13397
13398 * process.c (Fset_process_buffer): Clarify return value in
13399 docstring.
13400
13401 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
13402
13403 * dispnew.c (add_window_display_history): Use BVAR.
13404
13405 * xdisp.c (debug_method_add): Use BVAR.
13406 (check_window_end, dump_glyph_matrix, dump_glyph)
13407 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13408
13409 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13410 Likewise.
13411
13412 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13413 check till after the cache is created in init_frame_faces.
13414
13415 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13416
13417 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13418
13419 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13420
13421 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13422 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13423 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13424
13425 Improve buffer-overflow checking (Bug#8873).
13426 * fileio.c (Finsert_file_contents):
13427 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13428 Remove the old (too-loose) buffer overflow checks.
13429 They weren't needed, since make_gap checks for buffer overflow.
13430 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13431 The old code merely checked for Emacs fixnum overflow, and relied
13432 on undefined (wraparound) behavior. The new code avoids undefined
13433 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13434
13435 * editfns.c (Finsert_char): Don't dump core with very negative counts.
13436 Tune. Don't use wider integers than needed. Don't use alloca.
13437 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
13438
13439 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13440
13441 * insdel.c, lisp.h (buffer_overflow): New function.
13442 (insert_from_buffer_1, replace_range, replace_range_2):
13443 * insdel.c (make_gap_larger):
13444 * editfns.c (Finsert_char):
13445 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13446
13447 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13448
13449 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13450
13451 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
13452
13453 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13454 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13455
13456 * fileio.c: Don't assume EMACS_INT fits in off_t.
13457 (emacs_lseek): New static function.
13458 (Finsert_file_contents, Fwrite_region): Use it.
13459 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13460
13461 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13462
13463 * fns.c: Don't overflow int when computing a list length.
13464 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13465 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13466 truncation on 64-bit hosts. Check for QUIT every
13467 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13468 faster and is responsive enough.
13469 (Flength): Report an error instead of overflowing an integer.
13470 (Fsafe_length): Return a float if the value is not representable
13471 as a fixnum. This shouldn't happen except in contrived situations.
13472 (Fnthcdr, Fsort): Don't assume list length fits in int.
13473 (Fcopy_sequence): Don't assume vector length fits in int.
13474
13475 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13476 (header_size, word_size): New constants.
13477 (allocate_vectorlike): Don't check size overflow here.
13478 (allocate_vector): Check it here instead, since this is the only
13479 caller of allocate_vectorlike that could cause overflow.
13480 Check that the new vector's length is representable as a fixnum.
13481
13482 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13483 The previous code was bogus. For example, next_almost_prime (32)
13484 returned 39, which is undesirable as it is a multiple of 3; and
13485 next_almost_prime (24) returned 25, which is a multiple of 5 so
13486 why was the code bothering to check for multiples of 7?
13487
13488 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13489
13490 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13491
13492 Variadic C functions now count arguments with ptrdiff_t.
13493 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13494 Back then I didn't know that the Emacs coding style prefers signed int.
13495 Also, in the meantime I found a few more instances where arguments
13496 were being counted with int, which may truncate counts on 64-bit
13497 machines, or EMACS_INT, which may be unnecessarily wide.
13498 * lisp.h (struct Lisp_Subr.function.aMANY)
13499 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13500 Arg counts are now ptrdiff_t, not size_t.
13501 All variadic functions and their callers changed accordingly.
13502 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13503 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13504 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13505 * callint.c (Fcall_interactively): Check arg count for overflow,
13506 to avoid potential buffer overrun. Use signed char, not 'int',
13507 for 'varies' array, so that we needn't bother to check its size
13508 calculation for overflow.
13509 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13510 * eval.c (apply_lambda):
13511 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13512 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13513 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13514
13515 * callint.c (Fcall_interactively): Don't use index var as event count.
13516
13517 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13518 * mem-limits.h (SIZE): Remove; no longer used.
13519
13520 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
13521
13522 Remove unnecessary casts.
13523 * xterm.c (x_term_init):
13524 * xfns.c (x_set_border_pixel):
13525 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13526 These aren't needed now that we assume ANSI C.
13527
13528 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13529 It's more likely to cause problems (due to unsigned overflow)
13530 than to cure them.
13531
13532 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13533
13534 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13535
13536 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13537
13538 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13539
13540 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13541
13542 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13543
13544 GLYPH_CODE_FACE returns EMACS_INT, not int.
13545 * dispextern.h (merge_faces):
13546 * xfaces.c (merge_faces):
13547 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13548 Don't assume EMACS_INT fits in int.
13549
13550 * character.h (CHAR_VALID_P): Remove unused parameter.
13551 * fontset.c, lisp.h, xdisp.c: All uses changed.
13552
13553 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13554
13555 * fns.c (concat): Minor tuning based on overflow analysis.
13556 This doesn't fix any bugs. Use int to hold character, instead
13557 of constantly refetching from Emacs object. Use XFASTINT, not
13558 XINT, for value known to be a character. Don't bother comparing
13559 a single byte to 0400, as it's always less.
13560
13561 * floatfns.c (Fexpt):
13562 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13563
13564 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13565 for characters.
13566
13567 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13568
13569 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13570 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13571 incorrectly succeed when S was a string, because 4294967386 was
13572 truncated before it was used.
13573
13574 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13575 Otherwise, an out-of-range integer could cause undefined behavior
13576 on a 64-bit host.
13577
13578 * composite.c: Use int, not EMACS_INT, for characters.
13579 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13580 EMACS_INT, for values that are known to be in character range.
13581 This doesn't fix any bugs but is the usual style inside Emacs and
13582 may generate better code on 32-bit machines.
13583
13584 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13585 This is for reasons similar to the recent CHAR_STRING fix.
13586 * charset.c (Fencode_char): Check that character arg is actually
13587 a character. Pass an int to ENCODE_CHAR.
13588 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13589 wider than 'int', as a compile-time check to prevent future regressions
13590 in this area.
13591
13592 * character.c (char_string): Remove unnecessary casts.
13593
13594 Make sure a 64-bit char is never passed to CHAR_STRING.
13595 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13596 by silently ignoring the top 32 bits, allowing some values
13597 that were far too large to be valid characters.
13598 * character.h: Include <verify.h>.
13599 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13600 arguments are no wider than unsigned, as a compile-time check
13601 to prevent future regressions in this area.
13602 * data.c (Faset):
13603 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13604 (Fsubst_char_in_region):
13605 * fns.c (concat):
13606 * xdisp.c (decode_mode_spec_coding):
13607 Adjust to CHAR_STRING's new requirement.
13608 * editfns.c (Finsert_char, Fsubst_char_in_region):
13609 * fns.c (concat): Check that character args are actually
13610 characters. Without this test, these functions did the wrong
13611 thing with wildly out-of-range values on 64-bit hosts.
13612
13613 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13614 These casts should not be needed on 32-bit hosts, either.
13615 * keyboard.c (read_char):
13616 * lread.c (Fload): Remove casts to unsigned.
13617
13618 * lisp.h (UNSIGNED_CMP): New macro.
13619 This fixes comparison bugs on 64-bit hosts.
13620 (ASCII_CHAR_P): Use it.
13621 * casefiddle.c (casify_object):
13622 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13623 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13624 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13625 * dispextern.h (FACE_FROM_ID):
13626 * keyboard.c (read_char): Use UNSIGNED_CMP.
13627
13628 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13629 not to EMACS_INT, to avoid GCC warning.
13630
13631 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13632
13633 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13634 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13635 isn't needed on 32-bit machines.
13636
13637 * buffer.c (Fgenerate_new_buffer_name):
13638 Use EMACS_INT for count, not int.
13639 (advance_to_char_boundary): Return EMACS_INT, not int.
13640
13641 * data.c (Qcompiled_function): Now static.
13642
13643 * window.c (window_body_lines): Now static.
13644
13645 * image.c (gif_load): Rename local to avoid shadowing.
13646
13647 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13648 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13649 * alloc.c (make_save_value): Integer argument is now of type
13650 ptrdiff_t, not int.
13651 (mark_object): Use ptrdiff_t, not int.
13652 * lisp.h (pD): New macro.
13653 * print.c (print_object): Use it.
13654
13655 * alloc.c: Use EMACS_INT, not int, to count objects.
13656 (total_conses, total_markers, total_symbols, total_vector_size)
13657 (total_free_conses, total_free_markers, total_free_symbols)
13658 (total_free_floats, total_floats, total_free_intervals)
13659 (total_intervals, total_strings, total_free_strings):
13660 Now EMACS_INT, not int. All uses changed.
13661 (Fgarbage_collect): Compute overall total using a double, so that
13662 integer overflow is less likely to be a problem. Check for overflow
13663 when converting back to an integer.
13664 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13665 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13666 These were 'int' variables that could overflow on 64-bit hosts;
13667 they were never used, so remove them instead of repairing them.
13668 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13669 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13670 Previously, this ceilinged at INT_MAX, but that doesn't work on
13671 64-bit machines.
13672 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13673
13674 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13675 (allocate_vectorlike): Check for ptrdiff_t overflow.
13676 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13677 when a (possibly-narrower) signed value would do just as well.
13678 We prefer using signed arithmetic, to avoid comparison confusion.
13679
13680 * alloc.c: Catch some string size overflows that we were missing.
13681 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13682 for convenience in STRING_BYTES_MAX.
13683 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13684 The definition here is exact; the one in lisp.h was approximate.
13685 (allocate_string_data): Check for string overflow. This catches
13686 some instances we weren't catching before. Also, it catches
13687 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13688 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13689 and ptrdiff_t and EMACS_INT are both 64 bits.
13690
13691 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13692 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13693 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13694
13695 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13696
13697 * alloc.c (Fmake_string): Check for out-of-range init.
13698
13699 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13700
13701 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13702
13703 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13704
13705 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13706 xg_get_default_scrollbar_width.
13707
13708 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13709 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13710 (style_changed_cb): Call update_theme_scrollbar_width and call
13711 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13712 all frames (Bug#8505).
13713 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13714 Call gtk_window_set_resizable if HAVE_GTK3.
13715 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13716 and height if HAVE_GTK3 (Bug#8505).
13717 (scroll_bar_width_for_theme): New variable.
13718 (update_theme_scrollbar_width): New function.
13719 (xg_get_default_scrollbar_width): Move code to
13720 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13721 (xg_initialize): Call update_theme_scrollbar_width.
13722
13723 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13724
13725 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13726
13727 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13728
13729 * frame.c (make_frame): Call other_buffer_safely instead of
13730 other_buffer.
13731
13732 * window.c (temp_output_buffer_show): Call display_buffer with
13733 second argument Vtemp_buffer_show_specifiers and reset latter
13734 immediately after the call.
13735 (Vtemp_buffer_show_specifiers): New variable.
13736 (auto_window_vscroll_p, next_screen_context_lines)
13737 (Vscroll_preserve_screen_position): Remove leading asterisks from
13738 doc-strings.
13739
13740 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13741
13742 Fix minor problems found by GCC 4.6.0 static checking.
13743 * buffer.c (Qclone_number): Remove for now, as it's unused.
13744 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13745 (record_buffer): Remove unused local.
13746 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13747 (set_frame_buffer_list): Remove; unused.
13748 * frame.h (other_visible_frames): Remove decl.
13749 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13750 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13751 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13752 if HAVE_GPM.
13753 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13754 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13755 Define only if HAVE_GPM.
13756 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13757 (update_hints_inhibit): Remove; never set. All uses removed.
13758 * widgetprv.h (emacsFrameClassRec): Remove decl.
13759 * window.c (delete_deletable_window): Now returns void, since it
13760 wasn't returning anything.
13761 (compare_window_configurations): Remove unused locals.
13762 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13763 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13764 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13765 the same widths as pointers. This follows up on the 2011-05-06 patch.
13766 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13767 * xterm.h: Likewise.
13768 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13769
13770 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13771
13772 * makefile.w32-in: Update dependencies.
13773 (LISP_H): Add lib/intprops.h.
13774
13775 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13776
13777 * image.c (gif_load): Add animation frame delay to the metadata.
13778 (syms_of_image): Use DEFSYM. New symbol `delay'.
13779
13780 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13781
13782 * window.c (delete_deletable_window): Re-add.
13783 (Fset_window_configuration): Rewrite to handle dead buffers and
13784 consequently deletable windows.
13785 (window_tree, Fwindow_tree): Remove. Supply functionality in
13786 window.el.
13787 (compare_window_configurations): Simplify code.
13788
13789 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13790
13791 * image.c (imagemagick_load_image): Fix type mismatch.
13792 (Fimagemagick_types): Likewise.
13793
13794 * window.h (replace_buffer_in_windows): Declare.
13795
13796 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13797
13798 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13799 Qclone_number. Remove external declaration of Qdelete_window.
13800 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13801 code.
13802 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13803 Run Qbuffer_list_update_hook if allowed.
13804 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13805 buffer list implementation.
13806 (other_buffer_safely): New function.
13807 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13808 calls to replace_buffer_in_windows and
13809 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13810 if allowed.
13811 (record_buffer): Inhibit quitting and rewrite using quittable
13812 functions. Run Qbuffer_list_update_hook if allowed.
13813 (Frecord_buffer, Funrecord_buffer): New functions.
13814 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13815 Move switch-to-buffer to window.el.
13816 (bury-buffer): Move to window.el.
13817 (Vbuffer_list_update_hook): New variable.
13818
13819 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13820 section.
13821
13822 * window.h (resize_frame_windows): Move up in code.
13823 (Fwindow_frame): Remove EXFUN.
13824 (replace_buffer_in_all_windows): Remove prototype.
13825 (replace_buffer_in_windows_safely): Add prototype.
13826
13827 * window.c: Declare Qdelete_window static again. Move down
13828 declaration of select_count.
13829 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13830 (Fother_window): Move to window.el.
13831 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13832 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13833 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13834 window.el.
13835 (replace_buffer_in_windows): Implement by calling
13836 Qreplace_buffer_in_windows.
13837 (replace_buffer_in_all_windows): Remove with some functionality
13838 moved into replace_buffer_in_windows_safely.
13839 (replace_buffer_in_windows_safely): New function.
13840 (select_window_norecord, select_frame_norecord): Move in front
13841 of run_window_configuration_change_hook. Remove now obsolete
13842 declarations.
13843 (Fset_window_buffer): Rewrite doc-string.
13844 Call Qrecord_window_buffer.
13845 (keys_of_window): Move binding for other-window to window.el.
13846
13847 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13848
13849 * dispextern.h (struct image): Replace data member, whose int_val
13850 and ptr_val fields were not used by anything, with a single
13851 lisp_val object.
13852
13853 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13854 (gif_clear_image, gif_load, imagemagick_load_image)
13855 (gs_clear_image, gs_load): Callers changed.
13856
13857 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13858
13859 * buffer.h: Include <time.h>, for time_t.
13860 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13861
13862 Fix minor problems found by static checking.
13863
13864 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13865
13866 Make identifiers static if they are not used in other modules.
13867 * data.c (Qcompiled_function, Qframe, Qvector):
13868 * image.c (QimageMagick, Qsvg):
13869 * minibuf.c (Qmetadata):
13870 * window.c (resize_window_check, resize_root_window): Now static.
13871 * window.h (resize_window_check, resize_root_window): Remove decls.
13872
13873 * window.c (window_deletion_count, delete_deletable_window):
13874 Remove; unused.
13875 (window_body_lines): Now static.
13876 (Fdelete_other_windows_internal): Mark vars as initialized.
13877 Make sure 'resize_failed' is initialized.
13878 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13879 (resize_window_apply): Remove unused local.
13880 * window.h (delete_deletable_window): Remove decl.
13881
13882 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13883 (imagemagick_load_image): Fix pointer signedness problem by changing
13884 last arg from unsigned char * to char *. All uses changed.
13885 Also, fix a local for similar reasons.
13886 Remove unused locals. Remove locals to avoid shadowing.
13887 (fn_rsvg_handle_free): Remove; unused.
13888 (svg_load, svg_load_image): Fix pointer signedness problem.
13889 (imagemagick_load_image): Don't use garbage pointer image_wand.
13890
13891 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13892
13893 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13894
13895 * image.c (gif_load): Fix omitted cast error introduced by
13896 2011-06-06 change.
13897
13898 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13899
13900 * window.h (resize_proportionally, orig_total_lines)
13901 (orig_top_line): Remove from window structure.
13902 (set_window_height, set_window_width, change_window_heights)
13903 (Fdelete_window): Remove prototypes.
13904 (resize_frame_windows): Remove duplicate declaration.
13905
13906 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13907
13908 * window.h (resize_frame_windows, resize_window_check)
13909 (delete_deletable_window, resize_root_window)
13910 (resize_frame_windows): Declare prototypes.
13911
13912 * window.c (resize_window_apply): Make definition be "static" to
13913 match the prototype.
13914
13915 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13916
13917 * window.c: Remove declarations of Qwindow_size_fixed,
13918 window_min_size_1, window_min_size_2, window_min_size,
13919 size_window, window_fixed_size_p, enlarge_window, delete_window.
13920 Remove static from declaration of Qdelete_window, it's
13921 temporarily needed by Fbury_buffer.
13922 (replace_window): Don't assign orig_top_line and
13923 orig_total_lines.
13924 (Fdelete_window, delete_window): Remove. Window deletion is
13925 handled by window.el.
13926 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13927 Replace Fdelete_window calls with calls to Qdelete_window.
13928 (Fdelete_other_windows): Remove. Deleting other windows is
13929 handled by window.el.
13930 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13931 handled in window.el.
13932 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13933 Window minimum sizes are handled in window.el.
13934 (shrink_windows, size_window, set_window_height)
13935 (set_window_width, change_window_heights, window_height)
13936 (window_width, CURBEG, CURSIZE, enlarge_window)
13937 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13938 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13939 handled in window.el.
13940 (make_dummy_parent): Rename to make_parent_window and give it a
13941 second argument horflag.
13942 (make_window): Don't set resize_proportionally any more.
13943 (Fsplit_window): Remove. Windows are split in window.el.
13944 (save_restore_action, save_restore_orig_size)
13945 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13946 Resize mini windows in window.el.
13947 (grow_mini_window, shrink_mini_window): Implement by calling
13948 Qresize_root_window_vertically, resize_window_check and
13949 resize_window_apply.
13950 (saved_window, Fset_window_configuration, save_window_save):
13951 Do not handle orig_top_line, orig_total_lines, and
13952 resize_proportionally.
13953 (window_min_height, window_min_width): Move to window.el.
13954 (keys_of_window): Move bindings for delete-other-windows,
13955 split-window, delete-window and enlarge-window to window.el.
13956
13957 * buffer.c: Temporarily extern Qdelete_window.
13958 (Fbury_buffer): Temporarily call Qdelete_window instead of
13959 Fdelete_window (Fbury_buffer will move to window.el soon).
13960
13961 * frame.c (set_menu_bar_lines_1): Remove code handling
13962 orig_top_line and orig_total_lines.
13963
13964 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13965 set_window_height but set heights directly.
13966 (change_frame_size_1): Use resize_frame_windows.
13967
13968 * xdisp.c (init_xdisp): Don't use set_window_height but set
13969 heights directly.
13970
13971 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13972 Use resize_frame_windows instead of change_window_heights and run
13973 run_window_configuration_change_hook.
13974
13975 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13976 instead of change_window_heights and run
13977 run_window_configuration_change_hook.
13978
13979 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13980
13981 * window.c (replace_window): Rename second argument REPLACEMENT to
13982 NEW. New third argument SETFLAG. Rewrite.
13983 (delete_window, make_dummy_parent): Call replace_window with
13984 third argument 1.
13985 (window_list_1): Move down in code.
13986 (run_window_configuration_change_hook): Move set_buffer part
13987 before select_frame_norecord part in order to unwind correctly.
13988 Rename count1 to count.
13989 (recombine_windows, delete_deletable_window, resize_root_window)
13990 (Fdelete_other_windows_internal)
13991 (Frun_window_configuration_change_hook, make_parent_window)
13992 (resize_window_check, resize_window_apply, Fresize_window_apply)
13993 (resize_frame_windows, Fsplit_window_internal)
13994 (Fdelete_window_internal, Fresize_mini_window_internal):
13995 New functions.
13996 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13997
13998 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13999
14000 * window.h (window): Add some new members to window structure -
14001 normal_lines, normal_cols, new_total, new_normal, clone_number,
14002 splits, nest, prev_buffers, next_buffers.
14003 (WINDOW_TOTAL_SIZE): Move here from window.c.
14004 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
14005
14006 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14007 Remove.
14008 (make_dummy_parent): Set new members of windows structure.
14009 (make_window): Move down in code. Handle new members of window
14010 structure.
14011 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14012 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14013 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14014 (Fset_window_prev_buffers, Fwindow_next_buffers)
14015 (Fset_window_next_buffers, Fset_window_clone_number):
14016 New functions.
14017 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14018 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14019 Doc-string fixes.
14020 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14021 Argument WINDOW can be now internal window too.
14022 (Fwindow_use_time): Move up in code.
14023 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14024 Rewrite doc-string.
14025 (Fset_window_configuration, saved_window)
14026 (Fcurrent_window_configuration, save_window_save): Handle new
14027 members of window structure.
14028 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14029 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14030 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14031 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14032 Qget_mru_window, Qresize_root_window,
14033 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14034 Qauto_buffer_name; staticpro them.
14035
14036 2011-06-07 Martin Rudalics <rudalics@gmx.at>
14037
14038 * window.c (Fwindow_total_size, Fwindow_left_column)
14039 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14040 (Fwindow_list_1): New functions.
14041 (window_box_text_cols): Replace with window_body_cols.
14042 (Fwindow_width, Fscroll_left, Fscroll_right):
14043 Use window_body_cols instead of window_box_text_cols.
14044 (delete_window, Fset_window_configuration):
14045 Call delete_all_subwindows with window as argument.
14046 (delete_all_subwindows): Take a window as argument and not a
14047 structure. Rewrite.
14048 (window_loop): Remove handling of GET_LRU_WINDOW and
14049 GET_LARGEST_WINDOW.
14050 (Fget_lru_window, Fget_largest_window): Move to window.el.
14051
14052 * window.h: Extern window_body_cols instead of
14053 window_box_text_cols. delete_all_subwindows now takes a
14054 Lisp_Object as argument.
14055
14056 * indent.c (compute_motion, Fcompute_motion):
14057 Use window_body_cols instead of window_box_text_cols.
14058
14059 * frame.c (delete_frame): Call delete_all_subwindows with root
14060 window as argument.
14061
14062 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14063
14064 * fns.c (Fputhash): Document return value.
14065
14066 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
14067
14068 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14069
14070 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14071
14072 Cons<->int and similar integer overflow fixes (Bug#8794).
14073
14074 Check for overflow when converting integer to cons and back.
14075 * charset.c (Fdefine_charset_internal, Fdecode_char):
14076 Use cons_to_unsigned to catch overflow.
14077 (Fencode_char): Use INTEGER_TO_CONS.
14078 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14079 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14080 * data.c (long_to_cons, cons_to_long): Remove.
14081 (cons_to_unsigned, cons_to_signed): New functions.
14082 These signal an error for invalid or out-of-range values.
14083 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14084 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14085 * font.c (Ffont_variation_glyphs):
14086 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14087 * lisp.h: Include <intprops.h>.
14088 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14089 (cons_to_signed, cons_to_unsigned): New decls.
14090 (long_to_cons, cons_to_long): Remove decls.
14091 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14092 (Fprimitive_undo): Use CONS_TO_INTEGER.
14093 * xfns.c (Fx_window_property): Likewise.
14094 * xselect.c: Include <limits.h>.
14095 (x_own_selection, selection_data_to_lisp_data):
14096 Use INTEGER_TO_CONS.
14097 (x_handle_selection_request, x_handle_selection_clear)
14098 (x_get_foreign_selection, Fx_disown_selection_internal)
14099 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14100 (lisp_data_to_selection_data): Use cons_to_unsigned.
14101 (x_fill_property_data): Use cons_to_signed.
14102 Report values out of range.
14103
14104 Check for buffer and string overflow more precisely.
14105 * buffer.h (BUF_BYTES_MAX): New macro.
14106 * lisp.h (STRING_BYTES_MAX): New macro.
14107 * alloc.c (Fmake_string):
14108 * character.c (string_escape_byte8):
14109 * coding.c (coding_alloc_by_realloc):
14110 * doprnt.c (doprnt):
14111 * editfns.c (Fformat):
14112 * eval.c (verror):
14113 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14114 since they may not be the same number.
14115 * editfns.c (Finsert_char):
14116 * fileio.c (Finsert_file_contents):
14117 Likewise for BUF_BYTES_MAX.
14118
14119 * image.c: Use ptrdiff_t, not int, for sizes.
14120 (slurp_file): Switch from int to ptrdiff_t.
14121 All uses changed.
14122 (slurp_file): Check that file size fits in both size_t (for
14123 malloc) and ptrdiff_t (for sanity and safety).
14124
14125 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14126 if b->modtime has its maximal value.
14127
14128 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14129
14130 Don't assume time_t can fit into int.
14131 * buffer.h (struct buffer.modtime): Now time_t, not int.
14132 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14133 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14134
14135 Minor fixes for signed vs unsigned integers.
14136 * character.h (MAYBE_UNIFY_CHAR):
14137 * charset.c (maybe_unify_char):
14138 * keyboard.c (read_char, reorder_modifiers):
14139 XINT -> XFASTINT, since the integer must be nonnegative.
14140 * ftfont.c (ftfont_spec_pattern):
14141 * keymap.c (access_keymap, silly_event_symbol_error):
14142 XUINT -> XFASTINT, since the integer must be nonnegative.
14143 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14144 since it makes no difference and we prefer signed.
14145 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14146 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14147 nonnegative.
14148
14149 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14150
14151 * window.h (Fwindow_frame): Declare.
14152
14153 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14154
14155 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14156 (SPARE_MEMORY): Always define.
14157 (LARGE_REQUEST): Remove.
14158 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14159
14160 2011-06-06 Martin Rudalics <rudalics@gmx.at>
14161
14162 * lisp.h: Move EXFUNS for Fframe_root_window,
14163 Fframe_first_window and Fset_frame_selected_window to window.h.
14164
14165 * window.h: Move EXFUNS for Fframe_root_window,
14166 Fframe_first_window and Fset_frame_selected_window here from
14167 lisp.h.
14168
14169 * frame.c (Fwindow_frame, Fframe_first_window)
14170 (Fframe_root_window, Fframe_selected_window)
14171 (Fset_frame_selected_window): Move to window.c.
14172 (Factive_minibuffer_window): Move to minibuf.c.
14173 (Fother_visible_frames_p): New function.
14174
14175 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14176
14177 * window.c (decode_window, decode_any_window): Move up in code.
14178 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14179 (inhibit_frame_unsplittable): Remove unused variable.
14180 (Fwindow_buffer): Move up and rewrite doc-string.
14181 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14182 (Fwindow_prev): New functions.
14183 (Fwindow_frame): Move here from frame.c. Accept any window as
14184 argument.
14185 (Fframe_root_window, Fframe_first_window)
14186 (Fframe_selected_window): Move here from frame.c. Accept frame
14187 or arbitrary window as argument. Update doc-strings.
14188 (Fminibuffer_window): Move up in code.
14189 (Fwindow_minibuffer_p): Move up in code and simplify.
14190 (Fset_frame_selected_window): Move here from frame.c.
14191 Marginal rewrite.
14192 (Fselected_window, select_window, Fselect_window): Move up in
14193 code. Minor doc-string fixes.
14194
14195 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14196
14197 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14198 Do not assume that spare memory exists; that assumption is valid
14199 only if SYSTEM_MALLOC.
14200 (LARGE_REQUEST): New macro, so that the issue of large requests
14201 is separated from the issue of spare memory.
14202
14203 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14204
14205 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14206 format. (Bug#8806)
14207
14208 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14209
14210 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14211 before statements.
14212
14213 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14214
14215 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14216
14217 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14218
14219 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14220 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14221
14222 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
14223
14224 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14225
14226 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
14227
14228 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14229 (x_clipboard_manager_save): Add return value.
14230 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14231 New error handlers.
14232 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14233 Obey Vx_select_enable_clipboard_manager. Catch errors in
14234 x_clipboard_manager_save (Bug#8779).
14235 (Vx_select_enable_clipboard_manager): New variable.
14236 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
14237
14238 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
14239
14240 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14241
14242 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14243
14244 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14245 in the current matrix if keep_current_p is non-zero.
14246
14247 2011-06-04 Eli Zaretskii <eliz@gnu.org>
14248
14249 * bidi.c (bidi_level_of_next_char): Fix last change.
14250
14251 2011-06-03 Eli Zaretskii <eliz@gnu.org>
14252
14253 Support bidi reordering of text covered by display properties.
14254
14255 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14256 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14257 (bidi_cache_search, bidi_cache_iterator_state)
14258 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
14259 (bidi_level_of_next_char, bidi_move_to_visually_next):
14260 Support character positions inside a run of characters covered by a
14261 display string.
14262 (bidi_paragraph_init, bidi_resolve_explicit_1)
14263 (bidi_level_of_next_char): Call bidi_fetch_char and
14264 bidi_fetch_char_advance instead of FETCH_CHAR and
14265 FETCH_CHAR_ADVANCE.
14266 (bidi_init_it): Initialize new members.
14267 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14268 definitions.
14269 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14270 instead of using explicit *_CHAR codes.
14271 (bidi_resolve_explicit, bidi_resolve_weak):
14272 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
14273 bidirectional text is supported only in multibyte buffers.
14274 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14275 it to initialize the frame_window_p member of struct bidi_it.
14276 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14277 (bidi_resolve_explicit, bidi_resolve_weak)
14278 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14279 bidi_it->nchars is non-positive.
14280 (bidi_level_of_next_char): Don't try to lookup the cache for the
14281 next/previous character if nothing is cached there yet, or if we
14282 were just reseat()'ed to a new position.
14283
14284 * xdisp.c (set_cursor_from_row): Set start and stop points
14285 according to the row's direction when priming the loop that looks
14286 for the glyph on which to display cursor.
14287 (single_display_spec_intangible_p): Function deleted.
14288 (display_prop_intangible_p): Reimplement to call
14289 handle_display_spec instead of single_display_spec_intangible_p.
14290 Accept 3 additional arguments needed by handle_display_spec.
14291 This fixes incorrect cursor motion across display property with complex
14292 values: lists, `(when COND...)' forms, etc.
14293 (single_display_spec_string_p): Support property values that are
14294 lists with the argument STRING its top-level element.
14295 (display_prop_string_p): Fix the condition for processing a
14296 property that is a list to be consistent with handle_display_spec.
14297 (handle_display_spec): New function, refactored from the
14298 last portion of handle_display_prop.
14299 (compute_display_string_pos): Accept additional argument
14300 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14301 value of a `display' property is a "replacing spec".
14302 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14303 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14304 the display property, but just return a value indicating whether
14305 the display property will replace the characters it covers.
14306 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14307 frame_window_p members of struct bidi_it.
14308 (compute_display_string_pos, compute_display_string_end):
14309 New functions.
14310 (push_it): Accept second argument POSITION, where pop_it should
14311 jump to continue iteration.
14312 (reseat_1): Initialize bidi_it.disp_pos.
14313
14314 * keyboard.c (adjust_point_for_property): Adjust the call to
14315 display_prop_intangible_p to its new signature.
14316
14317 * dispextern.h (struct bidi_it): New member frame_window_p.
14318 (bidi_init_it): Update prototypes.
14319 (display_prop_intangible_p): Update prototype.
14320 (compute_display_string_pos, compute_display_string_end):
14321 Declare prototypes.
14322 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14323 EMACS_INT.
14324
14325 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
14326
14327 Malloc failure behavior now depends on size of allocation.
14328 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14329 * lisp.h: Change signatures accordingly.
14330 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14331 All callers changed. (Bug#8762)
14332
14333 * gnutls.c: Use Emacs's memory allocators.
14334 Without this change, the gnutls library would invoke malloc etc.
14335 directly, which causes problems on non-SYNC_INPUT hosts, and which
14336 runs afoul of improving memory_full behavior. (Bug#8761)
14337 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14338 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14339 xfree instead of the default malloc, realloc, free.
14340 (Fgnutls_boot): No need to check for memory allocation failure,
14341 since xmalloc does that for us.
14342
14343 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
14344 * category.c (hash_get_category_set):
14345 * ccl.c (ccl_driver):
14346 * charset.c (Fdefine_charset_internal):
14347 * charset.h (struct charset.hash_index):
14348 * composite.c (get_composition_id, gstring_lookup_cache)
14349 (composition_gstring_put_cache):
14350 * composite.h (struct composition.hash_index):
14351 * dispextern.h (struct image.hash):
14352 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14353 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14354 (hashfn_equal, hashfn_user_defined, make_hash_table)
14355 (maybe_resize_hash_table, hash_lookup, hash_put)
14356 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14357 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14358 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14359 * image.c (make_image, search_image_cache, lookup_image)
14360 (xpm_put_color_table_h):
14361 * lisp.h (struct Lisp_Hash_Table):
14362 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
14363 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
14364 for hashes and hash indexes, instead of 'unsigned' and 'int'.
14365 * alloc.c (allocate_vectorlike):
14366 Check for overflow in vector size calculations.
14367 * ccl.c (ccl_driver):
14368 Check for overflow when converting EMACS_INT to int.
14369 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14370 need to be updated by these changes.
14371 * fns.c (make_hash_table, maybe_resize_hash_table):
14372 Check for integer overflow with large hash tables.
14373 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14374 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14375 (SXHASH_REDUCE): New macro.
14376 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14377 Use it instead of discarding useful hash info with large hash values.
14378 (sxhash_float): New function.
14379 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14380 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
14381 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14382 Rewrite to use FIXNUM_BITS, as this simplifies things.
14383 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14384 Adjust signatures to match updated version of code.
14385 (consing_since_gc): Now EMACS_INT, since a single hash table can
14386 use more than INT_MAX bytes.
14387
14388 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14389
14390 Make it possible to build with GCC-4.6+ -O2 -flto.
14391
14392 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14393
14394 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14395
14396 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14397 Call minibuffer-inactive-mode.
14398
14399 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
14400
14401 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14402 Update dependencies.
14403
14404 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14405
14406 * data.c (init_data): Remove code for UTS, this system is not
14407 supported anymore.
14408
14409 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14410
14411 Don't force ./temacs to start in terminal mode.
14412
14413 * frame.c (make_initial_frame): Initialize faces in all cases, not
14414 only when CANNOT_DUMP is defined.
14415 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14416
14417 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14418
14419 * dispnew.c (add_window_display_history): Use const for the string
14420 pointer. Remove declaration, not needed.
14421
14422 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14423
14424 Use 'inline', not 'INLINE'.
14425 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
14426 * alloc.c, fontset.c (INLINE): Remove.
14427 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14428 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14429 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14430 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14431 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14432
14433 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14434
14435 Make it possible to run ./temacs.
14436
14437 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14438 syms_of_callproc does the same thing. Remove test for
14439 "initialized", do it in the caller.
14440 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14441
14442 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14443
14444 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14445 (read_minibuf): Use get_minibuffer.
14446 (syms_of_minibuf): Use DEFSYM.
14447 (Qmetadata): New var.
14448 * data.c (Qbuffer): Don't make it static.
14449 (syms_of_data): Use DEFSYM.
14450
14451 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14452
14453 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14454 (CCL_CODE_MIN): New macro.
14455
14456 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14457
14458 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14459
14460 * eval.c (Qdebug): Now static.
14461 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14462 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14463 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14464
14465 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14466
14467 * image.c: Various fixes to ImageMagick code comments.
14468 (Fimagemagick_types): Doc fix.
14469
14470 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14471
14472 Minor fixes prompted by GCC 4.6.0 warnings.
14473
14474 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14475
14476 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14477 (x_clipboard_manager_save_all): Move extern decl to ...
14478 * xterm.h: ... here, so that it can be checked for consistency.
14479
14480 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
14481
14482 * xselect.c (x_clipboard_manager_save_frame)
14483 (x_clipboard_manager_save_all): New functions.
14484 (Fx_clipboard_manager_save): Lisp function deleted.
14485
14486 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14487 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14488
14489 * xterm.h: Update prototype.
14490
14491 2011-05-28 William Xu <william.xwl@gmail.com>
14492
14493 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14494 exiting (Bug#8239).
14495
14496 2011-05-28 Jim Meyering <meyering@redhat.com>
14497
14498 Avoid a sign-extension bug in crypto_hash_function.
14499 * fns.c (to_uchar): Define.
14500 (crypto_hash_function): Use it to convert some newly-signed
14501 variables to unsigned, to avoid sign-extension bugs. For example,
14502 without this change, (md5 "truc") would evaluate to
14503 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14504 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
14505 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
14506
14507 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14508
14509 Integer overflow fixes.
14510
14511 * dbusbind.c: Serial number integer overflow fixes.
14512 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
14513 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14514 to hold a serial number that is too large for a fixnum.
14515 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14516 Check for serial numbers out of range. Decode any serial number
14517 that was so large that it became a float. (Bug#8722)
14518
14519 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14520 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14521 Use XFASTINT rather than XUINT when numbers are nonnegative.
14522 (xd_append_arg, Fdbus_method_return_internal):
14523 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14524 arguments, check that Lisp number is nonnegative, rather than
14525 silently wrapping negative numbers around. (Bug#8722)
14526 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
14527 (Bug#8722)
14528
14529 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14530
14531 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14532
14533 ccl: Add integer overflow checks.
14534 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14535 (IN_INT_RANGE): New macros.
14536 (ccl_driver): Use them to check for integer overflow when
14537 decoding a CCL program. Many of the new checks are whether XINT (x)
14538 fits in int; it doesn't always, on 64-bit hosts. The new version
14539 doesn't catch all possible integer overflows, but it's an
14540 improvement. (Bug#8719)
14541
14542 * alloc.c (make_event_array): Use XINT, not XUINT.
14543 There's no need for unsigned here.
14544
14545 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14546 This follows up to the 2011-05-06 change that substituted uintptr_t
14547 for EMACS_INT. This case wasn't caught back then.
14548
14549 Rework Fformat to avoid integer overflow issues.
14550 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14551 now (part of C89). Include <verify.h>.
14552 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14553 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14554 (Fformat): Avoid the prepass trying to compute sizes; it was only
14555 approximate and thus did not catch overflow reliably. Instead, walk
14556 through the format just once, formatting and computing sizes as we go,
14557 checking for integer overflow at every step, and allocating a larger
14558 buffer as needed. Keep track separately whether the format is
14559 multibyte. Keep only the most-recently calculated precision, rather
14560 than them all. Record whether each argument has been converted to
14561 string. Use EMACS_INT, not int, for byte and char and arg counts.
14562 Support field widths and precisions larger than INT_MAX. Avoid
14563 sprintf's undefined behavior with conversion specifications such as %#d
14564 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14565 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14566 formatting out-of-range floating point numbers with int
14567 formats. (Bug#8668)
14568
14569 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14570
14571 * data.c: Avoid integer truncation in expressions involving floats.
14572 * data.c: Include <intprops.h>.
14573 (arith_driver): When there's an integer overflow in an expression
14574 involving floating point, convert the integers to floating point
14575 so that the resulting value does not suffer from catastrophic
14576 integer truncation. For example, on a 64-bit host (* 4
14577 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14578 Do not rely on undefined behavior after integer overflow.
14579
14580 merge count_size_as_multibyte, parse_str_to_multibyte
14581 * character.c, character.h (count_size_as_multibyte):
14582 Rename from parse_str_to_multibyte; all uses changed.
14583 Check for integer overflow.
14584 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14585 since it's now a duplicate of the other. This is more of
14586 a character than a buffer op, so better that it's in character.c.
14587 * fns.c, print.c: Adjust to above changes.
14588
14589 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14590
14591 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14592
14593 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14594
14595 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14596 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14597 (x_clipboard_manager_save): Now static.
14598 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14599
14600 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14601 (crypto_hash_function): Now static.
14602 Fix pointer signedness problems. Avoid unnecessary initializations.
14603
14604 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14605
14606 * termhooks.h (Vselection_alist): Make it terminal-local.
14607
14608 * terminal.c (create_terminal): Initialize it.
14609
14610 * xselect.c: Support for clipboard managers.
14611 (Vselection_alist): Move to termhooks.h as terminal-local var.
14612 (LOCAL_SELECTION): New macro.
14613 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14614 (symbol_to_x_atom): Remove gratuitous arg.
14615 (x_handle_selection_request, lisp_data_to_selection_data)
14616 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14617 (x_own_selection, x_get_local_selection, x_convert_selection):
14618 New arg, specifying work frame. Use terminal-local Vselection_alist.
14619 (some_frame_on_display): Delete unused function.
14620 (Fx_own_selection_internal, Fx_get_selection_internal)
14621 (Fx_disown_selection_internal, Fx_selection_owner_p)
14622 (Fx_selection_exists_p): New optional frame arg.
14623 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14624 (x_handle_selection_clear): Don't treat other terminals with the
14625 same keyboard specially. Use the terminal-local Vselection_alist.
14626 (x_clear_frame_selections): Use Frun_hook_with_args.
14627
14628 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14629
14630 * xterm.h: Add support for those atoms.
14631
14632 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14633
14634 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14635 (converted_selections, conversion_fail_tag): New global variables.
14636 (x_selection_request_lisp_error): Free the above.
14637 (x_get_local_selection): Remove unnecessary code.
14638 (x_reply_selection_request): Args changed; handle arbitrary array
14639 of converted selections stored in converted_selections.
14640 Separate the XChangeProperty and SelectionNotify steps.
14641 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14642 (x_convert_selection): New function.
14643 (x_handle_selection_event): Simplify.
14644 (x_get_foreign_selection): Don't ignore incoming requests while
14645 waiting for an answer; this will fail when we implement
14646 SAVE_TARGETS, and seems unnecessary anyway.
14647 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14648 (Vx_sent_selection_functions): Doc fix.
14649
14650 2011-05-26 Leo Liu <sdl.web@gmail.com>
14651
14652 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14653
14654 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14655
14656 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14657
14658 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14659 for fringe update if it has periodic bitmap.
14660 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14661 and fringe_bitmap_periodic_p.
14662
14663 * fringe.c (get_fringe_bitmap_data): New function.
14664 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14665 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14666 row. Mark glyph row for fringe update if periodicity changed.
14667
14668 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14669 for fringe update unless it has periodic bitmap.
14670
14671 2011-05-25 Kenichi Handa <handa@m17n.org>
14672
14673 * xdisp.c (get_next_display_element): Set correct it->face_id for
14674 a static composition.
14675
14676 2011-05-24 Leo Liu <sdl.web@gmail.com>
14677
14678 * deps.mk (fns.o):
14679 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14680
14681 * fns.c (crypto_hash_function, Fsha1): New function.
14682 (Fmd5): Use crypto_hash_function.
14683 (syms_of_fns): Add Ssha1.
14684
14685 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14686
14687 * gnutls.c: Remove unused macros.
14688 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14689 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14690 Remove macros that are defined and never used.
14691 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14692
14693 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14694
14695 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14696 (Fx_get_selection_internal): Minor cleanup.
14697 (Fx_own_selection_internal): Rename arguments for consistency with
14698 select.el.
14699
14700 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14701
14702 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14703
14704 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14705
14706 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14707
14708 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14709
14710 * dispnew.c (scrolling_window): Don't exclude the case that the
14711 last enabled row in the desired matrix touches the bottom boundary.
14712
14713 2011-05-21 Glenn Morris <rgm@gnu.org>
14714
14715 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14716 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14717 and add some more files.
14718
14719 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14720
14721 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14722 report_file_error introduced by the change from 2011-05-07.
14723
14724 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14725
14726 * systime.h (Time): Define only if emacs is defined.
14727 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14728 where the include path doesn't have X11/X.h by default. See
14729 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14730
14731 2011-05-20 Kenichi Handa <handa@m17n.org>
14732
14733 * composite.c (find_automatic_composition): Fix previous change.
14734
14735 2011-05-20 Glenn Morris <rgm@gnu.org>
14736
14737 * lisp.mk: New file, split from Makefile.in.
14738 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14739 (shortlisp): Remove.
14740 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14741
14742 2011-05-19 Glenn Morris <rgm@gnu.org>
14743
14744 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14745 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14746 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14747 (lisp): Set the order to that of loadup.el.
14748 (shortlisp): Make it a copy of $lisp.
14749 (SOME_MACHINE_LISP): Remove.
14750 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14751 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14752
14753 2011-05-18 Kenichi Handa <handa@m17n.org>
14754
14755 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14756 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14757 (find_automatic_composition): Mostly rewrite for efficiency.
14758
14759 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14760
14761 * makefile.w32-in: Update dependencies.
14762
14763 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14764
14765 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14766 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14767
14768 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14769
14770 Fix some integer overflow issues, such as string length overflow.
14771
14772 * insdel.c (count_size_as_multibyte): Check for string overflow.
14773
14774 * character.c (lisp_string_width): Check for string overflow.
14775 Use EMACS_INT, not int, for string indexes and lengths; in
14776 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14777 the resulting string length overflows an EMACS_INT; instead,
14778 report a string overflow if no precision given. When checking for
14779 precision exhaustion, use a check that cannot possibly have
14780 integer overflow. (Bug#8675)
14781 * character.h (lisp_string_width): Adjust to new signature.
14782
14783 * alloc.c (string_overflow): New function.
14784 (Fmake_string): Use it. This doesn't change behavior, but saves
14785 a few bytes and will simplify future changes.
14786 * character.c (string_escape_byte8): Likewise.
14787 * lisp.h (string_overflow): New decl.
14788
14789 Fixups, following up to the user-interface timestamp change.
14790 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14791 for UI timestamps, instead of unsigned long.
14792 * msdos.c (mouse_get_pos): Likewise.
14793 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14794 * w32gui.h (Time): Define by including "systime.h" rather than by
14795 declaring it ourselves. (Bug#8664)
14796
14797 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14798 * image.c (clear_image_cache): Likewise.
14799
14800 * term.c (term_mouse_position): Don't assume time_t wraparound.
14801
14802 Be more systematic about user-interface timestamps.
14803 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14804 and sometimes 'EMACS_UINT', to represent these timestamps.
14805 This change causes it to use 'Time' uniformly, as that's what X uses.
14806 This makes the code easier to follow, and makes it easier to catch
14807 integer overflow bugs such as Bug#8664.
14808 * frame.c (Fmouse_position, Fmouse_pixel_position):
14809 Use Time, not unsigned long, for user-interface timestamps.
14810 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14811 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14812 * keyboard.h (last_event_timestamp): Likewise.
14813 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14814 * menu.h (xmenu_show): Likewise.
14815 * term.c (term_mouse_position): Likewise.
14816 * termhooks.h (struct input_event.timestamp): Likewise.
14817 (struct terminal.mouse_position_hook): Likewise.
14818 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14819 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14820 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14821 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14822 what it was before.
14823 * menu.h, termhooks.h: Include "systime.h", for Time.
14824
14825 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14826 Don't assume that the difference between two unsigned long values
14827 can fit into an integer. At this point, we know button_down_time
14828 <= event->timestamp, so the difference must be nonnegative, so
14829 there's no need to cast the result if double-click-time is
14830 nonnegative, as it should be; check that it's nonnegative, just in
14831 case. This bug is triggered when events are more than 2**31 ms
14832 apart (about 25 days). (Bug#8664)
14833
14834 * xselect.c (last_event_timestamp): Remove duplicate decl.
14835 (x_own_selection): Remove needless cast to unsigned long.
14836
14837 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14838 that always fit in int. Use a sentinel instead of a counter, to
14839 avoid a temp and to allay GCC's concerns about possible int overflow.
14840 * frame.h (struct frame): Use int for menu_bar_items_used
14841 instead of EMACS_INT, since it always fits in int.
14842
14843 * menu.c (grow_menu_items): Check for int overflow.
14844
14845 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14846
14847 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14848 Before, the code was not consistent. These values cannot exceed
14849 2**31 - 1 so there's no need to make them unsigned.
14850 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14851 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14852 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14853 as modifiers.
14854 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14855
14856 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14857 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14858 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14859 presumably because the widths might not match.
14860
14861 * window.c (size_window): Avoid needless test at loop start.
14862
14863 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14864
14865 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14866
14867 2011-05-12 Drew Adams <drew.adams@oracle.com>
14868
14869 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14870
14871 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14872
14873 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14874 `width' to `bar_area_x' and `bar_area_width', respectively.
14875 (x_scroll_run): Take account of fringe background extension.
14876
14877 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14878 Rename local vars `left' and `width' to `bar_area_x' and
14879 `bar_area_width', respectively.
14880 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14881 background extension.
14882
14883 2011-05-10 Jim Meyering <meyering@redhat.com>
14884
14885 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14886
14887 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14888
14889 * image.c (Finit_image_library): Return t for built-in image types,
14890 like pbm and xbm. (Bug#8640)
14891
14892 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14893
14894 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14895
14896 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14897
14898 * w32console.c (Fset_screen_color): Doc fix.
14899 (Fget_screen_color): New function.
14900 (syms_of_ntterm): Defsubr it.
14901
14902 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14903 unlink the temporary file if Fcall_process didn't create it in the
14904 first place.
14905 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14906 child process will be redirected to a file specified with `:file'.
14907 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14908 cue to call_process_cleanup not to close that handle.
14909
14910 2011-05-07 Ben Key <bkey76@gmail.com>
14911
14912 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14913 one of two shell specific rules, either bootstrap-temacs-CMD or
14914 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14915 to the previous implementation of the bootstrap-temacs rule.
14916 The bootstrap-temacs-CMD rule is similar to the previous
14917 implementation of the bootstrap-temacs rule except that it
14918 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14919 variable.
14920
14921 These changes, along with some changes to nt/configure.bat,
14922 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14923 earlier fix to add support for --cflags and --ldflags options
14924 that include quotes so that it works whether make uses cmd or
14925 sh as the shell.
14926
14927 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14928
14929 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14930 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14931 is a constant.
14932 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14933 a string. Handle both cases.
14934 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14935 (Fdbus_register_method): Use Qinvalid_function.
14936
14937 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14938
14939 * makefile.w32-in: Update dependencies.
14940 (LISP_H): Add inttypes.h and stdin.h.
14941 (PROCESS_H): Add unistd.h.
14942
14943 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14944
14945 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14946 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14947
14948 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14949
14950 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14951
14952 * term.c (vfatal): Remove stray call to va_end.
14953 It's not needed and the C Standard doesn't allow it here anyway.
14954
14955 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14956 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14957
14958 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14959 bytes.
14960
14961 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14962
14963 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14964
14965 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14966
14967 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14968
14969 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14970
14971 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14972 * charset.c (Fdefine_charset_internal): Don't initialize
14973 charset.code_space[15]. The value was garbage, on hosts with
14974 32-bit int (Bug#8600).
14975
14976 * lread.c (read_integer): Be more consistent with string-to-number.
14977 Use string_to_number to do the actual conversion; this avoids
14978 rounding errors and fixes some other screwups. Without this fix,
14979 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14980 (digit_to_number): Move earlier, for benefit of read_integer.
14981 Return -1 if the digit is out of range for the base, -2 if it is
14982 not a digit in any supported base. (Bug#8602)
14983
14984 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14985
14986 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14987 to match comment at start of function. This also removes a
14988 GCC warning about overflow in a 32+64-bit port.
14989
14990 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14991
14992 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14993 Reported by Stefan Monnier in
14994 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14995 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14996 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14997
14998 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14999 (EMACS_UINTPTR): Likewise, with uintptr_t.
15000
15001 * lisp.h: Prefer 64-bit EMACS_INT if available.
15002 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15003 on 32-bit hosts that have 64-bit int, so that they can access
15004 large files.
15005 However, temporarily disable this change unless the temporary
15006 symbol WIDE_EMACS_INT is defined.
15007
15008 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15009
15010 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15011 This removes an assumption that EMACS_INT and long are the same
15012 width as pointers. The assumption is true for Emacs porting targets
15013 now, but we want to make other targets possible.
15014 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15015 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15016 In the rest of the code, change types of integers that hold casted
15017 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15018 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15019 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15020 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15021 No need to cast type when ORing.
15022 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15023 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15024 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15025 assume EMACS_INT is the same width as char *.
15026 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15027 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15028 Remove no-longer-needed casts.
15029 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15030 (xg_tool_bar_help_callback, xg_make_tool_item):
15031 Use EMACS_INTPTR to hold an integer
15032 that will be cast to void *; this can avoid a GCC warning
15033 if EMACS_INT is not the same width as void *.
15034 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15035 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15036 (current_message_1, set_message_1):
15037 Use a local to convert to proper width without a cast.
15038 * xmenu.c (dialog_selection_callback): Likewise.
15039
15040 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15041 Also, don't assume VALBITS / RAND_BITS is less than 5,
15042 and don't rely on undefined behavior when shifting a 1 left into
15043 the sign bit.
15044 * lisp.h (get_random): Change signature to match.
15045
15046 * lread.c (hash_string): Use size_t, not int, for hash computation.
15047 Normally we prefer signed values; but hashing is special, because
15048 it's better to use unsigned division on hash table sizes so that
15049 the remainder is nonnegative. Also, size_t is the natural width
15050 for hashing into memory. The previous code used 'int', which doesn't
15051 retain enough info to hash well into very large tables.
15052 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15053
15054 * dbusbind.c: Don't possibly lose pointer info when converting.
15055 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15056 Use XPNTR rather than XHASH, so that the high-order bits of
15057 the pointer aren't lost when converting through void *.
15058
15059 * eval.c (Fautoload): Don't double-shift a pointer.
15060
15061 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15062
15063 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
15064
15065 * gnutls.c (DEF_GNUTLS_FN):
15066 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15067
15068 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15069
15070 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15071 marker. (Bug#8610)
15072
15073 2011-05-05 Eli Zaretskii <eliz@gnu.org>
15074
15075 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15076 New version that can reserve upto 2GB of heap space.
15077
15078 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
15079
15080 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15081
15082 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15083
15084 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15085 `gnutls_certificate_set_x509_key_file'.
15086
15087 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
15088
15089 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15090 Update dependencies.
15091
15092 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15093
15094 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15095 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15096 Remove unused parameter `fildes'.
15097 * process.c (read_process_output, send_process): Don't pass it.
15098
15099 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15100
15101 Fix previous change: the library cache is defined in w32.c.
15102 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15103 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15104
15105 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
15106
15107 Implement dynamic loading of GnuTLS on Windows.
15108
15109 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15110 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15111 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15112 Declare.
15113
15114 * gnutls.c (Qgnutls_dll): Define.
15115 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15116 (gnutls_*): Declare function pointers.
15117 (init_gnutls_functions): New function to initialize function pointers.
15118 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15119 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15120 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15121 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15122 (emacs_gnutls_write, emacs_gnutls_read)
15123 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15124 (Fgnutls_available_p): New function.
15125 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15126 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15127 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15128
15129 * image.c: Include w32.h.
15130 (Vimage_type_cache): Delete.
15131 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15132 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15133 (w32_delayed_load): Move to w32.c.
15134
15135 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15136
15137 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15138 (w32_delayed_load): Move from image.c. When loading a library, record
15139 its filename in the :loaded-from property of the library id.
15140 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15141 Initialize and staticpro them.
15142 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15143
15144 * process.c: Include lisp.h before w32.h, not after.
15145 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15146 instead of gnutls_record_check_pending.
15147
15148 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15149
15150 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15151
15152 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15153 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15154 as passed in.
15155
15156 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15157
15158 * xterm.c (x_set_frame_alpha): Do not set property on anything
15159 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15160
15161 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15162
15163 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15164
15165 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
15166
15167 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15168 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15169 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15170 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15171 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15172 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15173 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15174 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15175 (Qgnutls_bootprop_callbacks_verify): Make static.
15176
15177 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15178
15179 * callproc.c: Indentation fixup.
15180
15181 * sysdep.c (wait_for_termination_1): Make static.
15182 (wait_for_termination, interruptible_wait_for_termination):
15183 Move after wait_for_termination_1.
15184
15185 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15186
15187 * sysdep.c (interruptible_wait_for_termination): New function
15188 which is like wait_for_termination, but allows keyboard
15189 interruptions.
15190
15191 * callproc.c (Fcall_process): Add (:file "file") as an option for
15192 the STDOUT buffer.
15193 (Fcall_process_region): Ditto.
15194
15195 2011-04-30 Eli Zaretskii <eliz@gnu.org>
15196
15197 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15198 rather than `XVECTOR (FOO)->size'.
15199
15200 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15201 inttypes.h, as a gnulib replacement is used if it not available in
15202 system headers.
15203
15204 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15205
15206 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15207 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15208 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15209
15210 * coding.c (coding_alloc_by_realloc): Error out if destination
15211 will grow beyond MOST_POSITIVE_FIXNUM.
15212 (decode_coding_emacs_mule): Abort if there isn't enough place in
15213 charbuf for the composition carryover bytes. Reserve an extra
15214 space for up to 2 characters produced in a loop.
15215 (decode_coding_iso_2022): Abort if there isn't enough place in
15216 charbuf for the composition carryover bytes.
15217
15218 2011-04-21 Eli Zaretskii <eliz@gnu.org>
15219
15220 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15221 aborting when %lld or %lll format is passed.
15222 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15223 %llo or %llx format is passed. (Bug#8545)
15224
15225 * window.c (window_scroll_line_based): Use a marker instead of
15226 simple variables to record original value of point. (Bug#7952)
15227
15228 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15229 produced by %s or %c overflows available buffer space. (Bug#8545)
15230
15231 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15232
15233 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
15234 (SIZE_MAX): Move defn after all includes, as they might #define it.
15235
15236 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15237
15238 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15239
15240 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15241
15242 * keyboard.c (Qdelayed_warnings_hook): Define.
15243 (command_loop_1): Run `delayed-warnings-hook'
15244 if Vdelayed_warnings_list is non-nil.
15245 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15246 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15247
15248 2011-04-28 Eli Zaretskii <eliz@gnu.org>
15249
15250 * doprnt.c (doprnt): Don't return value smaller than the buffer
15251 size if the message was truncated. (Bug#8545).
15252
15253 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
15254
15255 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15256 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15257
15258 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15259
15260 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15261
15262 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
15263
15264 * makefile.w32-in: Update dependencies.
15265
15266 2011-04-27 Eli Zaretskii <eliz@gnu.org>
15267
15268 Improve `doprnt' and its usage. (Bug#8545)
15269 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15270 `format_end'. Remove support for %l as a conversion specifier.
15271 Don't use xrealloc. Improve diagnostics when the %l size modifier
15272 is used. Update the commentary.
15273
15274 * eval.c (verror): Simplify calculation of size_t.
15275
15276 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15277 messages.
15278
15279 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15280
15281 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15282 change.
15283
15284 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15285
15286 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15287 This makes this file independent of the recent pseudovector change.
15288
15289 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
15290
15291 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15292
15293 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
15294 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
15295 Remove unused local.
15296 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
15297
15298 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
15299 GCC 4.6.0 optimizes based on type-based alias analysis.
15300 For example, if b is of type struct buffer * and v of type struct
15301 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15302 != &v->size, and therefore "v->size = 1; b->size = 2; return
15303 v->size;" must therefore return 1. This assumption is incorrect
15304 for Emacs, since it type-puns struct Lisp_Vector * with many other
15305 types. To fix this problem, this patch adds a new type struct
15306 vectorlike_header that documents the constraints on layout of vectors
15307 and pseudovectors, and helps optimizing compilers not get fooled
15308 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15309 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
15310 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15311 the size member.
15312 (XSETPVECTYPE): Rewrite in terms of new macro.
15313 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15314 This is a bit clearer, and further avoids the possibility of
15315 undesirable aliasing.
15316 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
15317 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
15318 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15319 since Lisp_Subr is a special case (no "next" field).
15320 (ASIZE): Now uses header.size rather than size.
15321 All previous uses of XVECTOR (foo)->size replaced to use this macro,
15322 to avoid the hassle of writing XVECTOR (foo)->header.size.
15323 (struct vectorlike_header): New type.
15324 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15325 object, to help avoid aliasing.
15326 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15327 (SUBRP): Likewise, since Lisp_Subr is a special case.
15328 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15329 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15330 (struct Lisp_Hash_Table): Combine first two members into a single
15331 struct vectorlike_header member. All uses of "size" and "next" members
15332 changed to be "header.size" and "header.next".
15333 * buffer.h (struct buffer): Likewise.
15334 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15335 * frame.h (struct frame): Likewise.
15336 * process.h (struct Lisp_Process): Likewise.
15337 * termhooks.h (struct terminal): Likewise.
15338 * window.c (struct save_window_data, struct saved_window): Likewise.
15339 * window.h (struct window): Likewise.
15340 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15341 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15342 * buffer.c (init_buffer_once): Likewise.
15343 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15344 special case.
15345 * process.c (Fformat_network_address): Use local var for size,
15346 for brevity.
15347
15348 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15349
15350 Make the Lisp reader and string-to-float more consistent (Bug#8525)
15351 * data.c (atof): Remove decl; no longer used or needed.
15352 (digit_to_number): Move to lread.c.
15353 (Fstring_to_number): Use new string_to_number function, to be
15354 consistent with how the Lisp reader treats infinities and NaNs.
15355 Do not assume that floating-point numbers represent EMACS_INT
15356 without losing information; this is not true on most 64-bit hosts.
15357 Avoid double-rounding errors, by insisting on integers when
15358 parsing non-base-10 numbers, as the documentation specifies.
15359 * lisp.h (string_to_number): New decl, replacing ...
15360 (isfloat_string): Remove.
15361 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
15362 (read1): Do not accept +. and -. as integers; this
15363 appears to have been a coding error. Similarly, do not accept
15364 strings like +-1e0 as floating point numbers. Do not report
15365 overflow for integer overflows unless the base is not 10 which
15366 means we have no simple and reliable way to continue.
15367 Break out the floating-point parsing into a new
15368 function string_to_number, so that Fstring_to_number parses
15369 floating point numbers consistently with the Lisp reader.
15370 (digit_to_number): Move here from data.c. Make it static inline.
15371 (E_CHAR, EXP_INT): Remove, replacing with ...
15372 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15373 (string_to_number): New function, replacing isfloat_string.
15374 This function checks for valid syntax and produces the resulting
15375 Lisp float number too. Rework it so that string-to-number
15376 no longer mishandles examples like "1.0e+". Use strtoumax,
15377 so that overflow for non-base-10 numbers is reported only when
15378 there's no portable and simple way to convert to floating point.
15379
15380 * textprop.c (set_text_properties_1): Rewrite for clarity,
15381 and to avoid GCC warning about integer overflow.
15382
15383 * intervals.h (struct interval): Use EMACS_INT for members
15384 where EMACS_UINT might cause problems. See
15385 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15386 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15387 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15388 All uses changed.
15389 (offset_intervals): Tell GCC not to worry about length overflow
15390 when negating a negative length.
15391
15392 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15393 (overrun_check_free): Likewise.
15394
15395 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15396 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15397 word size.
15398
15399 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15400 (gnutls_make_error): Rename local to avoid shadowing.
15401 (gnutls_emacs_global_deinit): ifdef out; not used.
15402 (Fgnutls_boot): Use const for pointer to readonly storage.
15403 Comment out unused local. Fix pointer signedness problems.
15404
15405 * lread.c (openp): Don't stuff size_t into an 'int'.
15406 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15407 about possible signed overflow.
15408
15409 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15410 (GDK_KEY_g): Don't define if already defined.
15411 (xg_prepare_tooltip): Avoid pointer signedness problem.
15412 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15413
15414 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15415 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15416
15417 * xfns.c (Fx_window_property): Simplify a bit,
15418 to make a bit faster and to avoid GCC 4.6.0 warning.
15419 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15420
15421 * fns.c (internal_equal): Don't assume size_t fits in int.
15422
15423 * alloc.c (compact_small_strings): Tighten assertion a little.
15424
15425 Replace pEd with more-general pI, and fix some printf arg casts.
15426 * lisp.h (pI): New macro, generalizing old pEd macro to other
15427 conversion specifiers. For example, use "...%"pI"d..." rather
15428 than "...%"pEd"...".
15429 (pEd): Remove. All uses replaced with similar uses of pI.
15430 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
15431 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15432 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15433 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15434 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15435 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15436 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15437 64-bit hosts.
15438 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15439 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15440 * print.c (safe_debug_print, print_object): Likewise.
15441 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15442 to int.
15443 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15444 avoiding the 0 flag, which is not portable.
15445 * process.c (Fmake_network_process): Use pI to avoid cast.
15446 * region-cache.c (pp_cache): Likewise.
15447 * xdisp.c (decode_mode_spec): Likewise.
15448 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15449 behavior on 64-bit hosts with printf arg.
15450 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
15451 (x_stop_queuing_selection_requests): Likewise.
15452 (x_get_window_property): Don't truncate byte count to an 'int'
15453 when tracing.
15454
15455 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15456 here, since it parses constructs like leading '-' and spaces,
15457 which are not wanted; and it overflows with large numbers.
15458 Instead, simply match F[0-9]+, which is what is wanted anyway.
15459
15460 * alloc.c: Remove unportable assumptions about struct layout.
15461 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15462 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15463 (allocate_vectorlike, make_pure_vector): Use the new macros,
15464 plus offsetof, to remove unportable assumptions about struct layout.
15465 These assumptions hold on all porting targets that I know of, but
15466 they are not guaranteed, they're easy to remove, and removing them
15467 makes further changes easier.
15468
15469 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15470 This doesn't fix a bug but makes the code clearer.
15471 (string_overrun_cookie): Now const. Use initializers that
15472 don't formally overflow signed char, to avoid warnings.
15473 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15474 can cause Emacs to crash when string overrun checking is enabled.
15475 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15476 multiple of sizeof (EMACS_INT); it need not be, if
15477 alignof(EMACS_INT) < sizeof (EMACS_INT).
15478 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
15479
15480 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
15481
15482 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15483
15484 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15485
15486 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
15487 supposed to be handshaking. (Bug#8556)
15488 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15489
15490 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
15491
15492 * lisp.h (Qdebug): List symbol.
15493 * eval.c (Qdebug): Restore global linkage.
15494 * keyboard.c (debug-on-event): New variable.
15495 (handle_user_signal): Break into debugger when debug-on-event
15496 matches the current signal symbol.
15497
15498 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15499
15500 * alloc.c (check_sblock, check_string_bytes)
15501 (check_string_free_list): Convert to standard C.
15502
15503 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15504
15505 * w32.c (emacs_gnutls_push): Fix typo.
15506
15507 2011-04-25 Eli Zaretskii <eliz@gnu.org>
15508
15509 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15510 "cast to pointer from integer of different size".
15511
15512 Improve doprnt and its use in verror. (Bug#8545)
15513 * doprnt.c (doprnt): Document the set of format control sequences
15514 supported by the function. Use SAFE_ALLOCA instead of always
15515 using `alloca'.
15516
15517 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15518 is one byte too soon. Don't use xrealloc; instead xfree and
15519 xmalloc anew.
15520
15521 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15522
15523 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15524 callbacks stage.
15525
15526 * gnutls.c: Renamed global_initialized to
15527 gnutls_global_initialized. Added internals for the
15528 :verify-hostname-error, :verify-error, and :verify-flags
15529 parameters of `gnutls-boot' and documented those parameters in the
15530 docstring. Start callback support.
15531 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15532 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15533 on error. Return error code.
15534 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15535 (emacs_gnutls_read): Likewise.
15536 (Fgnutls_boot): Return handshake error code.
15537 (emacs_gnutls_handle_error): New function.
15538 (wsaerror_to_errno): Likewise.
15539
15540 * w32.h (emacs_gnutls_pull): Add prototype.
15541 (emacs_gnutls_push): Likewise.
15542
15543 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15544 (emacs_gnutls_push): Likewise.
15545
15546 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15547
15548 * process.c (wait_reading_process_output): Check if GnuTLS
15549 buffered some data internally if no FDs are set for TLS
15550 connections.
15551
15552 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15553 (LIBS): Link to USER_LIBS.
15554 ($(BLD)/gnutls.$(0)): New target.
15555
15556 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15557
15558 * xdisp.c (handle_single_display_spec): Rename the
15559 display_replaced_before_p argument into display_replaced_p, to
15560 make it consistent with the commentary. Fix typos in the
15561 commentary.
15562
15563 * textprop.c (syms_of_textprop): Remove dead code.
15564 (copy_text_properties): Delete obsolete commentary about an
15565 interface that was deleted long ago. Fix typos in the description
15566 of arguments.
15567
15568 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15569 to changes in oldXMenu/XMenu.h from 2011-04-16.
15570 <menu_help_message, prev_menu_help_message>: Constify.
15571 (IT_menu_make_room): menu->help_text is now `const char **';
15572 adjust.
15573
15574 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15575 to changes in oldXMenu/XMenu.h from 2011-04-16.
15576 (struct XMenu): Declare `help_text' `const char **'.
15577
15578 * xfaces.c <Qunspecified>: Make extern again.
15579
15580 * syntax.c: Include sys/types.h before including regex.h, as
15581 required by POSIX.
15582
15583 * doc.c (get_doc_string): Improve the format passed to `error'.
15584
15585 * doprnt.c (doprnt): Improve commentary.
15586
15587 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15588
15589 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15590 them with etags.
15591
15592 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15593 changes in globals.h immediately force recompilation.
15594 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15595 $(CURDIR)/s/ms-w32.h.
15596 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15597
15598 * character.c (Fchar_direction): Function deleted.
15599 (syms_of_character): Don't defsubr it.
15600 <char-direction-table>: Deleted.
15601
15602 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15603
15604 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15605 * doprnt.c: Include limits.h.
15606 (SIZE_MAX): New macro.
15607 (doprnt): Return a size_t value. 2nd arg is now size_t.
15608 Many local variables are now size_t instead of int or unsigned.
15609 Improve overflow protection. Support `l' modifier for integer
15610 conversions. Support %l conversion. Don't assume an EMACS_INT
15611 argument for integer conversions and for %c.
15612
15613 * lisp.h (doprnt): Restore prototype.
15614
15615 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15616 $(SRC)/character.h.
15617
15618 * Makefile.in (base_obj): Add back doprnt.o.
15619
15620 * deps.mk (doprnt.o): Add back prerequisites.
15621 (callint.o): Depend on character.h.
15622
15623 * eval.c (internal_lisp_condition_case): Include the handler
15624 representation in the error message.
15625 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15626 when breaking from the loop.
15627
15628 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15629
15630 * callint.c (Fcall_interactively): When displaying error message
15631 about invalid control letter, pass the character's codepoint, not
15632 a pointer to its multibyte form. Improve display of the character
15633 in octal and display also its hex code.
15634
15635 * character.c (char_string): Use %x to display the (unsigned)
15636 codepoint of an invalid character, to avoid displaying a bogus
15637 negative value.
15638
15639 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15640 `error', not SYMBOL_NAME itself.
15641
15642 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15643 character arguments to `error'.
15644
15645 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15646 to `error' in error message about FINAL_CHAR argument. Make sure
15647 FINAL_CHAR is a character, and use %c when it is passed as
15648 argument to `error'.
15649
15650 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15651
15652 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15653
15654 * w32.c: Include <time.h>.
15655 (sys_localtime): New function.
15656
15657 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15658
15659 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15660
15661 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15662
15663 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15664
15665 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15666 zombies (Bug#8467).
15667
15668 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15669
15670 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15671 gl_state.e_property when gl_state.object is Qt.
15672
15673 * insdel.c (make_gap_larger): Remove limitation of buffer size
15674 to <= INT_MAX.
15675
15676 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15677
15678 * xdisp.c (lookup_glyphless_char_display)
15679 (produce_glyphless_glyph): Handle cons cell entry in
15680 glyphless-char-display.
15681 (Vglyphless_char_display): Document it.
15682
15683 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15684 glyphless-char-display.
15685
15686 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15687
15688 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15689
15690 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15691
15692 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15693 definition for no-X builds.
15694
15695 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15696
15697 Static checks with GCC 4.6.0 and non-default toolkits.
15698
15699 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15700
15701 * process.c (keyboard_bit_set): Define only if SIGIO.
15702 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15703 (send_process): Repair possible setjmp clobbering.
15704
15705 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15706
15707 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15708
15709 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15710
15711 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15712 Define only if needed.
15713
15714 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15715 by pacifying GCC about it. Maybe it's time to retire it?
15716 * xfaces.c (USG, __TIMEVAL__): Likewise.
15717
15718 * dispextern.h (struct redisplay_interface): Rename param
15719 to avoid shadowing.
15720 * termhooks.h (struct terminal): Likewise.
15721 * xterm.c (xembed_send_message): Likewise.
15722
15723 * insdel.c (make_gap_smaller): Define only if
15724 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15725
15726 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15727 it.
15728
15729 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15730 so that we aren't warned about unused symbols.
15731
15732 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15733
15734 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15735
15736 * xfns.c (x_real_positions): Mark locals as initialized.
15737
15738 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15739
15740 * xterm.c: Fix problems found by static analysis with other toolkits.
15741 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15742 (x_dispatch_event): Declare static if USE_GTK, and
15743 define if USE_GTK || USE_X_TOOLKIT.
15744 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15745 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15746 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15747 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15748
15749 * xmenu.c (menu_help_callback): Pointer type fixes.
15750 Use const pointers when pointing at readonly data. Avoid pointer
15751 signedness clashes.
15752 (FALSE): Remove unused macro.
15753 (update_frame_menubar): Remove unused decl.
15754
15755 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15756
15757 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15758 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15759 (single_menu_item): Rename local to avoid shadowing.
15760
15761 * keyboard.c (make_lispy_event): Remove unused local var.
15762
15763 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15764 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15765
15766 * bitmaps: Change bitmaps from unsigned char back to the X11
15767 compatible char. Avoid the old compiler warnings about
15768 out-of-range initializers by using, for example, '\xab' rather
15769 than 0xab.
15770
15771 * xgselect.c (xgselect_initialize): Check vs interface
15772 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15773
15774 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15775
15776 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15777 to read-only memory.
15778
15779 * fns.c (vector): Remove; this old hack is no longer needed.
15780
15781 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15782 Remove unused var.
15783 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15784
15785 * xrdb.c (x_load_resources): Omit unused local.
15786
15787 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15788 (x_window): Rename locals to avoid shadowing.
15789 (USG): Use the kludged USG macro, to pacify gcc.
15790
15791 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15792 (x_term_init): Remove local to avoid shadowing.
15793
15794 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15795
15796 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15797 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15798
15799 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15800
15801 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15802
15803 Fix regex.c, syntax.c and friends for buffers > 2GB.
15804 * syntax.h (struct gl_state_s): Declare character position members
15805 EMACS_INT.
15806
15807 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15808
15809 * textprop.c (verify_interval_modification, interval_of):
15810 Declare arguments EMACS_INT.
15811
15812 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15813 EMACS_INT.
15814
15815 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15816
15817 * indent.c (Fvertical_motion): Local variable it_start is now
15818 EMACS_INT.
15819
15820 * regex.c (re_match, re_match_2, re_match_2_internal)
15821 (bcmp_translate, regcomp, regexec, print_double_string)
15822 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15823 (re_compile_pattern, re_exec): Declare arguments and local
15824 variables `size_t' and `ssize_t' and return values `regoff_t', as
15825 appropriate.
15826 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15827 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15828 <compile_stack_type>: `size' and `avail' are now `size_t'.
15829
15830 * regex.h <regoff_t>: Use ssize_t, not int.
15831 (re_search, re_search_2, re_match, re_match_2): Arguments that
15832 specify buffer/string position and length are now ssize_t and
15833 size_t. Return type is regoff_t.
15834
15835 2011-04-16 Ben Key <bkey76@gmail.com>
15836
15837 * nsfont.m: Fixed bugs in ns_get_family and
15838 ns_descriptor_to_entity that were caused by using free to
15839 deallocate memory blocks that were allocated by xmalloc (via
15840 xstrdup). This caused Emacs to crash when compiled with
15841 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15842 --enable-checking=xmallocoverrun). xfree is now used to
15843 deallocate these memory blocks.
15844
15845 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15846
15847 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15848
15849 emacs_write: Accept and return EMACS_INT for sizes.
15850 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15851 et seq.
15852 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15853 Accept and return EMACS_INT.
15854 (emacs_gnutls_write): Return the number of bytes written on
15855 partial writes.
15856 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15857 (emacs_read, emacs_write): Remove check for negative size, as the
15858 Emacs source code has been audited now.
15859 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15860 (emacs_read, emacs_write): Use it.
15861 * process.c (send_process): Adjust to the new signatures of
15862 emacs_write and emacs_gnutls_write. Do not attempt to store
15863 a byte offset into an 'int'; it might overflow.
15864 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15865
15866 * sound.c: Don't assume sizes fit in 'int'.
15867 (struct sound_device.period_size, alsa_period_size):
15868 Return EMACS_INT, not int.
15869 (struct sound_device.write, vox_write, alsa_write):
15870 Accept EMACS_INT, not int.
15871 (wav_play, au_play): Use EMACS_INT to store sizes and to
15872 record read return values.
15873
15874 2011-04-15 Ben Key <bkey76@gmail.com>
15875
15876 * keyboard.c (Qundefined): Don't declare static since it is used
15877 in nsfns.m.
15878 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15879 static since they are used in nsfont.m.
15880
15881 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15882
15883 * process.c (Qprocessp): Don't declare static.
15884 * lisp.h (Qprocessp): Declare again.
15885
15886 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15887
15888 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15889
15890 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15891
15892 Improve C-level modularity by making more things 'static'.
15893
15894 Don't publish debugger-only interfaces to other modules.
15895 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15896 (verify_bytepos, count_markers): Move decls to the only modules
15897 that need them.
15898 * region-cache.h (pp_cache): Likewise.
15899 * window.h (check_all_windows): Likewise.
15900 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15901
15902 * sysdep.c (croak): Now static, if
15903 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15904 * syssignal.h (croak): Declare only if not static.
15905
15906 * alloc.c (refill_memory_reserve): Now static if
15907 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15908 * lisp.h (refill_memory_reserve): Declare only if not static.
15909
15910 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15911 Define only if USE_LUCID.
15912
15913 * xrdb.c (x_customization_string, x_rm_string): Now static.
15914
15915 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15916 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15917
15918 * xdisp.c (draw_row_with_mouse_face): Now static.
15919 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15920
15921 * window.h (check_all_windows): Mark externally visible.
15922
15923 * window.c (window_deletion_count): Now static.
15924
15925 * undo.c: Make symbols static if they're not exported.
15926 (last_undo_buffer, last_boundary_position, pending_boundary):
15927 Now static.
15928
15929 * textprop.c (interval_insert_behind_hooks): Now static.
15930 (interval_insert_in_front_hooks): Likewise.
15931
15932 * term.c: Make symbols static if they're not exported.
15933 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15934 (max_frame_lines, tty_set_terminal_modes):
15935 (tty_reset_terminal_modes, tty_turn_off_highlight):
15936 (get_tty_terminal): Now static.
15937 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15938 * termhooks.h (term_mouse_moveto): Do not declare if
15939 HAVE_WINDOW_SYSTEM.
15940 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15941 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15942
15943 * sysdep.c: Make symbols static if they're not exported.
15944 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15945 Now static.
15946 (sigprocmask_set, full_mask): Remove; unused.
15947 (wait_debugging): Mark as visible.
15948 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15949 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15950
15951 * syntax.c (syntax_temp): Define only if !__GNUC__.
15952
15953 * sound.c (current_sound_device, current_sound): Now static.
15954
15955 * search.c (searchbufs, searchbuf_head): Now static.
15956
15957 * scroll.c (scroll_cost): Remove; unused.
15958 * dispextern.h (scroll_cost): Remove decl.
15959
15960 * region-cache.h (pp_cache): Mark as externally visible.
15961
15962 * process.c: Make symbols static if they're not exported.
15963 (process_tick, update_tick, create_process, chan_process):
15964 (Vprocess_alist, proc_buffered_char, datagram_access):
15965 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15966 (deactivate_process): Mark defn as static, as well as decl.
15967 * lisp.h (create_process): Remove decl.
15968 * process.h (chan_process, Vprocess_alist): Remove decls.
15969
15970 * print.c: Make symbols static if they're not exported.
15971 (print_depth, new_backquote_output, being_printed, print_buffer):
15972 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15973 (print_interval, print_number_index, initial_stderr_stream):
15974 Now static.
15975 * lisp.h (Fprinc): Remove decl.
15976 (debug_output_compilation_hack): Mark as externally visible.
15977
15978 * sysdep.c (croak): Move decl from here to syssignal.h.
15979 * syssignal.h (croak): Put it here, so the API can be checked when
15980 'croak' is called from dissociate_if_controlling_tty.
15981
15982 * minibuf.c: Make symbols static if they're not exported.
15983 (minibuf_save_list, choose_minibuf_frame): Now static.
15984 * lisp.h (choose_minibuf_frame): Remove decl.
15985
15986 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15987
15988 * lread.c: Make symbols static if they're not exported.
15989 (read_objects, initial_obarray, oblookup_last_bucket_number):
15990 Now static.
15991 (make_symbol): Remove; unused.
15992 * lisp.h (initial_obarray, make_symbol): Remove decls.
15993
15994 * keyboard.c: Make symbols static if they're not exported.
15995 (single_kboard, recent_keys_index, total_keys, recent_keys):
15996 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15997 (this_single_command_key_start, echoing, last_auto_save):
15998 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15999 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16000 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16001 (Vlispy_mouse_stem, double_click_count):
16002 Now static.
16003 (force_auto_save_soon): Define only if SIGDANGER.
16004 (ignore_mouse_drag_p): Now static if
16005 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16006 (print_help): Remove; unused.
16007 (stop_character, last_timer_event): Mark as externally visible.
16008 * keyboard.h (ignore_mouse_drag_p): Declare only if
16009 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16010 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16011 * lisp.h (echoing): Remove decl.
16012 (force_auto_save_soon): Declare only if SIGDANGER.
16013 * xdisp.c (redisplay_window): Simplify code, to make it more
16014 obvious that ignore_mouse_drag_p is not accessed if !defined
16015 USE_GTK && !defined HAVE_NS.
16016
16017 * intervals.c: Make symbols static if they're not exported.
16018 (merge_properties_sticky, merge_interval_right, delete_interval):
16019 Now static.
16020 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16021
16022 * insdel.c: Make symbols static if they're not exported.
16023 However, leave prepare_to_modify_buffer alone. It's never
16024 called from outside this function, but that appears to be a bug.
16025 (combine_after_change_list, combine_after_change_buffer):
16026 (adjust_after_replace, signal_before_change): Now static.
16027 (adjust_after_replace_noundo): Remove; unused.
16028 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
16029 (signal_before_change): Remove decls.
16030
16031 * indent.c (val_compute_motion, val_vmotion): Now static.
16032
16033 * image.c: Make symbols static if they're not exported.
16034 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16035 if USE_GTK.
16036 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16037 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16038
16039 * fringe.c (standard_bitmaps): Now static.
16040 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16041
16042 * frame.c: Make symbols static if they're not exported.
16043 (x_report_frame_params, make_terminal_frame): Now static.
16044 (get_frame_param): Now static, unless HAVE_NS.
16045 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16046 (x_get_resource_string): Remove; not used.
16047 * frame.h (make_terminal_frame, x_report_frame_params):
16048 (x_get_resource_string); Remove decls.
16049 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16050 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16051
16052 * font.c, fontset.c: Make symbols static if they're not exported.
16053 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16054 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16055 * font.c (font_close_object): Now static.
16056 * font.h (font_close_object): Remove.
16057 * fontset.c (FONTSET_OBJLIST): Remove.
16058 (free_realized_fontset) #if-0 the body, which does nothing.
16059 (face_suitable_for_char_p): #if-0, as it's never called.
16060 * fontset.h (face_suitable_for_char_p): Remove decl.
16061 * xfaces.c (face_at_string_position):
16062 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
16063 since 0 is always ASCII.
16064
16065 * fns.c (weak_hash_tables): Now static.
16066
16067 * fileio.c: Make symbols static if they're not exported.
16068 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16069 (Vwrite_region_annotation_buffers): Now static.
16070
16071 * eval.c: Make symbols static if they're not exported.
16072 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16073 * lisp.h (backtrace_list): Remove decl.
16074
16075 * emacs.c: Make symbols static if they're not exported.
16076 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16077 (fatal_error_code, fatal_error_signal_hook, standard_args):
16078 Now static.
16079 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16080 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16081 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16082 * lisp.h (fatal_error_signal_hook): Remove decl.
16083 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16084
16085 * editfns.c: Move a (normally-unused) function to its only use.
16086 * editfns.c, lisp.h (get_operating_system_release): Remove.
16087 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16088 worth the hassle of breaking this out.
16089
16090 * xterm.c: Make symbols static if they're not exported.
16091 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16092 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16093 (x_destroy_window, x_delete_display):
16094 Now static.
16095 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16096 (x_mouse_leave): Remove; unused.
16097 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16098 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16099 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16100 Remove decls.
16101 (x_mouse_leave): Declare only if WINDOWSNT.
16102 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16103 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16104 USE_X_TOOLKIT.
16105
16106 * ftxfont.c: Make symbols static if they're not exported.
16107 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16108 HAVE_FREETYPE.
16109 * font.h (ftxfont_driver): Likewise.
16110
16111 * xfns.c: Make symbols static if they're not exported.
16112 (x_last_font_name, x_display_info_for_name):
16113 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16114 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16115 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16116 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16117 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16118 (last_show_tip_args): Now static.
16119 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16120 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16121 (x_screen_planes): Remove; unused.
16122 * dispextern.h (x_screen_planes): Remove decl.
16123
16124 * dispnew.c: Make symbols static if they're not exported.
16125 * dispextern.h (redraw_garbaged_frames, scrolling):
16126 (increment_row_positions): Remove.
16127 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16128 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16129 Now static.
16130 (redraw_garbaged_frames): Remove; unused.
16131
16132 * xfaces.c: Make symbols static if they're not exported.
16133 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16134 Remove decls.
16135 * xterm.h (defined_color): Remove decls.
16136 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16137 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16138 (menu_face_changed_default, defined_color, free_realized_face):
16139 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16140 (ascii_face_of_lisp_face): Remove; unused.
16141
16142 * xdisp.c: Make symbols static if they're not exported.
16143 * dispextern.h (scratch_glyph_row, window_box_edges):
16144 (glyph_to_pixel_coords, set_cursor_from_row):
16145 (get_next_display_element, set_iterator_to_next):
16146 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16147 (show_mouse_face): Remove decls
16148 * frame.h (message_buf_print): Likewise.
16149 * lisp.h (pop_message, set_message, check_point_in_composition):
16150 Likewise.
16151 * xterm.h (set_vertical_scroll_bar): Likewise.
16152 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16153 (message_buf_print, scratch_glyph_row, displayed_buffer):
16154 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16155 (get_next_display_element, show_mouse_face, window_box_edges):
16156 (frame_to_window_pixel_xy, check_point_in_composition):
16157 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16158 (glyph_to_pixel_coords): Remove; unused.
16159
16160 * dired.c (file_name_completion): Now static.
16161
16162 * dbusbind.c (xd_in_read_queued_messages): Now static.
16163
16164 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16165 * data.c (circular_list_error): Remove.
16166
16167 * commands.h (last_point_position, last_point_position_buffer):
16168 (last_point_position_window): Remove decls.
16169 * keyboard.c: Make these variables static.
16170
16171 * coding.h (coding, code_convert_region, encode_coding_gap):
16172 Remove decls.
16173 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16174 (iso_code_class, detect_coding, code_convert_region): Now static.
16175 (encode_coding_gap): Remove; unused.
16176
16177 * chartab.c (chartab_chars, chartab_bits): Now static.
16178
16179 * charset.h (charset_iso_8859_1): Remove decl.
16180 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16181 Now static.
16182
16183 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16184 * ccl.c (Vccl_program_table): Now static.
16185 (check_ccl_update): Remove; unused.
16186
16187 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16188 * category.h: ... from here.
16189 * category.c (check_category_table, set_category_set): Now static.
16190
16191 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16192 * lisp.h: Remove these decls.
16193
16194 * buffer.c (buffer_count): Remove unused var.
16195
16196 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16197 so that it's not optimized away.
16198 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16199 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16200 exported only to the debugger.
16201
16202 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
16203 * atimer.h (run_all_atimers): Remove; not exported.
16204
16205 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16206 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16207 was inaccessible from Lisp.
16208 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16209 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16210
16211 alloc.c: Import and export fewer symbols, and remove unused items.
16212 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16213 is defined.
16214 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16215 it's not optimized away by whole-program optimization.
16216 (message_enable_multibyte, free_misc): Remove.
16217 (catchlist, handlerlist, mark_backtrace):
16218 Declare only if BYTE_MARK_STACK.
16219 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16220 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16221 (message_enable_multibyte): Remove decl.
16222 (free_misc, interval_free_list, float_block, float_block_index):
16223 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16224 (cons_free_list, last_marked_index):
16225 Now static.
16226 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16227 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16228 (mark_backtrace): Define only if BYTE_MARK_STACK.
16229 * xdisp.c (message_enable_multibyte): Now static.
16230
16231 Declare Lisp_Object Q* variables to be 'static' if not exported.
16232 This makes it easier for human readers (and static analyzers)
16233 to see whether these variables are used from other modules.
16234 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16235 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16236 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16237 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16238 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16239 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16240 * xmenu.c, xselect.c:
16241 Declare Q* vars static if they are not used in other modules.
16242 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16243 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16244 Remove decls of unexported vars.
16245 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16246
16247 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16248
16249 Make Emacs functions such as Fatom 'static' by default.
16250 This makes it easier for human readers (and static analyzers)
16251 to see whether these functions can be called from other modules.
16252 DEFUN now defines a static function. To make the function external
16253 so that it can be used in other C modules, use the new macro DEFUE.
16254 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16255 (Finit_image_library):
16256 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16257 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16258 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16259 Remove decls, since these functions are now static.
16260 (Funintern, Fget_internal_run_time): New decls, since these functions
16261 were already external.
16262
16263 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16264 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16265 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16266 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16267 * keyboard.c, keymap.c, lread.c:
16268 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16269 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16270 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16271 Mark functions with DEFUE instead of DEFUN,
16272 if they are used in other modules.
16273 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16274 decls for now-static functions.
16275 * buffer.h (Fdelete_overlay): Remove decl.
16276 * callproc.c (Fgetenv_internal): Mark as internal.
16277 * composite.c (Fremove_list_of_text_properties): Remove decl.
16278 (Fcomposition_get_gstring): New forward static decl.
16279 * composite.h (Fcomposite_get_gstring): Remove decl.
16280 * dired.c (Ffile_attributes): New forward static decl.
16281 * doc.c (Fdocumntation_property): New forward static decl.
16282 * eval.c (Ffetch_bytecode): New forward static decl.
16283 (Funintern): Remove extern decl; now in .h file where it belongs.
16284 * fileio.c (Fmake_symbolic_link): New forward static decl.
16285 * image.c (Finit_image_library): New forward static decl.
16286 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16287 * intervals.h (Fprevious_property_change):
16288 (Fremove_list_of_text_properties): Remove decls.
16289 * keyboard.c (Fthis_command_keys): Remove decl.
16290 (Fcommand_execute): New forward static decl.
16291 * keymap.c (Flookup_key): New forward static decl.
16292 (Fcopy_keymap): Now static.
16293 * keymap.h (Flookup_key): Remove decl.
16294 * process.c (Fget_process): New forward static decl.
16295 (Fprocess_datagram_address): Mark as internal.
16296 * syntax.c (Fsyntax_table_p): New forward static decl.
16297 (skip_chars): Remove duplicate decl.
16298 * textprop.c (Fprevious_property_change): New forward static decl.
16299 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16300 Now internal.
16301 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16302 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16303
16304 * editfns.c (Fformat): Remove unreachable code.
16305
16306 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16307
16308 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16309 change. (Bug#8496)
16310
16311 2011-04-13 Eli Zaretskii <eliz@gnu.org>
16312
16313 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16314 when at ZV. (Bug#8487)
16315
16316 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16317
16318 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16319 (Bug#8437)
16320 * keyboard.c (parse_tool_bar_item): Likewise.
16321 * sound.c (sound_cleanup, alsa_close): Likewise.
16322 * termcap.c (tgetent): Likewise.
16323 * xfns.c (x_default_font_parameter): Likewise.
16324 * xsettings.c (read_and_apply_settings): Likewise.
16325
16326 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16327 (overrun_check_free): Protoize.
16328
16329 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16330
16331 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16332 since callers should never pass a negative size.
16333 Change the signature to match that of plain 'read' and 'write'; see
16334 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16335 * lisp.h: Update prototypes of emacs_write and emacs_read.
16336
16337 2011-04-11 Eli Zaretskii <eliz@gnu.org>
16338
16339 * xdisp.c (redisplay_window): Don't try to determine the character
16340 position of the scroll margin if the window start point w->startp
16341 is outside the buffer's accessible region. (Bug#8468)
16342
16343 2011-04-10 Eli Zaretskii <eliz@gnu.org>
16344
16345 Fix write-region and its subroutines for buffers > 2GB.
16346 * fileio.c (a_write, e_write): Modify declaration of arguments and
16347 local variables to support buffers larger than 2GB.
16348 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16349
16350 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16351 argument, local variables, and return value.
16352
16353 * lisp.h: Update prototypes of emacs_write and emacs_read.
16354
16355 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16356
16357 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
16358
16359 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16360
16361 Fix more problems found by GCC 4.6.0's static checks.
16362
16363 * xdisp.c (vmessage): Use a better test for character truncation.
16364
16365 * charset.c (load_charset_map): <, not <=, for optimization,
16366 and to avoid potential problems with integer overflow.
16367 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
16368 * casetab.c (set_identity, shuffle): Likewise.
16369 * editfns.c (Fformat): Likewise.
16370 * syntax.c (skip_chars): Likewise.
16371
16372 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16373 This also lets GCC 4.6.0 generate slightly better loop code.
16374
16375 * callint.c (Fcall_interactively): <, not <=, for optimization.
16376 (Fcall_interactively): Count the number of arguments produced,
16377 not the number of arguments given. This is simpler and lets GCC
16378 4.6.0 generate slightly better code.
16379
16380 * ftfont.c: Distingish more carefully between FcChar8 and char.
16381 The previous code passed unsigned char * to a functions like
16382 strlen and xstrcasecmp that expect char *, which does not
16383 conform to the C standard.
16384 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16385 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16386 char * when the C standard requires it.
16387
16388 * keyboard.c (read_char): Remove unused var.
16389
16390 * eval.c: Port to Windows vsnprintf (Bug#8435).
16391 Include <limits.h>.
16392 (SIZE_MAX): Define if the headers do not.
16393 (verror): Do not give up if vsnprintf returns a negative count.
16394 Instead, grow the buffer. This ports to Windows vsnprintf, which
16395 does not conform to C99. Problem reported by Eli Zaretskii.
16396 Also, simplify the allocation scheme, by avoiding the need for
16397 calling realloc, and removing the ALLOCATED variable.
16398
16399 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16400
16401 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16402 But keep the doprint source code for now, as we might revamp it
16403 and use it again (Bug#8435).
16404 * lisp.h (doprnt): Remove.
16405 * Makefile.in (base_obj): Remove doprnt.o.
16406 * deps.mk (doprnt.o): Remove.
16407
16408 error: Print 32- and 64-bit integers portably (Bug#8435).
16409 Without this change, on typical 64-bit hosts error ("...%d...", N)
16410 was used to print both 32- and 64-bit integers N, which relied on
16411 undefined behavior.
16412 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
16413 * lisp.h (error, verror): Mark as printf-like functions.
16414 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16415 Report overflow in size calculations when allocating printf buffer.
16416 Do not truncate output string at its first null byte.
16417 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16418 Truncate the output at a character boundary, since vsnprintf does not
16419 do that.
16420 * charset.c (check_iso_charset_parameter): Convert internal
16421 character to string before calling 'error', since %c now has the
16422 printf meaning.
16423 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16424 overflow when computing char to be passed to 'error'. Do not
16425 pass Lisp_Object to 'error'; pass the integer instead.
16426 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16427 formatted with plain %d.
16428
16429 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16430
16431 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16432
16433 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16434
16435 * xterm.c (x_catch_errors): Remove duplicate declaration.
16436
16437 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16438
16439 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16440
16441 2011-04-10 Jim Meyering <meyering@redhat.com>
16442
16443 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16444 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16445 return ssize_t not "int", and use size_t as the buffer length.
16446 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16447 * gnutls.h: Update declarations.
16448 * process.c (read_process_output): Use ssize_t, to match.
16449 (send_process): Likewise.
16450
16451 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16452
16453 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16454
16455 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
16456
16457 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16458 Use unsigned char, to match FcChar8 type definition.
16459
16460 * xterm.c (handle_one_xevent):
16461 * xmenu.c (create_and_show_popup_menu):
16462 * xselect.c (x_decline_selection_request)
16463 (x_reply_selection_request): Avoid type-punned deref of X events.
16464
16465 2011-04-09 Eli Zaretskii <eliz@gnu.org>
16466
16467 Fix some uses of `int' instead of EMACS_INT.
16468 * search.c (string_match_1, fast_string_match)
16469 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16470 (scan_buffer, find_next_newline_no_quit)
16471 (find_before_next_newline, search_command, Freplace_match)
16472 (Fmatch_data): Make some `int' variables be EMACS_INT.
16473
16474 * xdisp.c (display_count_lines): 3rd argument and return value now
16475 EMACS_INT. All callers changed.
16476 (pint2hrstr): Last argument is now EMACS_INT.
16477
16478 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16479 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16480 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16481 (decode_coding_utf_16, decode_coding_emacs_mule)
16482 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16483 (decode_coding_ccl, decode_coding_charset)
16484 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16485 (decode_coding_iso_2022, decode_coding_emacs_mule)
16486 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16487 <char_offset, last_offset>: Declare EMACS_INT.
16488 (encode_coding_utf_8, encode_coding_utf_16)
16489 (encode_coding_emacs_mule, encode_invocation_designation)
16490 (encode_designation_at_bol, encode_coding_iso_2022)
16491 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16492 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16493 Declare EMACS_INT.
16494 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16495 (encode_invocation_designation): Last argument P_NCHARS is now
16496 EMACS_INT.
16497 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16498 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16499
16500 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16501 All users changed.
16502
16503 * ccl.c (Fccl_execute_on_string): Declare some variables
16504 EMACS_INT.
16505
16506 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
16507
16508 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16509
16510 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16511
16512 * process.c (Fformat_network_address): Doc fix.
16513
16514 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16515
16516 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
16517
16518 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
16519
16520 * keyboard.c (read_char): Call Lisp function help-form-show,
16521 instead of using internal_with_output_to_temp_buffer.
16522 (Qhelp_form_show): New var.
16523 (syms_of_keyboard): Use DEFSYM macro.
16524
16525 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16526
16527 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16528
16529 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
16530
16531 * process.c (Flist_processes): Remove to Lisp.
16532 (list_processes_1): Delete.
16533
16534 2011-04-06 Eli Zaretskii <eliz@gnu.org>
16535
16536 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16537
16538 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16539
16540 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
16541
16542 Fix more problems found by GCC 4.6.0's static checks.
16543
16544 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16545
16546 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16547
16548 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16549
16550 * xdisp.c (vmessage): Mark as a printf-like function.
16551
16552 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16553
16554 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16555
16556 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16557 printf-like functions.
16558 (tiff_load): Add casts to remove these marks before passing them
16559 to system-supplied API.
16560
16561 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16562
16563 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16564 This avoids several warnings with gcc -Wstrict-overflow.
16565 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16566 directly, rather than having caller test rule sign. This avoids
16567 some unnecessary tests.
16568 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16569 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16570 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16571
16572 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16573 (xfont_open): Avoid unnecessary tests.
16574
16575 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16576
16577 * composite.h, composite.c (composition_gstring_put_cache):
16578 Use EMACS_INT, not int, for length.
16579
16580 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16581 breaking out part of COMPOSITION_DECODE_RULE.
16582 (COMPOSITION_DECODE_RULE): Use it.
16583 * composite.c (get_composition_id): Remove unused local vars,
16584 by using the new macro.
16585
16586 * textprop.c (set_text_properties_1): Change while to do-while,
16587 since the condition is always true at first.
16588
16589 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16590 (interval_deletion_adjustment): Return unsigned value.
16591 All uses changed.
16592
16593 * process.c (list_processes_1, create_pty, read_process_output):
16594 (exec_sentinel): Remove vars that were set but not used.
16595 (create_pty): Remove unnecessary "volatile"s.
16596 (Fnetwork_interface_info): Avoid possibility of int overflow.
16597 (read_process_output): Do adaptive read buffering even if carryover.
16598 (read_process_output): Simplify nbytes computation if buffered.
16599
16600 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16601
16602 * syntax.c (scan_words): Remove var that was set but not used.
16603 (update_syntax_table): Use unsigned instead of int.
16604
16605 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16606 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16607 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16608
16609 * print.c (print_error_message): Avoid int overflow.
16610
16611 * font.c (font_list_entities): Redo for clarity,
16612 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16613
16614 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16615 (font_score): Avoid potential overflow in diff calculation.
16616
16617 * fns.c (substring_both): Remove var that is set but not used.
16618 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16619
16620 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16621
16622 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16623 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16624 can always succeed if overflow has undefined behavior.
16625
16626 * search.c (boyer_moore, wordify): Remove vars set but not used.
16627 (wordify): Omit three unnecessary tests.
16628
16629 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16630 All callers changed. This avoids the need for an unused var.
16631
16632 * casefiddle.c (casify_region): Remove var that is set but not used.
16633
16634 * dired.c (file_name_completion): Remove var that is set but not used.
16635
16636 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16637
16638 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16639 (Finsert_file_contents): Remove unnecessary code checking fd.
16640
16641 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16642 Check for integer overflow on size calculations.
16643
16644 * buffer.c (Fprevious_overlay_change): Remove var that is set
16645 but not used.
16646
16647 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16648 Remove vars that are set but not used.
16649 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16650 (timer_check_2): Mark vars as initialized.
16651
16652 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16653
16654 * image.c (lookup_image): Remove var that is set but not used.
16655 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16656
16657 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16658 that are set but not used.
16659
16660 * xfns.c (make_invisible_cursor): Don't return garbage
16661 if XCreateBitmapFromData fails (Bug#8410).
16662
16663 * xselect.c (x_get_local_selection, x_handle_property_notify):
16664 Remove vars that are set but not used.
16665
16666 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16667 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16668
16669 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16670 Remove var that is set but not used.
16671 (scroll_bar_windows_size): Now size_t, not int.
16672 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16673 Check for overflow.
16674
16675 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16676 (map_tty_color) [!defined MSDOS]: Likewise.
16677
16678 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16679
16680 * coding.c: Remove vars that are set but not used.
16681 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16682 All callers changed.
16683 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16684 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16685 (decode_coding_charset): Remove vars that are set but not used.
16686
16687 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16688 that is set but not used.
16689
16690 * print.c (print_object): Remove var that is set but not used.
16691
16692 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16693 The gnulib version avoids calling malloc in the usual case,
16694 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16695 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16696 * filelock.c (current_lock_owner): Likewise.
16697 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16698 * sysdep.c: Include allocator.h, careadlinkat.h.
16699 (emacs_no_realloc_allocator): New static constant.
16700 (emacs_readlink): New function.
16701 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16702 ../lib/careadlinkat.h.
16703
16704 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16705
16706 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16707 first non-nil return value).
16708
16709 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16710
16711 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16712 if not defined (Bug#8403).
16713
16714 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16715
16716 * xdisp.c (display_count_lines): Remove parameter `start',
16717 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16718 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16719 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16720 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16721 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16722 and thereabouts. All callers changed.
16723 (get_per_char_metric): Remove parameter `f', unused since
16724 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16725
16726 2011-04-02 Jim Meyering <meyering@redhat.com>
16727
16728 do not dereference NULL upon failed strdup
16729 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16730 (ns_get_family): Likewise.
16731
16732 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16733
16734 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16735
16736 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16737
16738 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16739 later (Bug#8403).
16740
16741 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16742
16743 Add lexical binding.
16744
16745 * window.c (Ftemp_output_buffer_show): New fun.
16746 (Fsave_window_excursion):
16747 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16748
16749 * lread.c (lisp_file_lexically_bound_p): New function.
16750 (Fload): Bind Qlexical_binding.
16751 (readevalloop): Remove `evalfun' arg.
16752 Bind Qinternal_interpreter_environment.
16753 (Feval_buffer): Bind Qlexical_binding.
16754 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16755 Mark as dynamic.
16756 (syms_of_lread): Declare `lexical-binding'.
16757
16758 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16759
16760 * keyboard.c (eval_dyn): New fun.
16761 (menu_item_eval_property): Use it.
16762
16763 * image.c (parse_image_spec): Use Ffunctionp.
16764
16765 * fns.c (concat, mapcar1): Accept byte-code-functions.
16766
16767 * eval.c (Fsetq): Handle lexical vars.
16768 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16769 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16770 (FletX, Flet): Obey lexical binding.
16771 (Fcommandp): Handle closures.
16772 (Feval): New `lexical' arg.
16773 (eval_sub): New function extracted from Feval. Use it almost
16774 everywhere where Feval was used. Look up vars in lexical env.
16775 Handle closures.
16776 (Ffunctionp): Move from subr.el.
16777 (Ffuncall): Handle closures.
16778 (apply_lambda): Remove `eval_flags'.
16779 (funcall_lambda): Handle closures and new byte-code-functions.
16780 (Fspecial_variable_p): New function.
16781 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16782 but without exporting it to Lisp.
16783
16784 * doc.c (Fdocumentation, store_function_docstring):
16785 * data.c (Finteractive_form): Handle closures.
16786
16787 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16788 interactive spec.
16789
16790 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16791 New byte-codes.
16792 (exec_byte_code): New function extracted from Fbyte_code to handle new
16793 calling convention for byte-code-functions. Add new byte-codes.
16794
16795 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16796
16797 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16798
16799 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16800
16801 * xdisp.c (redisplay_internal): Fix prototype.
16802
16803 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16804
16805 * xdisp.c (SCROLL_LIMIT): New macro.
16806 (try_scrolling): Use it when setting scroll_limit.
16807 Limit scrolling to 100 screen lines.
16808 (redisplay_window): Even when falling back on "recentering",
16809 position point in the window according to scroll-conservatively,
16810 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16811
16812 (try_scrolling): When point is above the window, allow searching
16813 as far as scroll_max, or one screenful, to compute vertical
16814 distance from PT to the scroll margin position. This prevents
16815 try_scrolling from unnecessarily failing when
16816 scroll-conservatively is set to a value slightly larger than the
16817 window height. Clean up the case of PT below the margin at bottom
16818 of window: scroll_max can no longer be INT_MAX. When aggressive
16819 scrolling is in use, don't let point enter the opposite scroll
16820 margin as result of the scroll.
16821 (syms_of_xdisp) <scroll-conservatively>: Document the
16822 threshold of 100 lines for never-recentering scrolling.
16823
16824 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16825
16826 * dispextern.h (move_it_by_lines):
16827 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16828 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16829 (message_log_check_duplicate): Remove parameters `prev_bol' and
16830 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16831 (redisplay_internal): Remove parameter `preserve_echo_area',
16832 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16833
16834 * indent.c (Fvertical_motion):
16835 * window.c (window_scroll_pixel_based, Frecenter):
16836 Don't pass `need_y_p' to `move_it_by_lines'.
16837
16838 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16839
16840 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16841 steal a few bits to be more compact.
16842 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16843 Remove unneeded casts.
16844
16845 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16846
16847 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16848
16849 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16850 binding" message (bug#7967).
16851
16852 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16853
16854 Fix more problems found by GCC 4.6.0's static checks.
16855
16856 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16857 Remove unused local var.
16858
16859 * editfns.c (Fmessage_box): Remove unused local var.
16860
16861 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16862 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16863 Omit unused local vars.
16864 * window.c (shrink_windows): Omit unused local var.
16865 * menu.c (digest_single_submenu): Omit unused local var.
16866 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16867 Omit unused local var.
16868
16869 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16870 Don't assume string length fits in int.
16871 (keyremap_step, read_key_sequence): Use size_t for sizes.
16872 (read_key_sequence): Don't check last_real_key_start redundantly.
16873
16874 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16875 instead of alloca (Bug#8344).
16876
16877 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16878 (Fbacktrace_frame): Don't assume nframes fits in int.
16879
16880 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16881
16882 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16883 concerns.
16884
16885 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16886
16887 * cm.c (calccost): Turn while-do into do-while, for clarity.
16888
16889 * keyboard.c (syms_of_keyboard): Use the same style as later
16890 in this function when indexing through an array. This also
16891 works around GCC bug 48267.
16892
16893 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16894
16895 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16896
16897 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16898 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16899
16900 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16901 This avoids undefined behavior on integer overflow, and is a bit
16902 more convenient anyway since it is compared to a size_t variable.
16903
16904 Variadic C functions now count arguments with size_t, not int.
16905 This avoids an unnecessary limitation on 64-bit machines, which
16906 caused (substring ...) to crash on large vectors (Bug#8344).
16907 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16908 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16909 All variadic functions and their callers changed accordingly.
16910 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16911 * data.c (arith_driver, float_arith_driver): Likewise.
16912 * editfns.c (general_insert_function): Likewise.
16913 * eval.c (struct backtrace.nargs, interactive_p)
16914 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16915 (funcall_lambda, mark_backtrace): Likewise.
16916 * fns.c (concat): Likewise.
16917 * frame.c (x_set_frame_parameters): Likewise.
16918 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16919 0 if not found, not -1. All callers changed.
16920
16921 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16922 (stack_copy_size): Now size_t, not int.
16923 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16924
16925 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16926
16927 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16928 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16929 All callers changed.
16930
16931 * lisp.h (multibyte_char_to_unibyte):
16932 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16933 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16934 * character.h (CHAR_TO_BYTE8):
16935 * cmds.c (internal_self_insert):
16936 * editfns.c (general_insert_function):
16937 * keymap.c (push_key_description):
16938 * search.c (Freplace_match):
16939 * xdisp.c (message_dolog, set_message_1): All callers changed.
16940
16941 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16942
16943 * keyboard.c (safe_run_hook_funcall): New function.
16944 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16945 don't set the hook to nil, but remove the offending function instead.
16946 (Qcommand_hook_internal): Remove, unused.
16947 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16948 Vcommand_hook_internal.
16949
16950 * eval.c (enum run_hooks_condition): Remove.
16951 (funcall_nil, funcall_not): New functions.
16952 (run_hook_with_args): Call each function through a `funcall' argument.
16953 Remove `cond' argument, now redundant.
16954 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16955 (Frun_hook_with_args_until_failure): Adjust accordingly.
16956 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16957
16958 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16959
16960 * dispextern.h (string_buffer_position): Remove declaration.
16961
16962 * print.c (strout): Remove parameter `multibyte', unused since
16963 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16964
16965 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16966 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16967 All callers changed.
16968
16969 * w32.c (_wsa_errlist): Use braces for struct initializers.
16970
16971 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16972 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16973 All callers changed.
16974 (string_buffer_position): Likewise. Also, make static (it's never
16975 used outside xdisp.c).
16976 (cursor_row_p): Remove parameter `w', unused since
16977 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16978 (decode_mode_spec): Remove parameter `precision', introduced during
16979 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16980 All callers changed.
16981
16982 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16983
16984 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16985
16986 2011-03-27 Anders Lindgren <andlind@gmail.com>
16987
16988 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16989 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16990 (ns_update_auto_hide_menu_bar): New functions.
16991 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16992 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16993 ns_constrain_all_frames.
16994 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16995 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16996
16997 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16998
16999 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17000
17001 2011-03-27 Glenn Morris <rgm@gnu.org>
17002
17003 * syssignal.h: Replace RETSIGTYPE with void.
17004 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17005 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17006 Replace SIGTYPE with void everywhere.
17007 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17008 * s/template.h (SIGTYPE): Remove commented out definition.
17009
17010 2011-03-26 Eli Zaretskii <eliz@gnu.org>
17011
17012 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17013 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17014
17015 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
17016
17017 * w32.c (read_unc_volume): Use parameter `henum', instead of
17018 global variable `wget_enum_handle'.
17019
17020 * keymap.c (describe_vector): Remove parameters `indices' and
17021 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17022 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17023
17024 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17025
17026 * keyboard.c (timer_check): Remove parameter `do_it_now',
17027 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17028 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17029 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17030
17031 * keyboard.c (read_char):
17032 * w32menu.c (w32_menu_display_help):
17033 * xmenu.c (show_help_event, menu_help_callback):
17034 Adjust calls to `show_help_echo'.
17035
17036 * gtkutil.c (xg_maybe_add_timer):
17037 * keyboard.c (readable_events):
17038 * process.c (wait_reading_process_output):
17039 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17040
17041 * insdel.c (adjust_markers_gap_motion):
17042 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17043 (gap_left, gap_right): Don't call it.
17044
17045 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
17046
17047 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17048 incurred during fontification.
17049
17050 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17051
17052 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17053 (DEFVAR_PER_BUFFER): Don't pass it.
17054
17055 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17056 (scrolling_window): Don't pass it.
17057
17058 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
17059
17060 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17061
17062 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17063 and `suffix'.
17064 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17065 of variables specific to SELinux and computation of `encoded_absname'.
17066
17067 * image.c (XPutPixel): Remove unused variable `height'.
17068
17069 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17070
17071 * unexw32.c (get_section_info): Remove unused variable `section'.
17072
17073 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17074 (system_process_attributes): Remove unused variable `sess'.
17075 (sys_read): Remove unused variable `err'.
17076
17077 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17078 (w32_wnd_proc): Remove unused variable `isdead'.
17079 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17080 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17081 (x_create_tip_frame): Remove unused variable `tem'.
17082
17083 * w32inevt.c (w32_console_read_socket):
17084 Remove unused variable `no_events'.
17085
17086 * w32term.c (x_draw_composite_glyph_string_foreground):
17087 Remove unused variable `width'.
17088
17089 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
17090
17091 * w32term.c (x_set_glyph_string_clipping):
17092 Don't pass uninitialized region to CombineRgn.
17093
17094 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
17095
17096 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17097 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17098 (Fx_close_connection): Remove unused variable `i'.
17099
17100 * w32font.c (w32font_draw): Return number of glyphs.
17101 (w32font_open_internal): Remove unused variable `i'.
17102 (w32font_driver): Add missing initializer.
17103
17104 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17105 (fill_in_menu): Remove unused variable `items_added'.
17106
17107 * w32term.c (last_mouse_press_frame): Remove static global variable.
17108 (w32_clip_to_row): Remove unused variable `f'.
17109 (x_delete_terminal): Remove unused variable `i'.
17110
17111 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17112 (NOTHING): Remove unused static global variable.
17113 (uniscribe_check_otf): Remove unused variable `table'.
17114 (uniscribe_font_driver): Add missing initializers.
17115
17116 2011-03-23 Julien Danjou <julien@danjou.info>
17117
17118 * term.c (Fsuspend_tty, Fresume_tty):
17119 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17120 * window.c (temp_output_buffer_show):
17121 * insdel.c (signal_before_change):
17122 * frame.c (Fhandle_switch_frame):
17123 * fileio.c (Fdo_auto_save):
17124 * emacs.c (Fkill_emacs):
17125 * editfns.c (save_excursion_restore):
17126 * cmds.c (internal_self_insert):
17127 * callint.c (Fcall_interactively):
17128 * buffer.c (Fkill_all_local_variables):
17129 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17130 Use Frun_hooks.
17131 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
17132 unconditionally since it does the check itself.
17133
17134 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
17135
17136 Fix more problems found by GCC 4.5.2's static checks.
17137
17138 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17139 the first time through the loop, since we know p0 < p1 then.
17140 This also avoids a gcc -Wstrict-overflow warning.
17141
17142 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17143 leading to a memory leak, possible in functions like
17144 load_charset_map_from_file that can allocate an unbounded number
17145 of objects (Bug#8318).
17146
17147 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17148 that could (at least in theory) be that large.
17149
17150 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17151 This is less likely to overflow, and avoids undefined behavior if
17152 overflow does occur. All callers changed. Use strtoul to scan
17153 for the unsigned long integer.
17154 (pint2hrstr): Simplify and tune code slightly.
17155 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
17156
17157 * scroll.c (do_scrolling): Work around GCC bug 48228.
17158 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17159
17160 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17161 This also avoids a warning with gcc -Wstrict-overflow.
17162 (validate_x_resource_name): Simplify count usage.
17163 This also avoids a warning with gcc -Wstrict-overflow.
17164
17165 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17166 fail (Bug#8306).
17167
17168 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
17169
17170 * process.c (Fmake_network_process): Use socklen_t, not int,
17171 where POSIX says socklen_t is required in portable programs.
17172 This fixes a porting bug on hosts like 64-bit HP-UX, where
17173 socklen_t is wider than int (Bug#8277).
17174 (Fmake_network_process, server_accept_connection):
17175 (wait_reading_process_output, read_process_output):
17176 Likewise.
17177
17178 * process.c: Rename or move locals to avoid shadowing.
17179 (list_processes_1, Fmake_network_process):
17180 (read_process_output_error_handler, exec_sentinel_error_handler):
17181 Rename or move locals.
17182 (Fmake_network_process): Define label "retry_connect" only if needed.
17183 (Fnetwork_interface_info): Fix pointer signedness.
17184 (process_send_signal): Add cast to avoid pointer signedness problem.
17185 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
17186 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
17187
17188 Make tparam.h and terminfo.c consistent.
17189 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17190 Include tparam.h instead, since it declares them.
17191 * cm.h (PC): Remove extern decl; tparam.h now does this.
17192 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17193 * terminfo.c: Include tparam.h, to check interfaces.
17194 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17195 (tparam): Adjust signature to match interface in tparam.h;
17196 this removes some undefined behavior. Check that outstring and len
17197 are zero, which they always are with Emacs.
17198 * tparam.h (PC, BC, UP): New extern decls.
17199
17200 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
17201 (xftfont_open): Rename locals to avoid shadowing.
17202
17203 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
17204 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17205 (OTF_TAG_SYM): Omit macro if not needed.
17206 (ftfont_list): Remove unused local.
17207 (get_adstyle_property, ftfont_pattern_entity):
17208 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17209 Rename locals to avoid shadowing.
17210
17211 * xfont.c (xfont_list_family): Mark var as initialized.
17212
17213 * xml.c (make_dom): Now static.
17214
17215 * composite.c (composition_compute_stop_pos): Rename local to
17216 avoid shadowing.
17217 (composition_reseat_it): Remove unused locals.
17218 (find_automatic_composition, composition_adjust_point): Likewise.
17219 (composition_update_it): Mark var as initialized.
17220 (find_automatic_composition): Mark vars as initialized,
17221 with a FIXME (Bug#8290).
17222
17223 character.h: Rename locals to avoid shadowing.
17224 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17225 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17226 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17227 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17228 to avoid shadowing.
17229
17230 * textprop.c (property_change_between_p): Remove; unused.
17231
17232 * intervals.c (interval_start_pos): Now static.
17233
17234 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17235
17236 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17237 Rename locals to avoid shadowing.
17238
17239 * sound.c (wav_play, au_play, Fplay_sound_internal):
17240 Fix pointer signedness.
17241 (alsa_choose_format): Remove unused local var.
17242 (wav_play): Initialize a variable to 0, to prevent undefined
17243 behavior (Bug#8278).
17244
17245 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17246
17247 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17248
17249 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17250 clobbering (Bug#8298).
17251 * sysdep.c (sys_subshell): Likewise.
17252 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
17253
17254 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17255 This should get cleaned up, so that child_setup has the
17256 same signature on all platforms.
17257
17258 * callproc.c (call_process_cleanup): Now static.
17259 (relocate_fd): Rename locals to avoid shadowing.
17260
17261 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
17262
17263 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17264 not to be necessary, and produces flickering.
17265
17266 2011-03-20 Glenn Morris <rgm@gnu.org>
17267
17268 * config.in: Remove file.
17269
17270 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
17271
17272 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17273 are now in src/globals.h.
17274 (syms_of_minibuf): Remove spurious & from previous change.
17275
17276 2011-03-20 Leo Liu <sdl.web@gmail.com>
17277
17278 * minibuf.c (completing-read-function): New variable.
17279 (completing-read-default): Rename from completing-read.
17280 (completing-read): Call completing-read-function.
17281
17282 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17283
17284 * xfaces.c (Fx_load_color_file):
17285 Read color file from absolute filename (bug#8250).
17286
17287 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
17288
17289 * makefile.w32-in: Update dependencies.
17290
17291 2011-03-17 Eli Zaretskii <eliz@gnu.org>
17292
17293 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17294
17295 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17296
17297 Fix more problems found by GCC 4.5.2's static checks.
17298
17299 * process.c (make_serial_process_unwind, send_process_trap):
17300 (sigchld_handler): Now static.
17301
17302 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17303 That way, the code declares only the vars that it needs.
17304 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17305 * s/cygwin.h (PTY_ITERATION): Likewise.
17306 * s/darwin.h (PTY_ITERATION): Likewise.
17307 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17308
17309 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17310 * process.c (allocate_pty): Don't declare stb unless it's needed.
17311
17312 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
17313 (CONSTANTLIM): Remove; unused.
17314 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17315 Define only if needed.
17316
17317 * unexelf.c (unexec): Name an expression,
17318 to avoid gcc -Wbad-function-cast warning.
17319 Use a different way to cause a compilation error if anyone uses
17320 n rather than nn, a way that does not involve shadowing.
17321 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
17322
17323 * deps.mk (unexalpha.o): Remove; unused.
17324
17325 New file unexec.h, the (simple) interface for unexec (Bug#8267).
17326 * unexec.h: New file.
17327 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17328 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17329 Depend on unexec.h.
17330 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17331 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17332 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
17333 Change as necessary to match prototype in unexec.h.
17334
17335 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17336 shadowing.
17337 (back_comment, skip_chars): Mark vars as initialized.
17338
17339 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17340 Rename locals to avoid shadowing.
17341
17342 * lread.c (read1): Rewrite so as not to use empty "else".
17343 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
17344
17345 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17346
17347 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17348 warning when compiling print.c.
17349
17350 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17351 instead of using an uninitialized var.
17352 (font_sort_entities): Mark var as initialized.
17353
17354 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17355
17356 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17357 pointers to constants.
17358 (font_parse_fcname): Remove unused vars.
17359 (font_delete_unmatched): Now static.
17360 (font_get_spec): Remove; unused.
17361 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17362 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17363 Rename or move locals to avoid shadowing.
17364
17365 * fns.c (require_nesting_list, require_unwind): Now static.
17366 (Ffillarray): Rename locals to avoid shadowing.
17367
17368 * floatfns.c (domain_error2): Define only if needed.
17369 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
17370
17371 * alloc.c (mark_backtrace): Move decl from here ...
17372 * lisp.h: ... to here, so that it can be checked.
17373
17374 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
17375 (Fdefvar): Rewrite so as not to use empty "else".
17376 (lisp_indirect_variable): Name an expression,
17377 to avoid gcc -Wbad-function-cast warning.
17378 (Fdefvar): Rename locals to avoid shadowing.
17379
17380 * callint.c (quotify_arg, quotify_args): Now static.
17381 (Fcall_interactively): Rename locals to avoid shadowing.
17382 Use const pointer when appropriate.
17383
17384 * lisp.h (get_system_name, get_operating_system_release):
17385 Move decls here, to check interfaces.
17386 * process.c (get_operating_system_release): Move decl to lisp.h.
17387 * xrdb.c (get_system_name): Likewise.
17388 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17389 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17390 some of which prompt warnings from gcc -Wbad-function-cast.
17391 (Fformat_time_string, Fencode_time, Finsert_char):
17392 (Ftranslate_region_internal, Fformat):
17393 Rename or remove local vars to avoid shadowing.
17394 (Ftranslate_region_internal): Mark var as initialized.
17395
17396 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17397 avoid shadowing.
17398
17399 * lisp.h (eassert): Check that the argument compiles, even if
17400 ENABLE_CHECKING is not defined.
17401
17402 * data.c (Findirect_variable): Name an expression, to avoid
17403 gcc -Wbad-function-cast warning.
17404 (default_value, arithcompare, arith_driver, arith_error): Now static.
17405 (store_symval_forwarding): Rename local to avoid shadowing.
17406 (Fmake_variable_buffer_local, Fmake_local_variable):
17407 Mark variables as initialized.
17408 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
17409
17410 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
17411 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17412 Rename locals to avoid shadowing.
17413 (mark_stack): Move local variables into the #ifdef region where
17414 they're used.
17415 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17416 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17417 needed otherwise.
17418 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17419 (GC_STRING_CHARS): Remove; not used.
17420 (Fmemory_limit): Cast sbrk's returned value to char *.
17421
17422 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17423 avoids undefined behavior in theory.
17424
17425 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17426
17427 Use functions, not macros, for up- and down-casing (Bug#8254).
17428 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17429 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17430 to use the following functions instead of these macros.
17431 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17432 EMACS_INT, since callers assume the returned value fits in int.
17433 (upcase1): Likewise, for UPCASE_TABLE.
17434 (uppercasep, lowercasep, upcase): New static inline functions.
17435 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
17436 the race-condition problem in the old DOWNCASE.
17437
17438 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17439 Rename locals to avoid shadowing.
17440 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
17441 (regex_compile, re_search_2, re_match_2_internal):
17442 Remove unused local vars.
17443 (FREE_VAR): Rewrite so as not to use empty "else",
17444 which gcc can warn about.
17445 (regex_compile, re_match_2_internal): Mark locals as initialized.
17446 (RETALLOC_IF): Define only if needed.
17447 (WORDCHAR_P): Likewise. This one is never needed, but is used
17448 only in a comment talking about a compiler bug, so put inside
17449 the #if 0 of that comment.
17450 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17451 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17452 Remove; unused.
17453
17454 * search.c (boyer_moore): Rename locals to avoid shadowing.
17455 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17456 (PREV_CHAR_BOUNDARY): Likewise.
17457
17458 * search.c (simple_search): Remove unused var.
17459
17460 * dired.c (compile_pattern): Move decl from here ...
17461 * lisp.h: ... to here, so that it can be checked.
17462 (struct re_registers): New forward decl.
17463
17464 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17465
17466 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17467 All uses changed.
17468 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17469 Rename locals to avoid shadowing.
17470 (Fvertical_motion): Mark locals as initialized.
17471
17472 * casefiddle.c (casify_object, casify_region): Now static.
17473 (casify_region): Mark local as initialized.
17474
17475 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17476
17477 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17478 New macros, so that the caller can use some names other than
17479 gcpro1, gcpro2, etc.
17480 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17481 of the new macros.
17482 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17483 argument, for consistency with GCPRO2_VAR, etc: it is now the
17484 prefix of the variable, not the variable itself. All uses
17485 changed.
17486 * dired.c (directory_files_internal, file_name_completion):
17487 Rename locals to avoid shadowing.
17488
17489 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17490 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17491 dired.c's scmp function, had undefined behavior.
17492 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17493 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17494 * buffer.h: ... to here, because these macros use current_buffer,
17495 and the new implementation with inline functions needs to have
17496 current_buffer in scope now, rather than later when the macros
17497 are used.
17498 (downcase, upcase1): New static inline functions.
17499 (DOWNCASE, UPCASE1): Reimplement using these functions.
17500 This avoids undefined behavior in expressions like
17501 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17502 from race conditions in accessing the global variables
17503 case_temp1 and case_temp2.
17504 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17505 * lisp.h (case_temp1, case_temp2): Remove their decls.
17506 * character.h (ASCII_CHAR_P): Move from here ...
17507 * lisp.h: ... to here, so that the inline functions mentioned
17508 above can use them.
17509
17510 * dired.c (directory_files_internal_unwind): Now static.
17511
17512 * fileio.c (file_name_as_directory, directory_file_name):
17513 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17514 Now static.
17515 (file_name_as_directory): Use const pointers when appropriate.
17516 (Fexpand_file_name): Likewise. In particular, newdir might
17517 point at constant storage, so make it a const pointer.
17518 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
17519 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17520 signedness issues.
17521 (Fset_file_times, Finsert_file_contents, auto_save_error):
17522 Rename locals to avoid shadowing.
17523
17524 * minibuf.c (choose_minibuf_frame_1): Now static.
17525 (Ftry_completion, Fall_completions): Rename or remove locals
17526 to avoid shadowing.
17527
17528 * marker.c (bytepos_to_charpos): Remove; unused.
17529
17530 * lisp.h (verify_bytepos, count_markers): New decls,
17531 so that gcc does not warn that these functions aren't declared.
17532
17533 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17534 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
17535 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
17536 (copy_text): Remove unused local var.
17537
17538 * filelock.c (within_one_second): Now static.
17539 (lock_file_1): Rename local to avoid shadowing.
17540
17541 * buffer.c (fix_overlays_before): Mark locals as initialized.
17542 (fix_start_end_in_overlays): Likewise. This function should be
17543 simplified by using pointers-to-pointers, but that's a different
17544 matter.
17545 (switch_to_buffer_1): Now static.
17546 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17547 (report_overlay_modification): Rename locals to avoid shadowing.
17548
17549 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17550 Fix pointer signedness issue.
17551 (sys_subshell): Mark local as volatile if checking for lint,
17552 to suppress a gcc -Wclobbered warning that does not seem to be right.
17553 (MAXPATHLEN): Define only if needed.
17554
17555 * process.c (serial_open, serial_configure): Move decls from here ...
17556 * systty.h: ... to here, so that they can be checked.
17557
17558 * fns.c (get_random, seed_random): Move extern decls from here ...
17559 * lisp.h: ... to here, so that they can be checked.
17560
17561 * sysdep.c (reset_io): Now static.
17562 (wait_for_termination_signal): Remove; unused.
17563
17564 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17565 (copy_keymap_item, append_key, push_text_char_description):
17566 Now static.
17567 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17568 (DENSE_TABLE_SIZE): Remove; unused.
17569 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17570 (describe_map_tree):
17571 Rename locals to avoid shadowing.
17572
17573 * keyboard.c: Declare functions static if they are not used elsewhere.
17574 (echo_char, echo_dash, cmd_error, top_level_2):
17575 (poll_for_input, handle_async_input): Now static.
17576 (read_char, kbd_buffer_get_event, make_lispy_position):
17577 (make_lispy_event, make_lispy_movement, apply_modifiers):
17578 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17579 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17580 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17581 (read_key_sequence, read_char): Mark locals as initialized.
17582 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17583
17584 * keyboard.h (make_ctrl_char): New decl.
17585 (mark_kboards): Move decl here ...
17586 * alloc.c (mark_kboards): ... from here.
17587
17588 * lisp.h (force_auto_save_soon): New decl.
17589
17590 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17591 (DEFINE_DUMMY_FUNCTION): New macro.
17592 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17593 Use it.
17594 (main): Add casts to avoid warnings
17595 if GCC considers string literals to be constants.
17596
17597 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17598
17599 * dbusbind.c: Pointer signedness fixes.
17600 (xd_signature, xd_append_arg, xd_initialize):
17601 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17602 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17603 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17604 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17605
17606 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17607 if GCC considers string literals to be constants.
17608 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17609
17610 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17611
17612 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17613 (print_preprocess, print_object): New macro to fix last change.
17614
17615 * print.c (print_preprocess): Don't forget font objects.
17616
17617 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17618
17619 * emacs.c (USAGE3): Doc fixes.
17620
17621 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17622
17623 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17624 structure.
17625
17626 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17627
17628 * lisp.h (VWindow_system, Qfile_name_history):
17629 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17630 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17631 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17632
17633 * w32select.c: Don't #include "keyboard.h".
17634 (run_protected): Add extern declaration for waiting_for_input.
17635
17636 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17637 * w32console.c (detect_input_pending, read_input_pending)
17638 (encode_terminal_code):
17639 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17640 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17641 (w32_system_caret_y, Qfile_name_history):
17642 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17643 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17644 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17645 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17646 * w32proc.c (Qlocal, report_file_error):
17647 * w32term.c (Vwindow_system, updating_frame):
17648 * w32uniscribe.c (initialized, uniscribe_font_driver):
17649 Remove unneeded extern declarations.
17650
17651 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17652
17653 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17654
17655 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17656
17657 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17658 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17659 These macros can no longer be used for assignment.
17660
17661 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17662 Assign struct members directly, instead of using BUF_BEGV etc.
17663 (record_buffer_markers, fetch_buffer_markers): New functions for
17664 recording and fetching special buffer markers.
17665 (set_buffer_internal_1, set_buffer_temp): Use them.
17666
17667 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17668
17669 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17670
17671 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17672 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17673
17674 * xdisp.c (hscroll_window_tree):
17675 (reconsider_clip_changes): Use PT instead of BUF_PT.
17676
17677 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17678
17679 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17680 $(EMACS_ROOT)/lib/intprops.h.
17681
17682 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17683
17684 Fix more problems found by GCC 4.5.2's static checks.
17685
17686 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17687 to unsigned char * to avoid compiler diagnostic.
17688 (xg_free_frame_widgets): Make it clear that a local variable is
17689 needed only if USE_GTK_TOOLTIP.
17690 (gdk_window_get_screen): Make it clear that this macro is needed
17691 only if USE_GTK_TOOLTIP.
17692 (int_gtk_range_get_value): New function, which avoids a diagnostic
17693 from gcc -Wbad-function-cast.
17694 (xg_set_toolkit_scroll_bar_thumb): Use it.
17695 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17696 diagnostic from gcc -Wbad-function-cast.
17697 (get_utf8_string, xg_get_file_with_chooser):
17698 Rename locals to avoid shadowing.
17699 (create_dialog): Move locals to avoid shadowing.
17700
17701 * xgselect.c (xg_select): Remove unused var.
17702
17703 * image.c (four_corners_best): Mark locals as initialized.
17704 (gif_load): Initialize transparent_p to zero (Bug#8238).
17705 Mark another local as initialized.
17706 (my_png_error, my_error_exit): Mark with NO_RETURN.
17707
17708 * image.c (clear_image_cache): Now static.
17709 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17710 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17711 (x_edge_detection): Remove unnecessary cast that
17712 gcc -Wbad-function-cast diagnoses.
17713 (gif_load): Fix pointer signedness.
17714 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17715 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17716
17717 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17718
17719 Improve quality of tests for time stamp overflow.
17720 For example, without this patch (encode-time 0 0 0 1 1
17721 1152921504606846976) returns the obviously-bogus value (-948597
17722 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17723 reports time overflow. See
17724 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17725 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17726 * editfns.c: Include limits.h and intprops.h.
17727 (TIME_T_MIN, TIME_T_MAX): New macros.
17728 (time_overflow): Move earlier, to before first use.
17729 (hi_time, lo_time): New functions, for an accurate test for
17730 out-of-range times.
17731 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17732 (Fget_internal_run_time): Don't assume time_t fits in int.
17733 (make_time): Use list2 instead of Fcons twice.
17734 (Fdecode_time): More accurate test for out-of-range times.
17735 (check_tm_member): New function.
17736 (Fencode_time): Use it, to test for out-of-range times.
17737 (lisp_time_argument): Don't rely on undefined left-shift and
17738 right-shift behavior when checking for time stamp overflow.
17739
17740 * editfns.c (time_overflow): New function, refactoring common code.
17741 (Fformat_time_string, Fdecode_time, Fencode_time):
17742 (Fcurrent_time_string): Use it.
17743
17744 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17745 * dired.c (make_time): Move to ...
17746 * editfns.c (make_time): ... here.
17747 * systime.h: Note the move.
17748
17749 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17750
17751 * fringe.c (update_window_fringes): Remove unused variables.
17752
17753 * unexmacosx.c (copy_data_segment): Also copy __got section.
17754 (Bug#8223)
17755
17756 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17757
17758 * termcap.c [MSDOS]: Include "msdos.h".
17759 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17760 Constify `char *' arguments and their references according to
17761 prototypes in tparam.h.
17762
17763 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17764
17765 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17766 Adapt all references accordingly.
17767
17768 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17769
17770 2011-03-11 Tom Tromey <tromey@redhat.com>
17771
17772 * buffer.c (syms_of_buffer): Remove obsolete comment.
17773
17774 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17775
17776 * termhooks.h (encode_terminal_code): Declare prototype.
17777
17778 * msdos.c (encode_terminal_code): Don't declare prototype.
17779
17780 * term.c (encode_terminal_code): Now external again, used by
17781 w32console.c and msdos.c.
17782
17783 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17784 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17785
17786 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17787
17788 Fix some minor problems found by GCC 4.5.2's static checks.
17789
17790 * fringe.c (update_window_fringes): Mark locals as initialized
17791 (Bug#8227).
17792 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17793
17794 * alloc.c (mark_fringe_data): Move decl from here ...
17795 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17796 to check its interface.
17797 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17798
17799 * fontset.c (free_realized_fontset): Now static.
17800 (Fset_fontset_font): Rename local to avoid shadowing.
17801 (fontset_font): Mark local as initialized.
17802 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17803
17804 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17805
17806 * xselect.c (x_disown_buffer_selections): Remove; not used.
17807 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17808 (x_own_selection, Fx_disown_selection_internal): Rename locals
17809 to avoid shadowing.
17810 (x_handle_dnd_message): Remove local to avoid shadowing.
17811
17812 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17813 so that the caller can use some name other than gcpro1.
17814 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17815 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17816 (Fx_backspace_delete_keys_p):
17817 Use them to avoid shadowing, and rename vars to avoid shadowing.
17818 (x_decode_color, x_set_name, x_window): Now static.
17819 (Fx_create_frame): Add braces to silence GCC warning.
17820 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17821 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17822 Remove unused locals.
17823 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17824 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17825 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17826 macros.
17827
17828 * xterm.h (x_mouse_leave): New decl.
17829
17830 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17831 Remove unused functions.
17832 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17833 (x_calc_absolute_position): Now static.
17834 (XTread_socket): Don't define label "out" unless it's used.
17835 Don't declare local "event" unless it's used.
17836 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17837 unless they are used.
17838 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17839 (x_fatal_error_signal): Remove; not used.
17840 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17841 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17842 (x_error_catcher, x_connection_closed, x_error_handler):
17843 (x_error_quitter, xembed_send_message, x_iconify_frame):
17844 (my_log_handler): Rename locals to avoid shadowing.
17845 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17846 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17847
17848 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17849 Rename or move locals to avoid shadowing.
17850 (tty_defined_color, merge_face_heights): Now static.
17851 (free_realized_faces_for_fontset): Remove; not used.
17852 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17853 does not deduce is never used uninitialized.
17854 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17855 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17856
17857 * terminal.c (store_terminal_param): Now static.
17858
17859 * xmenu.c (menu_highlight_callback): Now static.
17860 (set_frame_menubar): Remove unused local.
17861 (xmenu_show): Rename parameter to avoid shadowing.
17862 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17863 since they might point to immutable storage.
17864 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17865 since it's unused otherwise.
17866
17867 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17868 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17869 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17870 avoids a gcc -Wuninitialized diagnostic.
17871 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17872 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17873 does not deduce are never used uninitialized.
17874
17875 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17876
17877 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17878 * window.c (window_loop, size_window):
17879 (run_window_configuration_change_hook, enlarge_window): Likewise.
17880
17881 * window.c (display_buffer): Now static.
17882 (size_window): Mark variables that gcc -Wuninitialized
17883 does not deduce are never used uninitialized.
17884 * window.h (check_all_windows): New decl, to forestall
17885 gcc -Wmissing-prototypes diagnostic.
17886 * dispextern.h (bidi_dump_cached_states): Likewise.
17887
17888 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17889 shadowing.
17890 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17891 Include <limits.h>.
17892 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17893 and to avoid gcc -Wuninitialized warning.
17894 (load_charset_map): Mark variables that gcc -Wuninitialized
17895 does not deduce are never used uninitialized.
17896 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17897
17898 * coding.c (coding_set_source, coding_set_destination):
17899 Use "else { /* comment */ }" rather than "else /* comment */;"
17900 for clarity, and to avoid gcc -Wempty-body warning.
17901 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17902 a block, when the outer 'i' will do.
17903 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17904 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17905 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17906 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17907 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17908 Rename locals to avoid shadowing.
17909 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17910 * coding.c (emacs_mule_char, encode_invocation_designation):
17911 Now static, since they're not used elsewhere.
17912 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17913 (decode_coding_object, encode_coding_object, detect_coding_system):
17914 (decode_coding_emacs_mule): Mark variables that gcc
17915 -Wuninitialized does not deduce are never used uninitialized.
17916 (detect_coding_iso_2022): Initialize a local variable that might
17917 be used uninitialized. Leave a FIXME because it's not clear that
17918 this initialization is needed. (Bug#8211)
17919 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17920 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17921 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17922 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17923 Remove unused macros.
17924
17925 * category.c (hash_get_category_set): Remove unused local var.
17926 (copy_category_table): Now static, since it's not used elsewhere.
17927 * character.c (string_count_byte8): Likewise.
17928
17929 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17930 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17931
17932 * chartab.c (copy_sub_char_table): Now static, since it's not used
17933 elsewhere.
17934 (sub_char_table_ref_and_range, char_table_ref_and_range):
17935 Rename locals to avoid shadowing.
17936 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17937
17938 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17939 (BIDI_BOB): Remove unused macro.
17940
17941 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17942 deduce are never used uninitialized.
17943 * term.c (encode_terminal_code): Likewise.
17944
17945 * term.c (encode_terminal_code): Now static. Remove unused local.
17946
17947 * tparam.h: New file.
17948 * term.c, tparam.h: Include it.
17949 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17950 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17951 Move these decls to tparam.h, and make them agree with what
17952 is actually in tparam.c. The previous trick of using incompatible
17953 decls in different modules does not conform to the C standard.
17954 All callers of tparam changed to use tparam's actual API.
17955 * tparam.c (tparam1, tparam, tgoto):
17956 Use const pointers where appropriate.
17957
17958 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17959 * cm.h (struct cm): Likewise.
17960 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17961 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17962 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17963 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17964 (turn_on_face, init_tty): Likewise.
17965 * termchar.h (struct tty_display_info): Likewise.
17966
17967 * term.c (term_mouse_position): Rename local to avoid shadowing.
17968
17969 * alloc.c (mark_ttys): Move decl from here ...
17970 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17971
17972 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17973
17974 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17975
17976 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17977
17978 * search.c (compile_pattern_1): Remove argument regp, unused since
17979 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17980 (compile_pattern): Don't pass it.
17981
17982 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17983
17984 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17985 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17986 for ! HAVE_GTK3.
17987 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17988
17989 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17990
17991 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17992 gdk_window_get_screen, gdk_window_get_geometry,
17993 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17994 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17995 (xg_get_pixbuf_from_pixmap): New function.
17996 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17997 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17998 Call xg_get_pixbuf_from_pixmap instead of
17999 gdk_pixbuf_get_from_drawable.
18000 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18001 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18002 (xg_check_special_colors): Use GtkStyleContext and its functions
18003 for HAVE_GTK3.
18004 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18005 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18006 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
18007 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18008 Call gtk_widget_get_preferred_size.
18009 (xg_frame_resized): gdk_window_get_geometry only takes 5
18010 parameters.
18011 (xg_win_to_widget, xg_event_is_for_menubar):
18012 Call gdk_x11_window_lookup_for_display.
18013 (xg_set_widget_bg): New function.
18014 (delete_cb): New function.
18015 (xg_create_frame_widgets): Connect delete-event to delete_cb.
18016 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
18017 (xg_set_background_color): Call xg_set_widget_bg.
18018 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18019 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18020 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18021 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18022 if ! HAVE_GTK3.
18023 (update_frame_tool_bar): Call gtk_widget_hide.
18024 (xg_initialize): Use GDK_KEY_g.
18025
18026 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18027 if ! HAVE_GTK3
18028 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18029
18030 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18031 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18032 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18033
18034 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
18035
18036 * w32xfns.c (select_palette): Check success of RealizePalette against
18037 GDI_ERROR, not zero.
18038
18039 See ChangeLog.11 for earlier changes.
18040
18041 ;; Local Variables:
18042 ;; coding: utf-8
18043 ;; End:
18044
18045 Copyright (C) 2011-2012 Free Software Foundation, Inc.
18046
18047 This file is part of GNU Emacs.
18048
18049 GNU Emacs is free software: you can redistribute it and/or modify
18050 it under the terms of the GNU General Public License as published by
18051 the Free Software Foundation, either version 3 of the License, or
18052 (at your option) any later version.
18053
18054 GNU Emacs is distributed in the hope that it will be useful,
18055 but WITHOUT ANY WARRANTY; without even the implied warranty of
18056 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18057 GNU General Public License for more details.
18058
18059 You should have received a copy of the GNU General Public License
18060 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.