Merge profiler branch
[bpt/emacs.git] / src / ChangeLog
CommitLineData
3a880af4
SM
12012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2 Stefan Monnier <monnier@iro.umontreal.ca>
3 Juanma Barranquero <lekktu@gmail.com>
611b7507 4
3a880af4
SM
5 * profiler.c: New file.
6 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
7 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
8 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
9 * emacs.c (main): Call syms_of_profiler.
10 * alloc.c (Qautomatic_gc): New constant.
11 (MALLOC_PROBE): New macro.
12 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
13 (total_bytes_of_live_objects): New function.
14 (Fgarbage_collect): Use it. Record itself in backtrace_list.
15 Call malloc_probe for the memory profiler.
16 (syms_of_alloc): Define Qautomatic_gc.
17 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
18 race condition.
19 (struct backtrace): Move definition...
20 * lisp.h (struct backtrace): ..here.
21 (Qautomatic_gc, profiler_memory_running): Declare vars.
22 (malloc_probe, syms_of_profiler): Declare functions.
23 * xdisp.c (Qautomatic_redisplay): New constant.
24 (redisplay_internal): Record itself in backtrace_list.
25 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 26
b67238c2
JB
272012-09-25 Juanma Barranquero <lekktu@gmail.com>
28
29 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
30
e26fd2e4
PE
312012-09-25 Paul Eggert <eggert@cs.ucla.edu>
32
33 Prefer POSIX timers if available.
34 They avoid a race if the timer is too close to the current time.
35 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
36 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 37 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 38
eedec3ee
EZ
392012-09-25 Eli Zaretskii <eliz@gnu.org>
40
41 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
42 CHAR_STRING_ADVANCE.
43 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
44 STRING_CHAR_ADVANCE.
45
aa15c6bb
JB
462012-09-25 Juanma Barranquero <lekktu@gmail.com>
47
48 Move Vlibrary_cache to emacs.c and reset before dumping.
49
50 * lisp.h (reset_image_types): Declare.
51 [WINDOWSNT] (Vlibrary_cache): Declare.
52
53 * image.c (reset_image_types): New function.
54
55 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
56 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
57 (Fdump_emacs): Reset Vlibrary_cache and image_types.
58
59 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
60 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
61
62 * w32.h (Vlibrary_cache): Do not declare.
63
54d629be
EZ
642012-09-25 Eli Zaretskii <eliz@gnu.org>
65
16b22fef
EZ
66 * w32proc.c (sys_signal): Handle all signals defined by the
67 MS-Windows runtime, not just SIGCHLD. Actually install the signal
68 handlers for signals supported by Windows. Don't override
69 term_ntproc as the handler for SIGABRT.
70 (sigaction): Rewrite to call sys_signal instead of duplicating its
71 code.
72 (sys_kill): Improve commentary.
73
74 * w32.c (term_ntproc): Accept (and ignore) one argument, for
75 consistency with a signature of a signal handler. All callers
76 changed.
77 (init_ntproc): Accept an argument DUMPING. If dumping, don't
78 install term_ntproc as a signal handler for SIGABRT, as that
79 should be done by the dumped Emacs.
80
81 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
82
83 * w32select.c (term_w32select): Protect against repeated
84 invocation by setting clipboard_owner to NULL after calling
85 DestroyWindow.
86
87 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
88 and term_ntproc to their modified signatures.
89
54d629be
EZ
90 * character.c (char_string, string_char): Remove calls to
91 MAYBE_UNIFY_CHAR. See the discussion starting at
92 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
93 for the details.
94
59f7af81
CY
952012-09-25 Chong Yidong <cyd@gnu.org>
96
97 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
98
22e8cf4a
SM
992012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
100
101 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
102 when encountering an unknown bytecode.
103
578098f3
PE
1042012-09-24 Paul Eggert <eggert@cs.ucla.edu>
105
106 image.c, indent.c: Use bool for booleans.
107 * dispextern.h (struct image_type): Members valid_p, load, init
108 now return bool, not int. All uses changed.
109 * image.c: Omit unnecessary static decls.
110 (x_create_bitmap_mask, x_build_heuristic_mask):
111 Return void, not int, since callers don't care about the return value.
112 (x_create_bitmap_mask, define_image_type, valid_image_p)
113 (struct image_keyword, parse_image_spec, image_spec_value)
114 (check_image_size, image_background)
115 (image_background_transparent, x_clear_image_1)
116 (postprocess_image, lookup_image, x_check_image_size)
117 (x_create_x_image_and_pixmap, xbm_image_p)
118 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
119 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
120 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
121 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
122 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
123 (png_image_p, init_png_functions, png_load_body, png_load)
124 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
125 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
126 (init_gif_functions, gif_load, imagemagick_image_p)
127 (imagemagick_load_image, imagemagick_load, svg_image_p)
128 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
129 (gs_load):
130 * nsimage.m (ns_load_image):
131 * nsterm.m (ns_defined_color):
132 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
133 * xfns.c (x_defined_color):
134 * xterm.c (x_alloc_lighter_color_for_widget)
135 (x_alloc_nearest_color_1, x_alloc_nearest_color)
136 (x_alloc_lighter_color):
137 * indent.c (disptab_matches_widthtab, current_column)
138 (scan_for_column, string_display_width, indented_beyond_p)
139 (compute_motion, vmotion, Fvertical_motion):
140 Use bool for booleans.
141
a5f2b6ec
CY
1422012-09-24 Chong Yidong <cyd@gnu.org>
143
144 * chartab.c (Fset_char_table_default): Obsolete function removed.
145
18e27ea8
PE
1462012-09-23 Paul Eggert <eggert@cs.ucla.edu>
147
afea8a8a
PE
148 Move pid_t related decls out of lisp.h.
149 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
150 (interruptible_wait_for_termination):
151 Move these decls from lisp.h to syswait.h, since they use pid_t.
152 Needed on FreeBSD; see Herbert J. Skuhra in
153 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
154 * callproc.c: Include syswait.h.
155
18e27ea8
PE
156 gnutls.c, gtkutil.c: Use bool for boolean.
157 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
158 (emacs_gnutls_handle_error):
159 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
160 (xg_hide_tooltip, xg_create_frame_widgets)
161 (create_dialog, xg_uses_old_file_dialog)
162 (xg_get_file_with_chooser, xg_get_file_with_selection)
163 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
164 (xg_item_label_same_p, xg_update_menubar)
165 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
166 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
167 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
168 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
169 (update_frame_tool_bar, free_frame_tool_bar):
170 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
171 * nsmenu.m (ns_update_menubar):
172 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
173 * xfns.c (Fx_show_tip) [USE_GTK]:
174 Use bool for boolean.
175 * gtkutil.c (xg_update_frame_menubar):
176 * xmenu.c (update_frame_menubar):
177 Return void, not int, since caller ignores return value.
178 * gtkutil.c (xg_change_toolbar_position):
179 Return void, not 1.
180
af0e9f75
JB
1812012-09-23 Juanma Barranquero <lekktu@gmail.com>
182
183 * makefile.w32-in (BLOCKINPUT_H): Remove.
184 (SYSSIGNAL_H): New macro.
185 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
186 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
187 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
188 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
189 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
190 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
191 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
192 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
193 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
194 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
195 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
196 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
197 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
198 ($(BLD)/w32xfns.$(O)): Update dependencies.
199
5101529e
EZ
2002012-09-23 Eli Zaretskii <eliz@gnu.org>
201
202 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
203 fatal_error_backtrace.
204
205 * w32proc.c (sys_kill): Undo last change: don't do anything when
206 invoked to deliver SIGABRT to our own process. This is now
207 handled by emacs_raise.
208
2c3ee0ad
JB
2092012-09-23 Juanma Barranquero <lekktu@gmail.com>
210
211 * w32term.c (w32_read_socket): Remove leftover reference to
212 interrupt_input_pending.
213
62a1d661
PE
2142012-09-23 Paul Eggert <eggert@cs.ucla.edu>
215
216 Do not use SA_NODEFER.
217 Problem reported by Dani Moncayo in
218 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
219 * alloc.c (die):
220 * sysdep.c (emacs_abort): Do not reset signal handler.
221 * emacs.c (terminate_due_to_signal): Reset signal handler here.
222 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
223 wanted even on POSIXish hosts, and it doesn't work on Windows.
224
a0942b9a
JD
2252012-09-23 Jan Djärv <jan.h.d@swipnet.se>
226
227 * xterm.c (x_term_init): Call fixup_locale before and after calling
228 gtk_init (Bug#12392).
229
d07ff9db
CY
2302012-09-23 Chong Yidong <cyd@gnu.org>
231
232 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
233 Vdynamic_library_alist.
234
235 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
236 (Fgnutls_available_p): Caller changed.
237
238 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
239 (Flibxml_parse_xml_region): Likewise.
240
241 * dispextern.h (struct image_type): Remove arg from init function.
242
243 * image.c (Finit_image_library, lookup_image_type)
244 (define_image_type): Remove now-unneeded second arg.
245 (init_xpm_functions, init_png_functions, init_jpeg_functions)
246 (init_tiff_functions, init_gif_functions, init_svg_functions):
247 Arglist and w32_delayed_load calling convention changed.
248 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 249 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 250
4d7e6e51
PE
2512012-09-23 Paul Eggert <eggert@cs.ucla.edu>
252
253 Simplify and avoid signal-handling races (Bug#12471).
254 * alloc.c (die):
255 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
256 Avoid recursive loop if there's a fatal error in the function itself.
257 * atimer.c (pending_atimers):
258 * blockinput.h: Don't include "atimer.h"; no longer needed.
259 (interrupt_input_pending): Remove. All uses removed.
260 pending_signals now counts both atimers and ordinary interrupts.
261 This is less racy than having three separate pending-signal flags.
262 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
263 (input_blocked_p):
264 Rename from their upper-case counterparts BLOCK_INPUT,
265 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
266 INPUT_BLOCKED_P, and turn into functions. All uses changed.
267 This makes it easier to access volatile variables more accurately.
268 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
269 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
270 that's more reliable if the code is buggy and sets
271 interrupt_input_blocked to a negative value. All uses changed.
272 * atimer.c (deliver_alarm_signal):
273 Remove. No need to deliver this to the parent; any thread can
274 handle this signal now. All uses replaced by underlying handler.
275 * atimer.c (turn_on_atimers):
276 * dispnew.c (handle_window_change_signal):
277 * emacs.c (handle_danger_signal):
278 * keyboard.c (kbd_buffer_get_event):
279 Don't reestablish signal handler; not needed with sigaction.
280 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
281 (UNBLOCK_INPUT_TO):
282 Rework to avoid unnecessary accesses to volatile variables.
283 (UNBLOCK_INPUT_TO): Now a function.
284 (totally_unblock_input, unblock_input): New decls.
285 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
286 (init_data): Remove. Necessary stuff now done in init_signal.
287 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
288 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
289 (fatal_error_code): Remove; no longer needed.
290 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
291 it doesn't always backtrace. All uses changed. No need to reset
292 signal to default, since sigaction and/or die does that for us now.
293 Use emacs_raise (FOO), not kill (getpid (), FOO).
294 (main): Check more-accurately whether we're dumping.
295 Move fatal-error setup to sysdep.c
296 * floatfns.c: Do not include "syssignal.h"; no longer needed.
297 * gtkutil.c (xg_get_file_name, xg_get_font):
298 Remove no-longer-needed signal-mask manipulation.
299 * keyboard.c, process.c (POLL_FOR_INPUT):
300 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
301 * keyboard.c (read_avail_input): Remove.
302 All uses replaced by gobble_input.
303 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
304 (kbd_buffer_store_event_hold, gobble_input):
305 (record_asynch_buffer_change) [USABLE_SIGIO]:
306 (store_user_signal_events):
307 No need to mess with signal mask.
308 (gobble_input): If blocking input and there are terminals, simply
309 set pending_signals to 1 and return. All hooks changed to not
310 worry about whether input is blocked.
311 (process_pending_signals): Clear pending_signals before processing
312 them, in case a signal comes in while we're processing.
313 By convention callers now test pending_signals before calling us.
314 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
315 New functions, to support changes to blockinput.h.
316 (handle_input_available_signal): Now extern.
317 (reinvoke_input_signal): Remove. All uses replaced by
318 handle_async_input.
319 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
320 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
321 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
322 Clear sigmask reliably, even if Fsignal returns, which it can.
323 Omit unnecessary accesses to volatile var.
324 (quit_throw_to_read_char): No need to restore sigmask.
325 * keyboard.c (gobble_input, handle_user_signal):
326 * process.c (wait_reading_process_output):
327 Call signal-handling code rather than killing ourselves.
328 * lisp.h: Include <float.h>, for...
329 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
330 (pending_signals): Now volatile.
331 (syms_of_data): Now const if IEEE floating point.
332 (handle_input_available_signal) [USABLE_SIGIO]:
333 (terminate_due_to_signal, record_child_status_change): New decls.
334 * process.c (create_process): Avoid disaster if memory is exhausted
335 while we're processing a vfork, by tightening the critical section
336 around the vfork.
337 (send_process_frame, process_sent_to, handle_pipe_signal)
338 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
339 ignores SIGPIPE.
340 (send_process): No need for setjmp/longjmp any more, since the
341 SIGPIPE stuff is now gone. Instead, report an error if errno
342 is EPIPE.
343 (record_child_status_change): Now extern. PID and W are now args.
344 Return void, not bool. All callers changed.
345 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
346 Remove. All uses removed. This bug should be fixed now in a
347 different way.
348 (wait_for_termination_1): Use waitpid rather than sigsuspend,
349 and record the child status change directly. This avoids the
350 need to futz with the signal mask.
351 (process_fatal_action): Move here from emacs.c.
352 (emacs_sigaction_flags): New function, containing
353 much of what used to be in emacs_sigaction_init.
354 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
355 caught by emacs, to make races less likely.
356 (deliver_process_signal): Rename from handle_on_main_thread.
357 All uses changed.
358 (BACKTRACE_LIMIT_MAX): Now at top level.
359 (thread_backtrace_buffer, threadback_backtrace_pointers):
360 New static vars.
361 (deliver_thread_signal, deliver_fatal_thread_signal):
362 New functions, for more-accurate delivery of thread-specific signals.
363 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
364 (deliver_arith_signal): Handle in this thread, not
365 in the main thread, since it's triggered by this thread.
366 (maybe_fatal_sig): New function.
367 (init_signals): New arg DUMPING so that we can be more accurate
368 about whether we're dumping. Caller changed.
369 Treat thread-specific signals differently from process-general signals.
370 Block all signals while handling fatal error; that's safer.
371 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
372 on IEEE hosts.
373 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
374 Ignore SIGPIPE unless batch.
375 (emacs_backtrace): Output backtrace for the appropriate thread,
376 which is not necessarily the main thread.
377 * syssignal.h: Include <stdbool.h>.
378 (emacs_raise): New macro.
379 * xterm.c (x_connection_signal): Remove; no longer needed
380 now that we use sigaction.
381 (x_connection_closed): No need to mess with sigmask now.
382 (x_initialize): No need to reset SIGPIPE handler here, since
383 init_signals does this for us now.
384
8f4635e9
JD
3852012-09-23 Jan Djärv <jan.h.d@swipnet.se>
386
387 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 388 background rect may be larger (Bug#12245).
8f4635e9 389
3296976d
CY
3902012-09-23 Chong Yidong <cyd@gnu.org>
391
392 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
393
d41e491e
PE
3942012-09-22 Paul Eggert <eggert@cs.ucla.edu>
395
396 * .gdbinit: Just stop at fatal_error_backtrace.
397 See Stefan Monnier's request in
398 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
399 Remove no-longer-used query of system type.
400
c88b867f
CY
4012012-09-22 Chong Yidong <cyd@gnu.org>
402
403 * search.c (Freplace_match): Doc fix (Bug#12325).
404
405 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
406
407 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
408 (Fline_end_position): Doc fix.
409
410 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
411
bb4d86b4
CY
4122012-09-22 Chong Yidong <cyd@gnu.org>
413
414 * dispextern.h (struct image_type): Add new slot, storing a type
415 initialization function.
416
417 * image.c (define_image_type): Call the image initializer function
418 if it is defined. Arguments and return value changed.
419 (valid_image_p, make_image): Callers changed.
420 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
421 (gif_type, imagemagick_type, svg_type, gs_type):
422 Add initialization functions.
bb4d86b4
CY
423 (Finit_image_library): Call lookup_image_type.
424 (CHECK_LIB_AVAILABLE): Macro deleted.
425 (lookup_image_type): Call define_image_type here, rather than via
426 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
427 (syms_of_image): Move define_image_type calls for xbm_type and
428 pbm_type to lookup_image_type.
429
df9685f3
EZ
4302012-09-22 Eli Zaretskii <eliz@gnu.org>
431
432 * keyboard.c (timer_check_2): Move calculation of 'timers' and
433 'idle_timers' from here ...
434 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
435 lists, to avoid infloops when the timer does something stupid,
436 like reinvoke itself with the same or smaller time-out.
437 (Bug#12447)
438
8e17c9ba
MR
4392012-09-22 Martin Rudalics <rudalics@gmx.at>
440
441 * window.c (Fsplit_window_internal): Handle only Qt value of
442 Vwindow_combination_limit separately.
443 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
444 (Vwindow_combination_limit): New default value.
445 Rewrite doc-string.
8e17c9ba 446
589bd69b
EZ
4472012-09-22 Eli Zaretskii <eliz@gnu.org>
448
449 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
450 the new overlay string. (Bug#10159)
451
01108e3f
PE
4522012-09-22 Paul Eggert <eggert@cs.ucla.edu>
453
454 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
455 or that fprintf is async-signal-safe. POSIX doesn't require
456 either assumption.
457
82f8cd94
CY
4582012-09-22 Chong Yidong <cyd@gnu.org>
459
460 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
461 (Bug#8207).
462
3cccbd87
KH
4632012-09-22 Kenichi Handa <handa@gnu.org>
464
465 * composite.c (composition_reseat_it): Handle the case that a
466 grapheme cluster is not covered by a single font (Bug#12352).
467
09c01941
CY
4682012-09-21 Chong Yidong <cyd@gnu.org>
469
470 * image.c (define_image_type): Avoid adding duplicate types to
471 image_types (Bug#12463). Suggested by Jörg Walter.
472
acfa068f 4732012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
474
475 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
476 (print_load_command_name): Add case LC_DATA_IN_CODE.
477 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
478
acfa068f 4792012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
480
481 * eval.c (Frun_hook_with_args_until_success)
482 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
483
acfa068f 4842012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
485
486 * fileio.c (Ffile_selinux_context): Only call freecon when
487 lgetfilecon succeeded.
488 (Fset_file_selinux_context): Likewise. (Bug#12444)
489
acfa068f 4902012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
491
492 * xdisp.c (try_window_reusing_current_matrix): Under bidi
493 reordering, locate the cursor by calling set_cursor_from_row; if
494 that fails, clear the desired glyph matrix before returning a
495 failure indication to the caller. Fixes leaving garbled display
496 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
497 (compute_stop_pos_backwards): Fix a typo that caused crashes while
498 scrolling through multibyte text.
aa36e4d2 499
e99f70c8
SM
5002012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
501
502 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
503 calling mark_vectorlike since that's the one that marks the window.
504 (mark_discard_killed_buffers): Mark the final cdr.
505 * window.h (struct window): Move prev/next_buffers to the
506 non-standard fields.
507 * window.c (make_window): Initialize prev/next_buffers manually.
508
f75beb47
PE
5092012-09-20 Paul Eggert <eggert@cs.ucla.edu>
510
511 Omit unused arg EXPECTED from socket hooks.
512 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
513 * nsterm.m (ns_term_init):
514 * termhooks.h (struct terminal.read_socket_hook):
515 * w32inevt.c (w32_console_read_socket):
516 * w32term.c (w32_read_socket):
517 * xterm.c (XTread_socket):
518 Omit unused arg EXPECTED. All callers changed.
519 (store_user_signal_events): Return void, not int, since callers no
520 longer care about the return value. All uses changed.
521
b019b76a
JB
5222012-09-20 Juanma Barranquero <lekktu@gmail.com>
523
524 * w32gui.h (XParseGeometry): Do not declare.
525
05642592
PE
5262012-09-19 Paul Eggert <eggert@cs.ucla.edu>
527
e4bce92a
PE
528 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
529 Ignore 'expected'. See Eli Zaretskii in
530 <http://bugs.gnu.org/12471#8> (last line).
531
05642592
PE
532 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
533 (XParseGeometry): Now static. Substitute extremal values for
534 values that are out of range.
535
e543ae91
JD
5362012-09-19 Jan Djärv <jan.h.d@swipnet.se>
537
538 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
539
540 * nsfns.m (XParseGeometry): Remove.
541 (Fx_create_frame): Call x_set_offset to correctly interpret
542 top_pos in geometry.
543
3a880af4 544 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
545 (Fx_parse_geometry): If there is a space in string, call
546 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
547
45ba16c7
EZ
5482012-09-17 Eli Zaretskii <eliz@gnu.org>
549
c8b9f1bc
EZ
550 * search.c (scan_buffer): Use character positions in calls to
551 region_cache_forward and region_cache_backward, not byte
552 positions. (Bug#12196)
553
b4c932a2
EZ
554 * w32term.c (w32_read_socket): Set pending_signals to 1, like
555 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
556
45ba16c7
EZ
557 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
558 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
559 emacs_blocked_malloc, now deleted.
560
eeceac93
PE
5612012-09-17 Paul Eggert <eggert@cs.ucla.edu>
562
563 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
564 The workaround was for improving performance on Solaris 2.4, but
565 is getting in the way now. Emacs will still work if someone is
566 still running Solaris 2.4 in a museum somewhere; Sun dropped
567 support for Solaris 2.4 in 2003.
568 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
569 * process.c (create_process) [HAVE_WORKING_VFORK]:
570 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
571 since Emacs no longer uses vfork on that platform.
572
78f83752
GM
5732012-09-17 Glenn Morris <rgm@gnu.org>
574
575 * emacs.c: Use COPYRIGHT.
576
634b8cac
PE
5772012-09-16 Paul Eggert <eggert@cs.ucla.edu>
578
0caaedb1
PE
579 Remove configure's --without-sync-input option (Bug#12450).
580 When auditing signal-handling in preparation for cleaning it up,
581 I found that SYNC_INPUT has race conditions and would be a real
582 pain to fix. Since it's an undocumented and deprecated
583 configure-time option, now seems like a good time to remove it.
584 Also see <http://bugs.gnu.org/11080#16>.
585 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
586 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
587 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
588 (malloc_hysteresis):
589 (check_depth) [XMALLOC_OVERRUN_CHECK]:
590 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
591 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
592 (dont_register_blocks, bytes_used_when_reconsidered)
593 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
594 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
595 [!SYSTEM_MALLOC && !SYNC_INPUT]:
596 Remove. All uses removed.
597 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
598 implementation, one that depends on whether the new macro
599 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
600 is defined.
601 * atimer.c (run_timers, handle_alarm_signal):
602 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
603 (handle_async_input, process_pending_signals)
604 (handle_input_available_signal, init_keyboard):
605 * nsterm.m (ns_read_socket):
606 * process.c (wait_reading_process_output):
607 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
608 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
609 (emacs_write):
610 * xterm.c (XTread_socket):
611 Assume SYNC_INPUT.
612 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
613 * eval.c (handling_signal): Remove. All uses removed.
614 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
615 All uses replaced with the SYNC_INPUT version.
616 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
617 Remove decls.
618 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
619 Now static.
620
634b8cac
PE
621 * font.c (Ffont_shape_gstring): Remove unused local.
622
83da1b55
GM
6232012-09-16 Glenn Morris <rgm@gnu.org>
624
518650a5
GM
625 * Makefile.in (clean): No longer run nextstep's clean.
626
83da1b55
GM
627 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
628 (ns_frag): Remove.
629 (ns-app): Move here from ns.mk, and simplify.
630 (clean): Simplify nextstep entry.
631 * ns.mk: Remove file.
632
85a43e2e
KH
6332012-09-17 Kenichi Handa <handa@gnu.org>
634
635 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
636 not covert the last few charactes.
637
ba13e616 6382012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
639
640 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
641 here, but just check the validity of glyphs in the glyph-string.
642
a8c729af
MR
6432012-09-16 Martin Rudalics <rudalics@gmx.at>
644
3a880af4
SM
645 * window.c (Fwindow_parameter, Fset_window_parameter):
646 Accept any window as argument (Bug#12452).
a8c729af 647
c077c059
JD
6482012-09-16 Jan Djärv <jan.h.d@swipnet.se>
649
650 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
651 to ns_term_init to avoid memory leak.
652
653 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
654 explicit retain/release.
655 (ns_term_init): Only allow one display. Initialize outerpool and
656 ns_*_types.
657
39a57ad0
PE
6582012-09-15 Paul Eggert <eggert@cs.ucla.edu>
659
660 Port _setjmp fix to POSIXish hosts as well as Microsoft.
661 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
662 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
663 the Microsoft problem in a different way, by altering ../nt/config.nt.
664
7105c8cb
EZ
6652012-09-15 Eli Zaretskii <eliz@gnu.org>
666
667 * w32xfns.c:
668 * w32uniscribe.c:
669 * w32term.c:
670 * w32select.c:
671 * w32reg.c:
672 * w32proc.c:
673 * w32menu.c:
674 * w32inevt.c:
675 * w32heap.c:
676 * w32font.c:
677 * w32fns.c:
678 * w32console.c:
679 * w32.c:
680 * w16select.c: Remove inclusion of setjmp.h, as it is now included
681 by lisp.h. This completes removal of setjmp.h inclusion
682 erroneously announced in the previous commit. (Bug#12446)
683
684 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
685 more accurate.
686
687 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
688 not defined as a macro. The latter happens on MS-Windows.
689 (Bug#12446)
690
0328b6de
PE
6912012-09-15 Paul Eggert <eggert@cs.ucla.edu>
692
693 Port better to POSIX hosts lacking _setjmp (Bug#12446).
694 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 695 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
696 only reason for the instance was because "lisp.h" was included.
697 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
698 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
699 and _longjmp with the new symbols. Emacs already uses _setjmp if
700 available, so this change affects only POSIXish hosts that have
701 sigsetjmp but not _setjmp, such as some versions of Solaris and
702 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
703 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
704 (png_load_body) [HAVE_PNG]:
705 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
706 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
707 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
708 since PNG requires jmp_buf. This is the only exception to the
709 general rule that we now use sys_setjmp and sys_longjmp.
710 This exception is OK since this code does not change the signal
711 mask or longjmp out of a signal handler.
712
2af03429
PE
7132012-09-14 Paul Eggert <eggert@cs.ucla.edu>
714
715 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
716 Include "syssignal.h", for 'main_thread'.
717
2f294edf
DA
7182012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
719
720 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
721 * insdel.c (replace_range, replace_range_2):
722 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
723 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
724 Remove redundant check before calling offset_intervals.
725
6b533e9c
MR
7262012-09-14 Martin Rudalics <rudalics@gmx.at>
727
728 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
729 current buffer (Bug#12387).
730
2a7931e3
JB
7312012-09-14 Juanma Barranquero <lekktu@gmail.com>
732
733 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
734
c18e885b
PE
7352012-09-13 Paul Eggert <eggert@cs.ucla.edu>
736
737 Use a more backwards-compatible timer format (Bug#12430).
738 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
739 vector element, not from the 4th, since PSECS is now at the end.
740 (Fcurrent_idle_time): Doc fix.
741
d59a1afb
DA
7422012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
743
744 Function to mark objects and remove killed buffers at once.
745 * alloc.c (discard_killed_buffers): Rename to ...
746 (mark_discard_killed buffers) ... new name. Add marking
747 of remaining objects. Fix comment. Adjust users.
748 (mark_object): Do not touch frame buffer lists here.
749 * frame.c (delete_frame): Reset frame buffer lists here.
750
5f0cb45a
PE
7512012-09-13 Paul Eggert <eggert@cs.ucla.edu>
752
8ea47e3a
PE
753 Better workaround for GNOME bug when --enable-gcc-warnings.
754 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
755 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
756 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
757
4a4bbad2
PE
758 Simplify SIGIO usage (Bug#12408).
759 The code that dealt with SIGIO was crufty and confusing, e.g., it
760 played tricks like "#undef SIGIO" but these tricks were not used
761 consistently. Simplify mostly by not #undeffing standard symbols,
762 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
763 or not as we please) rather than "defined SIGIO" (standard symbol
764 that we probably shouldn't #undef).
765 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
766 Modules that need it can include it.
767 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
768 * dispextern.h (ignore_sigio): New decl.
769 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
770 unconditionally, since it's now a no-op if !USABLE_SIGIO.
771 * emacs.c (shut_down_emacs):
772 * keyboard.c (kbd_buffer_store_event_hold):
773 Use ignore_sigio rather than invoking 'signal' directly.
774 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
775 for FIONREAD.
776 (FIONREAD, SIGIO): Do not #undef.
777 (tty_read_avail_input): Use #error rather than a syntax error.
778 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
779 for I_PIPE, used by SETUP_SLAVE_PTY.
780 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
781 * sysdep.c (croak): Remove; no longer needed. This bit of
782 temporary code, with Fred N. Fish's comment that it's temporary,
783 has been in Emacs since at least 1992!
784 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
785 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
786 * syssignal.h (croak): Remove decl.
787 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
788 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
789 now that we're termios-only.
790 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
791 * term.c (dissociate_if_controlling_tty): Use #error rather than
792 a run-time error.
793
5f0cb45a
PE
794 Work around GCC and GNOME bugs when --enable-gcc-warnings.
795 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
796 to work around GNOME bug 683906.
797 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
798 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
799 This works around GCC bug 54561.
800
40bce90b
PE
8012012-09-12 Paul Eggert <eggert@cs.ucla.edu>
802
803 More fixes for 'volatile' and setjmp/longjmp.
804 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
805 * image.c (struct png_load_context) [HAVE_PNG]: New type.
806 (png_load_body) [HAVE_PNG]:
807 (jpeg_load_body) [HAVE_JPEG]:
808 New function, with most of the old parent function's body.
809 (png_load) [HAVE_PNG]:
810 (jpeg_load) [HAVE_JPEG]:
811 Invoke the new function, to avoid longjmp munging our locals.
812 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
813 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
814 longjmp is passed 2, as the C standard doesn't guarantee this.
815 Instead, store the failure code into mgr->failure_code.
816
bfeae2cf
SM
8172012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
818
819 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
820 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
821 (syms_of_keyboard): Remove support for unread-command-char.
822
8099e36b
EZ
8232012-09-12 Eli Zaretskii <eliz@gnu.org>
824
825 * w32proc.c (sys_kill): If PID is our process ID and the signal is
826 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
827 violation. (Bug#12426)
828
92547ff9
PE
8292012-09-12 Paul Eggert <eggert@cs.ucla.edu>
830
831 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
832
45b82ad0
SM
8332012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
834
835 * eval.c: Add `inhibit-debugger'.
836 (Qinhibit_debugger): New symbol.
837 (call_debugger): Bind it instead of Qdebug_on_error.
838 (maybe_call_debugger): Test Vinhibit_debugger.
839 (syms_of_eval): Define inhibit-debugger.
840 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
841 (syms_of_xdisp): Remove inhibit-debug-on-message.
842
5779a1dc
PE
8432012-09-11 Paul Eggert <eggert@cs.ucla.edu>
844
50f2e553
PE
845 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
846 If a nonvolatile local variable is written before a _longjmp to
847 the frame containing the variable, and is read after the _longjmp,
848 the value read is indeterminate. Some local variables of type
849 'struct handler' and 'struct catchtag' are used in this way, so
850 mark each of their slots as volatile if the slot can be set before
851 _longjmp and read afterwards.
852 * lisp.h (struct handler): var and chosen_clause are now volatile.
853 (struct catchtag): val, next, and pdlcount are now volatile.
854
ae1d87e2
PE
855 * bidi.c (bidi_push_it, bidi_pop_it):
856 * fns.c (copy_hash_table):
857 * image.c (define_image_type):
858 * keyboard.c (kbd_buffer_store_event_hold):
859 * process.c (Fprocess_send_eof):
860 * xfaces.c (x_create_gc) [HAVE_NS]:
861 * xgselect.c (xg_select):
862 Prefer assignment to memcpy when either will do.
863
5779a1dc
PE
864 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
865 Use pointer-to-a-pointer to simplify and avoid a NILP check each
866 time an item is removed. No need to mark this function 'inline';
867 the compiler knows better than we do.
868
c4c9756b
JD
8692012-09-11 Jan Djärv <jan.h.d@swipnet.se>
870
871 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
872 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
873 to change_frame_size (Bug#12388).
874 (windowDidResize:): Pass YES to updateFrameSize.
875
876 * nsterm.h: Add delay parameter to updateFrameSize.
877
d73e321c
DA
8782012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
879
880 Discard killed buffers from deleted window and frame objects.
881 This reduces an amount of references to killed buffers and
882 helps GC to reclaim them faster.
883 * alloc.c (discard_killed_buffers): New function.
884 (mark_object): Use it for deleted windows and frames.
885 (mark_object): If symbol's value is set up for a killed buffer
886 or deleted frame, restore it's global binding.
887 * data.c (swap_in_global_binding): Add GC notice.
888 (swap_in_symval_forwarding): Use convenient set_blv_where.
889 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
890 * window.h: ... to here.
891
e578f381
DA
8922012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
893
894 Convenient macro to check whether the buffer is live.
895 * buffer.h (BUFFER_LIVE_P): New macro.
896 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
897 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
898
3057e615
YM
8992012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
900
901 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
902 composition cases (Bug#12364).
903
904 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
905 overhang of succeeding glyphs overlapping box cursor.
906
907 * w32term.c (x_draw_glyph_string): Likewise.
908
6fda35f2
PE
9092012-09-11 Paul Eggert <eggert@cs.ucla.edu>
910
c990426a
PE
911 Simplify, document, and port floating-point (Bug#12381).
912 The porting part of this patch fixes bugs on non-IEEE platforms
913 with frexp, ldexp, logb.
914 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
915 Now static.
916 * floatfns.c: Simplify discussion of functions that Emacs doesn't
917 support, by removing commented-out code and briefly listing the
918 C89 functions excluded. The commented-out stuff was confusing
919 maintenance, e.g., we thought we needed cbrt but it was commented out.
920 (logb): Remove decl; no longer needed.
921 (isfinite): New macro, if not already supplied.
922 (isnan): Don't replace any existing macro.
923 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
924 are present on all C89 platforms.
925 (Ffrexp): Do not special-case zero, as frexp does the right thing
926 for that case.
927 (Flogb): Do not use logb, as it doesn't have the desired meaning
928 on hosts that use non-base-2 floating point. Instead, stick with
929 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
930 frexp, to avoid getting an unspecified result.
931
6fda35f2
PE
932 * xdisp.c (Qinhibit_debug_on_message): Now static.
933
16130a58
JD
9342012-09-10 Jan Djärv <jan.h.d@swipnet.se>
935
936 * nsterm.m (ns_update_begin): Set clip path to whole view by using
937 NSBezierPath (Bug#12131).
938
d105a573
CY
9392012-09-10 Chong Yidong <cyd@gnu.org>
940
941 * fns.c (Fdelq, Fdelete): Doc fix.
942
ff55dfe8
PE
9432012-09-10 Paul Eggert <eggert@cs.ucla.edu>
944
945 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
946 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
947
e7032e7c
SM
9482012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
949
950 * lisp.h (make_lisp_ptr): New macro to replace XSET.
951 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
952 Use it.
953
e9957956
EZ
9542012-09-09 Eli Zaretskii <eliz@gnu.org>
955
aba05ce9
EZ
956 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
957 left fringe if the window has a left margin. This avoids leaving
958 traces of the cursor because its leftmost pixel is not drawn over.
959
e9957956
EZ
960 * dispnew.c (update_window_line): When the left margin area of a
961 screen line is updated, set the redraw_fringe_bitmaps_p flag of
962 that screen line. (Bug#12277)
963
f6196b87
PE
9642012-09-09 Paul Eggert <eggert@cs.ucla.edu>
965
966 Assume C89 or later for math functions (Bug#12381).
967 This simplifies the code, and makes it a bit smaller and faster,
968 and (most important) makes it easier to clean up signal handling
969 since we can stop worring about floating-point exceptions in
970 library code. That was a problem before C89, but the problem
971 went away many years ago on all practical Emacs targets.
972 * data.c, image.c, lread.c, print.c:
973 Don't include <math.h>; no longer needed.
974 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
975 might be autoconfigured, as that never happens.
976 * data.c (fmod):
977 * doprnt.c (DBL_MAX_10_EXP):
978 * print.c (DBL_DIG):
979 Remove. C89 or later always defines these.
980 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
981 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
982 (arith_error, domain_error, domain_error2):
983 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
984 no longer needed -- we simply return what C returns. All uses removed.
985 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
986 the wrapped code.
987 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
988 Remove. All uses expanded, as these macros are no longer used
989 more than once and are now more trouble than they're worth.
990 (Ftan): Use tan, not sin / cos.
991 (Flogb): Assume C89 frexp.
992 (fmod_float): Assume C89 fmod.
993 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
994 (init_floatfns): Remove. All uses removed.
995
9d7f1863
JD
9962012-09-08 Jan Djärv <jan.h.d@swipnet.se>
997
998 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
999 compositeToPoint for OSX < 10.6 (Bug#12390).
1000
eabf0404
PE
10012012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1002
1003 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1004 This produces more-accurate results.
1005
0b3b1d23
JD
10062012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1007
1008 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1009 changes (Bug#12088).
1010
6dcef6ec
CY
10112012-09-08 Chong Yidong <cyd@gnu.org>
1012
1013 * syntax.c (Fstring_to_syntax): Doc fix.
1014
aa7d57c5
JD
10152012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1016
1017 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1018 in the internal border.
1019 (x_set_window_size): Remove static variables and their usage.
1020 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1021 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1022 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1023 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1024 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1025 (ns_fix_rect_ibw): Remove.
1026 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1027 (ns_dumpglyphs_box_or_relief): Ditto.
1028 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1029 adjustment.
1030 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1031 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1032 border adjustment.
1033 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1034 their usage. Add fringe_extended_p and its use as in other terms.
1035 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1036 scroll bar was removed.
1037 (updateFrameSize): New function.
1038 (windowDidResize): Move code to updateFrameSize and call it.
1039
1040 * nsterm.h (EmacsView): Add updateFrameSize.
1041
1a5432bc
CY
10422012-09-07 Chong Yidong <cyd@gnu.org>
1043
b4f5313e
CY
1044 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1045
1a5432bc
CY
1046 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1047
1a4f1e9b
PE
10482012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1049
1050 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1051 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1052 Problem introduced when merging patches. Noted by Eli Zaretskii in
1053 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1054 * floatfns.c: Comment fix.
1055 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1056 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1057 and anyway the declaration is harmless even if SIGDANGER is not defined.
1058 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1059 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1060 source files not surprisingly expected syssignal.h to define, or
1061 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1062 Include <sys/ioctl.h>, for FIONREAD.
1063 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1064 This eliminates a problem whereby other files mysteriously had
1065 to include "syssignal.h" before including "systty.h" if they
1066 wanted to use "#ifdef SIGIO".
1067
bc8000ff
EZ
10682012-09-07 Eli Zaretskii <eliz@gnu.org>
1069
3e6d6928
EZ
1070 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1071
1072 * w32.c (sigemptyset): Empty the set.
1073 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1074
bc8000ff
EZ
1075 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1076
b4fa72f2
DA
10772012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1078
1079 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1080 (mark_object): Likewise for frame objects.
1081
30730c93
PE
10822012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1083
1084 * syssignal.h (handle_on_main_thread): Always declare,
1085 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1086 This ports to platforms without HAVE_PTHREAD.
1087
2fe28299
PE
10882012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1089
1090 Signal-handler cleanup (Bug#12327).
1091 Emacs's signal handlers were written in the old 4.2BSD style with
1092 sigblock and sigmask and so forth, and this led to some
1093 inefficiencies and confusion. Rewrite these to use
1094 pthread_sigmask etc. without copying signal sets around. Also,
1095 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1096 'signal', and instead use functions that do not attempt to take
1097 over the system name space. This patch causes Emacs's text
1098 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1099 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1100 Do not include <signal.h> or "syssignal.h", as these
1101 modules do not use signals.
1102 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1103 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1104 Do not include <signal.h>, as "syssignal.h" does that for us now.
1105 * atimer.c (sigmask_atimers): New function.
1106 (block_atimers, unblock_atimers): New functions,
1107 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1108 All uses replaced.
1109 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1110 no longer needed here.
1111 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1112 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1113 * sysdep.c (struct save_signal): New member 'action', replacing
1114 old member 'handler'.
1115 (save_signal_handlers, restore_signal_handlers):
1116 Use sigaction instead of 'signal' to save and restore.
1117 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1118 New function. All users of 'signal' modified to use set_sighandler
1119 if they're writeonly, and to use sys_signal if they're read+write.
1120 (emacs_sigaction_init, forwarded_signal): New functions.
1121 (sys_signal): Remove. All uses replaced by calls to sigaction
1122 and emacs_sigaction_init, or by direct calls to 'signal'.
1123 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1124 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1125 all uses replaced by pthread_sigmask etc. calls.
1126 * syssignal.h: Include <signal.h>.
1127 (emacs_sigaction_init, forwarded_signal): New decls.
1128 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1129 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1130 (sigmask, sys_sigmask): Remove; no longer needed.
1131 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1132 (sigblock, sigunblock, sigfree):
1133 (sigsetmask) [!defined sigsetmask]:
1134 Remove. All uses replaced by pthread_sigmask.
1135 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1136 no longer need to be replaced, and its typical old uses
1137 are now done via emacs_sigaction_init and sigaction.
1138 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1139 (sys_sigdel): Remove; unused.
1140 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1141
0216c128
EZ
11422012-09-06 Eli Zaretskii <eliz@gnu.org>
1143
1144 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1145 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1146
c752cfa9
DA
11472012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1148
1149 Explicitly mark buffer_defaults and buffer_local_symbols.
1150 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1151 mark_local_symbols here.
1152 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1153 since special buffers aren't marked here any more.
1154 (allocate_buffer): Chain new buffer with all_buffers here...
1155 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1156 not here.
1157 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1158 (syms_of_buffer): Remove staticpro of the above.
1159 (init_buffer_once): Set names for buffer_defaults and
1160 buffer_local_symbols.
1161
a864ef14
PE
11622012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1163
1164 Use bool for booleans in font-related modules.
1165 * font.c (font_intern_prop, font_style_to_value)
1166 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1167 (generate_otf_features, font_check_otf_features, font_check_otf)
1168 (font_match_p, font_list_entities, font_at):
1169 * fontset.c (fontset_id_valid_p, reorder_font_vector
1170 (fontset_find_font, Fset_fontset_font)
1171 (face_suitable_for_char_p) [0]:
1172 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1173 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1174 (m17n_flt_initialized, ftfont_shape_by_flt):
1175 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1176 * nsfont.m (nsfont_draw):
1177 * w32font.c (w32font_draw):
1178 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1179 Use bool for booleans.
1180 * font.h: Adjust to above API changes.
1181 (struct font, struct font_driver, struct font_driver_list):
1182 Use bool for booleans.
1183 (struct font): Remove useless member encoding_type.
1184 All users removed.
1185 * fontset.c, xftfont.c: Omit unnecessary static decls.
1186
0699fc18
DA
11872012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1188
1189 * alloc.c (mark_object): Revert window marking code
1190 since it's unsafe for the Fset_window_configuration.
1191
20ef56db
PE
11922012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1193
2fe28299 1194 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1195 Be more systematic about preserving errno whenever a signal
1196 handler returns, even if it's not in the main thread. Do this by
1197 renaming signal handlers to distinguish between signal delivery
1198 and signal handling. All uses changed.
1199 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1200 * data.c (deliver_arith_signal): Rename from arith_error.
1201 * dispnew.c (deliver_window_change_signal): Rename from
1202 window_change_signal.
1203 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1204 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1205 * keyboard.c (deliver_input_available_signal): Rename from
1206 input_available_signal.
1207 (deliver_user_signal): Rename from handle_user_signal.
1208 (deliver_interrupt_signal): Rename from interrupt_signal.
1209 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1210 (deliver_child_signal): Rename from sigchld_handler.
1211 * atimer.c (handle_alarm_signal):
1212 * data.c (handle_arith_signal):
1213 * dispnew.c (handle_window_change_signal):
1214 * emacs.c (handle_fatal_signal, handle_danger_signal):
1215 * keyboard.c (handle_input_available_signal):
1216 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1217 * process.c (handle_pipe_signal, handle_child_signal):
1218 New functions, with the actual signal-handling code taken from the
1219 original respective signal handlers, sans the sporadic attempts to
1220 preserve errno, since that's now done by handle_on_main_thread.
1221 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1222 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1223 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1224 Move to sysdep.c.
1225 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1226 Move initialization of main_thread to sysdep.c's init_signals.
1227 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1228 our usage, and simplifies the mainline code.
1229 (record_child_status_change): New static function, as a helper
1230 for handle_child_signal, and with most of the old child handler's
1231 contents.
1232 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1233 (handle_child_signal): Use the above.
1234 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1235 Moved here from emacs.c.
1236 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1237 code moved here from emacs.c's main function.
1238 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1239 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1240 This lets callers save and restore errno properly.
20ef56db 1241
e3ccf108
DA
12422012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1243
1244 Remove redundant or unused things here and there.
1245 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1246 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1247 * editfns.c (Fcompare_buffer_substrings): Likewise.
1248 * frame.h (struct terminal, struct font_driver_list):
1249 Remove redundant declarations.
1250 * window.h (Qleft, Qright): Likewise.
1251
697e1e39
DA
12522012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1253
1254 Do not mark objects from deleted buffers, windows and frames.
1255 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1256 (mark_object): Likewise for windows and frames.
1257
c1ca42ca
DA
12582012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1259
1260 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1261 buffer_defaults and buffer_local_symbols as valid objects.
1262 Return special value to denote them.
1263
014d93be
PE
12642012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1265
f75d7a91
PE
1266 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1267 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1268 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1269 (file_name_absolute_p, Fsubstitute_in_file_name):
1270 (check_executable, check_writable, Ffile_accessible_directory_p)
1271 (Fset_file_selinux_context, Fdefault_file_modes)
1272 (Finsert_file_contents, choose_write_coding_system)
1273 (Fwrite_region, build_annotations, a_write, e_write)
1274 (Fdo_auto_save):
1275 * filelock.c (boot_time_initialized, get_boot_time)
1276 (get_boot_time_1, lock_file_1, within_one_second):
1277 * floatfns.c (in_float):
1278 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1279 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1280 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1281 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1282 * window.c (compare_window_configurations):
1283 Use bool for booleans.
1284 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1285 (Fdefault_file_modes): Now mode_t, not int, for modes.
1286 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1287 (internal_delete_file): Now returns void, not a (boolean) int,
1288 since nobody was looking at the return value.
1289 * lisp.h, window.h: Adjust to above API changes.
1290
014d93be
PE
1291 * xdisp.c (set_message): Simplify and reindent last change.
1292
776f29e1
JB
12932012-09-05 Juanma Barranquero <lekktu@gmail.com>
1294
1295 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1296
7f7e0167
LI
12972012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1298
1299 * eval.c (call_debugger): Make the function non-static so that we
1300 can call it from set_message.
1301
1302 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1303 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1304
cf29dd84
PE
13052012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1306
1307 Give more-useful info on a fatal error (Bug#12328).
1308 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1309 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1310 of doing the work ourselves.
1311 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1312 do most of the work.
1313 (fatal_error_backtrace): New function, taken from the guts
1314 of the old fatal_error_signal, but with a new option to output
1315 a backtrace.
1316 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1317 info about the signal than just its number.
1318 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1319 * sysdep.c: Include <execinfo.h>
1320 (emacs_backtrace): New function, taken partly from the previous
1321 code of the 'die' function.
1322 (emacs_abort): Call fatal_error_backtrace rather than abort.
1323
972debf2
SM
13242012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1325
1326 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1327 eager (load-time) macro-expansion.
1328 * lisp.mk (lisp): Add macroexp.
1329
1088b922
PE
13302012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1331
1332 Simplify redefinition of 'abort' (Bug#12316).
1333 Do not try to redefine the 'abort' function. Instead, redo
1334 the code so that it calls 'emacs_abort' rather than 'abort'.
1335 This removes the need for the NO_ABORT configure-time macro
1336 and makes it easier to change the abort code to do a backtrace.
1337 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1338 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1339 Remove; sysdep.c's emacs_abort now takes its place.
1340 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1341 'abort' changed to use 'emacs_abort'.
1342 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1343 (abort) [!defined abort]: Rename to ...
1344 (emacs_abort): ... new name.
1345 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1346 the place of the old 'abort' in emacs.c.
1347 * w32.c, w32fns.c (abort): Do not #undef.
1348 * w32.c (emacs_abort): Rename from w32_abort.
1349
30934d33
EZ
13502012-09-04 Eli Zaretskii <eliz@gnu.org>
1351
1352 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1353 offsets[j].dv, since the y axis of the screen coordinates points
1354 down, while the y axis of the font definition coordinates points
1355 up. This fixes display of Arabic diacritics such as KASRA and
1356 KASRATAN. (Bug#11860)
1357
af26b72c
PE
13582012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1359
1360 Be more systematic about _setjmp vs setjmp.
1361 * alloc.c (test_setjmp, mark_stack):
1362 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1363 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1364 (png_load, my_error_exit, jpeg_load):
1365 * process.c (send_process_trap, send_process):
1366 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1367 The underscored versions are up to 30x faster on some hosts.
1368 Formerly, the code used setjmp+longjmp sometimes and
1369 _setjmp+_longjmp at other times, with no particular reason to
1370 prefer setjmp+longjmp.
1371
26d4541d
PE
13722012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1373
d42f4f0f 1374 Fix minor problem found by static checking.
26d4541d 1375 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1376
c5e28e39
MR
13772012-09-03 Martin Rudalics <rudalics@gmx.at>
1378
1379 * buffer.c (Fdelete_all_overlays): New function.
1380
3eab3ca9
CY
13812012-09-03 Chong Yidong <cyd@gnu.org>
1382
1383 * gtkutil.c: Add extern decl for Qxft.
1384
c04889f8
PE
13852012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1386
1882aa38
PE
1387 * emacs.c, eval.c: Use bool for boolean.
1388 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1389 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1390 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1391 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1392 (main, decode_env_path, Fdaemon_initialized):
1393 * eval.c (call_debugger, Finteractive_p, interactive_p):
1394 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1395 (maybe_call_debugger, Fbacktrace):
1396 * process.c (read_process_output, exec_sentinel):
1397 Use bool for booleans.
1398 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1399 All callers changed.
1400 * eval.c (interactive_p): Omit always-true boolean argument
1401 EXCLUDE_SUBRS_P. All callers changed.
1402 * dispextern.h, lisp.h: Reflect above API changes.
1403 * firstfile.c (dummy): Use the address of 'main', whose signature
1404 won't change, instead of the address of 'initialize', whose
1405 signature just changed from int to bool.
1406 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1407 * msdos.c (fatal_error_in_progress): ... from here.
1408 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1409 of incrementing it.
1410 (redisplay_internal, unwind_redisplay): Simply clear
1411 REDISPLAYING_P when unwinding, instead of saving its previous,
1412 always-false value and then restoring it.
1413
a411ac43
PE
1414 Clean up some extern decls.
1415 Mostly, this hoists extern decls out of .c files and into .h files.
1416 That way, we're more likely to catch errors if the interfaces change.
1417 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1418 declare xg_mark_data.
1419 * dispextern.h (x_frame_parm_handlers):
1420 * font.h (Qxft):
1421 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1422 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1423 (Qultra_bold, Qoblique, Qitalic):
1424 Move extern decl here from .c file.
1425 * alloc.c (xg_mark_data) [USE_GTK]:
1426 * doc.c (Qclosure):
1427 * eval.c (Qlexical_binding):
1428 * fns.c (time) [!HAVE_UNISTD_H]:
1429 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1430 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1431 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1432 * lread.c (Qinternal_interpreter_environment):
1433 * minibuf.c (Qbuffer):
1434 * process.c (QCfamily, QCfilter):
1435 * widget.c (free_frame_faces):
1436 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1437 * xfont.c (x_clear_errors):
1438 * xterm.c (x_frame_parm_handlers):
1439 Remove now-redundant extern decls.
1440 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1441 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1442 Now static.
1443 * xfaces.c: Remove unnecessary static decls.
1444 * xterm.c (updating_frame): Remove decl of nonexistent object.
1445
c04889f8
PE
1446 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1447 when building globals.h, as the objects that are not built on
1448 this host are not needed to compile C files on this host.
1449
8b339673
JD
14502012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1451
1452 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1453
1454 * frame.h: Add missing prototype for x_wm_set_size_hint.
1455
a08d4ba7
PE
14562012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1457
1458 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1459 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1460 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1461 (Fsubstitute_command_keys):
1462 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1463 (save_excursion_save, save_excursion_restore)
1464 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1465 (format_time_string, general_insert_function)
1466 (make_buffer_string, make_buffer_string_both)
1467 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1468 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1469 (copy_text, insert_1, insert_1_both, insert_from_string)
1470 (insert_from_string_before_markers, insert_from_string_1)
1471 (insert_from_buffer, insert_from_buffer_1, replace_range)
1472 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1473 (del_range_2, modify_region):
1474 * intervals.c (intervals_equal, balance_possible_root_interval)
1475 (adjust_intervals_for_insertion, merge_properties_sticky)
1476 (graft_intervals_into_buffer, lookup_char_property)
1477 (adjust_for_invis_intang, set_point_both)
1478 (get_property_and_range, compare_string_intervals)
1479 (set_intervals_multibyte_1, set_intervals_multibyte):
1480 * keyboard.c (decode_timer):
1481 Use bool for boolean.
1482 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1483 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1484
48c948de
CY
14852012-09-02 Chong Yidong <cyd@gnu.org>
1486
1487 * keymap.c (push_key_description): Print M-TAB as C-M-i
1488 (Bug#11758).
1489
6c49a40b
JB
14902012-09-02 Juanma Barranquero <lekktu@gmail.com>
1491
1492 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1493 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1494 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1495 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1496 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1497 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1498 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1499
4dfbd238
EZ
15002012-09-01 Eli Zaretskii <eliz@gnu.org>
1501
7e510e28
EZ
1502 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1503 more than one grapheme cluster passed to the shaper: compute the
1504 offset adjustment values separately for each cluster. (Bug#11860)
1505
4dfbd238
EZ
1506 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1507 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1508 about implicit conversions from integer to pointer.
1509
86571ae0
DC
15102012-09-01 Daniel Colascione <dancol@dancol.org>
1511
1512 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1513 system used too early.
1514
0e23ef9d
PE
15152012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1516
1517 Better seed support for (random).
1518 * emacs.c (main): Call init_random.
1519 * fns.c (Frandom): Set the seed from a string argument, if given.
1520 Remove long-obsolete Gentzel cruft.
1521 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1522 (init_random): New function.
1523
17a2cbbd
DC
15242012-09-01 Daniel Colascione <dancol@dancol.org>
1525
1526 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1527 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1528 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1529 x_wm_set_size_hint, x_query_colors, x_real_positions,
1530 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1531 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1532 all of which have been moved to common code.
1533
1534 * xfaces.c: Include TERM_HEADER instead of listing all possible
1535 window-system headers.
1536
1537 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1538 to match header.
1539
1540 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1541 directly accessing frame internals.
1542
f18cbb28 1543 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1544 globals_of_w32font.
1545
1546 * process.c: Include TERM_HEADER instead of listing all possible
1547 window-system headers.
1548
3a880af4
SM
1549 * nsterm.h: Remove declarations now in frame.h.
1550 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
1551
1552 * menu.c: Include TERM_HEADER instead of listing all possible
1553 window-system headers.
1554
1555 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1556 window system.
1557
1558 * keyboard.c: Include TERM_HEADER instead of listing all possible
1559 window-system headers.
1560
1561 * image.c: Include TERM_HEADER instead of listing all possible
1562 window-system headers. Declare Vlibrary_cache when compiling for
1563 Windows.
1564
1565 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1566 window system declarations.
1567
1568 * frame.h: Move common functions here: set_frame_menubar,
1569 x_set_window_size, x_sync, x_get_focus_frame,
1570 x_set_mouse_position, x_set_mouse_pixel_position,
1571 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1572 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1573 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1574 x_activate_menubar, x_real_positions, x_bitmap_icon,
1575 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1576 and x_query_colors.
1577
1578 * frame.c: Include TERM_HEADER instead of listing all possible
1579 window-system headers.
1580
1581 * font.c: Include TERM_HEADER instead of listing all possible
1582 window-system headers.
1583
1584 * emacs.c: Include TERM_HEADER.
1585
f18cbb28
EZ
1586 * dispnew.c: Include TERM_HEADER instead of listing all possible
1587 window-system headers.
17a2cbbd 1588
f18cbb28 1589 * ccl.h: Include character.h.
17a2cbbd
DC
1590
1591 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1592 the current window system; include in list of objects to link into
1593 Emacs.
1594
c650a5de
DA
15952012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1596
1597 Remove mark_ttys function and fix tty_display_info initialization.
1598 * lisp.h (mark_ttys): Remove prototype.
1599 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1600 to mark_ttys because all possible values of 'top_frame' slot are
1601 the frames which are reachable from Vframe_list.
1602 * term.c (mark_ttys): Remove.
1603 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1604
4e0f6479
DA
16052012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1606
1607 Change struct frame bitfields from unsigned char to unsigned.
1608 * frame.h (struct frame): Change type of 'display_preempted',
1609 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1610 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1611 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1612 bitfields from unsigned char to unsigned.
1613
8b96a52c
DA
16142012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1615
1616 Remove unused member of struct x_output and struct w32_output.
1617 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1618 * w32term.h (struct w32_output): Likewise.
1619
b4444c8a
JD
16202012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1621
1622 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1623 does not become zero (Bug#12234).
1624
b98521db
PE
16252012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1626
1627 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1628 for GCC 4.7.1 x86-64.
1629
31d02438
GM
16302012-08-30 Glenn Morris <rgm@gnu.org>
1631
1632 * lread.c (init_lread): For out-of-tree builds, only add the
1633 source directory's site-lisp dir to the load-path if it exists,
1634 consistent with in-tree builds. (Bug#12302)
1635
7f8941d8
JD
16362012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1637
1638 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 1639 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
1640 (windowShouldClose:): Set window_closed.
1641 (dealloc): New member, free button_values.
fc0c31f8
JB
1642 (process_dialog:): Make member function. Remove window argument,
1643 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
1644 in button_values.
1645 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 1646 with tag. Remove return self, declare return value as void.
7f8941d8
JD
1647 (addString:row:): Remove return self, declare return value as void.
1648 (addSplit): Remove return self, declare return value as void.
1649 (clicked:): Remove return self, declare return value as void.
fc0c31f8 1650 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
1651 (initFromContents:isQuestion:): Adjust call to process_dialog.
1652 Code formatting change.
1653 (timeout_handler:): Set timer_fired to YES.
1654 (runDialogAt:): Set timer_fired to NO.
1655 Handle click on close button as quit.
1656
1657 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1658 Add window_closed and button_values. Add void as return value for
1659 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1660 Add process_dialog as new member.
1661
eada0861 16622012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 1663
eada0861
GM
1664 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1665 is not one of the heaps we manage. (Bug#12242)
1666
16672012-08-28 Glenn Morris <rgm@gnu.org>
1668
1669 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1670
457294dd
MR
16712012-08-28 Martin Rudalics <rudalics@gmx.at>
1672
1673 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
1674 auto-buffer-name window parameter. Install revision of reverted
1675 fix.
457294dd 1676
4f2daf31
DA
16772012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1678
1679 Do not allow to set major mode for a dead buffer.
1680 * buffer.c (Fset_buffer_major_mode): Signal an error
1681 if the buffer is dead.
1682 (Fother_buffer, other_buffer_safely): Remove redundant
1683 nested declaration.
1684
66322887
DA
16852012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1686
1687 Always use set_buffer_if_live to restore original buffer at unwind.
1688 * buffer.h (record_unwind_current_buffer): New function.
1689 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1690 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1691 * undo.c, window.c: Adjust users.
1692 * buffer.c (set_buffer_if_live): Fix comment.
1693
a3d794a1
DA
16942012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1695
1696 Fix usage of set_buffer_internal.
1697 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1698 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1699 * coding.c (decode_coding): Omit redundant test.
1700 * fileio.c (decide_coding_unwind): Likewise.
1701 * fns.c (secure_hash): Likewise.
1702 * insdel.c (modify_region): Likewise.
1703 * keyboard.c (command_loop_1): Likewise.
1704 * print.c (PRINTFINISH): Likewise.
1705 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1706
59ea14cd
PE
17072012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1708
1709 * dispnew.c: Use bool for boolean.
1710 (frame_garbaged, display_completed, delayed_size_change)
1711 (fonts_changed_p, add_window_display_history)
1712 (add_frame_display_history, verify_row_hash)
1713 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1714 (row_equal_p, realloc_glyph_pool)
1715 (allocate_matrices_for_frame_redisplay)
1716 (showing_window_margins_p)
1717 (adjust_frame_glyphs_for_frame_redisplay)
1718 (build_frame_matrix_from_leaf_window, make_current)
1719 (mirrored_line_dance, mirror_line_dance, update_frame)
1720 (update_window_tree, update_single_window)
1721 (check_current_matrix_flags, update_window, update_text_area)
1722 (update_window_line, set_window_update_flags, scrolling_window)
1723 (update_frame_1, scrolling, buffer_posn_from_coords)
1724 (do_pending_window_change, change_frame_size)
1725 (change_frame_size_1, sit_for):
1726 Use bool for boolean.
1727 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1728 and remove last int (actually boolean) argument, which was always 0.
1729 All callers changed.
1730 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1731 * dispextern.h (struct composition_it): Use bool for boolean.
1732 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1733 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1734 * dired.c (file_name_completion):
1735 Use bool for boolean. (This was missed in an earlier change.)
1736
95072a94
MR
17372012-08-27 Martin Rudalics <rudalics@gmx.at>
1738
1739 * window.c (Fset_window_configuration): Revert first part of
1740 last change.
1741
0f19feff
JD
17422012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1743
1744 * nsterm.h (NSPanel): New class variable dialog_return.
1745
3a880af4
SM
1746 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1747 Initialize dialog_return.
0f19feff
JD
1748 (windowShouldClose:): Use stop instead of stopModalWithCode.
1749 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1750 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1751 event.
1752 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1753 modal loop returns.
1754
f10fe38f
PE
17552012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1756
de1339b0
PE
1757 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1758 * composite.c (find_composition, composition_gstring_p)
1759 (composition_reseat_it, find_automatic_composition):
1760 * data.c (let_shadows_buffer_binding_p)
1761 (let_shadows_global_binding_p, set_internal, make_blv)
1762 (Fmake_variable_buffer_local, Fmake_local_variable)
1763 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1764 (cons_to_signed, arith_driver):
1765 * dbusbind.c (xd_in_read_queued_messages):
1766 * dired.c (directory_files_internal, file_name_completion):
1767 Use bool for booleans.
1768 * dired.c (file_name_completion):
1769 * process.h (fd_callback):
1770 Omit int (actually boolean) argument. It wasn't being used.
1771 All uses changed.
1772 * composite.h, lisp.h: Reflect above API changes.
1773
f10fe38f
PE
1774 * cmds.c, coding.c: Use bool for booleans.
1775 * cmds.c (move_point, Fself_insert_command):
1776 * coding.h (struct composition status, struct coding_system):
1777 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1778 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1779 (emacs_mule_char, decode_coding_emacs_mule)
1780 (encode_coding_emacs_mule, detect_coding_iso_2022)
1781 (decode_coding_iso_2022, encode_invocation_designation)
1782 (encode_designation_at_bol, encode_coding_iso_2022)
1783 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1784 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1785 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1786 (encode_coding_raw_text, detect_coding_charset)
1787 (decode_coding_charset, encode_coding_charset, detect_eol)
1788 (detect_coding, get_translation_table, produce_chars)
1789 (consume_chars, reused_workbuf_in_use)
1790 (make_conversion_work_buffer, code_conversion_save)
1791 (decode_coding_object, encode_coding_object)
1792 (detect_coding_system, char_encodable_p)
1793 (Funencodable_char_position, code_convert_region)
1794 (code_convert_string, code_convert_string_norecord)
1795 (Fset_coding_system_priority):
1796 * fileio.c (Finsert_file_contents):
1797 Use bool for booleans.
1798 * coding.h, lisp.h: Reflect above API changes.
1799 * coding.c: Remove unnecessary static function decls.
1800 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1801 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1802 not a boolean 'int', since callers never look at the return value.
1803 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1804 * coding.h (decoding_buffer_size, encoding_buffer_size)
1805 (emacs_mule_string_char): Remove unused extern decls.
1806 (struct iso_2022_spec, struct coding_system):
1807 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1808 (struct emacs_mule_spec): Remove unused field 'full_support'.
1809 All initializations removed.
1810 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1811
5474c384
DA
18122012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1813
f10fe38f 1814 Fix spare memory change (Bug#12286).
5474c384
DA
1815 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1816 (valid_lisp_object_p): Likewise.
1817
c4b6914d
MR
18182012-08-27 Martin Rudalics <rudalics@gmx.at>
1819
1820 * window.c (Fset_window_configuration): Record any window's old
1821 buffer if it's replaced (see Bug#8789). If the new current
1822 buffer doesn't appear in the selected window, go to its old
1823 point (Bug#12208).
1824
35aaa1ea
DA
18252012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1826
1827 Special MEM_TYPE_SPARE to denote reserved memory.
1828 * alloc.c (enum mem_type): New memory type.
1829 (refill_memory_reserve): Use new type for spare memory.
1830 This prevents live_cons_p and live_string_p from incorrect
1831 detection of uninitialized objects from spare memory as live.
1832
6af64513
PE
18332012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1834
8b2e00a3
PE
1835 Spelling fixes.
1836 * Makefile.in (.PHONY): versioclean -> versionclean.
1837
b52d6985
PE
1838 Remove unused external symbols.
1839 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1840 * window.c (Qwindow_valid_p, decode_valid_window):
1841 Now static, not extern.
1842 * data.c (Qinterval): Remove; unused.
1843 (syms_of_data): Do not define 'interval'.
1844 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1845 * window.h (decode_valid_window):
1846 Remove decls.
1847
d5172d4f
PE
1848 * character.c, charset.c, chartab.c: Use bool for booleans.
1849 * character.c (lisp_string_width, string_count_byte8)
1850 (string_escape_byte8):
1851 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1852 (load_charset_map_from_file, map_charset_chars)
1853 (Fdefine_charset_internal, define_charset_internal)
1854 (Fdeclare_equiv_charset, find_charsets_in_text)
1855 (Ffind_charset_region, char_charset, Fiso_charset):
1856 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1857 (sub_char_table_set, sub_char_table_set_range)
1858 (char_table_set_range, optimize_sub_char_table)
1859 (map_sub_char_table):
1860 Use bool for boolean.
1861 * character.c (str_to_unibyte): Omit last boolean argument; it was
1862 always 0. All callers changed.
1863 * character.h, charset.h: Adjust to match previous changes.
1864 * character.h (char_printable_p): Remove decl of nonexistent function.
1865 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1866 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1867 are all boolean, so make them single-bit bitfields.
1868
6af64513
PE
1869 * lisp.h (ASET): Remove attempt to detect side effects.
1870 It was meant to be temporary and it often doesn't work,
1871 because when IDX has side effects the behavior of IDX==IDX
1872 is undefined. See Stefan Monnier in
1873 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1874
e1f29348
BR
18752012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1876
1877 * lisp.h (functionp): New function (extracted from Ffunctionp).
1878 (FUNCTIONP): Use it.
1879 * eval.c (Ffunctionp): Use it.
1880
17c05d74
PE
18812012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1882
0f46bc75
PE
1883 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1884 as that's faster and simpler than static storage. Don't bother
1885 with the g_main_context_query overhead if g_main_context_pending
1886 says no events are pending.
1887 (gfds, gfds_size): Remove these static vars.
1888 (xgselect_initialize): Remove; no longer needed.
1889 All uses and decls removed.
1890
ee4c0f69
PE
1891 * emacs.c (fatal_error_signal_hook): Remove.
1892 All uses removed. This leftover from old code was always 0.
1893
17c05d74
PE
1894 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1895 * casefiddle.c (casify_object, casify_region):
1896 * casetab.c (set_case_table):
1897 * category.c, category.h (word_boundary_p):
1898 * category.h (CHAR_HAS_CATEGORY):
1899 Use bool for booleans, instead of int.
1900
391ceac5
EZ
19012012-08-25 Eli Zaretskii <eliz@gnu.org>
1902
1903 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1904
2f221583
PE
19052012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1906
f4a681b0
PE
1907 On assertion failure, print backtrace if available.
1908 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1909 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1910 * Makefile.in (LIB_EXECINFO): New macro.
1911 (LIBES): Use it.
1912
2f221583
PE
1913 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1914 * bytecode.c (exec_byte_code):
1915 * callint.c (check_mark, Fcall_interactively):
1916 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1917 (getenv_internal, sync_process_alive, call_process_exited):
1918 * lisp.h (USE_SAFE_ALLOCA):
1919 Use bool for booleans, instead of int.
1920 * lisp.h, process.h: Adjust prototypes to match above changes.
1921 * callint.c (Fcall_interactively): Don't assume the mark's
1922 offset fits in 'int'.
1923
37ef52bb
PE
19242012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1925
1926 * buffer.c, buffer.h: Use bool for boolean.
1927 * buffer.c (reset_buffer_local_variables)
1928 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1929 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1930 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1931 (overlay_touches_p, overlay_strings, Foverlay_put)
1932 (report_overlay_modification, call_overlay_mod_hooks):
1933 (mmap_enlarge, mmap_set_vars):
1934 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1935 Use bool for booleans, instead of int.
1936 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1937 since the 1-or-0 return value is always ignored anyway.
1938 (mmap_initialized_p):
1939 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1940 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1941
2cc21167
PE
19422012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1943
1944 * bidi.c: Use bool for boolean.
1945 This is a bit more readable, and makes the text segment of bidi.o
1946 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1947 Presumably it's faster too.
1948 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1949 Now bool.
1950 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1951 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1952 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1953 (bidi_explicit_dir_char, bidi_level_of_next_char)
1954 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1955 Use bool for booleans, instead of int.
1956 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1957 (bidi_unshelve_cache): Adjust decls to match code.
1958
7db4ddf4
MR
19592012-08-23 Martin Rudalics <rudalics@gmx.at>
1960
1961 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1962 argument.
1963
b1bb8011
PE
19642012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1965
1966 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1967 * atimer.h: Include <stdbool.h>.
1968
ff687885
DN
19692012-08-22 Dan Nicolaescu <dann@gnu.org>
1970
1971 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1972 compile time tests instead of run time tests on systems that do
1973 not use them.
1974 (FRAME_MAC_P): Remove leftover from deleted code.
1975 * frame.c (syms_of_frame): Remove leftover from deleted code.
1976
4ce7a138
JD
19772012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1978
1979 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1980
d733ec6d
PE
19812012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1982
1983 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1984 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 1985 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
1986 (fontset_add): Return void, for FONTSET_ADD.
1987
d0d2d26f
PE
19882012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1989
fce31d69
PE
1990 * alloc.c: Use bool for booleans.
1991 (gc_in_progress, abort_on_gc)
1992 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1993 (dont_register_blocks) [GC_MALLOC_CHECK]:
1994 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1995 (check_string_bytes, make_specified_string, memory_full)
1996 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1997 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1998 (mark_stack, valid_pointer_p, make_pure_string)
1999 (Fgarbage_collect, survives_gc_p, gc_sweep):
2000 Use bool for booleans, instead of int.
2001 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2002 Remove unused local.
2003 * alloc.c (PURE_POINTER_P):
2004 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2005 * editfns.c (Fformat):
2006 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2007 (Fdo_auto_save):
2008 * fns.c (sweep_weak_table):
2009 * lisp.h (suppress_checking, push_message, survives_gc_p)
2010 (make_pure_string, gc_in_progress, abort_on_gc):
2011 * lread.c (readchar, read1):
2012 * print.c (Fprin1_to_string):
2013 * xdisp.c (push_message):
2014 Use bool for booleans affected directly or indirectly by
2015 alloc.c's changes.
2016
d0d2d26f
PE
2017 Make recently-introduced setters macros.
2018 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2019 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2020 (set_fontset_default, set_fontset_fallback): Rename from their
2021 upper-case counterparts, and make them functions rather than macros.
2022 This is more consistent with the other recently-introduced setters.
2023 These don't need to be inline, since they're local.
2024
d18e2bb6
JD
20252012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2026
2027 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2028 the loop (Bug#12247).
2029
1b9d9d16
PE
20302012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2031
2032 * lisp.h (vcopy): Use memcpy rather than our own loop.
2033 This fixes a performance regression introduced by the recent
2034 addition of vcopy. This means 'vcopy' will need to be modified
2035 for a copying collector, but that's OK. Also, tighten the
2036 checking in the assertion.
2037
b2f09701
EZ
20382012-08-21 Eli Zaretskii <eliz@gnu.org>
2039
2040 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2041 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2042 non-base glyph for the width of the base character, according to
e1f29348
BR
2043 what x_draw_composite_glyph_string_foreground expects.
2044 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2045 expectations, to produce correct width of the composed character.
2046 Reverse the sign of the DU offset produced by ScriptPlace.
2047
9b994fed
PE
20482012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2049
2050 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2051
086ca913
DA
20522012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2053
2054 Avoid direct writes to contents member of struct Lisp_Vector.
2055 * lisp.h (vcopy): New function to copy data into vector.
2056 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2057 * fns.c (Ffillarray): Use ASET.
2058 * keyboard.c (timer_check_2): Use AREF and ASET.
2059 (append_tool_bar_item, Frecent_keys): Use vcopy.
2060 * lread.c (read_vector): Use ASET.
2061 * msdos.c (Frecent_doskeys): Use vcopy.
2062 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2063 (Finternal_merge_in_global_face): Use ASET and vcopy.
2064 * xfont.c (xfont_list_pattern): Likewise.
2065
5481664a
MR
20662012-08-21 Martin Rudalics <rudalics@gmx.at>
2067
2068 * window.c (Fwindow_point): For the selected window always return
2069 the position of its buffer's point.
2070 (Fset_window_point): For the selected window always go in its
2071 buffer to the specified position.
2072
6d470bdd
DA
20732012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2074
2075 Setter macros for fontsets.
2076 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2077 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2078 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2079 Adjust users.
2080
24564fe1
GM
20812012-08-20 Glenn Morris <rgm@gnu.org>
2082
2083 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2084 Don't assume that `ln -f' works.
2085
0a05a035
EZ
20862012-08-20 Eli Zaretskii <eliz@gnu.org>
2087
2088 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2089 and later about non-assignments with no effect. See discussion at
2090 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2091 details.
2092
e46f2325
DA
20932012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2094
2095 Inline setter functions for Lisp_Objects slots of struct specbinding.
2096 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2097 Adjust users.
2098
734fbd86
MR
20992012-08-20 Martin Rudalics <rudalics@gmx.at>
2100
2101 * window.c (select_window): Always make selected window's buffer
2102 current.
2103
f1a95992
DA
21042012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2105
2106 Use AREF and ASET for docstrings of category tables.
2107 * category.h (CATEGORY_DOCSTRING): Use AREF.
2108 (SET_CATEGORY_DOCSTRING): Use ASET.
2109 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2110
e83064be
DA
21112012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2112
2113 Inline setter functions for hash table members.
2114 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2115 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2116 (set_hash_key_and_value, set_hash_index, set_hash_next)
2117 (set_hash_hash): New functions.
2118 * charset.c, fns.c: Adjust users.
2119
4ce60d2e
DA
21202012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2121
2122 Inline getter and setter functions for per-buffer values.
2123 * buffer.h (per_buffer_default, set_per_buffer_default)
2124 (per_buffer_value, set_per_buffer_value): New functions.
2125 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2126 * buffer.c, data.c: Adjust users.
2127
c06c9690
JB
21282012-08-20 Juanma Barranquero <lekktu@gmail.com>
2129
2130 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2131
32bd4250
PE
21322012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2133
bad03192 2134 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2135 as gnulib does this if the system doesn't.
2136 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2137 Remove declaration. MS-Windows declares it on stdlib.h which is
2138 included by conf_post.h.
b69a6d22
PE
2139 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2140 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2141 * vm-limit.c: Include <unistd.h>, for 'environ'.
2142
22d7feb2
PE
2143 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2144 (start_of_data): Remove decl; mem-limits.h provides it.
2145
32bd4250
PE
2146 * xdisp.c (handle_invisible_prop): Make it a bit faster
2147 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2148
450809af
CY
21492012-08-19 Chong Yidong <cyd@gnu.org>
2150
2151 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2152 ends (Bug#3874).
2153
9e677988
AS
21542012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2155
6b1319ce
AS
2156 * .gdbinit: Use call instead of set when calling a function in the
2157 inferior.
2158
9e677988
AS
2159 * data.c (set_internal): Don't use set_blv_found.
2160 (Fkill_local_variable): Likewise.
2161
d7191076
AA
21622012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2163
2164 * nsfont.m (ns_ascii_average_width): Ensure the string
2165 ascii_printable is initialized with a null-terminated character
2166 array. Otherwise, it can contain undesired extra characters.
2167
e757f1c6
PE
21682012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2169
2170 port new setting code to Sun C 5.8 2005/10/13
2171 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2172 Return void, not Lisp_Object. Otherwise, the compiler
2173 complains about (A?B:C) where B is void and C is Lisp_Object
2174 when compiling CHAR_TABLE_SET, due to the recent change to
2175 the API of sub_char_table_set_contents.
2176
a999ce26
CY
21772012-08-18 Chong Yidong <cyd@gnu.org>
2178
2179 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2180 for the string case (Bug#3874).
2181
3f22b86f
PE
21822012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2183
39eb03f1
PE
2184 * buffer.h (BSET): Remove (Bug#12215).
2185 Replace all uses with calls to new setter functions.
2186 (bset_bidi_paragraph_direction, bset_case_canon_table)
2187 (bset_case_eqv_table, bset_directory, bset_display_count)
2188 (bset_display_time, bset_downcase_table)
2189 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2190 (bset_last_selected_window, bset_local_var_alist)
2191 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2192 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2193 (bset_width_table):
2194 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2195 (bset_auto_fill_function, bset_auto_save_file_format)
2196 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2197 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2198 (bset_cache_long_line_scans, bset_case_fold_search)
2199 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2200 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2201 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2202 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2203 (bset_header_line_format, bset_indicate_buffer_boundaries)
2204 (bset_indicate_empty_lines, bset_invisibility_spec)
2205 (bset_left_fringe_width, bset_major_mode, bset_mark)
2206 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2207 (bset_name, bset_overwrite_mode, bset_pt_marker)
2208 (bset_right_fringe_width, bset_save_length)
2209 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2210 (bset_scroll_up_aggressively, bset_selective_display)
2211 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2212 (bset_word_wrap, bset_zv_marker):
2213 * category.c (bset_category_table):
2214 * syntax.c (bset_syntax_table):
2215 New setter functions.
2216
6a09a33b
PE
2217 * process.h (PSET): Remove (Bug#12215).
2218 Replace all uses with calls to new setter functions.
2219 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2220 (PROCESS_INLINE): New macro.
2221 (pset_childp): New setter function.
2222 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2223 * process.c (PROCESS_INLINE):
2224 Define to EXTERN_INLINE, so that the corresponding functions
2225 are compiled into code.
2226 (pset_buffer, pset_command, pset_decode_coding_system)
2227 (pset_decoding_buf, pset_encode_coding_system)
2228 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2229 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2230 (pset_type, pset_write_queue): New setter functions.
2231
e8c17b81
PE
2232 * window.h (WSET): Remove (Bug#12215).
2233 Replace all uses with calls to new setter functions.
2234 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2235 (WINDOW_INLINE): New macro.
2236 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2237 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2238 (wset_total_lines, wset_vertical_scroll_bar)
2239 (wset_window_end_pos, wset_window_end_valid)
2240 (wset_window_end_vpos): New setter functions.
2241 * window.c (WINDOW_INLINE):
2242 Define to EXTERN_INLINE, so that the corresponding functions
2243 are compiled into code.
2244 (wset_combination_limit, wset_dedicated, wset_display_table)
2245 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2246 (wset_new_normal, wset_new_total, wset_next_buffers)
2247 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2248 (wset_prev_buffers, wset_right_fringe_width)
2249 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2250 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2251 (wset_window_parameters):
2252 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2253 (wset_column_number_displayed, wset_region_showing):
2254 New setter functions.
2255
3f22b86f
PE
2256 * termhooks.h (TSET): Remove (Bug#12215).
2257 Replace all uses with calls to new setter functions.
2258 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2259 (TERMHOOKS_INLINE): New macro.
2260 (tset_charset_list, tset_selection_alist): New setter functions.
2261 * terminal.c (TERMHOOKS_INLINE):
2262 Define to EXTERN_INLINE, so that the corresponding functions
2263 are compiled into code.
2264 (tset_param_alist): New setter function.
2265
742af32f
PE
22662012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2267
15dbb4d6
PE
2268 * keyboard.h (KSET): Remove (Bug#12215).
2269 Replace all uses with calls to new setter functions.
2270 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2271 (KEYBOARD_INLINE): New macro.
2272 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2273 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2274 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2275 New setter functions.
2276 * keyboard.c (KEYBOARD_INLINE):
2277 Define to EXTERN_INLINE, so that the corresponding functions
2278 are compiled into code.
2279 (kset_echo_string, kset_kbd_queue)
2280 (kset_keyboard_translate_table, kset_last_prefix_arg)
2281 (kset_last_repeatable_command, kset_local_function_key_map)
2282 (kset_overriding_terminal_local_map, kset_real_last_command)
2283 (kset_system_key_syms): New setter functions.
2284
f00af5b1
PE
2285 * frame.h (FSET): Remove (Bug#12215).
2286 Replace all uses with calls to new setter functions.
2287 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2288 (FRAME_INLINE): New macro.
2289 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2290 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2291 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2292 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2293 (fset_param_alist, fset_root_window, fset_scroll_bars)
2294 (fset_selected_window, fset_title, fset_tool_bar_items)
2295 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2296 * frame.c (FRAME_INLINE):
2297 Define to EXTERN_INLINE, so that the corresponding functions
2298 are compiled into code.
2299 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2300
0c94c8d6
PE
2301 A few more naming-convention fixes for getters and setters.
2302 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2303 and rename from buffer_overlays_set_before.
2304 (set_buffer_overlays_after): Move here from buffer.h, and rename
2305 from buffer_overlays_set_after.
2306 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2307 All uses changed.
2308 (set_buffer_intervals): Rename from buffer_set_intervals.
2309 * intervals.c (set_interval_object): Move here from intervals.h,
2310 and rename from interval_set_object.
2311 (set_interval_left): Move here from intervals.h, and rename from
2312 interval_set_left.
2313 (set_interval_right): Move here from intervals.h, and rename from
2314 interval_set_right.
2315 (copy_interval_parent): Move here from intervals.h, and rename from
2316 interval_copy_parent.
2317 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2318 (set_interval_plist): Rename from interval_set_plist.
2319 Return void, not Lisp_Object, since no caller uses the result.
2320 * lisp.h (string_intervals): Rename from string_get_intervals.
2321 (set_string_intervals): Rename from string_set_intervals.
2322
34dabdb7
PE
2323 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2324 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2325 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2326 All uses changed. See the end of
2327 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2328
742af32f
PE
2329 * lisp.h (CSET): Remove (Bug#12215).
2330 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2331 (set_char_table_purpose): New functions,
2332 replacing CSET. All uses changed. For example, replace
2333 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2334 "set_char_table_parent (char_table, parent);".
742af32f
PE
2335 The old version was confusing because it used the same name
2336 'parent' for two different things.
2337
a04e2c62
DA
23382012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2339
2340 Functions to get and set Lisp_Object fields of buffer-local variables.
2341 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2342 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2343 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2344 * data.c, eval.c, frame.c: Adjust users.
2345
383dcbf9
CY
23462012-08-17 Chong Yidong <cyd@gnu.org>
2347
2348 * xfaces.c (merge_face_vectors): If the target font specfies a
2349 font spec, make the font's attributes take precedence over
2350 directly-specified attributes.
2351 (merge_face_ref): Recognize :font.
2352
44386687
DA
23532012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2354
2355 Do not use memcpy for copying intervals.
2356 * intervals.c (reproduce_interval): New function.
2357 (reproduce_tree, reproduce_tree_obj): Use it.
2358 (reproduce_tree_obj): Remove prototype.
2359
927c7216
PE
23602012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2361
2362 * lisp.h (duration_to_sec_usec): Remove unused decl.
2363
93044f7b
AA
23642012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2365
2366 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2367 to an allocated instance of NSString, not to the class itself.
2368
9851e4a5
JB
23692012-08-17 Juanma Barranquero <lekktu@gmail.com>
2370
2371 * makefile.w32-in (C_CTYPE_H): New macro.
2372 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2373 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2374 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2375
620f13b0
PE
23762012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2377
2378 Use ASCII tests for character types.
2379 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2380 * xfns.c, xterm.c:
2381 Don't include <ctype.h>; was not needed.
2382 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2383 * sysdep.c, xfaces.c:
2384 Include <c-ctype.h> instead of <ctype.h>.
2385 * nsterm.m: Include <c-ctype.h>.
2386 * charset.c (read_hex):
2387 * doc.c (Fsnarf_documentation):
2388 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2389 (DRIVE_LETTER) [DOS_NT]:
2390 (Ffile_name_directory, Fexpand_file_name)
2391 (Fsubstitute_in_file_name):
2392 * font.c (font_parse_xlfd, font_parse_fcname):
2393 * frame.c (x_set_font_backend):
2394 * gtkutil.c (xg_get_font):
2395 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2396 * nsimage.m (hexchar):
2397 * nsterm.m (ns_xlfd_to_fontname):
2398 * sysdep.c (system_process_attributes):
2399 * xfaces.c (hash_string_case_insensitive):
2400 Use C-locale tests instead of locale-specific tests for character
2401 types, since we want the ASCII interpretation here, not the
2402 interpretation suitable for whatever happens to be the current locale.
2403
52162052
MR
24042012-08-16 Martin Rudalics <rudalics@gmx.at>
2405
2406 Consistently check windows for validity/liveness
2407 (Bug#11984, Bug#12025, Bug#12026).
2408 * lisp.h (CHECK_VALID_WINDOW): New macro.
2409 * window.c (decode_window): Rename to decode_live_window.
2410 (decode_valid_window, Fwindow_valid_p): New functions.
2411 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2412 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2413 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2414 (Fwindow_prev_sibling, Fwindow_combination_limit)
2415 (Fset_window_combination_limit, Fwindow_use_time)
2416 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2417 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2418 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2419 (Fwindow_hscroll, Fset_window_hscroll)
2420 (Fwindow_redisplay_end_trigger)
2421 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2422 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2423 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2424 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2425 (Fwindow_end, Fset_window_point, Fset_window_start)
2426 (Fpos_visible_in_window_p, Fwindow_line_height)
2427 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2428 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2429 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2430 (Fset_window_parameter, Fwindow_display_table)
2431 (Fset_window_display_table, Fdelete_other_windows_internal)
2432 (Fset_window_buffer, Fset_window_new_total)
2433 (Fset_window_new_normal, Fdelete_window_internal)
2434 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2435 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2436 (Fwindow_scroll_bars): Check whether argument window is a valid or
2437 live window. Update doc-strings.
2438 (syms_of_window): New symbol Qwindow_valid_p.
2439 * keyboard.c (Fposn_at_x_y): Check whether argument
2440 frame_or_window denotes a valid window.
2441
2751c80f
DA
24422012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2443
2444 Fix previous char table change.
2445 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2446 * chartab.c (optimize_sub_char_table): Likewise.
2447
032a42c8
CY
24482012-08-16 Chong Yidong <cyd@gnu.org>
2449
a2d19368
CY
2450 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2451
032a42c8
CY
2452 * xfont.c (xfont_open):
2453 * xftfont.c (xftfont_open): Set the font's max_width field.
2454
2455 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2456 min_width to space_width and average_width to the average over
2457 printable ASCII characters.
2458 (ns_char_width): Code cleanup.
2459 (ns_ascii_average_width): New utility function.
2460
2461 * font.h (struct font): Update comments.
2462
a098c930
DA
24632012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2464
032a42c8 2465 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2466 * lisp.h (CSET): New macro.
2467 (char_table_set_extras, char_table_set_contents)
2468 (sub_char_table_set_contents): New function.
2469 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2470 * syntax.c: Adjust users.
2471
8be3a09c
SM
24722012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2473
2474 * eval.c (eval_sub): Bind lexical-binding.
2475 * lread.c (Qlexical_binding): Make non-static.
2476
ac4845a6
JD
24772012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2478
ddee6515
JD
2479 * nsmenu.m (popupSession): Remove.
2480 (pop_down_menu): Remove endModalSession.
2481 (timeout_handler:): New method.
2482 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2483 Call runModalForWindow. Check timer_fired when it returns.
2484 If not set, cancel timer and break out of loop.
2485 Otherwise loop again, with a new timeout.
2486
2487 * nsterm.m: Include fcntl.h if present.
2488 (fd_entry, t_readfds, inNsSelect): Remove.
2489 (select_writefds, select_valid, select_timeout, selfds)
2490 (select_mutex, apploopnr): Add.
2491 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2492 Otherwise call kbd_buffer_store_event.
2493 (ns_send_appdefined): Remove release of fd_entry.
2494 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2495 Increment and decrement apploopnr.
2496 (ns_select): If no file descriptors, just do a NSTimer.
2497 Otherwise copy read/write masks and start select thread (fd_handler).
2498 Start main loop and wait for application defined event.
2499 Inform select thread to stop selecting after main loop is exited.
2500 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2501 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2502 (fd_handler:): Loop forever, wait for info from the main thread
2503 to either start or stop selecting. When select returns, send
2504 and appdefined event.
2505 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2506 If not call kbd_buffer_store_event.
2507
2508 * nsterm.h (EmacsApp): fd_handler takes id argument.
2509 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2510
ac4845a6
JD
2511 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2512
eb424fe3
EZ
25132012-08-15 Eli Zaretskii <eliz@gnu.org>
2514
2515 * region-cache.c (move_cache_gap): Update gap_len using the actual
2516 growth of the boundaries array. Do not change cache_len.
2517 (Bug#12196)
2518
4e6a86c6
DA
25192012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2520
2521 Generalize and cleanup font subsystem checks.
2522 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2523 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2524 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2525
5bf192ca
DA
25262012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2527
2528 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2529
f2045622
CY
25302012-08-15 Chong Yidong <cyd@gnu.org>
2531
8be3a09c
SM
2532 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2533 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2534 extract the font descriptor instead of just the font name.
2535 In that case, return a font spec instead of a string.
f2045622
CY
2536 (x_last_font_name): Move to this file from xfns.c.
2537
2538 * xfns.c (Fx_select_font): The return value can also be a font
2539 spec. Move x_last_font_name management to gtkutil.c.
2540
2541 * xfaces.c: Make font weight and style symbols non-static.
2542
7f6feb56
SM
25432012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2544
2545 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2546 (bug#12117).
2547
fecbd8ff
SM
25482012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2549
2550 * alloc.c (Fgarbage_collect): Use plural form consistently.
2551
9b8d5165
EZ
25522012-08-14 Eli Zaretskii <eliz@gnu.org>
2553
2554 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2555 iteration through the command loop. Fixes a problem whereby mouse
2556 movements are ignored until the first mouse click.
2557
f5d9e83a
PE
25582012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2559
2560 Use bool, not int, for Lisp booleans.
2561 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2562 makes Emacs a bit smaller and presumably a bit faster.
2563 * lisp.h: Include <stdbool.h>.
2564 (struct Lisp_Boolfwd, defvar_bool):
2565 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2566 * regex.c [!emacs]: Include <stdbool.h>.
2567 (false, true): Remove; <stdbool.h> does this for us now.
2568
55802e4a
CY
25692012-08-14 Chong Yidong <cyd@gnu.org>
2570
4abcdac8
CY
2571 * character.c (Fcharacterp): Doc fix (Bug#12076).
2572
2573 * data.c (Findirect_variable): Doc fix (Bug#11040).
2574
55802e4a
CY
2575 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2576
2577 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2578 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2579
8e99d072
BR
25802012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2581
2582 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2583 (bug#12022).
2584
08908aca
MR
25852012-08-14 Martin Rudalics <rudalics@gmx.at>
2586
2587 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2588 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2589 * minibuf.c (choose_minibuf_frame, read_minibuf):
2590 * w32fns.c (x_create_tip_frame):
2591 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2592 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2593
56120d6f
PE
25942012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2595
2596 * intervals.c (offset_intervals): Remove obsolete comment.
2597
67b77c0b
AS
25982012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2599
2600 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2601
f48b82fd
GR
26022012-08-14 Gergely Risko <gergely@risko.hu>
2603
2604 * coding.c (decode_coding): Record buffer modification before
2605 disabling undo_list (Bug#11773).
2606
fd318b54
DA
26072012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2608
2609 Revert and cleanup some recent overlay changes.
2610 * buffer.h (enum overlay_type): Remove.
2611 (buffer_get_overlays, buffer_set_overlays): Likewise.
2612 (buffer_set_overlays_before, buffer_set_overlays_after):
2613 New function. Adjust users.
2614 (unchain_both): Add eassert.
2615
41a62dd9
DA
26162012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2617
2618 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2619
5884c324
PE
26202012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2621
2622 * gtkutil.c (xg_mark_data): Don't assume C99.
2623
ca06f160
JD
26242012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2625
2626 * gtkutil.c (xg_frame_tb_info): New struct.
2627 (TB_INFO_KEY): New define.
2628 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2629 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2630 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2631 if not present.
2632 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 2633 is up to date. Otherwise store new data.
ca06f160
JD
2634 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2635
7864a3f7
DA
26362012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2637
2638 Use KSET for write access to Lisp_Object members of struct kboard.
2639 * keyboard.h (KSET): New macro.
2640 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2641 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2642 * xterm.c: Adjust users.
2643
4c31be61
DA
26442012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2645
2646 Use BSET for write access to Lisp_Object members of struct buffer.
2647 * buffer.h (BSET): New macro.
2648 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2649 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2650 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2651 * window.c, xdisp.c, xfns.c: Adjust users.
2652
14ae4239
BT
26532012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2654
2655 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2656
32bcadb4
JD
26572012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2658
3d29b2ce 2659 * nsterm.m (not_in_argv): New function.
fc0c31f8 2660 (application:openFile, application:openTempFile:):
3d29b2ce
JD
2661 (application:openFileWithoutUI:, application:openFiles:): Open file
2662 if not_in_argv returns non-zero (bug#12171).
2663
32bcadb4 2664 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
2665 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2666 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
2667 (xg_get_font_name): Use those functions/macros here.
2668 Reported by Frans Oilinki <moilinki@gmail.com>.
2669
9ff9402d 26702012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
2671
2672 * unexmacosx.c (copy_data_segment): Copy initialized data in
2673 statically linked libraries from input file rather than memory.
2674
db74a5fc
YM
2675 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2676 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2677 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2678
25e65510
GM
26792012-08-10 Glenn Morris <rgm@gnu.org>
2680
2681 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2682 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2683
7961135c
DA
26842012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2685
2686 Fix last change to allow compilation with low optimization levels.
2687 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2688 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2689
42b3a444
DA
26902012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2691
2692 Use common inline syntax in intervals.h.
2693 * intervals.h (INTERVALS_INLINE): New macro.
2694 Change all users from LISP_INLINE.
2695
9fb0c957
DA
26962012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2697
2698 Define Qnone once for all platforms.
2699 * frame.c (Qnone): Define here.
2700 (syms_of_frame): DEFSYM it.
2701 * lisp.h (Qnone): New declaration.
2702 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2703 * xfns.c: Remove duplication. Adjust users.
2704
65e8ee52
DA
27052012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2706
2707 Remove unused macros from intervals.h.
2708 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2709 * intervals.c: Adjust comment.
2710
9b855fd6
EZ
27112012-08-10 Eli Zaretskii <eliz@gnu.org>
2712
2713 * w32fns.c <w32_unicode_gui>: New static variable.
2714 (globals_of_w32fns): Initialize it according to os_subtype.
2715 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2716 testing os_subtype.
2717
39cb9e56 27182012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
2719 Eli Zaretskii <eliz@gnu.org>
2720
2721 Fix bug #10299 with Unicode characters sent by customized
2722 keyboards created by MSKLC.
2723 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2724 (w32_init_class): Use it to initialize the Emacs class with either
2725 ANSI or Unicode API calls.
2726 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2727 later.
2728 (w32_wnd_proc): If the character code sent by WM_CHAR or
2729 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2730 original message. Call DefWindowProcW on NT and later.
2731
9374581a
GM
27322012-08-10 Glenn Morris <rgm@gnu.org>
2733
4b94e8cf
GM
2734 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2735
9374581a
GM
2736 * lisp.h (DIRECTORY_SEP): Let configure set it.
2737
a2752828
DA
27382012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2739
2740 Use TSET for write access to Lisp_Object slots of struct terminal.
2741 * termhooks.h (TSET): New macro.
2742 * coding.c, terminal.c, xselect.c: Adjust users.
2743
cc92c454
SM
27442012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2745
2746 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2747 the failing expression, include them in the error message.
2748 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2749 * lisp.h (internal_condition_case_n): Update declaration.
2750
4cb3e6b3
DA
27512012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2752
2753 Inline functions to examine and change buffer overlays.
2754 * buffer.c (unchain_both): New function.
2755 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2756 (buffer_has_overlays): New function.
2757 (enum overlay_type): New enum.
2758 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2759 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2760
8707c1e5
DA
27612012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2762
2763 Inline functions to examine and change buffer intervals.
2764 * alloc.c (mark_interval_tree): Remove.
2765 (MARK_INTERVAL_TREE): Simplify.
2766 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2767 * intervals.c (buffer_balance_intervals): New function.
2768 (graft_intervals_into_buffer): Adjust indentation.
2769 (set_intervals_multibyte): Simplify.
2770 * buffer.h (BUF_INTERVALS): Remove.
2771 (buffer_get_intervals, buffer_set_intervals): New function.
2772 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2773 * intervals.c, textprop.c: Adjust users.
2774
ad8c997f
DA
27752012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2776
2777 Inline functions to examine and change string intervals.
2778 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2779 (string_get_intervals, string_set_intervals): New function.
2780 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2781 * lread.c, print.c, textprop.c: Adjust users.
2782
32ac3a6b
GM
27832012-08-08 Glenn Morris <rgm@gnu.org>
2784
2785 * lisp.mk (lisp): Remove language/persian.elc.
2786
77c7bcb1
DA
27872012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2788
2789 Cleanup intervals.
2790 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2791 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
2792 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2793 Adjust comment. Move under #if 0.
77c7bcb1
DA
2794 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2795 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2796
9c08a8d4
DA
27972012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2798
2799 Check total length of intervals with eassert.
2800 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2801 * intervals.c: Change all users to eassert.
2802
26d16b35
EZ
28032012-08-07 Eli Zaretskii <eliz@gnu.org>
2804
14ae4239
BT
2805 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2806 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
2807 INTERNAL_FIELD in Lisp_Cons.
2808
c644523b
DA
28092012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2810
2811 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2812 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2813 name since all xname users are fixed long time ago. Do not
2814 use INTERNAL_FIELD.
2815 (set_symbol_name, set_symbol_function, set_symbol_plist):
2816 (set_symbol_next, set_overlay_plist): New function.
2817 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2818 (struct Lisp_Overlay): Likewise.
2819 (CVAR, MVAR, SVAR): Remove.
2820 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2821 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2822 * xterm.c: Adjust users.
2823 * .gdbinit: Change to use name field of struct Lisp_Symbol
2824 where appropriate.
2825
6a3d20cc
DA
28262012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2827
2828 Basic functions to set Lisp_Object and pointer slots of intervals.
2829 * intervals.h (interval_set_parent, interval_set_object):
2830 (interval_set_left, interval_set_right, interval_set_plist):
2831 (interval_copy_parent): New function.
2832 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
2833 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2834 Adjust indentation.
6a3d20cc
DA
2835 (INTERVAL_SIZE): Remove. Adjust users.
2836 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2837
4d2b044c
DA
28382012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2839
2840 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2841 * process.h (PGET): Remove.
2842 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2843 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2844
d3d50620
DA
28452012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2846
2847 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2848 * window.h (WGET): Remove.
2849 (struct window): Do not use INTERNAL_FIELD.
2850 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2851 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2852 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2853 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2854 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2855 Adjust users.
2856
d10a51dc
CY
28572012-08-07 Chong Yidong <cyd@gnu.org>
2858
2859 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2860 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2861 (Fdelete_window_internal): Signal an error if the window is not on
2862 a live frame (Bug#12025).
2863
e69b0960
DA
28642012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2865
2866 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2867 * frame.h (FGET): Remove.
2868 (struct frame): Do not use INTERNAL_FIELD.
2869 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2870 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2871 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2872 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2873
25a20a3a
JB
28742012-08-06 Juanma Barranquero <lekktu@gmail.com>
2875
2876 * w32.c: Silence compiler warnings.
2877 (map_w32_filename): Remove unused variable `is_fat'.
2878 (chase_symlinks): Add parentheses around expression.
2879
1c6f11f4
GM
28802012-08-06 Glenn Morris <rgm@gnu.org>
2881
1db4583a
GM
2882 * sysdep.c: Respect BROKEN_GETWD.
2883
1c6f11f4
GM
2884 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2885 Let configure handle it.
2886 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2887
2b90362b
DA
28882012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2889
2890 Use GCALIGNMENT where appropriate.
2891 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2892 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2893 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2894
5f50daf2
EZ
28952012-08-06 Eli Zaretskii <eliz@gnu.org>
2896
14ae4239
BT
2897 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2898 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 2899
cbcc7007
SM
29002012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2901
2902 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2903 that should be sufficient for everyone.
2904
4d365fa4
JD
29052012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2906
2907 * keyboard.c (timer_check_2): Add break so timer_check returns next
2908 timeout.
2909
dd86bd82
DA
29102012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2911
2912 Fix Windows build errors introduced after converting to WGET and WSET.
2913 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2914 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2915
054e1668
JD
29162012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2917
2918 * nsterm.m (ns_frame_rehighlight): Use FSET.
2919
2920 * nsmenu.m (ns_update_menubar): Use FSET.
2921
21238f11
DA
29222012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2923
2924 Separate read and write access to Lisp_Object slots of Lisp_Process.
2925 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2926 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2927
077288cf
DA
29282012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2929
2930 Separate read and write access to Lisp_Object slots of struct window.
2931 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2932 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2933 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2934 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2935 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2936 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2937 Adjust users.
2938
71688bd7
DA
29392012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2940
2941 Fix Windows build errors introduced after converting to FGET and FSET.
2942 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2943 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2944 (w32_judge_scroll_bars): Change to use FSET.
2945 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2946
f99bac93
DA
29472012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2948
2949 Fix replacement typo.
2950 * window.c (replace_window): Set root_window instead of
2951 selected_window. This fixes a total window subsystem
2952 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2953
8c2a0f2d
GM
29542012-08-06 Glenn Morris <rgm@gnu.org>
2955
2956 * lisp.mk (lisp): Add language/persian.elc.
2957
edd74c35
DA
29582012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2959
2960 Separate read and write access to Lisp_Object slots of struct frame.
2961 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2962 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2963 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2964 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2965 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2966
8671676c
AS
29672012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2968
2969 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2970
663e2b3f
DA
29712012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2972
2973 Generalize common compile-time constants.
2974 * lisp.h (header_size, bool_header_size, word_size): Now here.
2975 (struct Lisp_Vector): Add comment.
2976 (struct Lisp_Bool_Vector): Move up to define handy constants.
2977 (VECSIZE, PSEUDOVECSIZE): Simplify.
2978 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2979 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2980 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2981 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2982 * xfont.c, xmenu.c: Use word_size where appropriate.
2983
d32e47af
LM
29842012-08-05 Lawrence Mitchell <wence@gmx.li>
2985
2986 * search.c (Freplace_match): Treat \? in the replacement text
2987 literally (Bug#8161).
2988
e5d9c0d1
CY
29892012-08-05 Chong Yidong <cyd@gnu.org>
2990
2991 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2992 * frame.c (Vdelete_frame_functions):
2993 * emacs.c (Vkill_emacs_hook): Doc fix.
2994
8da0576b
EZ
29952012-08-04 Eli Zaretskii <eliz@gnu.org>
2996
2997 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2998 --with-x-toolkit=no builds.
2999 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3000
02676e5d
CY
30012012-08-04 Chong Yidong <cyd@gnu.org>
3002
3003 * syntax.c (Fmodify_syntax_entry): Doc fix.
3004
97147da9
EZ
30052012-08-04 Eli Zaretskii <eliz@gnu.org>
3006
76151e2c
EZ
3007 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3008 * w32.c (init_environment): Change the default values of many
3009 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3010 them into environment when they were not already defined.
3011 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3012 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3013 (check_windows_init_file): Now external, not static.
3014 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3015 called when Vload_path is already set up.
3016
3017 * w32.h (check_windows_init_file): Add prototype.
3018
3019 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3020 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3021 compatibility with Posix platforms.
3022 (main): Move the call to check_windows_init_file to here from
3023 w32.c.
3024 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3025 any, in the DEFALT argument into the root of the Emacs build or
3026 installation tree, as appropriate.
3027
3028 * callproc.c (init_callproc_1): Call decode_env_path instead of
3029 doing its equivalent by hand.
3030 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3031 the code that sets Vexec_path run on MS-Windows.
3032
3033 * lread.c (init_lread): Add comments to #ifdef's.
3034
97147da9
EZ
3035 * msdos.c (dos_set_window_size, IT_update_begin)
3036 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3037 instead of direct references.
3038
185ee146
PE
30392012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3040
3041 Export DEFAULT_REHASH_* to GDB.
3042 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3043 Now constants, not macros.
3044
8834c57a
PE
30452012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3046
98c6f1e3
PE
3047 Remove unnecessary casts involving pointers.
3048 These casts are no longer needed now that we assume C89 or later,
3049 since they involve casting to or from void *.
3050 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3051 (make_pure_float, make_pure_vector):
3052 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3053 * macros.c (Fstart_kbd_macro):
3054 * menu.c (find_and_return_menu_selection):
3055 * minibuf.c (read_minibuf_noninteractive):
3056 * sysdep.c (closedir):
3057 * xdisp.c (x_produce_glyphs):
3058 * xfaces.c (compare_fonts_by_sort_order):
3059 * xfns.c (x_real_positions, select_visual):
3060 * xselect.c (x_stop_queuing_selection_requests)
3061 (x_get_window_property, x_get_window_property_as_lisp_data):
3062 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3063 Remove unnecessary pointer casts.
3064 * alloc.c (record_xmalloc): New function.
3065 * lisp.h (record_xmalloc): New decl.
3066 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3067 more like a function. This is because the pointer cast is not
3068 needed. All uses changed.
3069 * print.c (print_string, print_error_message): Avoid length recalc.
3070
8834c57a
PE
3071 Improve fix for macroexp crash with debugging (Bug#12118).
3072 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3073 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3074 not supposed to be invoked from the garbage collector.
3075 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3076 (gc_aset): New function, which is like ASET but can be
3077 used in the garbage collector.
3078 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3079 (set_hash_index): Use it instead of ASET.
3080
6dad7178
EZ
30812012-08-03 Eli Zaretskii <eliz@gnu.org>
3082
3083 Support symlinks on latest versions of MS-Windows.
3084 * w32.c: Include winioctl.h and aclapi.h.
3085 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3086 (revert_to_self): Forward declarations of static functions.
3087 <static BOOL g_b_init_get_security_info>:
3088 <g_b_init_create_symbolic_link>: New static flags.
3089 (globals_of_w32): Initialize them to zero.
3090 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3091 (map_w32_filename): Improve commentary. Simplify switch.
3092 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3093 headers (most versions of MinGW w32api don't).
3094 (get_security_info, create_symbolic_link)
3095 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3096 New functions.
3097 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3098 in the argument file name.
3099 (sys_access): Call unc_volume_file_attributes only if
3100 GetFileAttributes fails with network-related error codes.
3101 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3102 have the required privileges.
14ae4239 3103 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3104 get_file_security_desc.
3105 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3106 with addition of handling of symlinks and support for 'lstat'.
3107 If possible, get file's attributes and security information by
6dad7178
EZ
3108 handle, not by name. Produce S_IFLNK bit for symlinks, when
3109 called from 'lstat'.
3110 (stat, lstat): New functions, call 'stat_worker'.
3111 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3112 symlinks when the underlying filesystem supports them.
3113
f162bcc3
PE
31142012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3115
79ea6c20
PE
3116 Fix macroexp crash on Windows with debugging (Bug#12118).
3117 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3118 checking subscripts; problem introduced with the recent
3119 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3120 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3121 since it's used in non-static inline functions now.
3122
c0ce93fd
PE
3123 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3124 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3125
f162bcc3
PE
3126 Use C99-style 'extern inline' if available.
3127 * buffer.h (BUFFER_INLINE):
3128 * category.h (CATEGORY_INLINE):
3129 * character.h (CHARACTER_INLINE):
3130 * charset.h (CHARSET_INLINE):
3131 * composite.h (COMPOSITE_INLINE):
3132 * dispextern.h (DISPEXTERN_INLINE):
3133 * lisp.h (LISP_INLINE):
3134 * systime.h (SYSTIME_INLINE):
3135 New macro, replacing 'static inline' in this header.
3136 * buffer.h, category.h, character.h, charset.h, composite.h:
3137 * dispextern.h, lisp.h, systime.h:
3138 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3139 * alloc.c (LISP_INLINE):
3140 * buffer.c (BUFFER_INLINE):
3141 * category.c (CATEGORY_INLINE):
3142 * character.c (CHARACTER_INLINE):
3143 * charset.c (CHARSET_INLINE):
3144 * composite.c (COMPOSITE_INLINE):
3145 * dispnew.c (DISPEXTERN_INLINE):
3146 * sysdep.c (SYSTIME_INLINE):
3147 Define to EXTERN_INLINE, so that the corresponding functions
3148 are compiled into code.
3149 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3150 (INLINE_HEADER_END): New macros.
3151 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3152 since it's used in non-static inline functions now.
a8333d03 3153 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3154
837b365b
GM
31552012-08-02 Glenn Morris <rgm@gnu.org>
3156
d66b744d
GM
3157 * s/: Remove empty directory.
3158
837b365b
GM
3159 * s/ms-w32.h: Move to ../nt/inc.
3160 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3161 Update for new ms-w32.h location.
3162
13294f95
PE
31632012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3164
3165 Port to Solaris 8.
3166 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3167
90df0db3
GM
31682012-08-02 Glenn Morris <rgm@gnu.org>
3169
3170 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3171 hard-coding the path separator.
3172
4939150c
PE
31732012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3174
3175 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3176 This how ASET and AREF are supposed to work, and makes
3177 it easier to think about future improvements. See
3178 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3179 * charset.h (set_charset_attr): New function.
3180 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3181 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3182 (aref_addr): New function. All uses of &AREF(...) changed.
3183 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3184 (set_hash_index): New functions. All lvalue-style uses of
3185 HASH_KEY etc. changed.
3186 * keyboard.c (set_prop): New function. All lvalue-style uses
3187 of PROP changed.
3188
947b2afd
AA
31892012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3190
3191 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3192 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3193 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3194 * nsfns.m (ns_set_name_as_filename): Likewise.
3195 * nsmenu.m (ns_update_menubar): Likewise.
3196 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3197
4f5d0325
EZ
31982012-08-01 Eli Zaretskii <eliz@gnu.org>
3199
2008beae
EZ
3200 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3201 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3202 objects.
2008beae 3203
4f5d0325
EZ
3204 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3205
fe3cc771
GM
32062012-08-01 Glenn Morris <rgm@gnu.org>
3207
3208 * s/msdos.h: Remove file.
3209 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3210 * Makefile.in (S_FILE): Remove.
3211 (config_h): Remove S_FILE.
3212
c90acc54
JB
32132012-08-01 Juanma Barranquero <lekktu@gmail.com>
3214
3215 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3216 Remove; moved to nt/config.nt.
3217
d8a05828
DA
32182012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3219
3220 Use INTERNAL_FIELD for conses and overlays.
3221 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3222 Remove obsolete comment.
3223 (MVAR): New macro.
3224 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3225 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3226
8271d590
DA
32272012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3228
3229 Use INTERNAL_FIELD for symbols.
3230 * lisp.h (SVAR): New macro. Adjust users.
3231 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3232 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3233
3193acd2
DA
32342012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3235
3236 Use INTERNAL_FIELD for processes.
3237 * process.h (PVAR): New macro. Adjust style.
3238 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3239 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3240
3a45383a
DA
32412012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3242
3243 Use INTERNAL_FIELD for windows.
3244 * window.h (WVAR): New macro.
3245 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3246 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3247 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3248 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3249 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3250 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3251
c1dbc63c
PE
32522012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3253
3254 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3255
5c0c0e8a
GM
32562012-08-01 Glenn Morris <rgm@gnu.org>
3257
3258 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3259 Move to configure.ac.
3260
552a99b4
JB
32612012-08-01 Juanma Barranquero <lekktu@gmail.com>
3262
3263 * makefile.w32-in (CONFIG_H): Update dependencies.
3264 (CONF_POST_H): New macro.
3265
3266 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3267
8d8e2dfe
GM
32682012-07-31 Glenn Morris <rgm@gnu.org>
3269
bc96620a
GM
3270 * Makefile.in (S_FILE): No longer set by configure.
3271
476b1b2d
GM
3272 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3273 is available.
3274 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3275
b2c7a106
GM
3276 * process.h (NULL_DEVICE):
3277 * emacs.c (SEPCHAR):
3278 * editfns.c (USER_FULL_NAME): Let configure set them.
3279
d53d062a
GM
3280 * s/README, s/template.h: Remove files.
3281
4515017f
GM
3282 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3283
8d8e2dfe
GM
3284 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3285 Move to configure.ac.
3286
5b20b3cc
EZ
32872012-07-31 Eli Zaretskii <eliz@gnu.org>
3288
1e0afd9a
EZ
3289 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3290 resulting renaming of 'struct frame' members.
3291
5b20b3cc
EZ
3292 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3293
3294 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3295 after introduction of FVAR.
3296
f1310128
JD
32972012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3298
79e721e0
JD
3299 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3300
3301 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3302 instead of compositeToPoint.
3303 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3304
8d7c7eed 3305 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3306
e34f7f79
DA
33072012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3308
3309 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3310 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3311 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3312 (BVAR): Change to use INTERNAL_FIELD.
3313 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3314 (KVAR): Change to use INTERNAL_FIELD.
3315 * frame.h (FVAR): New macro.
3316 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3317 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3318 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3319 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3320 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3321
c09bfb2f
DA
33222012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3323
3324 Miscellaneous fixes for non-default X toolkits.
3325 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3326 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3327 Move under #ifdef USE_LUCID.
3328 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3329 definition and usage to avoid warnings.
3330
14c114ae
JD
33312012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3332
3333 * nsterm.m (openFiles): Fix previous checkin.
3334
3bd21e82
PE
33352012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3336
3337 * indent.c (compute_motion): Remove unused local.
3338
c1529ded
GM
33392012-07-31 Glenn Morris <rgm@gnu.org>
3340
400d5621
GM
3341 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3342
268e2432
GM
3343 * conf_post.h [USG5_4]:
3344 Move remaining contents of s/usg5-4-common.h here.
3345 * s/usg5-4-common.h: Remove file.
3346
7552f3ee
GM
3347 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3348 * s/irix6-5.h: Remove file.
3349
6a381852
GM
3350 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3351 * s/darwin.h: Remove file.
3352
c1529ded
GM
3353 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3354 * s/hpux10-20.h: Remove file, which is now empty.
3355
b429a4ee
GM
33562012-07-30 Glenn Morris <rgm@gnu.org>
3357
3358 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3359 * Makefile.in (config_h): Add conf_post.h.
3360 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3361
adff3182
JD
33622012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3363
3364 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3365 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3366 (openFile, openTempFile, openFileWithoutUI, openFiles):
3367 Open files only if ns_do_open_file.
adff3182 3368
c32af1e4
PE
33692012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3370
7393bcbb
PE
3371 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3372 This no-op macro hasn't been needed for many years.
3373 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3374
c32af1e4
PE
3375 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3376 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3377 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3378 gdb_make_enums_visible.
3379 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3380 (DIRECTORY_SEP): Now a constant, not a macro.
3381
302fc036
EZ
33822012-07-30 Eli Zaretskii <eliz@gnu.org>
3383
3384 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3385 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3386
3387 * w32term.c <w32_keyboard_codepage>: Renamed from
3388 keyboard_codepage and now external. All users changed.
3389
3390 * w32term.h: Add declaration of w32_keyboard_codepage.
3391
3392 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3393 the codepage to translate keys to Unicode. If this argument is
3394 -1, use the value returned by GetConsoleCP. All callers changed.
3395
88fb40b4
PE
33962012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3397
0aee6912
PE
3398 Update .PHONY listings in makefiles.
3399 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3400 bootstrap-clean, distclean, maintainer-clean, versioclean,
3401 extraclean, frc.
3402
88fb40b4
PE
3403 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3404 This is a bit clearer. Fix some commentary typos.
3405
0a763bd1
GM
34062012-07-30 Glenn Morris <rgm@gnu.org>
3407
32bac6d6
GM
3408 * s/netbsd.h: Let configure include signal.h if needed.
3409 Remove file, which is now empty.
3410
b65e7c46
GM
3411 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3412 Let configure set them.
3413 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3414 No more need to undefine.
0a763bd1 3415
169304bd
AS
34162012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3417
3418 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3419 non-single-byte char when adding meta modifier. (Bug#12090)
3420
6cd7a139
DA
34212012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3422
3423 Convert safe_call to use variable number of arguments.
3424 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3425 (safe_call2): Fix comment.
3426 * lisp.h (safe_call): Adjust prototype.
3427 * coding.c (encode_coding_object): Change to use safe_call2.
3428 * xfaces.c (merge_face_heights): Change to use safe_call1.
3429
d34d6ffc
GM
34302012-07-30 Glenn Morris <rgm@gnu.org>
3431
7b8a48e4 3432 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3433 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3434
d34d6ffc
GM
3435 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3436 Remove empty files.
3437
03a660a6
PE
34382012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3439
3440 Export to GDB most of lisp.h's remaining object-like macros.
3441 * lisp.h (min, max): Move earlier, because they're used earlier now.
3442 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3443 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3444 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3445 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3446 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3447 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3448 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3449 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3450 Now constants, for GDB. They need not be macros.
3451 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3452 Now constants, for GDB, as well as macros, for static initializers.
3453 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3454 Move to after the definition of struct Lisp_Char_Table,
3455 since the former now needs that type defined.
3456 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3457 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3458 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3459 New enums, for gdb_make_enums_visible.
3460 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3461 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3462 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3463 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3464 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3465 enum maxargs, enum MAX_ALLOCA.
3466 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3467 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3468 no longer needed, now that they are done in lisp.h.
3469
e499d0ee
DA
34702012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3471
3472 Cleanup string bytes checking.
3473 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3474 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3475 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3476 (check_sblock, compact_small_strings): Simplify.
3477
d5040d2d
PE
34782012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3479
3480 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3481 These macros are confusing and no longer need to be defined, as
3482 the enum values now suffice. All uses replaced with definiens.
3483 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3484
7f259ae6
JB
34852012-07-29 Juanma Barranquero <lekktu@gmail.com>
3486
3487 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3488 ($(BLD)/w32console.$(O)): Update dependencies.
3489
7e63e0c3
DA
34902012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3491
3492 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3493 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3494 time. Adjust users.
3495 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3496
ffd817eb
JD
34972012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3498
3499 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3500 setting sitelisp (Bug#12010).
3501
417a7a0e
EZ
35022012-07-29 Eli Zaretskii <eliz@gnu.org>
3503
14ae4239 3504 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3505
3506 * w32heap.c (cache_system_info):
3507 * w32.c (sys_rename):
3508 * w32proc.c (find_child_console, sys_kill): All users changed.
3509
387d4d92
PE
35102012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3511
3512 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3513
55a6cca6
EZ
35142012-07-29 Eli Zaretskii <eliz@gnu.org>
3515
3516 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3517
dbcf001c
DA
35182012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3519
3520 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3521 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3522 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3523
e2688e4a
DA
35242012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3525
3526 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3527 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3528 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3529 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3530 (replace_range, replace_range_2, del_range_2): Change to eassert.
3531 * marker.c (byte_char_debug_check): Adjust style.
3532
b46a6a83
PE
35332012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3534
3535 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3536 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3537 long-ago-commented-out code that talks about "WIN32".
3538 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3539 All uses changed.
3540
e32a5799
PE
35412012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3542
3543 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3544 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3545 Simplify by using alignof.
3546 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3547 * lisp.h: Include <stdalign.h>.
3548 (GCALIGNMENT): New macro and constant.
3549 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3550 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3551 (stdalign): New macro, if not already defined.
3552
df81cd29
EZ
35532012-07-28 Eli Zaretskii <eliz@gnu.org>
3554
01bd1b0d
EZ
3555 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3556 * w32inevt.c: Include w32inevt.h.
3557 (w32_read_console_input): New inline function, calls either
3558 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3559 w32_console_unicode_input.
3560 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3561 (w32_kbd_patch_key, key_event): Use the codepage returned by
3562 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3563 (key_event): use uChar.UnicodeChar only if
3564 w32_console_unicode_input is non-zero.
3565
3566 * w32console.c: Include w32heap.h.
3567 <w32_console_unicode_input>: New global variable.
3568 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3569 family of Windows, zero otherwise.
3570
3571 * w32inevt.h: Declare w32_console_unicode_input.
3572
df81cd29
EZ
3573 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3574 --without-x. (Bug#11742)
3575
c20fdd9e
PE
35762012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3577
3578 Adjust GDB to reflect pvec_type changes (Bug#12036).
3579 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3580 2012-07-04 changes to pseudovector representation.
3581 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3582
32770973 35832012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3584
3585 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3586 bus address.
3587 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3588
3438fe21
EZ
35892012-07-27 Eli Zaretskii <eliz@gnu.org>
3590
bcfbc9de
EZ
3591 * alloc.c (listn): Fix the order the arguments are consed onto the
3592 list.
3593
3438fe21
EZ
3594 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3595 enumeration constants, as PURE and HEAP are too general, and clash
3596 with other headers and sources, such as gmalloc.c and the
3597 MS-Windows system headers. All users changed.
3598
eeaea515
DA
35992012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3600
3601 Revert last save_excursion_save and save_excursion_restore changes.
3602 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3603 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3604
073c88c2
DA
36052012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3606
3607 Fix recently-introduced typos in Windows port.
3608 Reported by Martin Rudalics <rudalics@gmx.at>.
3609 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 3610 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 3611
4706125e
PE
36122012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3613
3614 Improve GDB symbol export (Bug#12036).
3615 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3616 arms of an 'if', not using conditional expressions; otherwise GDB
3617 complains about the types in the unevaluated arm when the argument
3618 is an integer literal.
3619 (xgetint): Simplify expression.
3620 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3621 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3622 Zaretskii in <http://bugs.gnu.org/12036#13>.
3623 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3624 needed now that we have gdb_make_enums_visible.
3625 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3626 (enum enum_USE_LSB_TAG):
3627 New enum types, packaging up enums that need to be exported to GDB.
3628
694b6c97
DA
36292012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3630
3631 Utility function to make a list from specified amount of objects.
3632 * lisp.h (enum constype): New datatype.
3633 (listn): New prototype.
3634 * alloc.c (listn): New function.
3635 (Fmemory_use_count, syms_of_alloc): Use it.
3636 * buffer.c (syms_of_buffer): Likewise.
3637 * callint.c (syms_of_callint): Likewise.
3638 * charset.c (define_charset_internal): Likewise.
3639 * coding.c (syms_of_coding): Likewise.
3640 * keymap.c (syms_of_keymap): Likewise.
3641 * search.c (syms_of_search): Likewise.
3642 * syntax.c (syms_of_syntax): Likewise.
3643 * w32.c (init_environment): Likewise.
3644 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3645 * xdisp.c (syms_of_xdisp): Likewise.
3646 * xfns.c (syms_of_xfns): Likewise.
3647
6195f384
DA
36482012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3649
3650 Fast save_excursion_save and save_excursion_restore.
3651 * lisp.h (struct Lisp_Excursion): New data type.
3652 (PVEC_EXCURSION): New pseudovector type.
3653 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3654 to deal with it. Adjust comments.
3655 (init_marker, attach_marker): New prototype.
3656 (unchain_marker): Adjust prototype.
3657 * marker.c (attach_marker): Change to global.
3658 (init_marker): New function.
3659 * alloc.c (Fmake_marker, build_marker): Use it.
3660 (build_marker): More easserts.
3661 (mark_object): Handle struct Lisp_Excursion.
3662 * editfns.c (save_excursion_save, save_excursion_restore):
3663 Reimplement to use struct Lisp_Excursion. Add comments.
3664
5eceb8fb
PE
36652012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3666
3667 Fix export of symbols to GDB (Bug#12036).
3668 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3669 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3670 emacs.c, as this is a more-suitable home. Had this been done earlier
3671 the fix for 12036 would have avoided some of the problems noted in
3672 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3673 would have been more obvious.
562157c8
PE
3674 * emacs.c: Do not include <verify.h>; no longer needed.
3675 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
3676 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3677 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3678 Remove; now done in lisp.h.
3679 * lisp.h (PUBLISH_TO_GDB): New macro.
3680 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3681 (DATA_SEG_BITS): Use it.
3682 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3683 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3684 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3685 not be usable in #if. This simplifies things.
3686
d6749401
JB
36872012-07-26 Juanma Barranquero <lekktu@gmail.com>
3688
3689 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3690
1781b9e9
PE
36912012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3692
d89518db 3693 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
3694 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3695 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3696 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3697 Adjust to changes in lisp.h and emacs.c, by using
3698 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3699 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3700 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3701 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3702 instead of gdb_valbits.
3703 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3704 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3705 instead of gdb_array_mark_flag.
3706 (xboolvector): Get size from $->size, not $->header.size.
3707 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3708 (xreload, hook-run, hookpost-run): Remove.
3709 * emacs.c: Include <verify.h>.
3710 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3711 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3712 Remove.
3713 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3714 (gdb_USE_LSB_TAG): New enum constants.
3715 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3716 Also define these as enum constants, so they're visible to GDB.
3717 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3718 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3719 as constants, so they're visible to GDB.
3720 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3721 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3722 Now enum constants, not macros, so they're visible to GDB.
3723 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3724 more convenient now. All uses changed.
3725 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3726 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3727
3628596a
DA
37282012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3729
3730 Explicitly free restriction data that are not needed anymore.
3731 * editfns.c (save_restriction_restore): Free restriction data.
3732
7abaf5cc
SM
37332012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3734
3735 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3736 add argument, tune behavior, and adjust all callers.
3737
71f88e00
PE
37382012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3739
3740 Use typedef for EMACS_INT, EMACS_UINT.
3741 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3742 than macros. This simplifies debugging in the usual case, since
3743 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3744 and it allows expressions involving EMACS_INT casts.
3745 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3746
57ec3034
JD
37472012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3748
3749 * nsterm.m (ns_read_socket): Return early if there is a modal
3750 window (Bug#12043).
3751
8137e7b3
MR
37522012-07-25 Martin Rudalics <rudalics@gmx.at>
3753
3754 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3755 that FOCUS-FRAME can be omitted.
3756
04e9897c
DA
37572012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3758
3759 Adjust buffer text indirection counters at the end of Fkill_buffer.
3760 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3761 buffer is definitely dead. This should really fix an issue reported
3762 by Christoph Scholtes again. (Bug#12007).
3763 (init_buffer_once): Initialize indirection counters of
3764 buffer_defaults and buffer_local_symbols (for sanity and safety).
3765
8a0484e1
EZ
37662012-07-24 Eli Zaretskii <eliz@gnu.org>
3767
3768 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3769 and continuation glyphs on tooltip frames, leave them at zero.
3770 Avoids continued lines in tooltips. (Bug#11832)
3771
fa691a83
DA
37722012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3773
3774 Simplify copy_overlay.
04e9897c 3775 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
3776 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3777
436bc8e0
EZ
37782012-07-23 Eli Zaretskii <eliz@gnu.org>
3779
3780 * print.c (print_object): Don't crash when a frame's name is nil
3781 or invalid. (Bug#12025)
3782
3783 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3784 it signals an error when a tooltip frame is being created.
3785
d7a7fda3
DA
37862012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3787
3788 Cleanup miscellaneous objects allocation and initialization.
3789 * alloc.c (allocate_misc): Change to static. Add argument to
3790 specify the subtype. Adjust comment and users.
3791 (build_overlay): New function.
3792 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3793 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3794 (allocate_misc): Remove prototype.
3795 (build_overlay): Add prototype.
3796
37972012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
3798
3799 Swap buffer text indirection counters in Fbuffer_swap_text.
3800 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3801 This avoids crash reported by Christoph Scholtes at
3802 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3803
9d7fa573
JD
38042012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3805
3806 * nsmenu.m (Popdown_data): New struct.
3807 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3808 free Popdown_data.
3809 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3810 (initWithContentRect): Make imgView and contentView non-static
3811 and autorelease them. Also autorelease img and matrix (Bug#12005).
3812 (dealloc): Remove (Bug#12005).
3813
0dd6d66d
DA
38142012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3815
3816 Adjust consing_since_gc when objects are explicitly freed.
3817 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3818 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3819 (free_cons, free_misc): Subtract object size from consing_since_gc.
3820
d36d71df
DA
38212012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3822
3823 Simplify and cleanup markers positioning code.
3824 * marker.c (attach_marker): More useful eassert.
3825 (live_buffer, set_marker_internal): New function.
3826 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3827 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3828
fb9ea40f
PE
38292012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3830
3831 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3832 as it's limited by the amount of memory, not by INT_MAX.
3833
2d5c5f7d
EZ
38342012-07-21 Eli Zaretskii <eliz@gnu.org>
3835
07fb592e
EZ
3836 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3837 in special-event-map. See the discussion at
3838 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3839 for the reasons.
3840
37a9eac8 3841 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
3842 info.dwItemData. Fixes crashes on 64-bit Windows.
3843 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 3844
c4328746
JD
38452012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3846
fc0c31f8 3847 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 3848 (conversationIdentifier): Return value is NSInteger.
784051c4 3849 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 3850
6e5d1c12
CY
38512012-07-21 Chong Yidong <cyd@gnu.org>
3852
3853 * window.c (decode_any_window): Signal an error if the window is
3854 on a dead frame (Bug#11984).
3855
9928463d
DA
38562012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3857
3858 Add indirection counting to speed up Fkill_buffer.
3859 * buffer.h (struct buffer): New member.
3860 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3861 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3862 base buffer indirection counter.
3863 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3864 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3865 through buffer list if indirection counter is 0.
3866
f8643a6b
DA
38672012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3868
3869 Extend the value returned by Fgarbage_collect with heap statistics.
3870 * alloc.c (Qheap): New symbol.
3871 (syms_of_alloc): DEFSYM it.
3872 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3873 (Fmemory_free): Remove.
3874 (syms_of_alloc): Don't defsubr it.
3875 * buffer.c (Fcompact_buffer): Remove.
3876 (syms_of_buffer): Don't defsubr it.
3877
dac616ff
DA
38782012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3879
3880 Make maybe_gc inline.
3881 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3882 * lisp.h (consing_since_gc, gc_relative_threshold)
3883 (memory_full_cons_threshold): Revert declaration.
3884 (maybe_gc): Remove prototype, define as inline.
3885 * alloc.c: Remove old commented-out code.
3886 (consing_since_gc, gc_relative_threshold)
3887 (memory_full_cons_threshold): Revert to global.
3888 (maybe_gc): Remove.
3889
d7ea76b4
DA
38902012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3891
3892 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3893 * lisp.h (build_unibyte_string): New function.
3894 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3895 * sysdep.c, w32fns.c, xfns.c: Use it.
3896 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3897 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3898 Adjust users accordingly.
3899 * font.h (font_open_by_name): Adjust prototype.
3900
765e61e3
DA
39012012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3902
3903 Cleanup calls to Fgarbage_collect.
3904 * lisp.h (maybe_gc): New prototype.
3905 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3906 Remove declarations.
3907 * alloc.c (maybe_gc): New function.
3908 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3909 Make them static.
3910 * bytecode.c (MAYBE_GC): Use maybe_gc.
3911 * eval.c (eval_sub, Ffuncall): Likewise.
3912 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3913 to avoid dependency from auto-save feature.
3914
52b852c7
PE
39152012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3916
3917 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3918 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3919 'for_each_per_buffer_object_at'.
3920 All uses changed. It's better to use upper-case for macros that
3921 cannot be implemented as functions, to give the reader a clue
3922 that they're special.
3923
5db81e33
SM
39242012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3925
3926 * alloc.c (Fgarbage_collect): Tweak docstring.
3927
5b835e1d
DA
39282012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3929
3930 Tweak the value returned from Fgarbage_collect again.
3931 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3932 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3933 Adjust documentation.
3934 (total_vector_bytes): Rename to total_vector_slots, adjust
3935 accounting.
3936 (total_free_vector_bytes): Rename to total_free_vector_slots,
3937 adjust accounting.
3938 (Qstring_bytes, Qvector_slots): New symbols.
3939 (syms_of_alloc): DEFSYM them.
3940
9cd47b72
DA
39412012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3942
3943 Buffer compaction primitive which may be used from Lisp.
3944 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3945 (syms_of_buffer): Register Fcompact_buffer.
3946 * alloc.c (Fgarbage_collect): Use compact_buffer.
3947 * buffer.h (compact_buffer): New prototype.
3948 (struct buffer_text): New member.
3949
d17337e5
DA
39502012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3951
3952 New macro to iterate over all buffers, miscellaneous cleanups.
3953 * lisp.h (all_buffers): Remove declaration.
3954 * buffer.h (all_buffers): Add declaration, with comment.
3955 (for_each_buffer): New macro.
3956 * alloc.c (Fgarbage_collect, mark_object): Use it.
3957 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3958 (init_buffer): Likewise.
3959 * data.c (Fset_default): Likewise.
3960 * coding.c (code_conversion_restore): Remove redundant check
3961 for dead buffer.
3962 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3963
60cfd278
AS
39642012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3965
3966 Fix bug that created negative-length intervals.
3967 * intervals.c (merge_interval_right, merge_interval_left):
3968 Do not zero out this interval if it is absorbed by its children,
3969 as this interval's total length doesn't change in that case. See
3970 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3971
d06714cb
PE
39722012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3973
83713154
PE
3974 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3975 when invoking (make-bool-vector N t) and N is a positive
3976 multiple of 8 -- the last 8 bits were mistakenly cleared.
3977
d06714cb
PE
3978 Remove some struct layout assumptions in bool vectors.
3979 * alloc.c (bool_header_size): New constant.
3980 (header_size, word_size): Move earlier, as they're now used earlier.
3981 Use 'word_size' in a few more places, where it's appropriate.
3982 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3983 padding before the data member of a bool vector.
3984 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3985 than doing the check by hand with an abort ().
3986
464d5a5e
SM
39872012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3988
5fbc0409
SM
3989 * eval.c (Fdefvar): Don't check constants since we only set the var if
3990 it's not yet defined anyway (bug#11904).
3991
464d5a5e
SM
3992 * lisp.h (last_undo_boundary): Declare new var.
3993 * keyboard.c (command_loop_1): Set it.
3994 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3995 were auto-added by the command loop (bug#11774).
3996
8dc2e44a
AS
39972012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3998
3999 * w32font.c (Qsymbol): Remove local definition.
4000 (syms_of_w32font): Don't DEFSYM it.
4001
169925ec
DA
40022012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4003
4004 Fix sweep_vectors to handle large bool vectors correctly.
4005 * alloc.c (sweep_vectors): Account total_vector_bytes for
4006 bool vectors larger than VBLOCK_BYTES_MAX.
4007
5fbfb018
CY
40082012-07-18 Chong Yidong <cyd@gnu.org>
4009
4010 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4011 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4012
3ab6e069
DA
40132012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4014
4015 Return more descriptive data from Fgarbage_collect.
4016 Suggested by Stefan Monnier in
4017 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4018 * alloc.c (bounded_number): New function.
4019 (total_buffers, total_vectors): New variable.
4020 (total_string_size): Rename to total_string_bytes, adjust users.
4021 (total_vector_size): Rename to total_vector_bytes, adjust users.
4022 (sweep_vectors): Account total_vectors and total_vector_bytes.
4023 (Fgarbage_collect): New return value. Adjust documentation.
4024 (gc_sweep): Account total_buffers.
4025 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4026 (VECTOR_SIZE): Remove.
4027 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4028 (Qinterval, Qmisc): New symbols.
4029 (syms_of_data): Initialize them.
4030 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4031 (Qcons, Qbuffer): New declarations.
4032
6d02fe5b
PE
40332012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4034
4035 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4036 Round up, not down. Improve doc.
4037
b7ffe040
DA
40382012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4039
4040 Restore old code in allocate_string_data to avoid Faset breakage.
4041 Reported by Julien Danjou <julien@danjou.info> in
4042 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4043 * alloc.c (allocate_string_data): Restore old code with minor
4044 adjustments, fix comment to explain this subtle issue.
4045
4dc7c8d5
SM
40462012-07-17 Eli Zaretskii <eliz@gnu.org>
4047
4048 Remove FILE_SYSTEM_CASE.
4049 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4050
4051 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4052 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4053 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4054 call-process-region passes it through expand-file-name.
4055
4056 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4057
40582012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4059
4060 Fix crash when creating indirect buffer (Bug#11917)
4061 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4062 Don't handle unbound variables specially if non-zero.
4063 (Fbuffer_local_variables): Pass zero.
4064 (clone_per_buffer_values): Pass non-zero.
4065
40662012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4067
4068 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4069 to make the loop interruptible.
4070
40712012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4072
4073 * gnutls.c (emacs_gnutls_handshake): Only retry if
4074 GNUTLS_E_INTERRUPTED.
4075
cce7fefc
DA
40762012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4077
4078 Cleanup and convert miscellaneous checks to eassert.
4079 * alloc.c (mark_interval): Fix comment, partially rephrase
4080 old comment from intervals.h (see below).
4081 * intervals.c (find_interval, adjust_intervals_for_insertion)
4082 (delete_interval, adjust_intervals_for_deletion)
4083 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4084 Convert to eassert.
4085 (adjust_intervals_for_insertion, make_new_interval):
4086 Remove obsolete and unused code.
4087 * intervals.h (struct interval): Remove obsolete comment.
4088 * textprotp.c (erase_properties): Remove unused code.
4089 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4090 (Fremove_list_of_text_properties): Convert to eassert.
4091
9ea10cc3
CY
40922012-07-17 Chong Yidong <cyd@gnu.org>
4093
4094 * editfns.c (Finsert_char): Doc fix.
4095
3900d5de
DA
40962012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4097
4098 Fix previous change to make Fmemory_free always accurate.
4099 * alloc.c (make_interval): Update total_free_intervals.
4100 (make_float): Likewise for total_free_floats.
4101 (free_cons, Fcons): Likewise for total_free_conses.
4102 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4103 Likewise for total_free_vector_bytes.
4104 (Fmake_symbol): Likewise for total_free_symbols.
4105 (bytes_free): Remove.
4106
7098646f
DA
41072012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4108
4109 Simple free memory accounting feature.
4110 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4111 (sweep_vectors): Accumulate size of free vectors.
4112 (Fgarbage_collect): Setup bytes_free.
4113 (Fmemory_free): New function.
4114 (syms_of_alloc): Register it.
4115
22657b40
DA
41162012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4117
4118 Cleanup overlays checking.
4119 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4120 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4121 eassert and OVERLAYP.
4122 (sort_overlays): Change to use OVERLAYP.
4123
ddfc8813
RK
41242012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4125
4126 * editfns.c (Finsert_char): Make it interactive, and make the
4127 second arg optional. Copy interactive spec and docstring from
4128 ucs-insert.
4129
7c26cf3c
PE
41302012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4131
4132 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4133 Unlike the other wrapped functions, fabs has an unspecified
4134 effect on errno.
4135
5d127af9
JD
41362012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4137
4138 * nsterm.m (keyDown): Interpret flags without left/right bits
4139 as the left key (Bug#11670).
4140
6a0dd1d7
DA
41412012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4142
4143 Remove empty and useless init functions.
4144 * lisp.h (init_character_once, init_fns, init_image)
4145 (init_filelock, init_sound): Remove prototype.
4146 * character.c (init_character_once): Remove.
4147 * filelock.c (init_filelock): Likewise.
4148 * fns.c (init_fns): Likewise.
4149 * image.c (init_image): Likewise.
4150 * sound.c (init_sound): Likewise.
4151 * emacs.c (main): Adjust accordingly.
4152
7a6136fd
DA
41532012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4154
4155 * gtkutil.h: Tiny cleanups.
4156 (use_old_gtk_file_dialog): Remove useless declaration.
4157 (xg_uses_old_file_dialog): Add suggested const attribute.
4158
ce811ad9
EZ
41592012-07-15 Eli Zaretskii <eliz@gnu.org>
4160
4161 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4162 (bidi_paragraph_init): Use it to limit search forward for a strong
4163 directional character in abnormally large paragraphs full of
4164 neutral or weak characters. (Bug#11943)
4165
c9adfeaa
SF
41662012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4167
4168 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4169 the toolbar (Bug#9451).
4170 (xg_make_tool_item): Give the widget event box a transparent
4171 background.
4172
fff62aa9
DA
41732012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4174
4175 Cleanup basic allocation variables and functions.
4176 * alloc.c (ignore_warnings, init_intervals, init_float)
4177 (init_cons, init_symbol, init_marker): Remove.
4178 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4179 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4180 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4181 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4182 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4183 (staticidx, init_alloc_once, init_strings, free_ablock):
4184 Remove redundant initialization.
4185 * fns.c (init_weak_hash_tables): Remove.
4186 * lisp.h (init_weak_hash_tables): Remove prototype.
4187
9730daca
DA
41882012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4189
4190 Use zero_vector where appropriate.
4191 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4192 accordingly.
4193 * lisp.h (zero_vector): New declaration.
4194 * font.c (null_vector): Remove.
4195 (syms_of_font): Remove initialization and staticpro.
4196 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4197 * keymap.c (Faccessible_keymaps): Likewise.
4198
2e2d2a13
LL
41992012-07-15 Leo Liu <sdl.web@gmail.com>
4200
4201 * fringe.c: Fix typo in comments.
4202
cd276f6e
LL
42032012-07-14 Leo Liu <sdl.web@gmail.com>
4204
4205 * fringe.c: Add a new bitmap exclamation-mark.
4206
5a1131d9
EZ
42072012-07-14 Eli Zaretskii <eliz@gnu.org>
4208
4209 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4210
4211 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4212 (HAVE_MENUS): Don't define, defined by editing config.in with
4213 msdos/sed2v2.inp.
4214 (GMALLOC_INHIBIT_VALLOC): Don't define.
4215 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4216
22e983b7
JB
42172012-07-14 Juanma Barranquero <lekktu@gmail.com>
4218
4219 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4220
5b3f250f
GM
42212012-07-14 Glenn Morris <rgm@gnu.org>
4222
4223 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4224 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4225 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4226
33d63ff4
GM
42272012-07-13 Glenn Morris <rgm@gnu.org>
4228
5b633342
GM
4229 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4230
33d63ff4
GM
4231 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4232 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4233
b55b9f85
JD
42342012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4235
0dc8cf50
JD
4236 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4237 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4238 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4239 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4240 where appropriate.
4241 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4242 as boolean expression.
4243 (x_set_window_size): Remove unused variable toolbar.
4244 (ns_get_color_default, ns_mod_to_lisp): Remove.
4245 (ns_mouse_position): Remove unused variables xchar and ychar.
4246 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4247 (ns_set_vertical_scroll_bar): Remove unused variable count.
4248 (ns_delete_terminal): Remove unused variable i.
4249 (ns_term_init): Remove unused variables r, g and b.
4250 (mouseDown): Remove unused variable window.
4251 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4252 (initFrameFromEmacs): Remove unused variable vbextra.
4253 (mouseEntered): Remove unused variables p and dpyinfo.
4254 (mouseExited): Remove unused variables p and r.
4255 (ns_define_frame_cursor, ns_clear_frame_area)
4256 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4257 (menuDown): Assign [sender tag] to variable and cast the variable.
4258
4259 * nsterm.h (menuDown): Add id as type to argument sender.
4260 (ns_display_info_for_name): Add Lisp_Object argument.
4261 (ns_term_init): Add Lisp_Object argument.
4262 (ns_map_event_to_object): Add void argument.
4263 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4264 prototype with arguments and only declare if __OBJC__.
4265 (nxatoms_of_nsselect): Add void argument.
4266 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4267 (ns_alloc_autorelease_pool): Add void argument.
4268 (ns_release_autorelease_pool): Add void* argument.
4269 (ns_get_defaults_value): Add const char* argument.
4270
4271 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4272 (initFromContents): Use SSDATA where appropriate.
4273 (ns_update_menubar): Add braces to ambigous if-else.
4274 (initWithTitle): Put () around assignment in if statement.
4275 (ns_menu_show): Remove unused variables window and keymap.
4276 (update_frame_tool_bar): Remove unused variable selected_p.
4277 (initWithContentRect): Remove unused variable this_cmd_name.
4278
4279 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4280 appropriate.
4281 (setXBMColor): Remove unused variable len.
4282 (setPixmapData): Put () around assignment in loop statement.
4283
4284 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4285 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4286 where appropriate.
4287 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4288 around assignment in loop statement.
4289 (nsfont_open): Remove unused variable i.
4290 (nsfont_open): Remove unused variable len.
4291 (nsfont_draw): Remove unused variable cs.
4292
4293 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4294 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4295 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4296 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4297 (Fns_font_name, Fns_perform_service)
4298 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4299 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4300 (ns_set_name): Remove unused variable view.
4301 (x_set_menu_bar_lines): Remove unused variable olines.
4302 (x_set_tool_bar_lines): Remove unused variable root_window.
4303 (Fns_list_colors): Put () around assignment in while statement.
4304 (Fns_perform_service): Remove unused variable len.
4305 (Fns_display_usable_bounds): Remove unused variable top.
4306 (syms_of_nsfns): Remove unused variable i.
4307
b55b9f85
JD
4308 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4309 memcpy (Bug#11907).
4310
ed9265fc 43112012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4312
4313 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4314 and free it with DestroyExceptionInfo (Bug#11558).
4315
ef099b57
JB
43162012-07-13 Juanma Barranquero <lekktu@gmail.com>
4317
4318 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4319 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4320 Set here, not in nt/config.nt.
4321
ea814a5d
EZ
43222012-07-13 Eli Zaretskii <eliz@gnu.org>
4323
4324 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4325 cursor overflow into the last glyph on display line when the right
4326 fringe is off. (Bug#11832)
4327
1a952767
PE
43282012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4329
4330 * xdisp.c (produce_special_glyphs): Now static.
4331 * dispextern.h (produce_special_glyphs): Remove decl.
4332
983188fd
GM
43332012-07-13 Glenn Morris <rgm@gnu.org>
4334
8d7c7eed 4335 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4336 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4337
983188fd
GM
4338 * s/usg5-4-common.h (USG, USG5):
4339 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4340 * s/sol2-6.h (SOLARIS2):
4341 * s/irix6-5.h (IRIX6_5):
4342 * s/hpux10-20.h (USG, USG5, HPUX):
4343 * s/gnu-linux.h (USG, GNU_LINUX):
4344 * s/freebsd.h (BSD_SYSTEM):
4345 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4346 * s/cygwin.h (CYGWIN):
4347 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4348 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4349
d1e68667 43502012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4351
4352 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4353
6de0e799
GM
43542012-07-13 Glenn Morris <rgm@gnu.org>
4355
739ae010
GM
4356 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4357
dbee5793
GM
4358 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4359
6de0e799
GM
4360 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4361 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4362
b82da769
GM
43632012-07-12 Glenn Morris <rgm@gnu.org>
4364
4fae5a7a 4365 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4366
4367 * process.c (init_process_emacs): Rename from init_process.
4368 The old name is also the name of a Mach system call.
4369 * lisp.h, emacs.c: Update for this name change.
4370 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4371 longer needed.
4372
5a979817
EZ
43732012-07-12 Eli Zaretskii <eliz@gnu.org>
4374
4375 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4376 memmove call that removes glyphs covered by the left truncation
4377 glyph. Improve commentary.
4378 (display_line): Fix display of continuation glyphs on GUI frames
4379 when the right fringe is turned off and variable-size fonts are
4380 used in the window. Move the code that appends a stretch glyph to
4381 produce_special_glyphs, so that it could be used for truncation
4382 and continuation glyphs alike.
4383 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4384 glyph of a suitably computed width, to align the special glyphs at
4385 the window margin. Code moved from display_line. (Bug#11832)
4386
3e91a053
GM
43872012-07-12 Glenn Morris <rgm@gnu.org>
4388
ba9e4b84
GM
4389 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4390
4391 * s/gnu-linux.h, s/hpux10-20.h:
4392 Do not unconditionally define HAVE_XRMSETDATABASE.
4393
3e91a053
GM
4394 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4395
b300b1f4
PE
43962012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4397
4398 Fix typos that broke OS X build.
4399 Reported by Randal L. Schwartz in
4400 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4401 * nsterm.m (ns_timeout): Add missing local decl.
4402 (ns_get_color): snprintf -> sprintf, to fix typo.
4403
6e777848
GM
44042012-07-12 Glenn Morris <rgm@gnu.org>
4405
3f922c37
GM
4406 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4407 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4408 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4409 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4410
0ab7b23a
GM
4411 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4412 Move PTY_OPEN to configure.
4413
6e777848
GM
4414 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4415 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4416 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4417
4a7edc24
DA
44182012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4419
4420 Use empty_unibyte_string where applicable.
4421 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4422 * lread.c (read1): Likewise.
4423 * xsettings.c (syms_of_xsettings): Likewise.
4424
308aab79
GM
44252012-07-12 Glenn Morris <rgm@gnu.org>
4426
42bd1719
GM
4427 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4428 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4429 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4430 * s/hpux10-20.h (RUN_TIME_REMAP):
4431 * s/bsd-common.h (TABDLY): Move to configure.
4432
4433 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4434
4435 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4436
ea0bbd17 4437 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4438 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4439
4440 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4441
308aab79
GM
4442 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4443 * s/template.h: Move NARROWPROTO to configure.
4444
ee1cf5cf
GM
44452012-07-11 Glenn Morris <rgm@gnu.org>
4446
30fe9bf4
GM
4447 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4448 unused since 2011-01-17 change to systty.h.
4449
ee1cf5cf
GM
4450 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4451 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4452 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4453
63e47e07
PE
44542012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4455
4456 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4457
c43fb4c3
GM
44582012-07-11 Glenn Morris <rgm@gnu.org>
4459
4460 * s/darwin.h, s/gnu-linux.h, s/template.h:
4461 Move INTERRUPT_INPUT to configure.
4462
e8df9267
DA
44632012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4464
4465 Minor adjustments to interning code.
4466 * lisp.h (intern, intern_c_string): Redefine as static inline
4467 wrappers for intern_1 and intern_c_string_1, respectively.
4468 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4469 * lread.c (intern_1, intern_c_string_1, oblookup):
4470 Simplify Vobarray checking.
e8df9267
DA
4471 * font.c (font_intern_prop): Likewise. Adjust comment.
4472 * w32font.c (intern_font_name): Likewise.
4473
34348bd4
AS
44742012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4475
d96a1e0c
AS
4476 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4477
34348bd4
AS
4478 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4479 of Fcar/Fcdr if possible.
4480 * font.c (check_otf_features): Likewise.
4481 * fontset.c (Fnew_fontset): Likewise.
4482 * gnutls.c (Fgnutls_boot): Likewise.
4483 * minibuf.c (read_minibuf): Likewise.
4484 * msdos.c (IT_set_frame_parameters): Likewise.
4485 * xmenu.c (Fx_popup_dialog): Likewise.
4486 * w32menu.c (Fx_popup_dialog): Likewise.
4487
c8add24e
GM
44882012-07-11 Glenn Morris <rgm@gnu.org>
4489
4b575b3c
GM
4490 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4491 since nothing has defined it on these platforms.
4492
09f4e3b0
GM
4493 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4494 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4495
172bedef
GM
4496 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4497 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4498 Move CLASH_DETECTION to configure.
4499
249685df
GM
4500 * s/gnu.h: Remove file, which is now empty.
4501
c8add24e
GM
4502 * s/gnu.h, s/gnu-linux.h:
4503 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4504
b41253a3
JW
45052012-07-11 John Wiegley <johnw@newartisans.com>
4506
4507 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4508 function attribute, so we only use it if it exists in the
4509 compiler.
4510
d923b542
DA
45112012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4512
4513 Avoid call to strlen in fast_c_string_match_ignore_case.
4514 * search.c (fast_c_string_match_ignore_case): Change to use
4515 length argument. Adjust users accordingly.
4516 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4517
5ebbef1d
PE
45182012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4519
bb352260
PE
4520 Assume mkdir, rmdir.
4521 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4522 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4523
57054ddd
PE
4524 Assume rename.
4525 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4526
b747d3f7
PE
4527 Assume perror.
4528 * s/hpux10-20.h (HAVE_PERROR): Remove.
4529 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4530 Remove dummy definition, as this problem was obsolete long ago.
4531
5ebbef1d
PE
4532 Assume strerror.
4533 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4534
984e7f30
DA
45352012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4536
4537 Avoid calls to strlen in font processing functions.
4538 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4539 (font_open_by_name): Change to use length argument.
4540 Adjust users accordingly.
d923b542
DA
4541 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4542 Adjust prototypes.
4543 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4544 Change to return ptrdiff_t.
984e7f30
DA
4545 (xfont_list_pattern, xfont_match): Use length returned by
4546 xfont_decode_coding_xlfd.
4547 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4548
20e94fdd
GM
45492012-07-11 Glenn Morris <rgm@gnu.org>
4550
9d596af3
GM
4551 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4552 Move DONT_REOPEN_PTY to configure.
4553
20e94fdd
GM
4554 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4555 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4556
e99a530f
PE
45572012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4558
22ffb973
PE
4559 Remove "#define unix" that is no longer needed (Bug#11905).
4560 * s/aix4-2.h (unix): Remove; no longer needed.
4561
e9a9ae03
PE
4562 EMACS_TIME simplification (Bug#11875).
4563 This replaces macros (which typically do not work in GDB)
4564 with functions, typedefs and enums, making the code easier to debug.
4565 The functional style also makes code easier to read and maintain.
4566 * systime.h: Include <sys/time.h> on all hosts, not just if
4567 WINDOWSNT, since 'struct timeval' is needed in general.
4568 (EMACS_TIME): Now a typedef, not a macro.
4569 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4570 not macros.
4571 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4572 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4573 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4574 (EMACS_TIME_LE): Now functions, not macros.
4575 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4576 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4577 which are not functions. All uses rewritten to use:
4578 (make_emacs_time): New function.
4579 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4580 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4581 not functions. All uses rewritten to use the following, respectively:
4582 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4583 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4584 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4585 * fileio.c (Fcopy_file):
4586 * xterm.c (XTflash): Get the current time closer to when it's used.
4587 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4588
ffacb126
PE
4589 * bytecode.c (targets): Suppress -Woverride-init warnings.
4590
e99a530f
PE
4591 Simplify by avoiding confusing use of strncpy etc.
4592 * doc.c (Fsnarf_documentation):
4593 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4594 * frame.c (Fmake_terminal_frame):
4595 * gtkutil.c (get_utf8_string):
4596 * lread.c (openp):
4597 * nsmenu.m (ns_update_menubar):
4598 * regex.c (regerror):
4599 Prefer memcpy to strncpy and strncat when either will do.
4600 * fileio.c (Fsubstitute_in_file_name):
4601 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4602 (menu_separator_name_p):
4603 * nsmenu.m (ns_update_menubar):
4604 Prefer memcmp to strncmp when either will do.
4605 * nsterm.m: Include <ftoastr.h>.
4606 (ns_get_color):
4607 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4608 Prefer snprintf to strncpy.
4609 * nsterm.m (ns_term_init):
4610 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4611 * nsterm.m (ns_term_init):
4612 Avoid the need for strncpy, by using build_string or
4613 make_unibyte_string directly. Use dtoastr, not snprintf.
4614 * process.c (Fmake_network_process): Diagnose service names that
4615 are too long, rather than silently truncating them or creating
4616 non-null-terminated names.
4617 (Fnetwork_interface_info): Likewise, for interface names.
4618 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4619 Prefer sprintf to strncat.
4620 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4621 Prefer vsnprintf to vsprintf + strncpy.
4622
c59592b3
GM
46232012-07-10 Glenn Morris <rgm@gnu.org>
4624
4625 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4626 Clarify fallback case.
4627
7d7bbefd
DA
46282012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4629
4630 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4631 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4632 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 4633 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
4634 where argument type is known to be a Lisp_Cons.
4635
3a4c8000
TT
46362012-07-10 Tom Tromey <tromey@redhat.com>
4637
4638 * bytecode.c (BYTE_CODE_THREADED): New macro.
4639 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4640 (enum byte_code_op): New type.
4641 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4642 (exec_byte_code): Use them. Use token threading when applicable.
4643
2a0213a6
DA
46442012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4645
4646 Optimize pure C strings initialization.
4647 * lisp.h (make_pure_string): Fix prototype.
4648 (build_pure_c_string): New function, defined as static inline. This
4649 provides a better opportunity to optimize away calls to strlen when
4650 the function is called with compile-time constant argument.
4651 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4652 argument, adjust users accordingly. Use build_pure_c_string where
4653 appropriate.
4654 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4655 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4656 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4657
cb1caeaf
DA
46582012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4659
4660 Avoid calls to strlen in miscellaneous functions.
4661 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4662 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4663 * lread.c (openp): Likewise.
4664
c293e30c
DA
46652012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4666
4667 Avoid calls to strlen in path processing functions.
4668 * fileio.c (file_name_as_directory): Add comment. Change to add
4669 srclen argument and return the length of result. Adjust users
4670 accordingly.
4671 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
4672 swap 1st and 2nd arguments to obey the common convention.
4673 Adjust users accordingly.
c293e30c
DA
4674 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4675
9e059e3f
GM
46762012-07-10 Glenn Morris <rgm@gnu.org>
4677
d02eb359
GM
4678 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4679 Move PENDING_OUTPUT_COUNT definition to configure.
4680
882cf227
GM
4681 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4682 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4683 * s/gnu.h (DATA_START): Move definitions to configure.
4684
af6e839f
GM
4685 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4686 We include usg5-4-common.h, which defines them both.
4687
40289a12
GM
4688 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4689 O_RDONLY already includes it).
4690
9e059e3f
GM
4691 Stop ns builds setting the EMACSLOADPATH environment variable.
4692 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4693 Now it does not set EMACSLOADPATH, just returns the load-path string.
4694 * nsterm.h: Update accordingly.
4695 * lread.c [HAVE_NS]: Include nsterm.h.
4696 (init_lread) [HAVE_NS]: Use ns_load_path.
4697 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4698
7c4e8ec0
GM
46992012-07-09 Glenn Morris <rgm@gnu.org>
4700
d4f600ff
GM
4701 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4702 since the included bsd-common.h does so.
4703
cbb31951
GM
4704 Stop ns builds setting the EMACSPATH environment variable.
4705 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4706 (ns_init_paths): Do not set EMACSPATH.
4707 * nsterm.h (ns_exec_path): Add it.
4708 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4709 Use ns_exec_path.
4710
7c4e8ec0
GM
4711 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4712
26bccfae
PE
47132012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4714
a0bee46f
PE
4715 * process.c (wait_reading_process_output): 'waitchannels' was unset
4716 when read_kbd || !NILP (wait_for_cell); fix this.
4717
5994c183
PE
4718 Add GCC-style 'const' attribute to functions that can use it.
4719 * character.h (char_resolve_modifier_mask):
4720 * keyboard.h (make_ctrl_char):
4721 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4722 (init_character_once, next_almost_prime, init_fns, init_image)
4723 (flush_pending_output, init_sound):
4724 * mem-limits.h (start_of_data):
4725 * menu.h (finish_menu_items):
4726 Add ATTRIBUTE_CONST.
4727 * emacs.c (DEFINE_DUMMY_FUNCTION):
4728 Declare the dummy function with ATTRIBUTE_CONST.
4729 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4730 Add decls with ATTRIBUTE_CONST.
4731
26bccfae
PE
4732 Minor improvements to make_formatted_string.
4733 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4734 where int is good enough, as vsprintf returns an int.
4735 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4736
a8290ec3
DA
47372012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4738
4739 Use make_formatted_string to avoid double length calculation.
4740 * lisp.h (make_formatted_string): New prototype.
4741 * alloc.c (make_formatted_string): New function.
4742 * buffer.c (Fgenerate_new_buffer_name): Use it.
4743 * dbus.c (syms_of_dbusbind): Likewise.
4744 * editfns.c (Fcurrent_time_zone): Likewise.
4745 * filelock.c (get_boot_time): Likewise.
4746 * frame.c (make_terminal_frame, set_term_frame_name)
4747 (x_report_frame_params): Likewise.
4748 * image.c (gs_load): Likewise.
4749 * minibuf.c (get_minibuffer): Likewise.
4750 * msdos.c (dos_set_window_size): Likewise.
4751 * process.c (make_process): Likewise.
4752 * xdisp.c (ensure_echo_area_buffers): Likewise.
4753 * xsettings.c (apply_xft_settings): Likewise.
4754
d01ba2f1
GM
47552012-07-09 Glenn Morris <rgm@gnu.org>
4756
4757 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4758 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4759 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4760 * nsterm.h (ns_etc_directory): Add it.
4761 * callproc.c [HAVE_NS]: Include nsterm.h.
4762 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4763
f1f924b6
DA
47642012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4765
4766 Move marker debugging code under MARKER_DEBUG.
4767 * marker.c (MARKER_DEBUG): Move marker debugging code under
4768 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4769 for bootstrap with --enable-checking (~3x slowdown reported
4770 by Juanma Barranquero <lekktu@gmail.com>).
4771 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4772
ab531b66
PE
47732012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4774
4775 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4776 See <http://bugs.gnu.org/11825#29>.
4777
c4b3bc8a
EZ
47782012-07-08 Eli Zaretskii <eliz@gnu.org>
4779
4780 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4781 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
4782 (display_line): Add commentary about displaying truncation glyphs
4783 on GUI frames.
4784 (produce_special_glyphs): Move here from term.c.
4785
4786 * term.c (produce_special_glyphs): Move to xdisp.c.
4787
4788 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4789 section.
c4b3bc8a 4790
b676b881
AS
47912012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4792
f17c5273
AS
4793 * xdisp.c (display_line): Avoid warning about implicit declaration
4794 of FRAME_FONT.
4795
298819b9
AS
4796 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4797
b676b881
AS
4798 * lisp.h: Remove empty conditional.
4799
6045c4fd
PE
48002012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4801
b3350bf9
PE
4802 * lread.c (load_path_check): Now static.
4803
6045c4fd
PE
4804 Fix some minor --with-ns problems found by static checking.
4805 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4806 (x_set_font) [!HAVE_X_WINDOWS]:
4807 * image.c (xpm_load_image) [HAVE_NS]:
4808 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4809 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4810 Remove unused local.
4811 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4812 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4813 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4814 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4815 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4816 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4817 Fix pointer signedness problem.
4818 * xfaces.c (FRAME_X_FONT_TABLE):
4819 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4820
929e7845
GM
48212012-07-07 Glenn Morris <rgm@gnu.org>
4822
4823 * lread.c (load_path_check): New function, split from init_lread.
4824 (init_lread): Reorganize. Motivation:
4825 If EMACSLOADPATH is set, check/warn about that rather than the
4826 defaults, which we are not going to use. Hence we can remove
4827 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4828 Don't warn if site-lisp directories are missing.
4829 If not installed, start from a blank load-path, since
4830 PATH_LOADSEARCH refers to the eventual installation directories.
4831
58dd0aa4
EZ
48322012-07-07 Eli Zaretskii <eliz@gnu.org>
4833
4834 Support truncation and continuation glyphs on GUI frames, when
4835 fringes are disabled. (Bug#11832)
4836 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
4837 continuation glyphs even if on GUI frames.
4838 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
4839 or both, are absent.
4840 (start_display, move_it_in_display_line_to): Handle the case of a
4841 GUI frame without a fringe to display continuation or truncation
4842 glyphs.
4843 (insert_left_trunc_glyphs): Support GUI frames: make sure
4844 truncation glyphs overwrite enough glyphs from the current line to
4845 have sufficient space in pixels.
4846 (display_line): Support truncation and continuation glyphs on GUI
4847 frames. If some spare pixels are left on the line after inserting
4848 the truncation glyphs, fill that space with a stretch glyph of a
4849 suitably computed width.
4850
4851 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4852 produce_glyphs, to support GUI sessions.
4853
31571fd7
PE
48542012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4855
5a16b9bc
PE
4856 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4857
f3047c75
PE
4858 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4859
31571fd7
PE
4860 Do not require float-time's arg to fit in time_t (Bug#11825).
4861 This works better on hosts where time_t is unsigned, and where
4862 float-time is applied to the (negative) difference between two times.
4863 * editfns.c (decode_time_components): Last arg is now double *,
4864 not int *, and means to store all the result as a double, without
4865 worrying about whether the seconds part fits in time_t.
4866 All callers changed.
4867 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4868 All callers changed.
4869 (Ffloat_time): Do not fail merely because the specified time falls
4870 outside of time_t range.
4871
4516fbef
GM
48722012-07-07 Glenn Morris <rgm@gnu.org>
4873
4874 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4875 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4876 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4877
07adc2c6
JB
48782012-07-07 Juanma Barranquero <lekktu@gmail.com>
4879
4880 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4881 Update dependencies.
4882
4883 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4884
fd573f31
PE
48852012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4886
fee5959d
PE
4887 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4888 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4889 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4890 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4891 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4892 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4893
fd573f31
PE
4894 * xfont.c (compare_font_names): Redo to omit the need for casts.
4895
ddadbc0e
AS
48962012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4897
fca8d6b6
AS
4898 * xfns.c (Fx_change_window_property): Doc fix.
4899 * w32fns.c (Fx_change_window_property): Doc fix.
4900
ddadbc0e
AS
4901 * w32fns.c (Fx_window_property): Accept the same arguments as the
4902 X Windows version. Doc fix.
4903 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4904
ed9265fc 49052012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
4906 Eli Zaretskii <eliz@gnu.org>
4907
4908 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4909 Windows-specific code from nt/config.nt moved here.
4910 Obsolete settings removed.
4911
216ee680
PE
49122012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 * process.c: Avoid unnecessary calls to gettime.
4915 (wait_reading_process_output): Don't get the time of day
4916 when gobbling data immediately and not waiting, as there's no need
4917 for it in that case. This removes a FIXME.
4918
bdd091e4
JD
49192012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4920
4921 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4922 is defined (Bug#11768).
4923
9d44f8ce
DA
49242012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4925
4926 Fix marker debugging code.
4927 * marker.c (byte_char_debug_check): Do not perform the check
4928 if buffer is not multibyte.
090bd7cb
JB
4929 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4930 Call byte_char_debug_check with correct arguments.
9d44f8ce 4931
90fc4786
DA
49322012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4933
4934 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
4935 * marker.c (byte_char_debug_check, count_markers):
4936 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
4937 (byte_debug_flag): Remove.
4938 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4939 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4940
7b7ae965
DA
49412012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4942
4e57b342
DA
4943 Avoid code repetition in marker-related functions.
4944 * marker.c (attach_marker): New function.
4945 (Fset_marker, set_marker_restricted, set_marker_both)
4946 (set_marker_restricted_both): Use it.
4947 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4948 Consistently rename charno to charpos.
4949 (marker_position): Add eassert.
4950 (marker_byte_position): Convert to eassert.
4951
49522012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4953
4954 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 4955 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 4956 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 4957
657924ff
DA
49582012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4959
4960 Introduce fast path for the widely used marker operation.
4961 * alloc.c (build_marker): New function.
4962 * lisp.h (build_marker): New prototype.
4963 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4964 * composite.c (autocmp_chars): Likewise.
4965 * editfns.c (buildmark): Remove.
4966 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4967 (save_restriction_save): Use build_marker.
4968 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4969 * window.c (save_window_save): Likewise.
4970
041a49a6
DA
49712012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4972
4973 Do not use Fdelete_overlay in delete_all_overlays
4974 to avoid redundant calls to unchain_overlay.
4975 * buffer.c (drop_overlay): New function.
4976 (delete_all_overlays, Fdelete_overlay): Use it.
4977 * minibuf.c (get_minibuffer): Fix comment.
4978
7dca65a4
PE
49792012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4980
4981 Port to OpenBSD 5.1 amd64.
4982 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4983 This is needed for OpenBSD, and should be harmless on all BSD systems.
4984 Also, include <sys/sysctl.h>, as it should be available on all
4985 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4986 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4987 use p_pid member, not kp_proc.pid.
4988
8eb876e2
GM
49892012-07-06 Glenn Morris <rgm@gnu.org>
4990
4991 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4992
38182d90
PE
49932012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4994
4995 More xmalloc and related cleanup.
4996 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4997 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4998 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4999 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5000 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5001 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5002 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5003 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5004 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5005 * xterm.c:
5006 Omit needless casts involving void * pointers and allocation.
5007 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5008 as the former is more robust if P's type is changed.
5009 Prefer xzalloc to xmalloc + memset 0.
5010 Simplify malloc-or-realloc to realloc.
5011 Don't worry about xmalloc returning a null pointer.
5012 Prefer xstrdup to xmalloc + strcpy.
5013 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5014 growing it.
5015 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5016 alloca of a constant.
5017
6dd5a677
EZ
50182012-07-05 Eli Zaretskii <eliz@gnu.org>
5019
5020 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5021 hscroll is larger than the line width. Fixes long and futile
5022 looping inside extend_face_to_end_of_line (on a TTY) producing
5023 glyphs that are not needed and thrown away.
5024
6b312f0f
DA
50252012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5026
5027 * marker.c (set_marker_restricted_both): Simplify by using
5028 clip_to_bounds.
5029
f520ef9b
PE
50302012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5031
5032 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5033
383b7c95
JD
50342012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5035
5036 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5037 not defined (Bug#11768).
5038 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5039 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5040 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5041 followed by gtk_box_set_homogeneous (Bug#11768).
5042 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5043 (update_theme_scrollbar_width, xg_create_scroll_bar):
5044 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5045 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5046 (is_box_type): New function (Bug#11768).
5047 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5048 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5049 with default display (Bug#11768).
5050
d6e7bf45
EZ
50512012-07-05 Eli Zaretskii <eliz@gnu.org>
5052
5053 * xdisp.c (window_hscroll_limited): New function.
5054 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5055 coordinates when window's hscroll is set to insanely large
5056 values. (Bug#11857)
5057
431391ec
JB
50582012-07-05 Juanma Barranquero <lekktu@gmail.com>
5059
5060 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5061 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5062
23f86fce
DA
50632012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5064
5065 Cleanup xmalloc.
5066 * lisp.h (xzalloc): New prototype. Omit needless casts.
5067 * alloc.c (xzalloc): New function. Omit needless casts.
5068 * charset.c: Omit needless casts. Convert all calls to
5069 xmalloc with following memset to xzalloc.
5070 * dispnew.c: Likewise.
5071 * fringe.c: Likewise.
5072 * image.c: Likewise.
5073 * sound.c: Likewise.
5074 * term.c: Likewise.
5075 * w32fns.c: Likewise.
5076 * w32font.c: Likewise.
5077 * w32term.c: Likewise.
5078 * xfaces.c: Likewise.
5079 * xfns.c: Likewise.
5080 * xterm.c: Likewise.
5081 * atimer.c: Omit needless casts.
5082 * buffer.c: Likewise.
5083 * callproc.c: Likewise.
5084 * ccl.c: Likewise.
5085 * coding.c: Likewise.
5086 * composite.c: Likewise.
5087 * doc.c: Likewise.
5088 * doprnt.c: Likewise.
5089 * editfns.c: Likewise.
5090 * emacs.c: Likewise.
5091 * eval.c: Likewise.
5092 * filelock.c: Likewise.
5093 * fns.c: Likewise.
5094 * gtkutil.c: Likewise.
5095 * keyboard.c: Likewise.
5096 * lisp.h: Likewise.
5097 * lread.c: Likewise.
5098 * minibuf.c: Likewise.
5099 * msdos.c: Likewise.
5100 * print.c: Likewise.
5101 * process.c: Likewise.
5102 * region-cache.c: Likewise.
5103 * search.c: Likewise.
5104 * sysdep.c: Likewise.
5105 * termcap.c: Likewise.
5106 * terminal.c: Likewise.
5107 * tparam.c: Likewise.
5108 * w16select.c: Likewise.
5109 * w32.c: Likewise.
5110 * w32reg.c: Likewise.
5111 * w32select.c: Likewise.
5112 * w32uniscribe.c: Likewise.
5113 * widget.c: Likewise.
5114 * xdisp.c: Likewise.
5115 * xmenu.c: Likewise.
5116 * xrdb.c: Likewise.
5117 * xselect.c: Likewise.
5118
0497dc44
PE
51192012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5120
5121 * fileio.c (time_error_value): Check the right error number.
5122 Problem reported by Troels Nielsen in
5123 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5124
356e7178
PE
51252012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5126
4e71fd89
PE
5127 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5128 This should be fixed in a better way; see Eli Zaretskii in
5129 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5130 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5131
f0941253
PE
5132 * fileio.c (time_error_value): Rename from special_mtime.
5133 The old name's problems were noted by Eli Zaretskii in
5134 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5135
065c9eb4
PE
5136 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5137 This variable's comment says Emacs needs at least one GDB-visible
5138 symbol of type enum pvec_type, to work around GDB problems.
5139 The symbol's value doesn't matter.
5140
356e7178
PE
5141 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5142 that causes compilation to fail on pre-C99 compilers.
5143
ed9265fc 51442012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5145
5146 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5147 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5148
3884d954
DA
51492012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5150
d209e2fb 5151 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5152 headers for buffer_defaults and buffer_local_symbols.
5153 Reported by Juanma Barranquero <lekktu@gmail.com>.
5154
ee28be33
SM
51552012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5156
5157 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5158 * lisp.h (enum pvec_type): Use fewer bits.
5159 (PSEUDOVECTOR_SIZE_BITS): New constant.
5160 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5161 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5162 change in pvec_type.
5163 (PSEUDOVECTOR_TYPEP): New macro.
5164 (TYPED_PSEUDOVECTORP): Use it.
5165 * fns.c (internal_equal): Adapt code to extract pvectype.
5166 * emacs.c (gdb_pvec_type): Update type.
5167 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5168 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5169 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5170 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5171 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5172 abusing vector->header.next.nbytes.
5173 (live_vector_p): Use PVEC_TYPE.
5174 (mark_object): Adapt code to extract pvectype. Use switch.
5175
c7f2cd7f
PE
51762012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5177
5178 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5179 Tighten new eassert a bit.
5180
8ce70ed2
DA
51812012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5182
5183 Fix compilation with --enable-gcc-warnings and -O1
5184 optimization level.
5185 * doprnt.c (doprnt): Change type of tem to int, initialize
5186 to avoid compiler warning. Add eassert.
5187 * search.c (simple_search): Initialize match_byte to avoid
5188 compiler warning. Add eassert.
5189
dea7f1e5
PE
51902012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5191
24a212eb
PE
5192 Avoid weird behavior with large horizontal scrolls.
5193 Without this change, for example, large hscroll values would
5194 mess up Emacs's display on Fedora 15 x86, presumably due to
5195 overflows in int calculations in the display code.
5196 Also, if buffers had long lines, Emacs would freeze.
5197 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5198 (set_window_hscroll): New function, containing the old guts of
5199 Fset_window_hscroll. Return the clipped value.
5200 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5201 This avoids the need to check against PTRDIFF_MAX.
5202
dea7f1e5
PE
5203 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5204
76046526
DA
52052012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5206
5207 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5208
39adff0d
PE
52092012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5210
63807d47
PE
5211 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5212 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5213 since GCC 4.4.6 issues a bogus warning for them.
5214
39adff0d
PE
5215 Fix bugs in file timestamp newness comparisons.
5216 * fileio.c (Ffile_newer_than_file_p):
5217 * lread.c (Fload): Use full timestamp resolution of files,
5218 not just the 1-second resolution, so that files that are only
5219 slightly newer still count as newer.
5220 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5221 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5222
dbeed9a6
PE
52232012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5224
5225 * fileio.c: Improve handling of file time marker. (Bug#11852)
5226 (special_mtime): New function.
5227 (Finsert_file_contents, Fverify_visited_file_modtime):
5228 Use it to set special mtime values consistently.
5229
636334d6
AS
52302012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5231
5232 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5233 marker for non-existing file. (Bug#11852)
5234
e2017fe2
GM
52352012-07-03 Glenn Morris <rgm@gnu.org>
5236
5237 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5238 and did not make it into globals.h).
5239
404dbd37
TT
52402012-07-03 Tom Tromey <tromey@redhat.com>
5241
5242 * window.c (Fset_window_margins, Fset_window_fringes)
5243 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5244 * textprop.c (Fprevious_property_change): No longer static.
5245 * syntax.c (Fsyntax_table_p): No longer static.
5246 * process.c (Fget_process, Fprocess_datagram_address): No longer
5247 static.
5248 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5249 * keyboard.c (Fcommand_execute): No longer static.
5250 Remove EXFUN.
5251 * insdel.c (Fcombine_after_change_execute): No longer static.
5252 * image.c (Finit_image_library): No longer static.
5253 * fileio.c (Fmake_symbolic_link): No longer static.
5254 * eval.c (Ffetch_bytecode): No longer static.
5255 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5256 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5257 No longer static.
404dbd37
TT
5258 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5259 static.
5260 * dired.c (Ffile_attributes): No longer static.
5261 * composite.c (Fcomposition_get_gstring): No longer static.
5262 * callproc.c (Fgetenv_internal): No longer static.
5263
5264 * ccl.h: Remove EXFUNs.
5265 * buffer.h: Remove EXFUNs.
5266 * dispextern.h: Remove EXFUNs.
5267 * intervals.h: Remove EXFUNs.
5268 * fontset.h: Remove EXFUN.
5269 * font.h: Remove EXFUNs.
5270 * dosfns.c (system_process_attributes): Remove EXFUN.
5271 * keymap.h: Remove EXFUNs.
5272 * lisp.h: Remove EXFUNs.
5273 * w32term.h: Remove EXFUNs.
5274 * window.h: Remove EXFUNs.
5275 * xsettings.h: Remove EXFUN.
5276 * xterm.h: Remove EXFUN.
5277
8e4fd1e1
GM
52782012-07-03 Glenn Morris <rgm@gnu.org>
5279
5280 * lisp.h (Frandom): Make it visible to C.
5281 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5282 buffer for invisible buffers. (Bug#1229)
5283
ca95b3eb
DA
52842012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5285
5286 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5287 values which aren't power of 2.
14ae4239
BT
5288 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5289 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5290 accordingly.
5291
7555c33f
SM
52922012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5293
5294 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5295
5296 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5297
d12e8f5a
DA
52982012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5299
5300 * alloc.c (allocate_vector_block): Remove redundant
5301 calls to mallopt if DOUG_LEA_MALLOC is defined.
5302 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5303 avoid calls to mallopt if zero_vector is returned.
5304
296094c3
DA
53052012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5306
5307 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5308 is enabled, avoid dereferencing NULL current_sblock if
5309 running undumped.
5310
36429c89
DA
53112012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5312
5313 Cleanup basic buffer management.
5314 * buffer.h (struct buffer): Change layout to use generic vector
5315 marking code. Fix some comments. Change type of 'clip_changed'
5316 to bitfield. Remove unused #ifndef old.
5317 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5318 (GET_OVERLAYS_AT): Fix indentation.
5319 (for_each_per_buffer_object_at): New macro.
5320 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5321 (Fbuffer_local_variables): Use it.
5322 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5323 * alloc.c (allocate_buffer): Adjust to match new layout of
5324 struct buffer. Fix comment.
5325 (mark_overlay): New function.
5326 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5327 Lisp area of struct buffer.
5328 (mark_object): Use it. Adjust marking of misc objects
5329 and related comments.
5330
3b3e4cac
PE
53312012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5332
5333 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5334 wrapper that is not needed because the wrapped code is a no-op (zero
5335 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5336 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5337
cf5c0175
DA
53382012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5339
5340 * alloc.c (mark_buffer): Simplify. Remove prototype.
5341 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5342 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5343 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5344 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5345
ca26824c
GM
53462012-06-30 Glenn Morris <rgm@gnu.org>
5347
2e4c5312
GM
5348 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5349
ca26824c
GM
5350 * epaths.in (PATH_SITELOADSEARCH): New.
5351 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5352 This is rather than relying on --enable-locallisppath elements
5353 having "site-lisp" in their names. (Bug#10208#25, 11658)
5354
0d23c240
EZ
53552012-06-30 Eli Zaretskii <eliz@gnu.org>
5356
c9240d7a
EZ
5357 * w32proc.c (sys_select): Accept and ignore one more argument.
5358
5359 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5360
0d23c240 5361 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5362 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5363
5364 * sysdep.c: Don't include dos.h and dosfns.h.
5365
5366 * process.c (sys_select):
5367 * msdos.c (sys_select): Accept one more argument and ignore it.
5368
5369 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5370 adapt data types and code to that.
5371
5372 * dosfns.c:
5373 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5374 which clashes with the gnulib function of the same name.
5375
af5a5a98
AS
53762012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5377
c5e4379c
AS
5378 * font.c (font_style_to_value, font_style_symbolic)
5379 (font_prop_validate_style): Add type checks for values in
5380 font_style_table.
5381
af5a5a98
AS
5382 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5383 argument.
5384 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5385 uses.
5386
8d38f461
EZ
53872012-06-29 Eli Zaretskii <eliz@gnu.org>
5388
2e5a6631
EZ
5389 * xdisp.c (try_window_id): Undo last change.
5390
8d38f461
EZ
5391 * w32.c (getwd): Adjust commentary about startup_dir.
5392 (init_environment): Always call sys_access, even in non-MSVC
5393 builds. Don't chdir to the directory of the Emacs executable.
5394 This undoes code from 1997 which was justified by the need to
5395 "avoid conflicts when removing and renaming directories". But its
5396 downside was that every relative file name was being interpreted
5397 relative to the directory of the Emacs executable, which can never
5398 be TRT. In particular, it broke sys_access when called with
5399 relative file names.
5400 (sys_access): Map GetLastError to errno.
5401
2af3565e
DA
54022012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5403
5404 * window.h (struct window): Change type of 'fringes_outside_margins'
5405 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5406 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5407 Adjust comment.
5408 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5409 to ptrdiff_t.
5410
c8d3a25c 54112012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5412
c8d3a25c
GM
5413 * gnutls.c (emacs_gnutls_handshake):
5414 Add QUIT to make the loop interruptible.
57570cd3 5415
c8d3a25c 54162012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5417
c8d3a25c
GM
5418 * charset.c (init_charset): Make lack of etc/charsets fatal.
5419
3e984ee8
DA
54202012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5421
5422 * editfns.c (region_limit): Fix type mismatch.
5423
ef884f23
DA
54242012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5425
5426 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5427 undefined. Convert from xassert to eassert.
5428 * nsmenu.m: Convert from xassert to eassert.
5429 * nsterm.m: Likewise.
5430
7d7e0027
SM
54312012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5432
5433 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5434
aa754e6a
PE
54352012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5436
5437 Avoid integer overflow on scroll-left and scroll-right.
5438 * window.c (HSCROLL_MAX): New macro.
5439 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5440 overflow when requested scroll falls outside ptrdiff_t range.
5441
80b00b08
DA
54422012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5443
5444 * window.h (struct window): Change type of 'hscroll',
5445 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5446 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5447 Adjust users accordingly.
5448 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5449 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5450 from EMACS_INT to ptrdiff_t.
5451 (make_window): Omit redundant initialization.
5452
62b2bcf6
JB
54532012-06-28 Juanma Barranquero <lekktu@gmail.com>
5454
5455 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5456
45942c7d
DA
54572012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5458
5459 * window.h (struct window): Change type of 'use_time' and
5460 'sequence_number' from Lisp_Object to int.
5461 * frame.c (make_frame): Adjust users accordingly.
5462 * print.c (print_object): Likewise.
5463 * window.c (select_window, Fwindow_use_time, make_parent_window)
5464 (make_window): Likewise.
5465
e509cfa6
DA
54662012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5467
5468 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5469 enabled with --enable-checking=[all,glyphs] configure option.
5470 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5471 adjust comments accordingly.
5472 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5473 undefined, adjust comments accordingly.
5474 * image.c: Likewise.
5475 * scroll.c: Likewise.
5476 * w32fns.c: Likewise.
5477 * w32term.c: Likewise.
5478 * xdisp.c: Likewise.
5479 * xfaces.c: Likewise.
5480 * xfns.c: Likewise.
5481 * xterm.c: Likewise.
5482
a54e2c05
DA
54832012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5484
5485 Generalize run-time debugging checks.
5486 * dispextern.h (XASSERTS): Remove.
5487 * fontset.c (xassert): Remove.
5488 Convert from xassert to eassert.
5489 * alloc.c: Convert from xassert to eassert.
5490 * bidi.c: Likewise.
5491 * dispnew.c: Likewise.
5492 * fns.c: Likewise.
5493 * fringe.c: Likewise.
5494 * ftfont.c: Likewise.
5495 * gtkutil.c: Likewise.
5496 * image.c: Likewise.
5497 * keyboard.c: Likewise.
5498 * menu.c: Likewise.
5499 * process.c: Likewise.
5500 * scroll.c: Likewise.
5501 * sound.c: Likewise.
5502 * term.c: Likewise.
5503 * w32console.c: Likewise.
5504 * w32fns.c: Likewise.
5505 * w32term.c: Likewise.
5506 * window.c: Likewise.
5507 * xdisp.c: Likewise.
5508 * xfaces.c: Likewise.
5509 * xfns.c: Likewise.
5510 * xselect.c: Likewise.
5511 * xterm.c: Likewise.
5512
1ec4b7b2
SM
55132012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5514
5515 * fns.c (maybe_resize_hash_table): Output message when growing the
5516 purify-hashtable.
5517
2014308a
DA
55182012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5519
5520 * alloc.c (allocate_string_data): Remove dead code.
5521 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5522 avoid GCC warning about unused macro.
5523
246155eb
DA
55242012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5525
5526 * alloc.c (allocate_string): Omit intervals initialization.
5527 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5528 as in make_pure_string and make_pure_c_string.
5529
43184b7b
DA
55302012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5531
d209e2fb 5532 * alloc.c (allocate_string): Fix last change.
43184b7b 5533
3fe6dd74
DA
55342012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5535
d209e2fb 5536 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5537 to memset, add explicit initialization where appropriate.
5538
1ba6038a
GM
55392012-06-27 Glenn Morris <rgm@gnu.org>
5540
5541 * lisp.mk (lisp): Remove paths.elc.
5542
c89926a5
CY
55432012-06-27 Chong Yidong <cyd@gnu.org>
5544
5545 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5546
ed6b3510
JW
55472012-06-26 John Wiegley <johnw@newartisans.com>
5548
1ec4b7b2 5549 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5550 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5551
ed6b3510
JW
5552 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5553 when building with Clang.
5554
8edd4a2b
SM
55552012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5556
5557 * eval.c (Fapply): Allow calling it with a single argument.
5558
f6f62d1b
EZ
55592012-06-26 Eli Zaretskii <eliz@gnu.org>
5560
5561 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5562 _stricmp and _strnicmp.
5563 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5564
62efea5e
DA
55652012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5566
5567 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5568 allocated window.
5569 (allocate_process): Likewise for new process.
8edd4a2b 5570 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5571 (allocate_frame): Likewise.
5572 * frame.c (make_frame): Omit redundant initialization.
5573 * window.c (make_parent_window): Use memset.
5574 (make_window): Omit redundant initialization.
5575 * process.c (make_process): Omit redundant initialization.
5576 * terminal.c (create_terminal): Likewise.
5577
42997f4d
DA
55782012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5579
5580 * term.c (delete_tty): Remove redundant call to memset.
5581
1130ecfc
DA
55822012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5583
5584 * alloc.c: Remove build_string.
5585 * lisp.h: Define build_string as static inline. This provides
5586 a better opportunity to optimize away calls to strlen when the
5587 function is called with compile-time constant argument.
5588 * image.c (imagemagick_error): Convert to build_string.
5589 * w32proc.c (sys_spawnve): Likewise.
5590 * xterm.c (x_term_init): Likewise.
5591
cf38a720
PE
55922012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5593
99027bdd
PE
5594 Use sprintf return value instead of invoking strlen on result.
5595 In the old days this wasn't portable, since some sprintf
5596 implementations returned char *. But they died out years ago and
5597 Emacs already assumes sprintf returns int.
5598 Similarly for float_to_string.
5599 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5600 * ccl.c (ccl_driver):
5601 * character.c (string_escape_byte8):
5602 * data.c (Fnumber_to_string):
5603 * doprnt.c (doprnt):
5604 * print.c (print_object):
5605 * xdisp.c (message_dolog):
5606 * xfns.c (syms_of_xfns):
5607 Use sprintf or float_to_string result to avoid need to call strlen.
5608 * data.c (Fnumber_to_string):
5609 Use make_unibyte_string, since the string must be ASCII.
5610 * lisp.h, print.c (float_to_string): Now returns int length.
5611 * term.c (produce_glyphless_glyph):
5612 Use sprintf result rather than recomputing it.
5613
cf38a720
PE
5614 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5615 * Makefile.in (ALL_CFLAGS):
5616 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5617 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5618
3511c784
DA
56192012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5620
0a08eb21 5621 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
5622 strcasecmp if available.
5623 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5624
fb7da12e
AS
56252012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5626
5627 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5628 Avoid comma operator.
5629 * menu.c (push_submenu_start, push_submenu_end)
5630 (push_left_right_boundary, push_menu_pane): Likewise.
5631 * msdos.c (dos_rawgetc): Likewise.
5632
afa2ffd8
DA
56332012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5634
5635 * xfns.c (xic_create_fontsetname): Remove redundant calls
5636 to memset.
5637
b3b4476b
PE
56382012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5639
4495ff38
PE
5640 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5641 sprintf already null-terminates its output.
5642
b3b4476b
PE
5643 * xfns.c (x_window): Remove redundant cast.
5644
b00876c9
DA
56452012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5646
5647 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5648 `const char *' to `char *' to avoid compiler warning.
5649
d188e26b
PE
56502012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5651
885d1d74
PE
5652 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5653 instead of truncating it to 63 (admittedly a generous limit).
5654
d188e26b
PE
5655 * process.c: Fix spelling and caps in comments.
5656
e2f560b1
DN
56572012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5658
e86db54b 5659 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
5660 * sysdep.c (setpgrp): Remove definition, not used in this file.
5661
7583a3a1
JB
56622012-06-24 Juanma Barranquero <lekktu@gmail.com>
5663
5664 * makefile.w32-in: Update dependencies.
5665
696056c2
EZ
56662012-06-24 Eli Zaretskii <eliz@gnu.org>
5667
5668 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5669 (SYSTIME_H): Add nt/inc/sys/time.h.
5670
5671 * systime.h [WINDOWSNT]: Include sys/time.h.
5672
5673 * s/ms-w32.h (struct timespec): Definition moved from
5674 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5675
845ca893
PE
56762012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5677
5678 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5679 * buffer.h (buffer_slot_type_mismatch):
5680 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5681 * eval.c (unwind_to_catch):
5682 * image.c (my_png_error, my_error_exit):
5683 * keyboard.c (quit_throw_to_read_char, user_error)
5684 (Fexit_recursive_edit, Fabort_recursive_edit):
5685 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5686 (wrong_type_argument, buffer_overflow, __executable_start)
5687 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5688 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5689 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5690 (fatal):
5691 (child_setup) [!DOS_NT]:
5692 * lread.c (end_of_file_error, invalid_syntax):
5693 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5694 * puresize.h (pure_write_error):
5695 * search.c (matcher_overflow):
5696 * sound.c (sound_perror, alsa_sound_perror):
5697 * sysdep.c, syssignal.h (croak):
5698 * term.c (maybe_fatal, vfatal):
5699 * textprop.c (text_read_only):
5700 * undo.c (user_error):
5701 * unexmacosx.c (unexec_error):
5702 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5703 Use _Noreturn rather than NO_RETURN.
5704 No need for separate decl merely because of _Noreturn.
5705 * sound.c (sound_warning, parse_sound):
5706 Remove unnecessary forward decls.
5707
f1dd8073
PE
57082012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5709
5710 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5711 * lisp.h (WAIT_READING_MAX): New macro.
5712 * dispnew.c (Fsleep_for, sit_for):
5713 * keyboard.c (kbd_buffer_get_event):
5714 * process.c (Faccept_process_output):
5715 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5716 This improves on the previous patch, which introduced a bug
5717 when time_t is unsigned and as wide as intmax_t.
5718 See <http://bugs.gnu.org/9000#51>.
5719
b82c1755
EZ
57202012-06-23 Eli Zaretskii <eliz@gnu.org>
5721
5722 * dispnew.c (sit_for, Fsleep_for):
5723 * keyboard.c (kbd_buffer_get_event):
5724 * process.c (Faccept_process_output): Avoid compiler warnings when
5725 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5726
ca300656
JB
57272012-06-23 Juanma Barranquero <lekktu@gmail.com>
5728
049ec95b
JB
5729 * makefile.w32-in: Update dependencies.
5730
ca300656
JB
5731 * w32.c (ltime): Add return type and declare static.
5732 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5733
db7b8d06
PE
57342012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5735
5736 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5737 Privately reported by Herbert J. Skuhra.
5738 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5739 All uses changed.
5740 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5741 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5742
0bd8297f
EZ
57432012-06-23 Eli Zaretskii <eliz@gnu.org>
5744
96512555
EZ
5745 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5746 last argument of make_unibyte_string.
5747
0bd8297f
EZ
5748 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5749 language ID in the event parameters.
5750
5751 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5752 event.code, not the obscure "character set ID".
5753
63def6b6
CY
57542012-06-23 Chong Yidong <cyd@gnu.org>
5755
5756 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5757
e8a02204
EZ
57582012-06-23 Eli Zaretskii <eliz@gnu.org>
5759
388cdec0
EZ
5760 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5761 * w32.c (fdutimens): New function.
5762
5763 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5764
5765 * s/ms-w32.h (pselect): Redirect to sys_select.
5766
5767 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5768
e8a02204
EZ
5769 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5770 in the logic of incrementing and decrementing the value of
5771 use_relocatable_buffers.
5772
d054f3fb
PE
57732012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5774
5775 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5776 Privately reported by Herbert J. Skuhra.
5777 [__FreeBSD__]: Remove "*/" typo after "#include".
5778 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5779 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5780 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5781 Don't assume EMACS_TIME and struct timeval are the same type.
5782
d35af63c
PE
57832012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5784
5785 Support higher-resolution time stamps (Bug#9000).
5786 The time stamps are only nanosecond-resolution at the C level,
5787 since that's the best that any real-world system supports now.
5788 But they are picosecond-resolution at the Lisp level, as that's
5789 easy, and leaves room for future OS improvements.
5790
5791 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5792 (LIBES): Use it.
5793
5794 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5795 Don't get current time unless it's needed.
5796
5797 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5798 now provides it if it's absent.
5799 (start_atimer): Port to higher-res time stamps.
5800 Check for time stamp overflow. Don't get current time more
5801 often than is needed.
5802
5803 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5804 Include systime.h, not time.h.
5805 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5806
5807 * dired.c: Include stat-time.h.
5808 (Ffile-attributes): File times now have higher resolution.
5809
5810 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5811 (struct image): Timestamp now has higher resolution.
5812
5813 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5814 has at least microseconds now. All uses removed.
5815 (update_frame, update_single_window, update_window, update_frame_1)
5816 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 5817 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
5818
5819 * editfns.c (time_overflow): Now extern.
5820 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5821 (float-time, Fformat_time_string, Fcurrent_time_string)
5822 (Fcurrent_time_zone): Accept and generate higher-resolution
5823 time stamps.
5824 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5825 (decode_time_components, lisp_seconds_argument): New functions.
5826 (make_time): Now static.
5827 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5828 Report an error if the time is invalid, rather than having the caller
5829 do that.
5830
5831 * fileio.c: Include <stat-time.h>
5832 (Fcopy_file): Copy higher-resolution time stamps.
5833 Prefer to set the time stamp via a file descriptor if that works.
5834 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5835 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5836 (Fvisited_file_modtime, Fset_visited_file_modtime):
5837 Support higher-resolution time stamps.
5838
5839 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5840
5841 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5842
5843 * image.c (prepare_image_for_display, clear_image_cache)
5844 (lookup_image): Port to higer-resolution time stamps.
5845
5846 * keyboard.c (start_polling, bind_polling_period):
5847 Check for time stamp overflow.
5848 (read_char, kbd_buffer_get_event, timer_start_idle)
5849 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5850 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5851 Port to higher-resolution time stamps. Do not assume time_t is signed.
5852 (decode_timer): New function. Timers are now vectors of length 9,
5853 not 8, to accommodate the picosecond component.
5854 (timer_check_2): Use it.
5855
5856 * nsterm.m (select_timeout, timeval_subtract): Remove.
5857 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5858 as they're a bit more accurate and handle overflow better.
5859 (ns_select): Change prototype to be compatible with pselect.
5860 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5861 * nsterm.h (ns_select): Adjust prototype.
5862
5863 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5864 us-resolution time stamps.
5865 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5866
5867 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5868
5869 * lisp.h (time_overflow): New decl.
5870 (wait_reading_process_output): First arg is now intmax_t, not int,
5871 to accommodate larger waits.
5872
5873 * process.h (struct Lisp_Process.read_output_delay):
5874 Now counts nanoseconds, not microseconds.
5875 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5876 EMACS_HAS_USECS.
5877 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5878 (wait_reading_process_output):
5879 Port to ns-resolution time stamps.
5880 (Faccept_process_output, wait_reading_process_output):
5881 Check for time stamp overflow. Do not assume time_t is signed.
5882 (select_wrapper): Remove; we now use pselect.
5883 (Fprocess_attributes): Now generates ns-resolution time stamps.
5884
5885 * sysdep.c: Include utimens.h. Don't include utime.h
5886 or worry about struct utimbuf; gnulib does that for us now.
5887 (gettimeofday): Remove; gnulib provides a substitute.
5888 (make_timeval): New function.
5889 (set_file_times): Now sets ns-resolution time stamps.
5890 New arg FD; all uses changed.
5891 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5892 (system_process_attributes):
5893 Now returns ns-resolution time stamp. All uses changed.
5894 Check for time stamp overflow.
5895
5896 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5897 provides a substitute now.
5898
5899 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5900 since it guarantees struct timespec.
5901 (EMACS_TIME): Now struct timespec, so that we can support
5902 ns-resolution time stamps.
5903 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5904 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5905 (EMACS_USECS): Remove.
5906 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5907 so multiply the arg by 1000 before storing it.
5908 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5909 New macros.
5910 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5911 Port to ns-resolution time stamps.
5912 (EMACS_TIME_NEG_P): Remove; replaced by....
5913 (EMACS_TIME_SIGN): New macro.
5914 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5915 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5916 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5917 (make_timeval, make_lisp_time, decode_time_components): New decls.
5918 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5919 that it mishandled time_t overflow. You can't compare by subtracting!
5920 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5921 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5922
5923 * term.c: Include <sys/time.h>.
5924 (timeval_to_Time): New function, for proper overflow wraparound.
5925 (term_mouse_position, term_mouse_click): Use it.
5926
5927 * undo.c (record_first_change): Support higher-resolution time stamps
5928 in the undo buffer.
5929 (Fprimitive_undo): Use them when restoring time stamps.
5930
5931 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5932 (w32_get_internal_run_time):
5933 Port to higher-resolution Emacs time stamps.
5934 (ltime): Now accepts single 64-bit integer, as that's more convenient
5935 for callers.
5936
5937 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5938
5939 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5940 for compatibility with pselect. Support ns-resolution time stamps.
5941
5942 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5943
5944 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5945 Check for time stamp overflow, and support ns-resolution time stamps.
5946
5947 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5948 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5949 (timeval_subtract): Remove; no longer needed.
5950 (XTflash, XTring_bell, x_wait_for_event):
5951 Port to ns-resolution time stamps. Don't assume time_t is signed.
5952
b6a92dfe
CY
59532012-06-22 Chong Yidong <cyd@gnu.org>
5954
5955 * xdisp.c (x_consider_frame_title): Revert last change.
5956
d251c37c
EZ
59572012-06-22 Eli Zaretskii <eliz@gnu.org>
5958
5959 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5960 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5961 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5962 staticidx goes up to 1597 out of 1600 = 0x640.)
5963
f10deafb
PE
59642012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5965
5966 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5967 Otherwise, the umask might be mistakenly 0 while handling input signals.
5968
ec6de1e2
SM
59692012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5970
5971 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5972
28be1ada
DA
59732012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5974
5975 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5976 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5977 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5978 access to `contents' member of Lisp_Vector objects with AREF and ASET
5979 where appropriate.
5980
c6bf3022
CY
59812012-06-19 Chong Yidong <cyd@gnu.org>
5982
5983 * frame.c (delete_frame): When selecting a frame on a different
5984 text terminal, do not alter the terminal's top-frame.
5985
5986 * xdisp.c (format_mode_line_unwind_data): Record the target
5987 frame's selected window and its terminal's top-frame.
5988 (unwind_format_mode_line): Restore them.
5989 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5990 Callers changed.
5991 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5992 since tty frames can be explicitly named.
5993 (prepare_menu_bars): Likewise.
5994
5995 * term.c (Ftty_top_frame): New function.
5996
defd4196
PE
59972012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5998
5999 Port byte-code-meter to modern targets.
6000 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6001 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6002 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6003 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6004 (METER_1, METER_2): Simplify.
6005
1053a871
SM
60062012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6007
6008 * data.c (Fdefalias): Return `symbol' (bug#11686).
6009
b7e8d081
MR
60102012-06-18 Martin Rudalics <rudalics@gmx.at>
6011
6012 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6013 gets killed during executing of this function (Bug#11665).
6014 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6015 (Vkill_buffer_query_functions): In doc-string say that functions
6016 run by this hook should not change the current buffer.
6017
7ea2b339
PE
60182012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6019
6020 Fix recently-introduced process.c problems found by static checking.
6021 * process.c (write_queue_push, write_queue_pop, send_process):
6022 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6023 (write_queue_pop): Fix pointer signedness problem.
6024 (send_process): Remove unused local.
6025
96a313a1
CY
60262012-06-17 Chong Yidong <cyd@gnu.org>
6027
6028 * xdisp.c (redisplay_internal): No need to redisplay terminal
6029 frames that are not on top.
6030
20ca2e94
TN
60312012-06-17 Troels Nielsen <bn.troels@gmail.com>
6032
6033 * process.c (make_process): Initialize write_queue.
6034 (write_queue_push, write_queue_pop): New functions.
6035 (send_process): Use them to maintain correct ordering of process
6036 writes (Bug#10815).
6037
9a900ca9
PE
60382012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6039
310fbfa8
PE
6040 * lisp.h (eassert): Assume C89 or later.
6041 This removes the need for CHECK.
6042 (CHECK): Remove. Its comments about always evaluating its
6043 argument were confusing, as 'eassert' typically does not evaluate
6044 its argument.
6045
27bb1ca4
PE
6046 * coding.c (produce_chars): Use ptrdiff_t, not int.
6047
9a900ca9
PE
6048 * xterm.c (x_draw_underwave): Check for integer overflow.
6049 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6050
41b7f8bc 60512012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6052
6053 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6054 referenced (Bug#11583).
6055
9b0e3eba
AA
60562012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6057
6058 Implement wave-style variant of underlining.
6059 * dispextern.h (face_underline_type): New enum.
6060 (face): Add field for underline type.
6061 * nsterm.m (ns_draw_underwave): New function.
6062 (ns_draw_text_decoration): Use it.
6063 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6064 New functions.
6065 (x_draw_glyph_string): Use them.
6066 * xfaces.c (Qline, Qwave): New Lisp objects.
6067 (check_lface_attrs, merge_face_ref)
1053a871
SM
6068 (Finternal_set_lisp_face_attribute, realize_x_face):
6069 Handle wave-style underline face attributes.
9b0e3eba
AA
6070 * xterm.c (x_draw_underwave): New function.
6071 (x_draw_glyph_string): Use it.
6072
0fb52f11
JB
60732012-06-16 Juanma Barranquero <lekktu@gmail.com>
6074
6075 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6076 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6077 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6078 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6079 ($(BLD)/w32select.$(O)): Update dependencies.
6080
e5560ff7
AS
60812012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6082
6083 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6084 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6085 * character.c (_fetch_multibyte_char_p): Remove.
6086 * alloc.c: Include "character.h" before "buffer.h".
6087 * bidi.c: Likewise.
6088 * buffer.c: Likewise.
6089 * bytecode.c: Likewise.
6090 * callint.c: Likewise.
6091 * callproc.c: Likewise.
6092 * casefiddle.c: Likewise.
6093 * casetab.c: Likewise.
6094 * category.c: Likewise.
6095 * cmds.c: Likewise.
6096 * coding.c: Likewise.
6097 * composite.c: Likewise.
6098 * dired.c: Likewise.
6099 * dispnew.c: Likewise.
6100 * doc.c: Likewise.
6101 * dosfns.c: Likewise.
6102 * editfns.c: Likewise.
6103 * emacs.c: Likewise.
6104 * fileio.c: Likewise.
6105 * filelock.c: Likewise.
6106 * font.c: Likewise.
6107 * fontset.c: Likewise.
6108 * fringe.c: Likewise.
6109 * indent.c: Likewise.
6110 * insdel.c: Likewise.
6111 * intervals.c: Likewise.
6112 * keyboard.c: Likewise.
6113 * keymap.c: Likewise.
6114 * lread.c: Likewise.
6115 * macros.c: Likewise.
6116 * marker.c: Likewise.
6117 * minibuf.c: Likewise.
6118 * nsfns.m: Likewise.
6119 * nsmenu.m: Likewise.
6120 * print.c: Likewise.
6121 * process.c: Likewise.
6122 * regex.c: Likewise.
6123 * region-cache.c: Likewise.
6124 * search.c: Likewise.
6125 * syntax.c: Likewise.
6126 * term.c: Likewise.
6127 * textprop.c: Likewise.
6128 * undo.c: Likewise.
6129 * unexsol.c: Likewise.
6130 * w16select.c: Likewise.
6131 * w32fns.c: Likewise.
6132 * w32menu.c: Likewise.
6133 * window.c: Likewise.
6134 * xdisp.c: Likewise.
6135 * xfns.c: Likewise.
6136 * xmenu.c: Likewise.
6137 * xml.c: Likewise.
6138 * xselect.c: Likewise.
6139
2f07e6af
EZ
61402012-06-16 Eli Zaretskii <eliz@gnu.org>
6141
1053a871
SM
6142 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6143 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6144 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6145 row.
6146 (handle_face_prop): Use chunk-relative overlay string index when
6147 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6148 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6149 the rightmost. (Bug#11720)
2f07e6af 6150
29b83cec
AS
61512012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6152
6153 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6154 (CATEGORY_MEMBER): Enforce 1/0 value.
6155 * category.c (_temp_category_set): Remove.
6156
4c5501e9
EZ
61572012-06-16 Eli Zaretskii <eliz@gnu.org>
6158
6159 * window.c (Fdelete_other_windows_internal)
6160 (Fdelete_window_internal): Don't access frame's mouse highlight
6161 info of the initial frame. (Bug#11677)
6162
2b570124
PE
61632012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6164
e93864f9
PE
6165 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6166 Assume USE_2_TAGS_FOR_INTS.
6167 (xreload): Adjust $tagmask width to match recent lisp.h change.
6168
2b570124
PE
6169 Simplify lisp.h in minor ways that should not affect code.
6170 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6171 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6172 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6173 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6174 (INTTYPEBITS): New macro, for clarity.
6175 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6176 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6177 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6178 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6179 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6180
81755f69
JB
61812012-06-13 Juanma Barranquero <lekktu@gmail.com>
6182
6183 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6184
16192a57
GM
61852012-06-13 Glenn Morris <rgm@gnu.org>
6186
6187 * s/bsd-common.h (BSD4_3):
6188 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6189
646b5f55
AS
61902012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6191
6192 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6193 instead of union.
6194 (XLI, XIL): Define.
1053a871
SM
6195 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6196 Use them.
6197 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6198 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6199 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6200 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6201 * frame.c (delete_frame): Remove outdated comment.
6202 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6203 USE_LISP_UNION_TYPE.
6204 (Fw32_unregister_hot_key): Likewise.
6205 (Fw32_toggle_lock_key): Likewise.
6206 * w32menu.c (add_menu_item): Likewise.
6207 (w32_menu_display_help): Use XIL instead of checking
6208 USE_LISP_UNION_TYPE.
6209 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6210 (init_heap): Likewise.
6211 * w32term.c (w32_read_socket): Update comment.
6212
1d3823c9
GM
62132012-06-13 Glenn Morris <rgm@gnu.org>
6214
c62ff706
GM
6215 * s/usg5-4-common.h, src/s/unixware.h:
6216 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6217
1d3823c9
GM
6218 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6219
bfe3e0a2
PE
62202012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6221
6222 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6223 * alloc.c (make_number) [!defined make_number]:
6224 Remove, as lisp.h always defines this now.
6225 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6226 (roundup_size): Verify that it is a power of 2.
6227 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6228 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6229 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6230 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6231 USE_LSB_TAG now is always defined to be either 0 or 1.
6232 All uses changed.
6233 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6234 code works fine either way, and efficiency is not a concern here,
6235 as the union type is for debugging, not for production.
6236 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6237 Use an inline function on all platforms when using the union type,
6238 since this is simpler and 'static inline' can be used portably
6239 within Emacs now.
6240 (LISP_INITIALLY_ZERO): New macro.
6241 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6242 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6243
45fa9c0f
GM
62442012-06-12 Glenn Morris <rgm@gnu.org>
6245
b4492cba
GM
6246 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6247
6248 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6249
45fa9c0f
GM
6250 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6251 Move BROKEN_SIGIO to configure.
6252
6253 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6254 Move NO_TERMIO to configure.
6255
0e25d334
CY
62562012-06-12 Chong Yidong <cyd@gnu.org>
6257
6258 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6259 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6260 MagickExportImagePixels is undefined.
6261
43682bb6
PE
62622012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6263
6264 * image.c (imagemagick_load_image): Remove unused label.
6265
a9be7d2b
GM
62662012-06-11 Glenn Morris <rgm@gnu.org>
6267
6268 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6269 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6270 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6271 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6272
3017f87f
SM
62732012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6274
6275 * alloc.c (make_byte_code): New function.
6276 (Fmake_byte_code): Use it. Don't purify here.
6277 * lread.c (read1): Use it as well to avoid extra allocation.
6278
1b9b4cf4
CY
62792012-06-11 Chong Yidong <cyd@gnu.org>
6280
6281 * image.c (imagemagick_load_image): Implement transparency.
6282
95988fcf
AS
62832012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6284
6285 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6286 account for preceding backslashes. (Bug#11663)
6287
cd4eb164
CY
62882012-06-09 Chong Yidong <cyd@gnu.org>
6289
6290 * term.c: Support italics in capable terminals (Bug#9652).
6291 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6292 (turn_on_face): Output using TS_enter_italic_mode if available.
6293 Don't handle unused blinking and alt-charset cases.
6294 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6295 and tty_alt_charset_p cases.
6296 (tty_capable_p, init_tty): Support italics.
6297
6298 * termchar.h (struct tty_display_info): Add field for italics.
6299 Remove unused blink field.
6300
6301 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6302 Handle slant.
6303
6304 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6305 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6306 tty_alt_charset_p. Add tty_italic_p.
6307
ff88beb8
MA
63082012-06-09 Michael Albinus <michael.albinus@gmx.de>
6309
6310 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6311 dbus_type_is_basic if available.
6312 (xd_extract_signed, xd_extract_unsigned): Rename from
6313 extract_signed and extract_unsigned, respectively. Adapt callers.
6314
44286096
CY
63152012-06-09 Chong Yidong <cyd@gnu.org>
6316
1682701f
CY
6317 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6318
44286096
CY
6319 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6320 case (Bug#9752).
6321
d86feb17
PE
63222012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6323
6324 * xdisp.c (vmessage): Treat frame message as multibyte.
6325 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6326 would generate the diagnostic "Making \302\247 buffer-local while
6327 let-bound!".
6328
d5c20fe8
EZ
63292012-06-08 Eli Zaretskii <eliz@gnu.org>
6330
6331 * dispnew.c (showing_window_margins_p): Undo last change, which
6332 was done due to an inadvertent commit.
6333 (adjust_frame_glyphs_for_frame_redisplay): Do call
6334 showing_window_margins_p.
6335
513749ee
SM
63362012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6337
6338 * eval.c (Fmake_var_non_special): New primitive.
6339 (syms_of_eval): Defsubr it.
6340 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6341
d4a8f5c1
JB
63422012-06-08 Juanma Barranquero <lekktu@gmail.com>
6343
6344 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6345 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6346
8bbbc977
EZ
63472012-06-08 Eli Zaretskii <eliz@gnu.org>
6348
6349 * alloc.c (allocate_vectorlike): Fix last change.
6350
f3372c87
DA
63512012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6352
6353 Block-based vector allocation of small vectors.
6354 * lisp.h (struct vectorlike_header): New field `nbytes',
6355 adjust comment accordingly.
6356 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6357 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6358 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6359 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6360 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6361 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6362 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6363 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6364 (roundup_size): New constant.
6365 (struct vector_block): New data type.
6366 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6367 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6368 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6369 (sweep_vectors): New functions.
6370 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6371 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6372 or equal to VBLOCK_BYTES_MAX.
6373 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6374 (init_alloc_once): Add call to init_vectors.
6375
4f18a4ed
SM
63762012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6377
6378 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6379
86f158bc
PE
63802012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6381
6382 * doprnt.c (doprnt): Truncate multibyte char correctly.
6383 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6384 would mishandle a string argument "Xc" if X was a multibyte
6385 character of length 2: it would truncate after X's first byte
6386 rather than including all of X.
6387
c5cfcbe0
CY
63882012-06-06 Chong Yidong <cyd@gnu.org>
6389
6390 * buffer.c (word_wrap): Doc fix.
6391
c05cf390
PE
63922012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6393
6394 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6395
0c3461de
GM
63962012-06-03 Glenn Morris <rgm@gnu.org>
6397
6398 * xdisp.c (tool-bar-style): Doc fix.
6399
c71232db
UM
64002012-06-03 Ulrich Müller <ulm@gentoo.org>
6401
6402 * Makefile.in (PAXCTL): Define.
6403 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6404 binary via PaX flags if the paxctl utility is available.
6405 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6406 Restore PaX flags to their default. (Bug#11398)
6407
383f7350
CY
64082012-06-03 Chong Yidong <cyd@gnu.org>
6409
6410 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6411 buffer (Bug#11226).
6412
5f2c76c6
CY
64132012-06-03 Chong Yidong <cyd@gnu.org>
6414
6415 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6416 (note_mode_line_or_margin_highlight): If there is no help echo,
6417 use mode-line-default-help-echo. Handle the case where the mouse
6418 position is past the end of the mode line string.
6419
6420 * buffer.c (buffer_local_value_1): New function, split from
6421 Fbuffer_local_value; can return Qunbound.
6422 (Fbuffer_local_value): Use it.
6423 (Vmode_line_format): Docstring tweaks.
6424
773d47f6
PE
64252012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6426
6427 * sysdep.c (system_process_attributes): Improve comment.
6428
f2d6a3df
SM
64292012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6430
6431 * keyboard.c: Export real-this-command to Elisp.
6432 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6433 and DEFVAR it. Update all users.
6434
63810350
PE
64352012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6436
7bd5c1f4
PE
6437 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6438
63810350
PE
6439 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6440 Convert pctcpu and pctmem to Lisp float properly.
6441 Let the compiler fold better, as 100.0/0x8000 is exact.
6442
a2821611
AS
64432012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6444
6445 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6446 cons_block.
6447
5fceba1d
PE
64482012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6449
6450 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6451
c98ff5dd
DA
64522012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6453
6454 For a 'struct window', replace some Lisp_Object fields to
6455 bitfields where appropriate, remove unused fields.
6456 * window.h (struct window): Remove unused 'last_mark_x' and
6457 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6458 change it's type from Lisp_Object to bitfield.
6459 Change type of 'force_start', 'optional_new_start',
6460 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6461 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6462
ca34e0be
PE
64632012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6464
6465 Pacify gcc -Wdouble-precision when using Xaw.
6466 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6467 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6468 Use 'float' consistently, rather than 'float' in most places
6469 and 'double' in a couple of places.
6470
efc00ab1 64712012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6472
6473 * xdisp.c (handle_stop): Detect whether we have overlay strings
6474 loaded by testing it->current.overlay_string_index to be
6475 non-negative, instead of checking whether n_overlay_strings is
6476 positive. (Bug#11587)
6477
efc00ab1 64782012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6479
6480 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6481
6482 * doc.c (Fsubstitute_command_keys): Doc fix.
6483
efc00ab1 64842012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6485
6486 * search.c (search_buffer): Remove calls to
6487 r_alloc_inhibit_buffer_relocation, as it is now called by
6488 maybe_unify_char, which was the cause of relocation of buffer text
6489 in bug#11519.
6490
efc00ab1 64912012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6492
6493 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6494 for the duration of call to load_charset, to avoid problems with
6495 callers of maybe_unify_char that access buffer text through C
6496 pointers.
6497
6498 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6499 decrement the inhibition flag, instead of just setting or
6500 resetting it.
6501
ba93a187
PE
65022012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6503
6504 Remove obsolete '#define static' cruft.
6505 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6506 This #undef was "temporary" in 2000; it is no longer needed
6507 now that '#define static' has gone away.
6508 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6509 (gray_bitmap_bits): Remove; no longer needed.
6510 All uses replaced with definiens.
6511 * xterm.c: Include "bitmaps/gray.xbm".
6512
9e4bf381
PE
65132012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6514
6515 Clean up __executable_start, monstartup when --enable-profiling.
6516 The following changes affect the code only when profiling.
6517 * dispnew.c (__executable_start): Rename from safe_bcopy.
6518 Define only on platforms that need it.
6519 * emacs.c: Include <sys/gmon.h> when profiling.
6520 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6521 (__executable_start): Remove decl, since lisp.h does it now.
6522 (safe_bcopy): Remove decl; no longer has that name.
6523 (main): Coalesce #if into single bit of code, for simplicity.
6524 Cast pointers to uintptr_t, since standard libraries want integers
6525 and not pointers.
6526 * lisp.h (__executable_start): New decl.
6527
32d72c2f
GM
65282012-05-31 Glenn Morris <rgm@gnu.org>
6529
6530 * image.c (Fimagemagick_types): Doc fix.
6531
baac5bc7
JM
65322012-05-30 Jim Meyering <meyering@redhat.com>
6533
6534 * callproc.c (Fcall_process_region): Include directory component
6535 in mkstemp error message (Bug#11586).
6536
72cb32cf
PE
65372012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6538
6539 * alloc.c, lisp.h (make_pure_vector): Now static.
6540
61b108cc
SM
65412012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6542
6543 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6544 Move to byte-run.el.
6545 (Fautoload): Do the hash-doc more carefully.
6546 * data.c (Fdefalias): Purify definition, except for keymaps.
6547 (Qdefun): Move from eval.c.
6548 * lisp.h (Qdefun): Remove.
6549 * lread.c (read1): Tiny simplification.
6550
471fe23d
TN
65512012-05-29 Troels Nielsen <bn.troels@gmail.com>
6552
934f3f58 6553 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6554 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6555 Bug#9642, but explicitly check that the buffer the overlay would
6556 be moved to is live and rearrange lines to make sure that errors
6557 will not put the overlay in an inconsistent state.
6558 (Fdelete_overlay): Cosmetics.
6559
85d0efd1
EZ
65602012-05-28 Eli Zaretskii <eliz@gnu.org>
6561
6562 * w32term.c (my_bring_window_to_top): New function.
6563 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6564 could be different from the original one.
6565 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6566 (Bug#11513)
6567
6568 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6569 by calling BringWindowToTop.
6570
6571 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6572 (WM_EMACS_END): Increase by one.
6573
da92a98c
PE
65742012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6575
6576 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6577 This avoids undefined behavior that might cause the eassert
6578 to not catch an out-of-range value.
6579
74d1f848
JB
65802012-05-28 Juanma Barranquero <lekktu@gmail.com>
6581
6582 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6583 Update dependencies.
6584
9e1a06fc
EZ
65852012-05-27 Eli Zaretskii <eliz@gnu.org>
6586
6587 * bidi.c (bidi_mirror_char): Fix last change.
6588
f3dd7312
AS
65892012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6590
6591 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6592 when referring to sectname field in printf format.
6593
81899c91
PE
65942012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6595
57b81a9f
PE
6596 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6597 Only r_alloc_inhibit_buffer_relocation needed to be added;
6598 the others were already declared.
6599
81899c91
PE
6600 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6601 before checking whether it's out of range. Put the check inside
6602 eassert. See
6603 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6604
33017faf 66052012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
6606
6607 * callproc.c (Fcall_process): Restore a line that was accidentally
6608 commented out in the 2011-02-13 change (bug#11547).
6609
33017faf 66102012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
6611
6612 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6613 defined on ralloc.c.
6614
6615 * buffer.c [REL_ALLOC]: Remove prototypes of
6616 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6617 they are now on lisp.h.
6618
6619 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6620
6621 * search.c (search_buffer): Use it to inhibit relocation of buffer
6622 text while re_search_2 is doing its job, because re_search_2 is
6623 passed C pointers to buffer text. (Bug#11519)
6624
23415acf
EZ
6625 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6626 Update value to 24.
6627
44e27368
EZ
6628 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6629 state after an additional call to move_it_in_display_line_to, keep
6630 the values of it->max_ascent and it->max_descent found for the
6631 entire line.
6632 (pos_visible_p): Revert the comparison against bottom_y to what it
6633 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6634 (Bug#11464)
6635
c1892f11
PE
66362012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6637
6638 Fix coding-related core dumps with gcc -ftrapv.
6639 The code was computing A - B, where A and B are pointers, and B is
6640 random garbage. This can lead to core dumps on platforms that
6641 have special pointer registers, and it also leads to core dumps on
6642 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6643 A - B only when B is initialized properly.
6644 * coding.c (coding_set_source, coding_set_destination): Return void.
6645 (coding_change_source, coding_change_destinations): New functions,
6646 with the old behaviors of coding_set_source and coding_set_destination.
6647 All callers that need an offset changed to use these new functions.
6648
eb7afdad
GM
66492012-05-26 Glenn Morris <rgm@gnu.org>
6650
6651 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6652
f12fdf02
EZ
66532012-05-26 Eli Zaretskii <eliz@gnu.org>
6654
53a63be6 6655 Extend mouse support on W32 text-mode console.
61b108cc
SM
6656 * xdisp.c (draw_row_with_mouse_face):
6657 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 6658
eb3f6f01 6659 * w32console.c: Include window.h.
61b108cc
SM
6660 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6661 New functions.
eb3f6f01
EZ
6662 (initialize_w32_display): Initialize mouse-highlight data.
6663
53a63be6
EZ
6664 * w32inevt.c: Include termchar.h and window.h.
6665 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6666 moves, call note_mouse_highlight. If help_echo changed, call
6667 gen_help_event to produce help-echo message in the echo area.
6668 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6669 highlight info.
6670
4cfd81f6
PE
66712012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6672
6673 * lread.c (read1): Simplify slightly to avoid an overflow warning
6674 with GCC 4.7.0 on x86-64.
6675
4446092a
EZ
66762012-05-26 Eli Zaretskii <eliz@gnu.org>
6677
6678 * bidi.c (bidi_mirror_char): Revert last change: an int is
6679 definitely wide enough here.
6680
42b2a986 66812012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 6682
42b2a986 6683 Fix integer width and related bugs (Bug#9874).
eb106a49 6684 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
6685 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6686 (string_bytes, check_sblock, allocate_string_data):
6687 (compact_small_strings, Fmake_bool_vector, make_string)
6688 (make_unibyte_string, make_multibyte_string)
6689 (make_string_from_bytes, make_specified_string)
6690 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6691 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6692 (mark_vectorlike):
6693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6694 (allocate_pseudovector):
6695 Use int, not EMACS_INT, where int is wide enough.
6696 (inhibit_garbage_collection, Fgarbage_collect):
6697 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6698 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6699 int might not be wide enough.
6700 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6701 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6702 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6703 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6704 (bidi_level_of_next_char, bidi_move_to_visually_next):
6705 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6706 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6707 (Fkill_buffer, Fset_buffer_major_mode)
6708 (advance_to_char_boundary, Fbuffer_swap_text)
6709 (Fset_buffer_multibyte, overlays_at, overlays_in)
6710 (overlay_touches_p, struct sortvec, record_overlay_string)
6711 (overlay_strings, recenter_overlay_lists)
6712 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6713 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6714 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6715 (Foverlay_recenter, last_overlay_modification_hooks_used)
6716 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
6718 (validate_region): Omit unnecessary test for b <= e,
6719 since that's guaranteed by the previous test.
d311d28c
PE
6720 (adjust_overlays_for_delete): Avoid pos + length overflow.
6721 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6722 (report_overlay_modification):
6723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6724 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6725 Omit pointer cast, which isn't needed anyway, and doesn't work
6726 after the EMACS_INT -> ptrdiff_t change.
02481186 6727 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
6728 * buffer.h: Adjust decls to match defn changes elsewhere.
6729 (struct buffer_text, struct buffer):
6730 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6731 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
6732 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6733 not int, to avoid needless 32-bit limit on 64-bit hosts.
6734 (exec_byte_code): Use tighter memory-full test, one that checks
6735 for alloca overflow. Don't compute the address of the object just
6736 before an array, as that's not portable. Use EMACS_INT, not
6737 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
6738 * callint.c (Fcall_interactively):
6739 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6740 * callproc.c (call_process_kill, Fcall_process):
6741 Don't assume pid_t fits into an Emacs fixnum.
6742 (call_process_cleanup, Fcall_process, child_setup):
6743 Don't assume pid_t fits into int.
6744 (call_process_cleanup, Fcall_process, delete_temp_file)
6745 (Fcall_process_region):
6746 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6747 (Fcall_process): Simplify handling of volatile integers.
6748 Use int, not EMACS_INT, where int will do.
6749 * casefiddle.c (casify_object, casify_region, operate_on_word)
6750 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6752 (casify_object): Avoid integer overflow when overallocating buffer.
6753 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 6754 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
6755 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6756 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6757 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6758 integers are now checked earlier. All uses replaced with XINT.
6759 (ccl_driver):
6760 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6761 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
6762 (ccl_driver, Fregister_code_conversion_map):
6763 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
6764 (resolve_symbol_ccl_program): Check that vector header is in range.
6765 Always copy the vector, so that we can check its contents reliably
6766 now rather than having to recheck each instruction as it's being
6767 executed. Check that vector words fit in 'int'.
6768 (ccl_get_compiled_code, Fregister_ccl_program)
6769 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6770 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6771 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6772 contents are in range.
6773 (Fccl_execute_on_string): Check that status is in range.
6774 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6775 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6776 Accept and return EMACS_INT, not int, because callers can pass values
6777 out of 'int' range.
6778 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6779 (multibyte_chars_in_text, parse_str_as_multibyte)
6780 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6781 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6782 (string_escape_byte8, Fget_byte):
6783 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 6784 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
6785 avoid mishandling large integers.
6786 * character.h: Adjust decls to match defn changes elsewhere.
6787 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6788 (Ffind_charset_region):
6789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6790 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6791 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 6792 Don't assume fixnum fits in int.
d311d28c
PE
6793 (load_charset_map_from_vector, Fmap_charset_chars):
6794 Remove now-unnecessary CHECK_NATNUMs.
6795 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
6796 Don't rely on undefined behavior with signed left shift overflow.
6797 Don't assume unsigned int fits into fixnum, or that fixnum fits
6798 into unsigned int. Don't require max_code to be a valid fixnum;
6799 that's not true for gb10830 4-byte on a 32-bit host. Allow
6800 invalid_code to be a cons, for the same reason. Require code_offset
6801 to be a character. Avoid int overflow if max_char is close
6802 to INT_MAX.
6803 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6804 this is intended anyway and avoids some undefined behavior.
6805 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6806 INDEX_TO_CODE_POINT, as that's what it expects.
6807 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
6808 * charset.h (DECODE_CHAR): Return int, not unsigned;
6809 this is what was intended anyway, and it avoids undefined behavior.
6810 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6811 integer-overflow issues.
6812 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6813 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6814 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
6815 * chartab.c (Fmake_char_table, Fset_char_table_range)
6816 (uniprop_get_decoder, uniprop_get_encoder):
6817 Don't assume fixnum fits in int.
6818 * cmds.c (move_point): New function, that does the gist of
6819 Fforward_char and Fbackward_char, but does so while checking
6820 for integer overflow more accurately.
c96e5d6a 6821 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
6822 (Fforward_line, Fend_of_line, internal_self_insert)
6823 (internal_self_insert):
6824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6825 Fix a FIXME, by checking for integer overflow when calculating
6826 target_clm and actual_clm.
6827 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 6828 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
6829 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6830 (coding_alloc_by_making_gap, alloc_destination)
6831 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6832 (encode_coding_utf_16, detect_coding_emacs_mule)
6833 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6834 (detect_coding_iso_2022, decode_coding_iso_2022)
6835 (encode_invocation_designation, encode_designation_at_bol)
6836 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6837 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6838 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6839 (encode_coding_ccl, encode_coding_raw_text)
6840 (detect_coding_charset, decode_coding_charset)
6841 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6842 (produce_composition, produce_charset, produce_annotation)
6843 (decode_coding, handle_composition_annotation)
6844 (handle_charset_annotation, consume_chars, decode_coding_gap)
6845 (decode_coding_object, encode_coding_object, detect_coding_system)
6846 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6847 (code_convert_region, code_convert_string)
8f50130c
PE
6848 (Fdefine_coding_system_internal)
6849 (coding_set_source, coding_set_destination):
d311d28c
PE
6850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6851 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6852 (Fdefine_coding_system_internal):
6853 Don't assume fixnums fit in int.
6854 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 6855 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
6856 (Funencodable_char_position, Fcheck_coding_systems_region)
6857 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 6858 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 6859 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 6860 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 6861 Don't access memory outside of the args array.
d311d28c 6862 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
6863 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6864 result of ENCODE_CHAR.
d311d28c
PE
6865 * coding.h: Adjust decls to match defn changes elsewhere.
6866 (struct coding_system):
6867 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6868 * composite.c (get_composition_id, find_composition)
6869 (run_composition_function, update_compositions)
6870 (compose_text, composition_gstring_put_cache)
6871 (composition_gstring_p, composition_gstring_width)
6872 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6873 (composition_compute_stop_pos, composition_reseat_it)
6874 (composition_update_it, struct position_record)
6875 (find_automatic_composition, composition_adjust_point)
6876 (Fcomposition_get_gstring, Ffind_composition_internal):
6877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6878 (update_compositions):
6879 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6880 * composite.h: Adjust decls to match defn changes elsewhere.
6881 (struct composition):
6882 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6883 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6884 Do not attempt to compute the address of the object just before a
6885 buffer; this is not portable.
6886 (Faref, Faset):
6887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6888 (Faset): Use int, not EMACS_INT, where int is wide enough.
6889 (Fstring_to_number): Don't assume fixnums fit in int.
6890 (Frem): Don't assume arg is nonnegative.
6891 * dbusbind.c (xd_append_arg): Check for integers out of range.
6892 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 6893 (extract_signed, extract_unsigned): New functions.
243e0530
PE
6894 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6895 (xd_get_connection_references): Return ptrdiff_t, not int.
6896 All uses changed.
6897 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6898 (xd_read_message_1):
6899 Use int, not unsigned, where the dbus API uses int.
6900 (Fdbus_message_internal): Don't overflow mtype.
6901 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
6902 * dired.c (directory_files_internal, file_name_completion, scmp)
6903 (file_name_completion_stat):
6904 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6905 (file_name_completion): Don't overflow matchcount.
6906 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6907 * dispextern.h: Adjust decls to match defn changes elsewhere.
6908 (struct text_pos, struct glyph, struct bidi_saved_info)
6909 (struct bidi_string_data, struct bidi_it, struct composition_it)
6910 (struct it):
6911 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6912 (struct display_pos, struct composition_it, struct it):
6913 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6914 * dispnew.c (increment_matrix_positions)
6915 (increment_row_positions, mode_line_string)
6916 (marginal_area_string):
6917 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 6918 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
6919 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6920 (duration_to_sec_usec): New function, to check for overflow better.
6921 (Fsleep_for, sit_for): Use it.
6922 * doc.c (get_doc_string, store_function_docstring):
6923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6924 (get_doc_string, Fsnarf_documentation):
6925 Use int, not EMACS_INT, where int is wide enough.
6926 (get_doc_string):
6927 Use SAFE_ALLOCA, not alloca.
6928 Check for overflow when converting EMACS_INT to off_t.
6929 * doprnt.c (doprnt):
6930 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6931 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6932 Don't assume uid_t fits into fixnum.
6933 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6934 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6935 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6936 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6937 (general_insert_function)
6938 (Finsert_char, make_buffer_string, make_buffer_string_both)
6939 (update_buffer_properties, Fbuffer_substring)
6940 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6941 (Fsubst_char_in_region, check_translation)
6942 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6943 (transpose_markers, Ftranspose_regions):
6944 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6945 (clip_to_bounds): Move to lisp.h as an inline function).
6946 (Fconstrain_to_field): Don't assume integers are nonnegative.
6947 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6948 (Fsubst_char_in_region, Fsave_restriction):
6949 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6950 (Femacs_pid): Don't assume pid_t fits into fixnum.
6951 (lo_time): Use int, not EMACS_INT, when int suffices.
6952 (lisp_time_argument): Check for usec out of range.
6953 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
6954 (Fuser_login_name, Fuser_full_name): Signal an error
6955 if a uid argument is out of range, rather than relying on
6956 undefined behavior.
c8d5c857
PE
6957 (Fformat_time_string): Remove now-unnecessary check.
6958 lisp_time_argument checks for out-of-range usec now.
243e0530 6959 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
6960 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6961 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6962 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6963 (init_cmdargs, Fdump_emacs):
6964 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6965 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6966 the bottom (typically) 32 bits of the fixnum.
6967 * eval.c (specpdl_size, call_debugger):
6968 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6969 (when_entered_debugger, Fbacktrace_debug):
6970 Don't assume fixnum can fit in int.
6971 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6972 the object just before a buffer; this is not portable.
6973 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6974 (grow_specpdl, unbind_to):
6975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6976 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6977 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 6978 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
6979 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6980 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6981 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6982 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6983 (a_write, e_write):
6984 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6985 (Fcopy_file, non_regular_nbytes, read_non_regular)
6986 (Finsert_file_contents):
6987 Use int, not EMACS_INT, where int is wide enough.
6988 (READ_BUF_SIZE): Verify that it fits in int.
6989 (Finsert_file_contents): Check that counts are in proper range,
6990 rather than assuming fixnums fit into ptrdiff_t etc.
6991 Don't assume fixnums fit into int.
125b3835 6992 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
6993 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6994 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
6995 (string_char_to_byte, string_byte_to_char)
6996 (string_make_multibyte, string_to_multibyte)
6997 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6998 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6999 (substring_both, Fdelete, internal_equal, Ffillarray)
7000 (Fclear_string, mapcar1)
7001 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7002 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7003 (larger_vector, make_hash_table, maybe_resize_hash_table)
7004 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7005 (Fmaphash, secure_hash):
7006 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7007 (concat): Check for string index and length overflow.
7008 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7009 (Frequire):
7010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7011 (larger_vector): New API (vec, incr_min, size_max) replaces old
7012 one (vec, new_size, init). This catches size overflow.
7013 INIT was removed because it was always Qnil.
7014 All callers changed.
7015 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7016 the upper bound on a hash table index size.
7017 (make_hash_table, maybe_resize_hash_table): Use it.
7018 (secure_hash): Computer start_byte and end_byte only after
7019 they're known to be in ptrdiff_t range.
7020 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7021 (Ffont_get_glyphs, Ffont_at):
7022 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7023 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7024 (Flist_fonts, Fopen_font):
7025 Don't assume fixnum can fit in int.
7026 (check_gstring): Don't assume index can fit in int.
7027 (font_match_p): Check that fixnum is a character, not a nonnegative
7028 fixnum, since the later code needs to stuff it into an int.
7029 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7030 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7031 conversion overflow issues.
7032 (Fopen_font): Check for integer out of range.
7033 (Ffont_get_glyphs): Don't assume index can fit in int.
7034 * font.h: Adjust decls to match defn changes elsewhere.
7035 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7036 integer overflow.
7037 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7038 printmax_t, where ptrdiff_t is wide enough.
7039 (Finternal_char_font):
7040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7041 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7042 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7043 (Fset_frame_position, x_set_frame_parameters)
7044 (x_set_line_spacing, x_set_border_width)
7045 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7046 Check that fixnums are in proper range for system types.
7047 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7048 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7049 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7050 Use SAFE_ALLOCA_LISP, not alloca.
7051 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7052 intptr_t is wide enough.
7053 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7054 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7055 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7056 Check for fixnum out of range.
7057 * ftfont.c (ftfont_list): Don't assume index fits in int.
7058 Check that fixnums are in proper range for system types.
7059 (ftfont_shape_by_flt):
7060 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7061 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7062 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7063 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7064 Check that fixnums are in proper range for system types.
7065 * gnutls.h: Adjust decls to match defn changes elsewhere.
7066 * gtkutil.c (xg_dialog_run):
7067 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7068 (update_frame_tool_bar):
7069 Check that fixnums are in proper range for system types.
7070 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7071 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7072 * indent.c (last_known_column, last_known_column_point):
7073 (current_column_bol_cache):
7074 (skip_invisible, current_column, check_display_width):
7075 (check_display_width, scan_for_column, current_column_1)
7076 (Findent_to, Fcurrent_indentation, position_indentation)
7077 (indented_beyond_p, Fmove_to_column, compute_motion):
7078 (Fcompute_motion, Fvertical_motion):
7079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7080 (last_known_column_modified): Use EMACS_INT, not int.
7081 (check_display_width):
7082 (Fcompute_motion):
7083 Check that fixnums and floats are in proper range for system types.
7084 (compute_motion): Don't assume index or fixnum fits in int.
7085 (compute_motion, Fcompute_motion):
7086 Use int, not EMACS_INT, when it is wide enough.
7087 (vmotion): Omit local var start_hpos that is always 0; that way
7088 we don't need to worry about overflow in expressions involving it.
7089 * indent.h: Adjust decls to match defn changes elsewhere.
7090 (struct position):
7091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7092 Use int, not EMACS_INT, where int is wide enough.
7093 Remove unused members ovstring_chars_done and tab_offset;
7094 all uses removed.
7095 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7096 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7097 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7098 (make_gap, copy_text, insert, insert_and_inherit)
7099 (insert_before_markers, insert_before_markers_and_inherit)
7100 (insert_1, count_combining_before, count_combining_after)
7101 (insert_1_both, insert_from_string)
7102 (insert_from_string_before_markers, insert_from_string_1)
7103 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7104 (adjust_after_replace, adjust_after_insert, replace_range)
7105 (replace_range_2, del_range, del_range_1, del_range_byte)
7106 (del_range_both, del_range_2, modify_region)
7107 (prepare_to_modify_buffer, signal_before_change)
7108 (signal_after_change, Fcombine_after_change_execute):
7109 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7110 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7111 (balance_an_interval, split_interval_right, split_interval_left)
7112 (find_interval, next_interval, update_interval)
7113 (adjust_intervals_for_insertion, delete_node, delete_interval)
7114 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7115 (static_offset_intervals, offset_intervals)
7116 (merge_interval_right, merge_interval_left, make_new_interval)
7117 (graft_intervals_into_buffer, temp_set_point_both)
7118 (temp_set_point, set_point, adjust_for_invis_intang)
7119 (set_point_both, move_if_not_intangible, get_property_and_range)
7120 (get_local_map, copy_intervals, copy_intervals_to_string)
7121 (compare_string_intervals, set_intervals_multibyte_1):
7122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7123 * intervals.h: Adjust decls to match defn changes elsewhere.
7124 (struct interval):
7125 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7126 * keyboard.c (this_command_key_count, this_single_command_key_start)
7127 (before_command_key_count, before_command_echo_length, echo_now)
7128 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7129 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7130 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7131 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7132 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7133 (last_non_minibuf_size, last_point_position, echo_truncate)
7134 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7135 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7136 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7137 (stuff_buffered_input):
7138 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7139 (last_auto_save, command_loop_1, read_char):
7140 Use EMACS_INT, not int, to avoid integer overflow.
7141 (record_char): Avoid overflow in total_keys computation.
7142 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7143 * keyboard.h: Adjust decls to match defn changes elsewhere.
7144 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7145 (Fkey_description, Fdescribe_vector, Flookup_key):
7146 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7147 (click_position): New function, to check that positions are in range.
7148 (Fcurrent_active_maps):
7149 (describe_command):
7150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7151 (Faccessible_keymaps, Fkey_description):
7152 (preferred_sequence_p):
7153 Don't assume fixnum can fit into int.
7154 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7155 Check for integer overflow in size calculations.
7156 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7157 avoid mishandling large integers.
7158 * lisp.h: Adjust decls to match defn changes elsewhere.
7159 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7160 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7161 (struct Lisp_Marker):
7162 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7163 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7164 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7165 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7166 All callers changed.
7167 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7168 Assume the arg has valid form, since it always does.
7169 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7170 unsigned integer system type.
7171 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7172 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7173 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7174 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7175 (duration_to_sec_usec): New decl.
7176 * lread.c (read_from_string_index, read_from_string_index_byte)
7177 (read_from_string_limit, readchar, unreadchar, openp)
7178 (read_internal_start, read1, oblookup):
7179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7180 (Fload, readevalloop, Feval_buffer, Feval_region):
7181 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7182 (openp): Check for out-of-range argument to 'access'.
7183 (read1): Use int, not EMACS_INT, where int is wide enough.
7184 Don't assume fixnum fits into int.
6efdadfd 7185 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7186 (read_filtered_event): Use duration_to_sec_usec
7187 to do proper overflow checking on durations.
d311d28c
PE
7188 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7189 in size calculation.
7190 (Fexecute_kbd_macro):
7191 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7192 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7193 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7194 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7195 (set_marker_both, set_marker_restricted_both, marker_position)
7196 (marker_byte_position, Fbuffer_has_markers_at):
7197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7198 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7199 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7200 It now merely ensures that the menu is large enough, without
7201 necessarily growing it, as this avoids some integer overflow issues.
7202 All callers changed.
7203 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7205 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7206 Use SAFE_ALLOCA_LISP, not alloca.
7207 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7208 to EMACS_INT. Check that fixnums are in proper range for system types.
7209 * minibuf.c (minibuf_prompt_width, string_to_object)
7210 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7211 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7213 (get_minibuffer, read_minibuf_unwind):
7214 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7215 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7216 this simplifies overflow checking. All callers changed.
7217 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7218 (Ftest_completion):
7219 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7220 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7221 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7222 Check that fixnums are in proper range for system types.
7223 (Fx_create_frame, Fx_show_tip):
7224 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7225 * nsfont.m (ns_findfonts, nsfont_list_family):
7226 Don't assume fixnum fits in long.
7227 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7228 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7229 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7230 wide enough.
17fdb222 7231 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7232 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7233 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7234 (PRINTDECLARE, PRINTPREPARE):
7235 (strout, print_string):
7236 (print, print_preprocess, print_check_string_charset_prop)
7237 (print_object):
7238 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7239 (PRINTDECLARE):
7240 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7241 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7242 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7243 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7244 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7245 (print_error_message): Use SAFE_ALLOCA, not alloca.
7246 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7247 (print_depth, new_backquote_output, print_number_index):
7248 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7249 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7250 (Fset_process_window_size, Fformat_network_address)
7251 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7252 (sigchld_handler):
d311d28c 7253 Check that fixnums are in proper range for system types.
d44287d4 7254 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7255 Check for process-ids out of pid_t range rather than relying on
7256 undefined behavior.
e4d81efc 7257 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7258 (Fformat_network_address, read_process_output, send_process)
7259 (Fprocess_send_region, status_notify):
7260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7261 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7262 (wait_reading_process_output, read_process_output, exec_sentinel):
7263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7264 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7265 (Faccept_process_output): Use duration_to_sec_usec to do proper
7266 overflow checking on durations.
dde14581
PE
7267 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7268 Don't assume pid_t fits in int.
02481186
PE
7269 * process.h (struct Lisp_Process): Members tick and update_tick
7270 are now of type EMACS_INT, not int.
b62b53e8
PE
7271 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7272 configured --with-wide-int.
d311d28c
PE
7273 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7274 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7275 * search.c (looking_at_1, string_match_1):
7276 (fast_string_match, fast_c_string_match_ignore_case)
7277 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7278 (scan_newline, find_before_next_newline, search_command)
7279 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7280 (set_search_regs, wordify):
7281 (Freplace_match):
7282 (Fmatch_data):
7283 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7284 (string_match_1, search_buffer, set_search_regs):
7285 (Fmatch_data):
7286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7287 (wordify): Check for overflow in size calculation.
7288 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7289 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7290 Check that fixnums are in proper range for system types.
7291 * sound.c (struct sound_device)
7292 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7293 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7294 (Fplay_sound_internal):
7295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7296 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7297 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7298 (Fparse_partial_sexp):
7299 Don't assume fixnums can fit in int.
7300 (struct lisp_parse_state, find_start_pos, find_start_value)
7301 (find_start_value_byte, find_start_begv)
7302 (update_syntax_table, char_quoted, dec_bytepos)
7303 (find_defun_start, prev_char_comend_first, back_comment):
7304 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7305 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7306 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7307 (Finternal_describe_syntax_value): Check that match_lisp is a
7308 character, not an integer, since the code stuffs it into int.
7309 (scan_words, scan_sexps_forward):
7310 Check that fixnums are in proper range for system types.
7311 (Fforward_word):
7312 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7313 (scan_sexps_forward):
7314 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7315 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7316 * syntax.h: Adjust decls to match defn changes elsewhere.
7317 (struct gl_state_s):
7318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7319 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7320 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7321 * sysdep.c (wait_for_termination_1, wait_for_termination)
7322 (interruptible_wait_for_termination, mkdir):
7323 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7324 (emacs_read, emacs_write):
7325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7326 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7327 and double all fit in int.
d311d28c
PE
7328 * term.c (set_tty_color_mode):
7329 Check that fixnums are in proper range for system types.
7330 * termhooks.h (struct input_event):
7331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7332 * textprop.c (validate_interval_range, interval_of)
7333 (Fadd_text_properties, set_text_properties_1)
7334 (Fremove_text_properties, Fremove_list_of_text_properties)
7335 (Ftext_property_any, Ftext_property_not_all)
7336 (copy_text_properties, text_property_list, extend_property_ranges)
7337 (verify_interval_modification):
7338 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7339 (Fnext_single_char_property_change)
7340 (Fprevious_single_char_property_change):
7341 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7342 (copy_text_properties):
7343 Check for integer overflow in index calculation.
d311d28c
PE
7344 * undo.c (last_boundary_position, record_point, record_insert)
7345 (record_delete, record_marker_adjustment, record_change)
7346 (record_property_change):
7347 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7348 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7350 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7351 (Fx_hide_tip, Fx_file_dialog):
7352 * w32menu.c (set_frame_menubar):
7353 Use ptrdiff_t, not int, for consistency with rest of code.
7354 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7355 (select_window, Fdelete_other_windows_internal)
7356 (window_scroll_pixel_based, window_scroll_line_based)
7357 (Frecenter, Fset_window_configuration):
7358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7359 (Fset_window_hscroll, run_window_configuration_change_hook)
7360 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7361 (Fscroll_other_window, Frecenter):
d311d28c
PE
7362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7363 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7364 Don't assume fixnum fits in int.
7365 (Fset_window_scroll_bars):
7366 Check that fixnums are in proper range for system types.
7367 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7368 (string_pos, c_string_pos, number_of_chars, init_iterator)
7369 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7370 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7371 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7372 (face_before_or_after_it_pos, handle_invisible_prop)
7373 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7374 (display_prop_intangible_p, string_buffer_position_lim)
7375 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7376 (get_overlay_strings_1, get_overlay_strings)
7377 (iterate_out_of_display_property, forward_to_next_line_start)
7378 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7379 (get_next_display_element, set_iterator_to_next)
7380 (get_visually_first_element, compute_stop_pos_backwards)
7381 (handle_stop_backwards, next_element_from_buffer)
7382 (move_it_in_display_line_to, move_it_in_display_line)
7383 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7384 (add_to_log, message_dolog, message_log_check_duplicate)
7385 (message2, message2_nolog, message3, message3_nolog
7386 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7387 (current_message_1, truncate_echo_area, truncate_message_1)
7388 (set_message, set_message_1, store_mode_line_noprop)
7389 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7390 (text_outside_line_unchanged_p, check_point_in_composition)
7391 (reconsider_clip_changes)
7392 (redisplay_internal, set_cursor_from_row, try_scrolling)
7393 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7394 (redisplay_window, find_last_unchanged_at_beg_row)
7395 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7396 (trailing_whitespace_p, find_row_edges, display_line)
7397 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7398 (display_mode_element, store_mode_line_string)
7399 (pint2str, pint2hrstr, decode_mode_spec)
7400 (display_count_lines, display_string, draw_glyphs)
7401 (x_produce_glyphs, x_insert_glyphs)
7402 (rows_from_pos_range, mouse_face_from_buffer_pos)
7403 (fast_find_string_pos, mouse_face_from_string_pos)
7404 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7405 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7406 (safe_call, init_from_display_pos, handle_fontified_prop)
7407 (handle_single_display_spec, load_overlay_strings)
7408 (with_echo_area_buffer, setup_echo_area_for_printing)
7409 (display_echo_area, echo_area_display)
7410 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7411 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7412 (redisplay_window, dump_glyph_row, display_mode_line)
7413 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7414 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7415 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7416 (handle_single_display_spec, build_desired_tool_bar_string)
7417 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7418 (get_specified_cursor_type):
7419 Check that fixnums are in proper range for system types.
7420 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7421 (Flookup_image_map):
7422 Don't assume fixnums fit in int.
7423 (compare_overlay_entries):
7424 Avoid mishandling comparisons due to subtraction overflow.
7425 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7426 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7427 (handle_tool_bar_click):
7428 Use int, not unsigned, since we prefer signed and the signedness
7429 doesn't matter here.
7430 (get_next_display_element, next_element_from_display_vector):
7431 Use int, not EMACS_INT, when int is wide enough.
7432 (start_hourglass): Use duration_to_sec_usec to do proper
7433 overflow checking on durations.
7434 * xfaces.c (Fbitmap_spec_p):
7435 Check that fixnums are in proper range for system types.
7436 (compare_fonts_by_sort_order):
7437 Avoid mishandling comparisons due to subtraction overflow.
7438 (Fx_family_fonts, realize_basic_faces):
7439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7440 (Fx_family_fonts):
7441 Don't assume fixnum fits in int.
7442 Use SAFE_ALLOCA_LISP, not alloca.
7443 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7444 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7445 (face_at_buffer_position, face_for_overlay_string)
7446 (face_at_string_position):
7447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7448 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7449 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7450 (Fx_show_tip):
7451 Check that fixnums are in proper range for system types.
7452 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7453 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7454 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7455 (Fx_change_window_property): Don't assume fixnums fit in int.
7456 * xfont.c (xfont_chars_supported):
7457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7458 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7459 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7460 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7461 * xml.c (parse_region):
7462 * xrdb.c (magic_file_p):
7463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7464 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7465 (x_get_local_selection, x_reply_selection_request)
7466 (x_handle_selection_request, wait_for_property_change):
7467 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7468 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7469 short is wide enough.
7470 (x_send_client_event): Don't assume fixnum fits in int.
7471 * xterm.c (x_x_to_emacs_modifiers):
7472 Don't assume EMACS_INT overflows nicely into int.
7473 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7474 may come from Lisp.
7475 (handle_one_xevent): NATNUMP can eval its arg twice.
7476 (x_connection_closed):
7477 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7478 * xterm.h: Adjust decls to match defn changes elsewhere.
7479 (struct scroll_bar): Use struct vectorlike_header
7480 rather than rolling our own approximation.
7481 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7482
c6574eb5
GM
74832012-05-25 Glenn Morris <rgm@gnu.org>
7484
7485 * lisp.mk (lisp): Update for more files being compiled now.
7486
e8d32c7e
SM
74872012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7488
48def666
SM
7489 * lread.c: Remove `read_pure' which makes no difference.
7490 (read_pure): Remove var.
7491 (unreadpure): Remove function.
7492 (readevalloop): Don't call read_list with -1 flag.
7493 (read1, read_vector): Don't test read_pure any more.
7494 (read_list): Simplify.
7495
e8d32c7e
SM
7496 * fileio.c, character.h: Minor style tweaks.
7497
4b2addb7
DA
74982012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7499
7500 * window.h (clip_changed): Remove useless declaration.
7501
584461b2
JB
75022012-05-22 Juanma Barranquero <lekktu@gmail.com>
7503
7504 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7505 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7506
34374650
PE
75072012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7508
7509 Remove src/m/*.
7510 This directory predates autoconf and is no longer needed nowadays.
7511 Move its few remaining bits of functionality to where they're needed.
7512 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7513 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7514 * m/template.h: Remove.
7515 * Makefile.in (M_FILE): Remove. All uses removed.
7516 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7517 * lisp.h (USE_LSB_TAG):
7518 * mem-limits.h (EXCEEDS_LISP_PTR):
7519 Use VAL_MAX, not VALBITS, in #if.
7520 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7521 (EMACS_UINT): Define unconditionally now.
7522 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7523 (BITS_PER_EMACS_INT): New constants, replacing
7524 what used to be in config.h, but not useful in #if.
7525 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7526 define them any more.
7527 (VAL_MAX): New macro.
7528 (VALMASK): Use it.
7529 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7530 BITS_PER_EMACS_INT, in #if.
7531 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7532 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7533 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7534 * s/ms-w32.h (DATA_START):
7535 Move here from removed file m/intel386.h.
7536 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7537 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7538
261cb4bb
PE
75392012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7540
7541 Assume C89 or later.
7542 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7543 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7544 (xrealloc):
7545 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7546 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7547 * textprop.c, tparam.c (NULL): Remove.
7548 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7549 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7550 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7551 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7552 * xterm.c (input_signal_count): Assume volatile works.
7553
ff23cd9f
KB
75542012-05-21 Ken Brown <kbrown@cornell.edu>
7555
7556 * xgselect.c (xg_select): Fix first argument in call to 'select'
7557 (bug#11508).
7558
1b170bc6
KB
75592012-05-20 Ken Brown <kbrown@cornell.edu>
7560
7561 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7562 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7563
b2f4d39f
KB
75642012-05-19 Ken Brown <kbrown@cornell.edu>
7565
7566 * xfns.c (x_in_use): Remove `static' qualifier.
7567 * xterm.h (x_in_use): Declare.
7568 * xgselect.c: Include xterm.h.
7569 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7570 and `display_arg' (bug#9754).
7571
003fdae2
PE
75722012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7573
9232a6d9
PE
7574 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7575
003fdae2
PE
7576 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7577 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7578
784b56e2
EZ
75792012-05-18 Eli Zaretskii <eliz@gnu.org>
7580
7581 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7582
7583 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7584 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7585
7586 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7587 reference to image_cache->refcount.
7588 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7589
a0a79cde
JL
75902012-05-17 Juri Linkov <juri@jurta.org>
7591
7592 * search.c (Fword_search_regexp, Fword_search_backward)
7593 (Fword_search_forward, Fword_search_backward_lax)
7594 (Fword_search_forward_lax): Move functions to isearch.el
7595 (bug#10145, bug#11381).
7596
b0572523
PE
75972012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7598
7599 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7600
9660f5fc
SM
76012012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7602
7603 * lread.c (init_obarray): Declare Qt and Qnil as special.
7604
4374de83
GM
76052012-05-14 Glenn Morris <rgm@gnu.org>
7606
7607 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 7608 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 7609
dc44c39a
PE
76102012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7611
078c97cb
PE
7612 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7613
dc44c39a
PE
7614 * unexaix.c: Port to more-recent AIX compilers.
7615 (report_error, report_error_1, make_hdr, copy_sym)
7616 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7617 Make arguments const char *, not char *, to avoid violations of C
7618 standard and to fix some AIX warnings reported by Gilles Pion.
7619
e18afed7 76202012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
7621
7622 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7623 already have overlays loaded.
7624 (handle_single_display_spec): Before returning without displaying
7625 fringe bitmap, synchronize the bidi iterator with the main display
7626 iterator, by calling iterate_out_of_display_property.
7627 (iterate_out_of_display_property): Detect buffer iteration by
7628 testing that it->string is a Lisp string.
7629 (get_next_display_element): When the current object is exhausted,
7630 and there's something on it->stack, call set_iterator_to_next to
7631 proceed with what's on the stack, instead of returning zero.
7632 (set_iterator_to_next): If called at the end of a Lisp string,
7633 proceed to consider_string_end without incrementing string
7634 position. Don't increment display vector index past the end of
7635 the display vector. (Bug#11417)
c8fb9dc6
EZ
7636 (pos_visible_p): Don't report a position visible when move_it_to
7637 stopped at the last line of window, which happens to be scanned
7638 backwards by the bidi iteration. (Bug#11464)
ac268e67 7639
e18afed7 76402012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
7641
7642 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7643 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
7644 are on a TTY, and thus unable to display on the fringes.
7645 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
7646 so we need to signal to the caller that this is a "replacing"
7647 display spec. This fixes display when the spec is invalid or we
7648 are on a TTY.
7649
e18afed7 76502012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
7651
7652 * unexaix.c (make_hdr): Fix typo in prototype.
7653 This bug broke the build on AIX. Problem reported by Gilles Pion.
7654
9d0a235a
MA
76552012-05-14 Michael Albinus <michael.albinus@gmx.de>
7656
7657 * keyboard.c (kbd_buffer_get_event): Read special events also in
7658 batch mode. (Bug#11415)
7659
9e6b06ed
GM
76602012-05-12 Glenn Morris <rgm@gnu.org>
7661
7662 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7663
c1a1d7a3
EZ
76642012-05-12 Eli Zaretskii <eliz@gnu.org>
7665
7666 * lisp.mk (lisp): Add newcomment.elc.
7667
3fe7cdc8
GM
76682012-05-12 Glenn Morris <rgm@gnu.org>
7669
7670 * Makefile.in (MKDIR_P): New, set by configure.
7671 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7672
53f7d2c0
PE
76732012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7674
7675 Remove unused function hourglass_started.
7676 * dispextern.h (hourglass_started):
7677 * w32fns.c (hourglass_started):
7678 * xdisp.c (hourglass_started): Remove.
7679
75aafb17
JB
76802012-05-10 Juanma Barranquero <lekktu@gmail.com>
7681
7682 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7683 Update dependencies.
7684
12959e8e
PE
76852012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7686
97107e2e
PE
7687 * xgselect.c (xg_select): Put maxfds+1 into a var.
7688 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7689
12959e8e
PE
7690 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7691
836d29b3
DA
76922012-05-10 Dave Abrahams <dave@boostpro.com>
7693
7694 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7695 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7696
5cb67954
MA
76972012-05-09 Michael Albinus <michael.albinus@gmx.de>
7698
7699 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7700 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7701 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7702 Initialize xd_registered_buses.
7703
3478ec45
PE
77042012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7705
b263a6b0
PE
7706 Untag more efficiently if USE_LSB_TAG.
7707 This is based on a proposal by YAMAMOTO Mitsuharu in
7708 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7709 For an admittedly artificial (nth 8000 longlist) benchmark on
7710 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7711 Emacs's overall text size by 1%.
7712 * lisp.h (XUNTAG): New macro.
7713 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7714 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7715 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7716 * eval.c (Fautoload):
7717 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7718 * frame.h (XFRAME): Use XUNTAG.
7719
3478ec45
PE
7720 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7721 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7722 Remove unportable assumptions about print widths of types like
7723 dbus_uint32_t.
7724 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7725 intptr_t when converting between pointer and integer, to avoid GCC
7726 warnings about wrong width.
7727
666b903b 77282012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
7729
7730 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7731 stack for each reader_thread, instead of defaulting to 8MB
7732 determined by the linker. This avoids failures in creating
7733 subprocesses on Windows 7, see the discussion in this thread:
7734 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7735
b120cc17
JC
77362012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7737
7738 Fix up display of the *Minibuf-0* buffer in the mini window.
7739 * keyboard.c (read_char): Don't clear the echo area if there's no
7740 message to clear.
7741 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 7742 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 7743
9a4b36f8
MA
77442012-05-07 Michael Albinus <michael.albinus@gmx.de>
7745
7746 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7747 batch mode.
7748
e5f9458f
CY
77492012-05-06 Chong Yidong <cyd@gnu.org>
7750
7751 * lisp.mk (lisp): Update.
7752
eceeb5fc 77532012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
7754
7755 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7756
71873e2b
SM
77572012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7758
7759 * data.c (PUT_ERROR): New macro.
7760 (syms_of_data): Use it. Add new error type `user-error'.
7761 * undo.c (user_error): New function.
7762 (Fprimitive_undo): Use it.
7763 * print.c (print_error_message): Adjust print style for `user-error'.
7764 * keyboard.c (user_error): New function.
7765 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7766
ab0fa4e4
PE
77672012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7768
7769 Do not limit current-time-string to years 1000..9999.
7770 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7771 (Fcurrent_time_string): Support any year that is supported by the
7772 underlying localtime representation. Don't use asctime, as it
7773 has undefined behavior for years outside the range -999..9999.
7774
7ed806a7
PE
77752012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7776
7777 Fix race conditions involving setenv, gmtime, localtime, asctime.
7778 Without this fix, interrupts could mess up code that uses these
7779 nonreentrant functions, since setting TZ invalidates existing
7780 tm_zone or tzname values, and since most of these functions return
7781 pointers to static storage.
7782 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7783 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7784 Grow the critical sections to include not just invoking
7785 localtime/gmtime, but also accessing these functions' results
7786 including their tm_zone values if any, and any related TZ setting.
7787 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
7788 so that the struct tm is saved in the critical section.
7789 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
7790 motivated by the fact that memory allocation needs to be outside
7791 the critical section.
7792
0c16dfed
DA
77932012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7794
7795 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7796 with RESET_INTERVAL.
7797
7798 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7799 Remove duplicated buffer name initialization.
7800
3f83ace8
JM
78012012-05-02 Jim Meyering <jim@meyering.net>
7802
7803 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7804
c7b8541e
JM
7805 * xfns.c (x_window): Use xstrdup (Bug#11375).
7806
90207a15 78072012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
7808
7809 * xdisp.c (pos_visible_p): If already at a newline from the
7810 display string before the 'while' loop, don't walk back the glyphs
7811 from it3.glyph_row. Solves assertion violation when the display
7812 string begins with a newline (egg.el). (Bug#11367)
7813
b593d6a9
AH
78142012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7815
7816 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7817 Move to simple.el.
7818
4737362e
GM
78192012-05-01 Glenn Morris <rgm@gnu.org>
7820
99cf43f9
GM
7821 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7822 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7823 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7824 All were removed before 23.1.
7825
9311dcff
GM
7826 * dispnew.c: Remove HAVE_LIBNCURSES test;
7827 it is always true on relevant platforms.
7828
4d5c6349
GM
7829 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7830 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7831
4737362e
GM
7832 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7833
74dd3a6b
AS
78342012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7835
7836 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7837 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7838 Remove.
7839
13c379ee
PE
78402012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7841
7842 Do not avoid creating empty evaporating overlays (Bug#9642).
7843 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7844 That is, do not delete an evaporating overlay if it becomes
7845 empty after its bounds are adjusted to fit within its buffer.
7846 This fix caused other problems, and I'm reverting it until we get
7847 to the bottom of them.
7848
a8e7d6d7 78492012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
7850
7851 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7852
a8e7d6d7 78532012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
7854
7855 * xdisp.c (pos_visible_p): If the window start position is beyond
7856 ZV, start the display from buffer beginning. Prevents assertion
7857 violation in init_iterator when the minibuffer window is scrolled
7858 via the scroll bar.
7859
7860 * window.c (window_scroll_pixel_based): Likewise.
7861
a8e7d6d7 78622012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
7863
7864 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7865
a8e7d6d7 78662012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
7867
7868 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7869 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7870
a8e7d6d7 78712012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 7872
b593d6a9
AH
7873 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7874 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 7875
1c6900d9
EZ
78762012-04-26 Eli Zaretskii <eliz@gnu.org>
7877
4c3fa1d9
EZ
7878 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7879 display element, check also the underlying string or buffer
7880 character. (Bug#11341)
7881
1c6900d9
EZ
7882 * w32menu.c: Include w32heap.h.
7883 (add_menu_item): If the call to AppendMenuW (via
7884 unicode_append_menu) fails, disable Unicode menus only if we are
7885 running on Windows 9X/Me.
7886
42bf8205
AS
78872012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7888
7889 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7890 (xgetint): Add missing shift for LSB tags.
7891
b1bac16e
MR
78922012-04-24 Martin Rudalics <rudalics@gmx.at>
7893
7894 * keyboard.c (read_char): Don't wipe echo area for select window
7895 events: These might get delayed via `mouse-autoselect-window'
7896 (Bug#11304).
7897
d69621cc
JB
78982012-04-24 Juanma Barranquero <lekktu@gmail.com>
7899
7900 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7901 manipulation of :loaded-from data.
7902
02fd101b
JB
79032012-04-23 Juanma Barranquero <lekktu@gmail.com>
7904
7905 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7906 now a cons (bug#11311).
7907
888bec30
PE
79082012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7909
89a438bd
PE
7910 Do not create empty overlays with the evaporate property (Bug#9642).
7911 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7912 if it becomes empty after its bounds are adjusted to fit within
7913 its buffer. Without this fix, in a nonempty buffer (let ((o
7914 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7915 yields an empty overlay that has the evaporate property, which is
7916 not supposed to happen.
7917
1068fe4d
PE
7918 Fix minor GTK3 problems found by static checking.
7919 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7920 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7921 (struct _EmacsFixedClass, emacs_fixed_get_type):
7922 Move decls here from emacsgtkfixed.h, since they needn't be public.
7923 (emacs_fixed_get_type): Now static.
7924 (emacs_fixed_class_init): Omit unused local.
7925 (emacs_fixed_child_type): Remove; unused.
7926 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7927 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7928 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7929 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7930 (EMACS_FIXED_GET_CLASS): Remove; unused.
7931 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7932
888bec30
PE
7933 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7934 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7935
de85e130
PE
79362012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7937
d0baac98 7938 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 7939 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
7940 (__malloc_size_t, __malloc_ptrdiff_t):
7941 Remove. All uses removed, replaced by the definiens if needed,
7942 since we can assume C89 or better now.
7943 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7944 (protect_malloc_state, align, get_contiguous_space)
7945 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7946 (malloc_atfork_handler_child, malloc_enable_thread)
7947 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7948 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7949 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7950 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7951 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7952 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7953 Define using prototypes, not old style.
7954 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7955 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7956 (align): Don't assume that signed integer overflow wraps around.
7957 Omit unused local var.
7958 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7959 (_free_internal_nolock, memalign, mallochook, reallochook):
7960 Omit no-longer-needed casts.
7961 (valloc): Use getpagesize, not __getpagesize.
7962 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7963 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7964
de85e130
PE
7965 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7966
dcbf5805
MA
79672012-04-22 Michael Albinus <michael.albinus@gmx.de>
7968
7969 Move functions from C to Lisp. Make non-blocking method calls
7970 the default. Implement further D-Bus standard interfaces.
7971
7972 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7973 (QCdbus_request_name_allow_replacement)
7974 (QCdbus_request_name_replace_existing)
7975 (QCdbus_request_name_do_not_queue)
7976 (QCdbus_request_name_reply_primary_owner)
7977 (QCdbus_request_name_reply_in_queue)
7978 (QCdbus_request_name_reply_exists)
7979 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7980 (QCdbus_registered_serial, QCdbus_registered_method)
7981 (QCdbus_registered_signal): New Lisp objects.
7982 (XD_DEBUG_MESSAGE): Use sizeof.
7983 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7984 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7985 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7986 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7987 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7988 (xd_signature, xd_append_arg): Allow float for integer types.
7989 (xd_get_connection_references): New function.
b593d6a9
AH
7990 (xd_get_connection_address): Rename from xd_initialize.
7991 Return cached address.
dcbf5805
MA
7992 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7993 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7994 level.
7995 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 7996 Return number of refcounts.
dcbf5805
MA
7997 (Fdbus_get_unique_name): Make stronger parameter check.
7998 (Fdbus_message_internal): New defun.
7999 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8000 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8001 (Fdbus_send_signal, Fdbus_register_service)
8002 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8003 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8004 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8005 (Vdbus_compiled_version, Vdbus_runtime_version)
8006 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8007 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8008 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8009 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8010 Adapt docstring.
dcbf5805 8011
52828e02
PE
80122012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8013
da05bc4c
PE
8014 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8015 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8016 Do not assume ptrdiff_t is the same width as 'int'.
8017
52828e02
PE
8018 * alloc.c: Handle unusual debugging option combinations.
8019 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8020 since the two debugging options are incompatible.
8021 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8022 is defined.
8023 (mem_init, mem_insert, mem_insert_fixup):
8024 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8025 (NEED_MEM_INSERT): Remove; no longer needed.
8026
f01769f9
LL
80272012-04-22 Leo Liu <sdl.web@gmail.com>
8028
8029 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8030
5790543d
PE
80312012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8032
8033 * sysdep.c [__FreeBSD__]: Minor cleanups.
8034 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8035 Use Emacs indenting style more consistently. Avoid some casts.
8036 Use 'double' consistently rather than mixing 'float' and 'double'.
8037
b91b7e4d
EW
80382012-04-21 Eduard Wiebe <usenet@pusto.de>
8039
b593d6a9
AH
8040 * sysdep.c (list_system_processes, system_process_attributes):
8041 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8042
6114eb15
AS
80432012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8044
8045 * lisp.mk (lisp): Update.
8046
2f38dff7
PE
80472012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8048
8049 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8050 It is never used otherwise.
8051
4ae29f89
SM
80522012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8053
8054 * print.c (print_preprocess): Only check print_depth if print-circle
8055 is nil.
8056 (print_object): Check for cycles even when print-circle is nil and
8057 print-gensym is t, but only check print_depth if print-circle is nil.
8058
f30d612a
CY
80592012-04-20 Chong Yidong <cyd@gnu.org>
8060
8061 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8062 set the status to "failed" and ensure that sentinel is run.
8063
c07a4c0b 80642012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8065
8066 * process.c (Fset_process_inherit_coding_system_flag)
8067 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8068 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8069
c07a4c0b 80702012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8071
8072 * xdisp.c (string_buffer_position_lim): Limit starting position to
8073 BEGV.
8074 (set_cursor_from_row): If called for a mode-line or header-line
8075 row, return zero immediately.
8076 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8077 farther than the first row after the header line, if any.
8078 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8079 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8080
c07a4c0b 80812012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8082
4ae29f89
SM
8083 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8084 (bug#11238).
ad3a2b41 8085
c07a4c0b 80862012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 80872012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8088
8089 configure: new option --enable-gcc-warnings (Bug#11207)
8090 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8091 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8092 (ALL_CFLAGS): Use new macros rather than old.
8093 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8094 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8095 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8096 -Wunused-result, -Wunused-variable. This should go away once
8097 the Emacs and Gnulib regex code is merged.
8098 (xmalloc, xrealloc): Now static.
8099
aba027e8
PE
81002012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8101
8102 * dired.c (Fsystem_groups): Remove unused local.
8103
e5a36063
GM
81042012-04-17 Glenn Morris <rgm@gnu.org>
8105
8106 * dired.c (Fsystem_users): Doc fix.
8107
316411f0
DA
81082012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8109
8110 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8111 (syms_of_dired): Add them.
8112
9426aba4
PE
81132012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8114
b62a57be
PE
8115 Fix minor alloc.c problems found by static checking.
8116 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8117 New extern decls, to avoid calling undeclared functions.
8118 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8119 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8120 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8121 (NEED_MEM_INSERT): New macro.
8122 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8123 Remove one incorrect comment and fix another.
b62a57be 8124
3539f31f
PE
8125 Fix minor ralloc.c problems found by static checking.
8126 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8127 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8128 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8129 (r_alloc_sbrk): Now static.
8130
a041960a
PE
8131 Improve ralloc.c interface checking.
8132 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8133 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8134 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8135 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8136 [REL_ALLOC]: ... to here, to check interface.
8137 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8138 Remove decls. This fixes an "It stinks!".
8139
9426aba4
PE
8140 * alloc.c (which_symbols): Fix alignment issue / type clash.
8141
d55c12ed
AS
81422012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8143
8144 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8145 (struct Lisp_Misc_Any): Likewise.
8146 (struct Lisp_Free): Likewise.
8147 * alloc.c (union aligned_Lisp_Symbol): Define.
8148 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8149 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8150 (union aligned_Lisp_Misc): Define.
8151 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8152 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8153 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8154
b948ce8b
PE
81552012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8156
8157 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8158 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8159 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8160 * s/netbsd.h, s/sol2-6.h:
8161 Remove definition of GC_MARK_STACK, since the default now works.
8162 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8163 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8164 no longer the default.
8165 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8166
35dc09a1 81672012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8168
35dc09a1
GM
8169 * lread.c (lisp_file_lexically_bound_p):
8170 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8171
35dc09a1
GM
81722012-04-14 Eli Zaretskii <eliz@gnu.org>
8173
8174 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8175 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8176
81772012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8178
8179 * nsterm.m (constrainFrameRect): Always constrain when there is only
8180 one screen (Bug#10962).
8181
bcd86815
KB
81822012-04-13 Ken Brown <kbrown@cornell.edu>
8183
8184 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8185
c25df26e
RT
81862012-04-13 Reuben Thomas <rrt@sc3d.org>
8187
8188 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8189
0fc59f1e
DC
81902012-04-11 Daniel Colascione <dancol@dancol.org>
8191
8192 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8193 against is gone. It's better to use vfork now so that when Cygwin
8194 gains a new, working vfork, we use it automatically (bug#10398).
8195
de8c03dc
SM
81962012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8197
8198 * window.c (save_window_save): Obey window-point-insertion-type.
8199
2f097256
GM
82002012-04-11 Glenn Morris <rgm@gnu.org>
8201
8202 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8203
453b951e
SM
82042012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8205
8206 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8207
75f1671a 82082012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8209
8210 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8211 (force_quit_count): New var.
8212 (handle_interrupt): Use it.
8213
2a8ce227
JB
82142012-04-10 Juanma Barranquero <lekktu@gmail.com>
8215
8216 * w32.c (w32_delayed_load): Record the full path of the library
8217 being loaded (bug#10424).
8218
935396c0
GM
82192012-04-09 Glenn Morris <rgm@gnu.org>
8220
05920a43
GM
8221 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8222 not just in the obarray, before snarfing them. (Bug#11036)
8223
935396c0
GM
8224 * Makefile.in ($(leimdir)/leim-list.el):
8225 Pass EMACS rather than BUILT_EMACS.
8226
a18ecafa
TZ
82272012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8228
8229 * process.c (make_process):
8230 * process.h: Add integer `gnutls_handshakes_tried' member to
8231 process struct.
8232
6bbef4e5
JC
8233 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8234 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8235
8236 * gnutls.c (gnutls_log_function2i): Convenience log function.
8237 (emacs_gnutls_read): Use new log functions,
8238 `gnutls_handshakes_tried' process member, and
8239 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8240 attempts per process (connection).
8241
b4d3bc10
CY
82422012-04-09 Chong Yidong <cyd@gnu.org>
8243
8244 * eval.c (Fuser_variable_p, user_variable_p_eh)
8245 (lisp_indirect_variable): Functions deleted.
8246 (Fdefvar): Caller changed.
8247
8248 * callint.c (Finteractive, Fcall_interactively):
8249 * minibuf.c (Fread_variable): Callers changed.
8250
70f4d973
EZ
82512012-04-09 Eli Zaretskii <eliz@gnu.org>
8252
8253 * xdisp.c (set_cursor_from_row): If the display string appears in
8254 the buffer at position that is closer to point than the position
8255 after the display string, display the cursor on the first glyph of
8256 the display string. Fixes cursor display when a 'display' text
8257 property immediately follows invisible text. (Bug#11094)
8258
cb3c2e3e
PE
82592012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8260
8261 composite.c: use 'double' consistently
8262 * composite.c (get_composition_id): Use 'double' consistently
8263 instead of converting 'float' to 'double' and vice versa; this is
8264 easier to understand and avoids a GCC warning.
8265
fd06db5d
GM
82662012-04-09 Glenn Morris <rgm@gnu.org>
8267
50fe702a
GM
8268 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8269 preparation for dumping it with emacs. (Bug#4789)
8270 (leimdir): New variable.
8271 ($(leimdir)/leim-list.el): New rule.
8272 (emacs$(EXEEXT)): Depend on leim-list.el.
8273
fd06db5d
GM
8274 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8275 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8276 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8277
55c131ee
AS
82782012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8279
8280 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8281 proper alignment.
8282
9209588f
JB
82832012-04-07 Juanma Barranquero <lekktu@gmail.com>
8284
8285 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8286 Remove unused local variable.
8287
e3fb2efb
PE
82882012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8289
8290 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8291 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8292 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8293 objects, as mark_maybe_pointer will catch them otherwise.
8294 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8295 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8296
b5385551
PE
82972012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8298
8299 Fix typo that broke non-Windows builds.
8300 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8301
9078ead6
EZ
83022012-04-07 Eli Zaretskii <eliz@gnu.org>
8303
8304 Support building on MS-Windows with libxml2.
8305
8306 * makefile.w32-in (OBJ2): Add xml.$(O).
8307 (GLOBAL_SOURCES): Add xml.c.
8308 ($(BLD)/xml.$(O)): New dependency list.
8309
8310 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8311 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8312 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8313 [!WINDOWSNT]: New macros.
8314 (init_libxml2_functions, libxml2_loaded_p): New functions.
8315 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8316 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8317 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8318 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8319 linked in).
6bbef4e5
JC
8320 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8321 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8322 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8323
8324 * emacs.c: Don't include libxml/parser.h.
8325 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8326 xmlCleanupParser directly.
8327
8328 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8329
3811fdf3
EZ
83302012-04-07 Eli Zaretskii <eliz@gnu.org>
8331
8332 * indent.c (Fvertical_motion): If there is a display string at
8333 point, use it.vpos to compute how many lines to backtrack after
8334 move_it_to point. (Bug#11133)
8335
2f8e16b2
EZ
83362012-04-06 Eli Zaretskii <eliz@gnu.org>
8337
8338 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8339 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8340 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8341 macros related to unification of CJK characters. For the details,
8342 see the discussion following the message here:
8343 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8344
3d439cd1
CY
83452012-04-04 Chong Yidong <cyd@gnu.org>
8346
8347 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8348
8bc53d00
EZ
83492012-04-01 Eli Zaretskii <eliz@gnu.org>
8350
8351 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8352 instead of alloca. (Bug#11138)
8353
3b0512a3
AS
83542012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8355
8356 * w32menu.c (is_simple_dialog): Properly check lisp types.
8357 (Bug#11141)
8358
8427ddd2
EZ
83592012-03-31 Eli Zaretskii <eliz@gnu.org>
8360
979022ef
EZ
8361 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8362 position we get to after a call to move_it_to fails the
8363 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8364 only if we wind up in a string from display property. (Bug#11063)
8365
a6b1c7cc
EZ
8366 * window.c (Fdelete_other_windows_internal): Invalidate the row
8367 and column information about mouse highlight, so that redisplay
8368 restores it after reallocating the glyph matrices. (Bug#7464)
8369
8427ddd2
EZ
8370 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8371 string comes from a `display' text property, use the buffer
8372 position of that property as if we actually saw that position in
8373 the row's glyphs.
697ba24b
EZ
8374 (move_it_by_lines): Remove the assertion that
8375 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8376 violated when there's a before-string at the beginning of a line.
8377 (Bug#11063)
8427ddd2 8378
65a0a738
EZ
83792012-03-30 Eli Zaretskii <eliz@gnu.org>
8380
8381 * xdisp.c (append_space_for_newline): If the default face was
8382 remapped, use the remapped face for the appended newline.
8383 (extend_face_to_end_of_line): Use the remapped default face for
8384 extending the face to the end of the line.
8385 (display_line): Call extend_face_to_end_of_line when the default
8386 face was remapped. (Bug#11068)
8387
581355cc
EZ
83882012-03-29 Eli Zaretskii <eliz@gnu.org>
8389
8390 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8391
e8fc049f
SM
83922012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8393
8394 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8395
4fb9a543
GM
83962012-03-27 Glenn Morris <rgm@gnu.org>
8397
8398 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8399 Doc fixes.
8400
679910f1
KH
84012012-03-26 Kenichi Handa <handa@m17n.org>
8402
8403 * dispextern.h (struct glyph): Fix previous change. Change the
8404 bit length of glyphless.ch to 25 (Bug#11082).
8405
90d49b7f
CY
84062012-03-26 Chong Yidong <cyd@gnu.org>
8407
8408 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8409 (command_loop_1): Use it; inhibit selection update for
8410 handle-select-window too (Bug#8996).
8411
f514f6f0
FP
84122012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8413
e8fc049f 8414 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8415
bf43fa51
KH
84162012-03-25 Kenichi Handa <handa@m17n.org>
8417
8418 * dispextern.h (struct glyph): Change the bit length of
8419 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8420
8a0c01dd
EZ
84212012-03-24 Eli Zaretskii <eliz@gnu.org>
8422
8423 * s/ms-w32.h (tzname): Include time.h before redirecting to
8424 _tzname. Fixes the MSVC build. (Bug#9960)
8425
7d1c3a76
AS
84262012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8427
8ed79523
AS
8428 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8429 characters.
8430
7d1c3a76
AS
8431 * xterm.c (XTread_socket): Only modify handling_signal if
8432 !SYNC_INPUT. (Bug#11080)
8433
e99a9b8b
EZ
84342012-03-23 Eli Zaretskii <eliz@gnu.org>
8435
8436 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8437 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8438 when fetching a multibyte character consumes more bytes than
8439 CHAR_BYTES returns, due to unification of CJK characters in
8440 string_char. (Bug#11073)
8441
5063c0e1
TN
84422012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8443
8444 * process.c (wait_reading_process_output): Handle pty disconnect
8445 by refraining from sending oneself a SIGCHLD (bug#10933).
8446
9f851fbd
CY
84472012-03-22 Chong Yidong <cyd@gnu.org>
8448
8449 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8450
5063c0e1 8451 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8452 Mark string as coming from a prefix property.
8453 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8454 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8455
fb5b8aca
CY
84562012-03-21 Chong Yidong <cyd@gnu.org>
8457
8458 * xfaces.c (Vface_remapping_alist): Doc fix.
8459
62356a1b
EZ
84602012-03-20 Eli Zaretskii <eliz@gnu.org>
8461
8462 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8463 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8464 Doc fixes.
62356a1b 8465
025de85b
CY
84662012-03-20 Chong Yidong <cyd@gnu.org>
8467
8468 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8469 to reflect default non-nil value of redisplay-dont-pause.
8470
4827f94e
KH
84712012-03-19 Kenichi Handa <handa@m17n.org>
8472
8473 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8474 it fit in a valid range (Bug#11003).
8475
e50a24a2
EZ
84762012-03-18 Eli Zaretskii <eliz@gnu.org>
8477
8478 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8479 that is not from display property, accept the row as a "cursor
8480 row" if one of the string's character has a non-nil `cursor'
8481 property. Fixes cursor positioning when there are newlines in
8482 overlay strings, e.g. in icomplete.el. (Bug#11035)
8483
9af5ed87
PE
84842012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8485
8486 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8487
d1f55f16
CY
84882012-03-12 Chong Yidong <cyd@gnu.org>
8489
8490 * eval.c (inhibit_lisp_code): Rename from
8491 inhibit_window_configuration_change_hook; move from window.c.
8492
8493 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8494 * window.c (run_window_configuration_change_hook)
8495 (syms_of_window): Callers changed.
8496
66c5eebd
CY
84972012-03-11 Chong Yidong <cyd@gnu.org>
8498
413df973
CY
8499 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8500
66c5eebd
CY
8501 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8502
1de11f56
CY
85032012-03-10 Chong Yidong <cyd@gnu.org>
8504
8505 * frame.c (other_visible_frames): Don't assume the selected frame
8506 is visible (Bug#10955).
8507
cae07000
SM
85082012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8509
8510 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8511
89c94350
JD
85122012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8513
8514 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8515 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8516 zero (Bug#10954).
8517
999dd333
GM
85182012-03-03 Glenn Morris <rgm@gnu.org>
8519
01a6dcc8 8520 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8521
de0100f2
EZ
85222012-03-02 Eli Zaretskii <eliz@gnu.org>
8523
8524 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8525 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8526 (redisplay_window, next_element_from_string): Fix typos in
8527 comments.
3e441275
EZ
8528 (redisplay_window): Pass to move_it_vertically the margin in
8529 pixels, not in screen lines.
de0100f2 8530
96a72ee9
GM
85312012-03-02 Glenn Morris <rgm@gnu.org>
8532
8533 * buffer.c (buffer-list-update-hook): Doc fix.
8534
312508d7
EZ
85352012-02-29 Eli Zaretskii <eliz@gnu.org>
8536
8537 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8538 push_it before setting up the iterator for the first overlay
8539 string, even if we have an empty string loaded.
8540 (next_overlay_string): If there's an empty string on the iterator
8541 stack, pop the stack. (Bug#10903)
8542
27f3c637
PE
85432012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8544
8545 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8546 Suggested by Stefan Monnier in
8547 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8548 * alloc.c (widen_to_Lisp_Object): New static function.
8549 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8550 and widening them to Lisp_Objects. This would work even if
8551 USE_LSB_TAG is defined and wide integers are used, which might
8552 happen in a future version of Emacs.
8553
3c9dfce6
CY
85542012-02-25 Chong Yidong <cyd@gnu.org>
8555
fa74b241
CY
8556 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8557 Doc fix.
8558
3c9dfce6
CY
8559 * xselect.c (Fx_selection_exists_p): Doc fix.
8560 (x_clipboard_manager_save_all): Print an informative message
8561 before saving to clipboard manager.
8562
9486df08
CY
85632012-02-24 Chong Yidong <cyd@gnu.org>
8564
8565 * keyboard.c (process_special_events): Handle all X selection
8566 requests in kbd_buffer, not just the next one (Bug#8869).
8567
f01d3321
CY
85682012-02-23 Chong Yidong <cyd@gnu.org>
8569
8570 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8571 call when setting menu-bar-lines and tool-bar-lines parameters.
8572 (unwind_create_frame_1): New helper function.
8573
8574 * window.c (inhibit_window_configuration_change_hook): New var.
8575 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8576 (syms_of_window): Initialize it.
f01d3321 8577
86b847b6
CY
85782012-02-22 Chong Yidong <cyd@gnu.org>
8579
8580 * xterm.c (x_draw_image_relief): Add missing type check for
8581 Vtool_bar_button_margin (Bug#10743).
8582
a59225b1
CY
85832012-02-21 Chong Yidong <cyd@gnu.org>
8584
8585 * fileio.c (Vfile_name_handler_alist): Doc fix.
8586
8587 * buffer.c (Fget_file_buffer): Protect against invalid file
8588 handler return value.
8589
310f5bd4
PE
85902012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8591
cb3a28cc
PE
8592 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8593 when computing $valmask.
8594
310f5bd4
PE
8595 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8596 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8597 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8598 It's useless in that case, and it can cause problems on hosts
8599 that allocate halves of EMACS_INT values separately.
8600 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8601 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8602 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8603 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8604 it avoids undefined behavior on hosts where shifting right by more
8605 than the word width has undefined behavior.
8606
2375c96a
CY
86072012-02-19 Chong Yidong <cyd@gnu.org>
8608
8609 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8610 (Funhandled_file_name_directory, Ffile_name_as_directory)
8611 (Fdirectory_file_name, Fexpand_file_name)
8612 (Fsubstitute_in_file_name): Protect against invalid file handler
8613 return values (Bug#10845).
8614
3eb49e71
EZ
86152012-02-18 Eli Zaretskii <eliz@gnu.org>
8616
8617 * .gdbinit (pitx): Fix incorrect references to fields of the
8618 iterator stack.
8619
7b926f3f
CY
86202012-02-17 Chong Yidong <cyd@gnu.org>
8621
8622 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8623
11273115
PE
86242012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8625
8626 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8627 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8628
c3a70e2b
CY
86292012-02-15 Chong Yidong <cyd@gnu.org>
8630
8631 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8632 marked as special. Also, starting docstrings with * is obsolete.
8633
0ca43699
AS
86342012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8635
8636 * gnutls.c (emacs_gnutls_write): Fix last change.
8637
2e8f3c56
LI
86382012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8639
8640 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8641 send_process.
8642
af70074f
SM
86432012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8644
8645 * keymap.c (Fsingle_key_description): Handle char ranges.
8646
95986d52
CY
86472012-02-12 Chong Yidong <cyd@gnu.org>
8648
afd83bd1
CY
8649 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8650 as that creates a dangerous corner case.
8651
95986d52
CY
8652 * window.c (Fdelete_window_internal): Invalidate the mouse
8653 highlight (Bug#9904).
8654
bd7da63e
GM
86552012-02-12 Glenn Morris <rgm@gnu.org>
8656
8657 * xselect.c (Fx_own_selection_internal)
8658 (Fx_get_selection_internal, Fx_disown_selection_internal)
8659 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8660 * nsselect.m (Fx_own_selection_internal)
8661 (Fx_disown_selection_internal, Fx_selection_exists_p)
8662 (Fx_selection_owner_p, Fx_get_selection_internal):
8663 Sync docs and argument specs with the xselect.c versions.
8664
77abcbc2
LI
86652012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8666
8667 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8668
90b671e2
EZ
86692012-02-11 Eli Zaretskii <eliz@gnu.org>
8670
1c0ca0b7
EZ
8671 * w32select.c (Fx_selection_exists_p): Sync doc string and
8672 argument list with xselect.c. (Bug#10783)
8673
8674 * w16select.c (Fx_selection_exists_p): Sync doc string and
8675 argument list with xselect.c. (Bug#10783)
90b671e2 8676
49241268
GM
86772012-02-10 Glenn Morris <rgm@gnu.org>
8678
8679 * fns.c (Fsecure_hash): Doc fix.
8680
f998bbe7 86812012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
8682
8683 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8684
0992bd9c
CY
86852012-02-07 Chong Yidong <cyd@gnu.org>
8686
8687 * buffer.c (Fbuffer_local_variables)
8688 (buffer_lisp_local_variables): Handle unbound vars correctly;
8689 don't let Qunbound leak into Lisp.
8690
af008560
GM
86912012-02-07 Glenn Morris <rgm@gnu.org>
8692
dd605cc4
GM
8693 * image.c (Fimagemagick_types): Doc fix.
8694
af008560
GM
8695 * image.c (imagemagick-render-type): Change it from a lisp object
8696 to an integer. Move the doc here from the lisp manual.
8697 Treat all values not equal to 0 the same.
8698
1449fa1d
CY
86992012-02-06 Chong Yidong <cyd@gnu.org>
8700
8701 * doc.c (store_function_docstring): Avoid applying docstring of
8702 alias to base function (Bug#2603).
8703
3723ec07
AS
87042012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8705
8706 * .gdbinit (pp1, pv1): Remove redundant defines.
8707 (pr): Use pp.
8708
79c1cc1e
CY
87092012-02-04 Chong Yidong <cyd@gnu.org>
8710
8711 * nsterm.m: Declare a global (Bug#10694).
8712
d7f29f8e
EZ
87132012-02-04 Eli Zaretskii <eliz@gnu.org>
8714
cae07000
SM
8715 * w32.c (get_emacs_configuration_options):
8716 Include --enable-checking, if specified, in the return value.
d7f29f8e 8717
3b95a6f9
MR
87182012-02-04 Martin Rudalics <rudalics@gmx.at>
8719
8720 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8721 after rounding frame sizes. (Bug#9723)
8722
d6fa96a6
EZ
87232012-02-04 Eli Zaretskii <eliz@gnu.org>
8724
8725 * keyboard.c (adjust_point_for_property): Don't position point
8726 before BEGV. (Bug#10696)
8727
df0b2940
PE
87282012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8729
8730 Handle overflow when computing char display width (Bug#9496).
8731 * character.c (char_width): Return EMACS_INT, not int.
8732 (char_width, c_string_width): Check for overflow when
8733 computing the width; this is possible now that individual
8734 characters can have unbounded width. Problem introduced
8735 by merge from Emacs 23 on 2012-01-19.
8736
6bee44d6
MA
87372012-02-02 Michael Albinus <michael.albinus@gmx.de>
8738
8739 * dbusbind.c (Fdbus_register_method): Mention the return value
8740 :ignore in the docstring.
8741
44f92739
GM
87422012-02-02 Glenn Morris <rgm@gnu.org>
8743
1b9f60cc
GM
8744 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8745
44f92739
GM
8746 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8747 Unconditionally set to t. (Bug#10673)
8748 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8749 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8750 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8751
c5d3843c
KH
87522012-02-02 Kenichi Handa <handa@m17n.org>
8753
8754 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8755 0, do not call append_composite_glyph.
8756
159462d4 87572012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
8758
8759 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8760 NULL (Bug#6988).
8761 (x_produce_glyphs): If the component of a composition is a null
8762 string, set it->pixel_width to 1 to avoid zero-width glyph.
8763
78cef877
EZ
87642012-02-01 Eli Zaretskii <eliz@gnu.org>
8765
8766 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8767 first 2 arguments are identical. This makes inserting large
8768 output from a subprocess an order of magnitude faster on
8769 MS-Windows, where all sbrk'ed memory is always contiguous.
8770
97897668
GM
87712012-01-31 Glenn Morris <rgm@gnu.org>
8772
8773 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 8774 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
8775 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8776
31fd3586
GM
87772012-01-29 Glenn Morris <rgm@gnu.org>
8778
8779 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8780
0e24a8b2
CY
87812012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8782
8783 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8784
cc0adcb0
CY
87852012-01-28 Chong Yidong <cyd@gnu.org>
8786
8787 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8788
acc28cb9
CY
87892012-01-26 Chong Yidong <cyd@gnu.org>
8790
9c69cfb7
CY
8791 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8792
acc28cb9
CY
8793 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8794 repeat counts (Bug#10507).
8795
48da7392
GM
87962012-01-26 Glenn Morris <rgm@gnu.org>
8797
8798 * lread.c (syms_of_lread): Doc fix.
8799
14af5f7f
CY
88002012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8801
8802 * coding.c (encode_designation_at_bol): Change return value to
8803 EMACS_INT.
8804
0b21c100
CY
88052012-01-25 Chong Yidong <cyd@gnu.org>
8806
8807 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8808
3c2907f7
CY
88092012-01-21 Chong Yidong <cyd@gnu.org>
8810
8811 * floatfns.c (Fcopysign): Make the second argument non-optional,
8812 since nil is not allowed anyway.
8813
959ad23f
AS
88142012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8815
8816 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8817 (send_process): Likewise.
8818
34a02f46
MR
88192012-01-19 Martin Rudalics <rudalics@gmx.at>
8820
8821 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
8822 (Vwindow_persistent_parameters): Do not use Qstate.
8823 Rewrite doc-strings.
34a02f46 8824
1259009a 88252012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
8826
8827 * character.c (char_width): New function.
70d4fdf6
GM
8828 (Fchar_width, c_string_width, lisp_string_width):
8829 Use char_width (Bug#9496).
25ed9e61 8830
6a6ee00d
MR
88312012-01-16 Martin Rudalics <rudalics@gmx.at>
8832
8833 * window.c (Vwindow_persistent_parameters): New variable.
8834 (Fset_window_configuration, save_window_save): Handle persistent
8835 window parameters.
8836
c85efaf7
EZ
88372012-01-14 Eli Zaretskii <eliz@gnu.org>
8838
8839 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8840 thrashing the stack of the thread. (Bug#9087)
8841
5944709e
PE
88422012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8843
8844 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8845
e71f5d99
EZ
88462012-01-11 Eli Zaretskii <eliz@gnu.org>
8847
8848 * xdisp.c (rows_from_pos_range): Handle the case where the
8849 highlight ends on a newline. (Bug#10464)
8850 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8851 he end column for display of highlight that ends on a newline
8852 before a R2L line.
8853
ce316182
GM
88542012-01-11 Glenn Morris <rgm@gnu.org>
8855
8856 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8857 from load-path also when installation-directory is nil. (Bug#10208)
8858
5b43da69
GM
88592012-01-10 Glenn Morris <rgm@gnu.org>
8860
74cc8ff9
GM
8861 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8862
7d8d6e4e
GM
8863 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8864 Update template values to be closer to their typical values these days.
5b43da69 8865
a0db8d43
EZ
88662012-01-09 Eli Zaretskii <eliz@gnu.org>
8867
8868 * xdisp.c (rows_from_pos_range): Accept additional argument
8869 DISP_STRING, and accept any glyph in a row whose object is that
8870 string as eligible for mouse highlight. Fixes mouse highlight of
8871 display strings from overlays. (Bug#10464)
8872
9a0115ab 88732012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 8874
b9110d6a 8875 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
8876 * fileio.c (auto_saving_dir_umask): New static var.
8877 (Fmake_directory_internal): Use it.
8878 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8879 creating the directory. The old code temporarily assigns
8880 too-generous permissions to the directory.
8881 (do_auto_save_eh): Clear it.
b9110d6a 8882 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
8883 that the var is always cleared.
8884
6c1bd3f3
EZ
88852012-01-07 Eli Zaretskii <eliz@gnu.org>
8886
8887 * search.c (scan_buffer): Pass character positions to
8888 know_region_cache, not byte positions. (Bug#6540)
8889
069d2b50
L
88902012-01-07 LynX <_LynX@bk.ru> (tiny change)
8891
8892 * w32.c (sys_rename): Report EXDEV when rename of a directory
8893 fails because the target is on another logical disk. (Bug#10284)
8894
75bf0d33
DB
88952012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8896
8897 * xterm.c (x_embed_request_focus): New function.
8898
8899 * xterm.h: Add prototype.
8900
8901 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8902
1c6e5a32
GM
89032012-01-05 Glenn Morris <rgm@gnu.org>
8904
8905 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8906
651e947e
EZ
89072012-01-01 Eli Zaretskii <eliz@gnu.org>
8908
8909 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8910 Load gnutls_transport_set_lowat only if GnuTLS version is below
8911 2.11.1.
8912 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8913 GnuTLS versions below 2.11.1.
8914
3778cdd8
AL
89152011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8916
8917 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8918 to the doc string advising against its use for altering the way
8919 windows are scrolled.
8920
0e5317f7
KH
89212011-12-28 Kenichi Handa <handa@m17n.org>
8922
8923 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8924 coding-system ASCII compatible only when it does not produce BOM
8925 on encoding (Bug#10383).
8926
93d5ca1f
JD
89272011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8928
8929 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8930 can scroll.
8931 (create_and_show_popup_menu): Always use menu_position_func for
8932 Gtk3 (Bug#10361).
8933
ca22b785
AS
89342011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8935
8936 * callint.c (Fcall_interactively): Don't truncate prompt string.
8937
d048e1e6
EZ
89382011-12-23 Eli Zaretskii <eliz@gnu.org>
8939
8940 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8941 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 8942 resumed from there (after widening). (Bug#10360)
d048e1e6 8943
5ccaba1f
JD
89442011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8945
8946 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8947
204ee57f
JD
89482011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8949
b81d40f0
JB
8950 * nsterm.m (x_free_frame_resources):
8951 Release f->output_data.ns->miniimage.
204ee57f
JD
8952 (ns_index_color): Fix indentation. Do not retain
8953 color_table->colors[i].
8954
8955 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8956 before returning.
8957
8958 * nsfns.m (x_set_background_color): Assign return value from
8959 ns_index_color to face-background instead of NSColor*.
8960 (ns_implicitly_set_icon_type): Fix indentation.
8961 Change assignment in for loop to comparison.
8962
8963 * emacs.c (ns_pool): New variable.
8964 (main): Assign ns_pool.
8965 (Fkill_emacs): Call ns_release_autorelease_pool.
8966
8967 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8968 autorelease fdesc, release fdAttrs and tdict.
8969 (ns_get_covering_families): Release charset.
8970 (ns_findfonts): Release NSFontDescriptor created with new.
8971 (ns_uni_to_glyphs): Fix indentation.
8972 (setString): Release attrStr before assigning new value.
8973
c803b2b7
JD
89742011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8975
678f4426
JD
8976 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8977 and NS_IMPL_COCOA.
8978 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8979 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8980
cd394be1 89812011-12-18 David Reitter <reitter@cmu.edu>
678f4426 8982
5fecd5fc
JD
8983 * nsterm.m (ns_term_init): Subscribe for notifications
8984 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8985 to method trackingNotification in EmacsMenu.
8986
8987 * nsmenu.m (trackingMenu): New variable.
3771cb17 8988 (trackingNotification): New method (from Aquamacs).
5fecd5fc 8989 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 8990 from Aquamacs (Bug#7030).
678f4426
JD
8991
89922011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 8993
c803b2b7
JD
8994 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8995 (symbol_to_nsstring): Fix indentation.
8996 (ns_symbol_to_pb): New function.
cae07000
SM
8997 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8998 (Fns_rotate_cut_buffers_internal): Remove.
8999 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9000 Fns_store_cut_buffer_internal.
9001 (ns_get_foreign_selection, Fx_own_selection_internal)
9002 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9003 (Fns_get_selection_internal, Fns_store_selection_internal):
9004 Use ns_symbol_to_pb and check if return value is nil.
9005 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9006 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9007 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9008 renamed to Sns_store_selection_internal.
9009 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9010 and remove this function.
9011 (ns_handle_selection_clear): Remove, never used.
9012 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9013 here.
9014
e1b01a3a
KB
90152011-12-17 Ken Brown <kbrown@cornell.edu>
9016
9017 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9018 GID is unknown (Bug#10257).
9019
2adb6e85
PE
90202011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9021
9022 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9023 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9024 which caused a build failure on GNU/Linux IA-64. This problem was
9025 introduced by my 2011-10-07 patch.
9026
d1d7b339
JL
90272011-12-15 Juri Linkov <juri@jurta.org>
9028
9029 * image.c (imagemagick_error): New function. (Bug#10112)
9030 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9031 Use `imagemagick_error' where ImageMagick functions return
9032 `MagickFalse'.
9033 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9034 proper order.
9035
100d5755
KH
90362011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9037
9038 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9039 fill background (Bug#8992).
9040
454592a6
MR
90412011-12-13 Martin Rudalics <rudalics@gmx.at>
9042
9043 * window.c (Vwindow_combination_resize)
9044 (Vwindow_combination_limit): Use t instead of non-nil in
9045 doc-strings.
61d4b438
MR
9046 (Vrecenter_redisplay): Add first sentence of doc-string on
9047 separate line.
53524d93 9048 (Frecenter): Fix doc-string typo.
454592a6 9049
3633e3aa
KH
90502011-12-11 Kenichi Handa <handa@m17n.org>
9051
9052 * coding.c (Funencodable_char_position): Pay attention to the
9053 buffer text relocation (Bug#9389).
9054
7b9d523a 90552011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9056
7b9d523a
JD
9057 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9058 gtk_init (Bug#10100).
9059
b73189c6
EZ
90602011-12-10 Eli Zaretskii <eliz@gnu.org>
9061
9062 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9063 IT->string is nil. (Bug#10263)
9064
f7dfe5d6
JD
90652011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9066
83faebb4
JD
9067 * nsterm.h (x_free_frame_resources): Declare.
9068
f7dfe5d6
JD
9069 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9070 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9071
9072 * nsterm.h (ns_get_defaults_value): Declare.
9073
9074 * nsterm.m (ns_default): Call ns_get_defaults_value.
9075
7cd4e72c
EZ
90762011-12-09 Eli Zaretskii <eliz@gnu.org>
9077
9078 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9079 (Bug#10170)
9080
b34d7317
YM
90812011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9082
9083 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9084 that where the value of an _OBJC_* symbol points to is in the .bss
9085 section (Bug#10240).
9086
76470ad1
KH
90872011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9088
9089 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9090 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9091
745fff94
KH
90922011-12-08 Kenichi Handa <handa@m17n.org>
9093
9094 * ftfont.c (get_adstyle_property): Fix previous change
9095 (Bug#10233).
9096
6e44397c
JB
90972011-12-07 Juanma Barranquero <lekktu@gmail.com>
9098
9099 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9100 dirs from the default value of EMACSLOADPATH (bug#10208).
9101
7efa6272
GM
91022011-12-07 Glenn Morris <rgm@gnu.org>
9103
9104 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9105 installation and source directories as well. (Bug#10208)
9106
f6fc4d87
CY
91072011-12-06 Chong Yidong <cyd@gnu.org>
9108
9109 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9110
2bf26180
GM
91112011-12-06 Glenn Morris <rgm@gnu.org>
9112
9113 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9114 as an error, not just -1. (Bug#10217)
9115
3a6ad4f0
CY
91162011-12-05 Chong Yidong <cyd@gnu.org>
9117
9118 * keyboard.c (process_special_events): New function.
9119 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9120
75a3b399
PE
91212011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 * coding.c (encode_designation_at_bol): Don't use uninitialized
9124 local variable (Bug#9318).
9125
c3c9e25e
KH
91262011-12-05 Kenichi Handa <handa@m17n.org>
9127
9128 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9129 return Qnil (Bug#8046, Bug#10193).
9130
5eb05ea3
KH
91312011-12-05 Kenichi Handa <handa@m17n.org>
9132
9133 * coding.c (encode_designation_at_bol): New args charbuf_end and
9134 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9135 (coding_set_source): Return how many bytes coding->source was
9136 relocated.
9137 (coding_set_destination): Return how many bytes
9138 coding->destination was relocated.
9139 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9140 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9141
91422011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9143
9144 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9145 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9146 macro (Bug#9318).
9147
91482011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9149
9150 The following changes are to fix Bug#9318.
9151
a79703f5 9152 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9153 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9154 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9155 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9156
7dbda6df
JB
91572011-12-05 Juanma Barranquero <lekktu@gmail.com>
9158
9159 * lisp.h (process_quit_flag): Fix external declaration.
9160
6d5eb5b0
SM
91612011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9162
9163 Don't macro-inline non-performance-critical code.
9164 * eval.c (process_quit_flag): New function.
9165 * lisp.h (QUIT): Use it.
9166
a0c3fad0
JD
91672011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9168
9169 * nsfns.m (get_geometry_from_preferences): New function.
9170 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9171
6c07aac2
AS
91722011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9173
9174 * emacs.c (Qkill_emacs): Define.
9175 (syms_of_emacs): Initialize it.
9176 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9177 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9178 (quit_throw_to_read_char): Add parameter `from_signal'.
9179 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9180 * lisp.h (QUIT): Call Fkill_emacs if requested.
9181
c052ead4
JD
91822011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9183
9184 * widget.c (update_wm_hints): Return if wmshell is null.
9185 (widget_update_wm_size_hints): New function.
9186
9187 * widget.h (widget_update_wm_size_hints): Declare.
9188
9189 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9190 widget_update_wm_size_hints (Bug#10104).
9191
9e49252b
EZ
91922011-12-03 Eli Zaretskii <eliz@gnu.org>
9193
9194 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9195 before a newline, prepare the bidi iterator for consuming the
9196 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9197 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9198
02b16839
JL
91992011-12-02 Juri Linkov <juri@jurta.org>
9200
9201 * search.c (Fword_search_regexp): New Lisp function created from
9202 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9203 (Fword_search_backward, Fword_search_forward)
9204 (Fword_search_backward_lax, Fword_search_forward_lax):
9205 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9206 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9207
0068070e
SM
92082011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9209
9210 * fileio.c (Finsert_file_contents): Move after-change-function call
9211 to before the "handled:" label, since all "goto handled" appear in
9212 cases where the *-change-functions have already been properly called
9213 (bug#10117).
9214
3360a3fc
AS
92152011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9216
9217 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9218 waiting for input. (Bug#10169)
9219
73d6c093
EZ
92202011-11-30 Eli Zaretskii <eliz@gnu.org>
9221
9222 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9223 verifies glyph row's hash code--we have just reallocated the
9224 glyphs, so their contents can be complete garbage. (Bug#10164)
9225
febe6bea
JB
92262011-11-30 Juanma Barranquero <lekktu@gmail.com>
9227
9228 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9229
801a4313
EZ
92302011-11-30 Eli Zaretskii <eliz@gnu.org>
9231
9232 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9233 attributes are tested _before_ calling verify_row_hash, to protect
9234 against GCC re-ordering of the tests. (Bug#10164)
9235
2b56b87e
JD
92362011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9237
9238 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9239
9240 * xterm.c (handle_one_xevent): Only set async_visible and friends
9241 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9242 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9243 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9244
dbf31225
PE
92452011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9246
9247 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9248 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9249 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9250 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9251 All uses changed to use GCPRO1 etc.
9252 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9253 Revert to old implementation (i.e., before 2011-03-11).
9254
1305621b
YM
92552011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9256
9257 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9258 of scroll runs so as to avoid assigning disabled bogus rows and
9259 unnecessary graphics copy operations.
9260
8c9afb46
EZ
92612011-11-27 Eli Zaretskii <eliz@gnu.org>
9262
9263 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9264 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9265 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9266 (malloc, free, realloc, calloc): Redirect to e_* only when
9267 compiling Emacs.
9268
9269 * lisp.h (GCTYPEBITS): Move before first use.
9270 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9271 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9272 this macro definition.
9273
9274 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9275 _MSC_VER.
9276
54e9e3bf
JD
92772011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9278
6d5eb5b0
SM
9279 * gtkutil.c (xg_create_frame_widgets):
9280 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9281 present with Gtk+ 2.0.
9282
83aca1cb
PE
92832011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9284
9285 * fileio.c (Finsert_file_contents): Undo previous change; see
9286 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9287
5b76caa4
PE
92882011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9289
9290 Rename locals to avoid shadowing.
9291 * fileio.c (Finsert_file_contents):
9292 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9293 * process.c (wait_reading_process_output):
9294 Rename inner 'proc' to 'p' to avoid shadowing.
9295 Indent for consistency with usual Emacs style.
9296
8c535114
EZ
92972011-11-25 Eli Zaretskii <eliz@gnu.org>
9298
9299 * xdisp.c (redisplay_window): If cursor row is not fully visible
9300 after recentering, and scroll-conservatively is set to a large
9301 number, scroll window by a few more lines to make the cursor fully
9302 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9303 (start_display): Don't move to the next line if the display should
9304 start at a newline that is part of a display vector or an overlay
9305 string. (Bug#10119)
8c535114 9306
fa4fdb5c
JL
93072011-11-24 Juri Linkov <juri@jurta.org>
9308
9309 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9310 after the `MagickPingImage' call. (Bug#10112)
9311
90ec88df
CY
93122011-11-23 Chong Yidong <cyd@gnu.org>
9313
9314 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9315
56e2e794
MR
93162011-11-23 Martin Rudalics <rudalics@gmx.at>
9317
9318 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9319 making another buffer current. (Bug#10114)
9320
b6e64c41
GM
93212011-11-23 Glenn Morris <rgm@gnu.org>
9322
9323 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9324
6b21de18
CY
93252011-11-23 Chong Yidong <cyd@gnu.org>
9326
9327 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9328 using it (Bug#5984).
9329
b12cd789
EZ
93302011-11-22 Eli Zaretskii <eliz@gnu.org>
9331
9332 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9333 and header-lines, as they don't have one computed for them.
9334 (Bug#10098)
9335
9336 * .gdbinit (prow): Make displayed values more self-explaining.
9337 Add row's hash code.
9338
261b6fd4
LMI
93392011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9340
9341 * process.c (wait_reading_process_output): Fix asynchrounous
9342 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9343 (wait_reading_process_output): Add comment and URL.
261b6fd4 9344
e7cfd277
JD
93452011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9346
9347 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9348
a9b9b7f5
CY
93492011-11-21 Chong Yidong <cyd@gnu.org>
9350
9351 * window.c (Fnext_window, Fprevious_window): Doc fix.
9352
b0d15b4f
SM
93532011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9354
9355 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9356
fe7a3057
JB
93572011-11-20 Juanma Barranquero <lekktu@gmail.com>
9358
9359 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9360
d2999b1a
MR
93612011-11-20 Martin Rudalics <rudalics@gmx.at>
9362
9363 * window.c (Fset_window_combination_limit): Rename argument
9364 STATUS to LIMIT.
9365 (Vwindow_combination_limit): Remove "status" from doc-string.
9366
d5ff9cd0
AS
93672011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9368
9369 * m/ibms390.h: Remove.
9370 * m/ibms390x.h: Don't include "ibms390.h".
9371
a5bb9bd3
SM
93722011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9373
9374 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9375 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9376
cd1181db
JB
93772011-11-20 Juanma Barranquero <lekktu@gmail.com>
9378
9379 * casetab.c (Fset_case_table):
9380 * charset.c (Fcharset_after): Fix typos.
9381
615a3b8d 93822011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9383
17e845af
PE
9384 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9385 Otherwise, valgrind does not work on some platforms.
9386 Problem reported by Andreas Schwab in
6a0bf43d
PE
9387 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9388 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9389 is set, removing the need for VIRT_ADDRESS_VARIES.
9390 (PURE_P): Use a more-efficient implementation that needs just one
9391 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9392 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9393 to 4 (xorl, subq, cmpq, setbe).
9394 * alloc.c (pure): Always extern now, since that's the
9395 VIRT_ADDR_VARIES behavior.
9396 (PURE_POINTER_P): Use a single comparison, not two, for
9397 consistency with the new puresize.h.
9398 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9399 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9400 Remove VIRT_ADDR_VARIES no longer needed.
9401
f8fe6f96
EZ
94022011-11-19 Eli Zaretskii <eliz@gnu.org>
9403
9404 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9405 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9406 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9407 behave as if the cursor position were at the window margin.
9408
9409 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9410 and the cursor position is out of bounds, behave as if the cursor
9411 position were at the window margin. (Bug#10075)
9412
df05a53c
CY
94132011-11-18 Chong Yidong <cyd@gnu.org>
9414
9415 * window.c (Fwindow_combination_limit): Make first argument
9416 non-optional, since it is meaningless for live windows like the
9417 selected window.
61ccba97 9418
2071918e
DA
94192011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9420
9421 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9422
b50a28de
SM
94232011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9424
9425 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9426 (graft_intervals_into_buffer): Simplify.
9427
015137db
EZ
94282011-11-18 Eli Zaretskii <eliz@gnu.org>
9429
9430 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9431 hash values of the two rows.
9432 (copy_row_except_pointers): Preserve the used[] arrays and the
9433 hash values of the two rows. (Bug#10035)
68c95424 9434 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9435
9436 * xdisp.c (row_hash): New function, body extracted from
9437 compute_line_metrics.
9438 (compute_line_metrics): Call row_hash, instead of computing the
9439 hash code inline.
9440
9441 * dispnew.c (verify_row_hash): Call row_hash for computing the
9442 hash code of a row, instead of duplicating code from xdisp.c.
9443
9444 * dispextern.h (row_hash): Add prototype.
9445
a2addb04
TH
94462011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9447
9448 * frame.c (delete_frame): Don't delete the terminal when the last
9449 X frame is closed if emacs is built with GTK toolkit.
9450
df85d315
JB
94512011-11-17 Juanma Barranquero <lekktu@gmail.com>
9452
9453 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9454
a0c2d0ae
MR
94552011-11-17 Martin Rudalics <rudalics@gmx.at>
9456
9457 * window.c (Vwindow_splits): Rename to
9458 Vwindow_combination_resize. Suggested by Juri Linkov.
9459 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9460 of Vwindow_splits.
9461
58179cce
JB
94622011-11-16 Juanma Barranquero <lekktu@gmail.com>
9463
7877f373
JB
9464 * nsfns.m (Fns_font_name):
9465 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9466
b6f67890
MR
94672011-11-16 Martin Rudalics <rudalics@gmx.at>
9468
9469 * window.h (window): Rename slot "nest" to "combination_limit".
9470 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9471 (Fset_window_nest): Rename to Fset_window_combination_limit.
9472 (Vwindow_nest): Rename to Vwindow_combination_limit.
9473 (recombine_windows, make_parent_window, make_window)
9474 (Fsplit_window_internal, saved_window)
9475 (Fset_window_configuration, save_window_save): Rename all
9476 occurrences of window_nest to window_combination_limit.
9477
c7015153
JB
94782011-11-15 Juanma Barranquero <lekktu@gmail.com>
9479
9480 * image.c (imagemagick_load_image): Fix typo.
9481
322ad6ec
EZ
94822011-11-14 Eli Zaretskii <eliz@gnu.org>
9483
9484 * xdisp.c (display_line): Move the call to
9485 highlight_trailing_whitespace before the call to
9486 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9487 faces of all the glyphs to compute ROW's hash value.
9488 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9489
f067b8ec
JB
94902011-11-14 Juanma Barranquero <lekktu@gmail.com>
9491
9492 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9493 just return (bug#10044).
9494
1e5b2111
EZ
94952011-11-12 Eli Zaretskii <eliz@gnu.org>
9496
7ef3cbd5
EZ
9497 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9498 with user-defined heap size. Bump the default size of the temacs
9499 heap to 27MB, to avoid memory warning when running temacs.
9500 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9501
1e5b2111
EZ
9502 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9503 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9504 (verify_row_hash) [XASSERTS]: New function.
9505 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9506 that the hash value of glyph rows is correct.
1e5b2111 9507
89d61221
MR
95082011-11-12 Martin Rudalics <rudalics@gmx.at>
9509
9510 * window.h (window): Remove splits slot.
9511 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9512 (Fdelete_other_windows_internal, make_parent_window)
9513 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9514 (Fset_window_configuration, save_window_save): Don't deal with
9515 split status of windows.
9516 (saved_window): Remove splits slot.
9517 (Vwindow_splits): Rewrite doc-string.
9518
97f18cc8
JD
95192011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9520
9521 * xfns.c (unwind_create_frame):
9522 * nsfns.m (unwind_create_frame):
9523 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9524 Vframe_list (Bug#9999).
9525
22a648b4
DA
95262011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9527
0b381c7e 9528 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9529
659afede
KH
95302011-11-11 Kenichi Handa <handa@m17n.org>
9531
9532 * callproc.c (Fcall_process): Set the member dst_multibyte of
9533 process_coding.
9534
9ac0394b
KH
95352011-11-11 Johan Bockgård <bojohan@gnu.org>
9536
9537 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9538 avoid a crash (bug#9496).
9539
2fbdc249
CY
95402011-11-09 Chong Yidong <cyd@gnu.org>
9541
9542 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9543 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9544
ac6b1f81
PE
95452011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9546
9547 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9548
09db192c
PE
95492011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9550
9551 Avoid some portability problems by eschewing 'extern inline' functions.
9552 The trivial performance wins aren't worth the portability hassles; see
9553 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9554 et seq.
9555 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9556 (window_box_width, window_box_left, window_box_left_offset)
9557 (window_box_right, window_box_right_offset): Undo previous change,
9558 by removing the "extern"s.
9559 * intervals.c (adjust_intervals_for_insertion)
9560 (adjust_intervals_for_deletion): Undo previous change,
9561 making these static again.
9562 (offset_intervals, temp_set_point_both, temp_set_point)
9563 (copy_intervals_to_string): No longer inline.
9564 * xdisp.c (window_text_bottom_y, window_box_width)
9565 (window_box_height, window_box_left_offset)
9566 (window_box_right_offset, window_box_left, window_box_right)
9567 (window_box): No longer inline.
9568
105216ed
CY
95692011-11-08 Chong Yidong <cyd@gnu.org>
9570
9571 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9572 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9573 Signal an error if not a live window.
105216ed
CY
9574 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9575 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9576
ae9e237f
JB
95772011-11-07 Juanma Barranquero <lekktu@gmail.com>
9578
9579 * lisp.h (syms_of_abbrev): Remove declaration.
9580 Reported by CHENG Gao <chenggao@royau.me>.
9581
c7aa8333
EZ
95822011-11-07 Eli Zaretskii <eliz@gnu.org>
9583
9584 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9585 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9586 of temacs in GUI mode.
9587
be7f5545
MR
95882011-11-07 Martin Rudalics <rudalics@gmx.at>
9589
9590 * window.h: Declare delete_all_child_windows instead of
9591 delete_all_subwindows.
9592 * window.c (Fwindow_nest, Fset_window_nest)
9593 (Fset_window_new_total, Fset_window_new_normal)
9594 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9595 (delete_all_subwindows): Rename to delete_all_child_windows.
9596 (Fdelete_other_windows_internal, Fset_window_configuration):
9597 Call delete_all_child_windows instead of delete_all_subwindows.
9598 * frame.c (delete_frame): Call delete_all_child_windows instead
9599 of delete_all_subwindows.
9600
ca78dc43
PE
96012011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9602
9603 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9604 This is also needed for porting to any host where GC_MARK_STACK is
9605 not GC_MAKE_GCPROS_NOOPS.
9606 (which_symbols): Use it.
9607
a0241d01
KH
96082011-11-07 Kenichi Handa <handa@m17n.org>
9609
9610 * coding.c (coding_set_destination): Check coding->src_pos only
9611 when coding->src_object is a buffer (bug#9910).
9612
9613 * process.c (send_process): Set the member src_multibyte of coding
9614 to 0 (bug#9911) when sending a unibyte text.
9615
9616 * callproc.c (Fcall_process): Set the member src_multibyte of
9617 process_coding to 0 (bug#9912).
9618
a64bfdfa 96192011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
9620
9621 * xmenu.c (cleanup_widget_value_tree): New function.
9622 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9623 calling free_menubar_widget_value_tree directly (Bug#9830).
9624
cb41b32a
PE
96252011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9626
9627 Fix some portability problems with 'inline'.
9628 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9629 (window_box_width, window_box_left, window_box_left_offset)
9630 (window_box_right, window_box_right_offset): Declare extern.
9631 Otherwise, these inline functions do not conform to C99 and
9632 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9633 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9634 * intervals.c (adjust_intervals_for_insertion)
9635 (adjust_intervals_for_deletion): Now extern, because otherwise the
9636 extern inline functions 'offset_intervals' couldn't refer to it.
9637 (static_offset_intervals): Remove.
9638 (offset_intervals): Rewrite using the old contents of
9639 static_offset_intervals. The old version didn't conform to C99
9640 because an extern inline function contained a reference to an
9641 identifier with static linkage.
9642
b7041366
AS
96432011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9644
9645 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9646 GC.
9647
88a37c4d
EZ
96482011-11-06 Eli Zaretskii <eliz@gnu.org>
9649
9650 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9651 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9652 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9653 return Qleft_to_right.
9654
49745b39
CY
96552011-11-06 Chong Yidong <cyd@gnu.org>
9656
9657 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9658 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9659 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9660 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9661 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9662 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9663 (Fwindow_vscroll): Doc fix.
9664 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9665 argument, since it makes no sense to pass a live window and for
9666 consistency with window-child.
9667
1f05cd82
CS
96682011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9669
9670 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9671 support MSVC.
9672
22610910
JR
96732011-11-05 Jason Rumney <jasonr@gnu.org>
9674
9675 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9676 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9677 fonts (Bug#6029).
9678 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9679 bitwise arithmetic preventing use of unicode-sip and non-truetype
9680 opentype fonts.
9681
a06776b2
EZ
96822011-11-05 Eli Zaretskii <eliz@gnu.org>
9683
3ad924ba
EZ
9684 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9685 "emacs"-only part.
9686
a06776b2
EZ
9687 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9688 initialization code to keep similarity to xfns.c after changes
9689 from 2011-11-05.
9690
c9e7db78
JD
96912011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9692
a97f8f3f
JD
9693 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9694 (unwind_create_frame): New function (Bug#9943).
9695 (Fx_create_frame): Restructure code to be more similar to the one in
9696 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9697 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9698 Move terminal->reference_count++ just before making the frame official
9699 (Bug#9943).
9700
9701 * nsterm.m (x_free_frame_resources): New function.
9702 (x_destroy_window): Move code to x_free_frame_resources.
9703
c9e7db78 9704 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
9705 (Fx_create_frame, x_create_tip_frame):
9706 Move terminal->reference_count++ just before making the frame
75f1671a 9707 official. Move initialization of image_cache_refcount and
c9e7db78
JD
9708 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9709
a6fc3b5c
EZ
97102011-11-05 Eli Zaretskii <eliz@gnu.org>
9711
9712 Support MSVC build with newer versions of Visual Studio.
9713 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9714 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9715 nt/gmake.defs.
9716
9717 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9718 which are not supported by MSVC.
9719 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9720 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9721 bitfields.
9722 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9723 types in bitfields.
9724 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9725
9726 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9727
58179cce 97282011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
9729
9730 Support MSVC build with newer versions of Visual Studio.
9731 * w32.c: Don't include w32api.h for MSVC.
9732 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9733
9734 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9735 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9736 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9737 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9738 e_* cousins.
9739 (alloca) [_MSC_VER]: Define to _alloca.
9740
9741 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9742
9743 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9744
a58c13ed
EZ
97452011-11-04 Eli Zaretskii <eliz@gnu.org>
9746
9747 * xdisp.c (note_mouse_highlight): If either of
9748 previous/next-single-property-change returns nil, treat that as
9749 the beginning or the end of the buffer. (Bug#9955)
9750
fe0b6370
JD
97512011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9752
a58c13ed 9753 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
9754 label is not null (Bug#9951).
9755 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9756 may be NULL.
9757
89bd5ee1
EZ
97582011-11-04 Eli Zaretskii <eliz@gnu.org>
9759
9760 * window.c (Fwindow_body_size): Mention in the doc string that the
9761 return value is in frame's canonical units. (Bug#9949)
9762
84c3edb9
EZ
97632011-11-03 Eli Zaretskii <eliz@gnu.org>
9764
4e2fb5c7
EZ
9765 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9766
84c3edb9 9767 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 9768 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 9769 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 9770
bc17a887
EZ
97712011-11-01 Eli Zaretskii <eliz@gnu.org>
9772
9773 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9774 Don't stop backward scan on the continuation glyph, even though
9775 its CHARPOS is positive.
6d5eb5b0
SM
9776 (mouse_face_from_buffer_pos, note_mouse_highlight):
9777 Rename cover_string to disp_string.
bc17a887 9778
4ee88440
MR
97792011-11-01 Martin Rudalics <rudalics@gmx.at>
9780
9781 * window.c (temp_output_buffer_show): Don't use
9782 Vtemp_buffer_show_specifiers.
9783 (Vtemp_buffer_show_specifiers): Remove unused variable.
9784
c2ff3c02
EZ
97852011-10-30 Eli Zaretskii <eliz@gnu.org>
9786
9787 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9788 past the beginning of the current glyph matrix.
9789
58179cce 97902011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
9791
9792 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9793 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9794 HAVE_GTK3 (Bug#9869).
b77a6a7f 9795
3b574623
JD
9796 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9797 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9798
b77a6a7f
JD
9799 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9800
9801 * xterm.c: Declare x_handle_net_wm_state to return int.
9802 (handle_one_xevent): Check if we are iconified but don't have
9803 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9804 (get_current_wm_state): Return non-zero if not hidden,
9805 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9806 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9807 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9808 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9809
196e41e4
PE
98102011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9811
9812 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9813 so that this new function doesn't get optimized away by a
9814 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9815
021f2e1a
AS
98162011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9817
9818 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9819
8b058d44
EZ
98202011-10-29 Eli Zaretskii <eliz@gnu.org>
9821
9822 Fix the `xbytecode' command.
9823 * .gdbinit (xprintbytestr): New command.
b50a28de 9824 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
9825 (xbytecode): Print the byte-code string as well.
9826
4452fb80
EZ
98272011-10-29 Kim Storm <storm@cua.dk>
9828
8b058d44
EZ
9829 * alloc.c (which_symbols): New function.
9830
21b72067
AS
98312011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9832
9833 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9834 line. (Bug#9903)
9835
83ed7b5c
GM
98362011-10-29 Glenn Morris <rgm@gnu.org>
9837
9838 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9839 Not clear what it was for, and it causes various bugs. (Bug#9839)
9840
5a7a728b
EZ
98412011-10-28 Eli Zaretskii <eliz@gnu.org>
9842
9843 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9844 possible random value that matches one of those tested as
9845 condition to clear the mouse face.
9846
d3d0842f
CY
98472011-10-28 Chong Yidong <cyd@gnu.org>
9848
9849 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9850
31b39d13
DN
98512011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9852
9853 * window.c (make_window): Initialize phys_cursor_on_p.
9854
9aba6043
SM
98552011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9856
9857 * lisp.h (struct Lisp_Symbol): Update comments.
9858
c20992f4
JB
98592011-10-28 Juanma Barranquero <lekktu@gmail.com>
9860
9861 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9862
db4f02f2
EZ
98632011-10-28 Eli Zaretskii <eliz@gnu.org>
9864
9865 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9866 <oslsachem@gmail.com> for helping to debug this.
9867
9868 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9869 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9870 (g_b_init_get_glyph_outline_w): New static variables.
9871 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9872 (GetGlyphOutlineW_Proc): New typedefs.
9873 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
9874 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9875 New functions.
9876 (w32font_open_internal, compute_metrics):
9877 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
9878 instead of calling the "wide" APIs directly.
9879
9880 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9881
9882 * w32.h (syms_of_w32font): Add prototype.
9883
87e68db4
JB
98842011-10-27 Juanma Barranquero <lekktu@gmail.com>
9885
9886 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9887 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9888 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9889 (Fmove_to_window_line): Doc fix.
9890
435c1d67
CY
98912011-10-27 Chong Yidong <cyd@gnu.org>
9892
9893 * process.c (make_process): Set gnutls_state to NULL.
9894
9895 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9896 non-NULL, regardless of GNUTLS_INITSTAGE.
9897 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9898 an error. Set process slots as soon as we allocate them.
9899
9900 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9901
9c6c6f49
CY
99022011-10-27 Chong Yidong <cyd@gnu.org>
9903
9aba6043
SM
9904 * gnutls.c (emacs_gnutls_deinit): New function.
9905 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
9906 (Fgnutls_deinit, Fgnutls_boot): Use it.
9907
9908 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9909 (deactivate_process): Call emacs_gnutls_deinit.
9910
657d08d3
JB
99112011-10-27 Juanma Barranquero <lekktu@gmail.com>
9912
9913 * image.c (x_create_x_image_and_pixmap):
9914 * w32.c (sys_rename, w32_delayed_load):
9915 * w32font.c (fill_in_logfont):
9916 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9917
5430d399
JB
99182011-10-26 Juanma Barranquero <lekktu@gmail.com>
9919
9920 * w32fns.c (w32_default_color_map): New function,
9921 extracted from Fw32_default_color_map.
a7ef684b 9922 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 9923
fe0055fa
PE
99242011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9925
9926 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9927
e6346438
SM
99282011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9929
9930 * keyboard.c (test_undefined): New function (bug#9751).
9931 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9932
e112cc37
ET
99332011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9934
9935 * sysdep.c (init_sys_modes): Fix the check for the controlling
9936 terminal (Bug#6649).
9937
7b5d6677
EZ
99382011-10-20 Eli Zaretskii <eliz@gnu.org>
9939
9940 * dispextern.h (struct bidi_it): New member next_en_type.
9941
9942 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9943 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9944 current character, check also for next_en_type being WEAK_EN.
9945 (bidi_resolve_weak): Don't enter the expensive loop if the current
9946 position is before next_en_pos. Record the bidi type of the first
9947 non-ET, non-BN character we find, in addition to its position.
9948 (bidi_level_of_next_char): Invalidate next_en_type when
9949 next_en_pos is over-stepped.
9950
7da0b018
PE
99512011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9952
9953 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9954 * editfns.c: Rewrite current-time-zone so that it invokes
9955 the equivalent of (format-time-string "%Z") to get the time zone name.
9956 This fixes a bug when the time zone name contains characters that
9957 need converting from the system time locale to Emacs internal format.
9958 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9959 that patch fixed format-time-string to do the conversion, but
9960 I forgot to fix current-time-zone.
9961 (format_time_string): New function, containing most of
9962 what Fformat_time_string used to contain.
9963 (Fformat_time_string): Rewrite in terms of format_time_string.
9964 This doesn't change this function's behavior.
9965 (current-time-zone): Rewrite to use format_time_string.
9966 This fixes the bug reported by Michael Schierl in
9967 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9968 Jason Rumney's 2007-06-07 change worked around this bug, but
9969 didn't fix it.
9970 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9971
8547b010
EZ
99722011-10-19 Eli Zaretskii <eliz@gnu.org>
9973
9974 * xdisp.c (start_display): If the character at POS is displayed
9975 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
9976 (try_window_reusing_current_matrix): If a line ends in a display
9977 vector or the next line starts in a display vector, continue
9978 redrawing the window even though the character position of
9979 start_row was reached.
8547b010
EZ
9980 (Bug#9771, part 2)
9981
4e948d15
CY
99822011-10-18 Chong Yidong <cyd@gnu.org>
9983
9984 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9985 with nobreak-char-display too.
9986
4787455f
EZ
99872011-10-18 Eli Zaretskii <eliz@gnu.org>
9988
9989 Fix part 3 of bug#9771.
9990 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9991 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9992 non-neutral characters if the current character is a paragraph
9993 separator (a.k.a. Newline). This avoids running the same
9994 expensive loop twice, once when we consume the preceding newline
9995 and the other time when the line actually needs to be displayed.
9996 Avoid the loop when we see neutrals on the base embedding level
9997 following a character whose directionality is the same as the
9998 paragraph's. This avoids running the expensive loop when a line
9999 ends in a long sequence of neutrals, like control characters.
10000 Add assertion against STRONG_AL type. Slightly rearrange code
10001 that determines the type of a neutral given the first non-neutral
10002 that follows it.
10003 (bidi_level_of_next_char): Set next_en_pos to zero when
10004 invalidating its info.
10005
2c91f553
EZ
100062011-10-17 Eli Zaretskii <eliz@gnu.org>
10007
10008 * xdisp.c (push_display_prop): Determine whether to record string
10009 or buffer position by IT->string, not by IT->method. Allow
10010 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10011 (move_it_vertically_backward): Don't look for character position
10012 immediately after the newline when in a continuation line.
10013 (Bug#9771, part 1)
2c91f553 10014
c7b08b0d
MR
100152011-10-15 Martin Rudalics <rudalics@gmx.at>
10016
10017 * window.c (coordinates_in_window): Rewrite and delabelize
10018 vertical border check. (Bug#5357) (Bug#9618)
10019
6b02f655
SM
100202011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10021
10022 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10023 errors in XSetWindowBorder (bug#9310).
10024
81d40c92
DA
100252011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10026
10027 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10028 avoid crash when xmalloc overrun checking is enabled.
10029
d4172c3b
EZ
100302011-10-13 Eli Zaretskii <eliz@gnu.org>
10031
10032 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10033 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10034 cursor motion with <left> and <right> arrow keys.
10035
10036 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10037 some callers set that themselves.
10038
b00eea75
EZ
100392011-10-12 Eli Zaretskii <eliz@gnu.org>
10040
10041 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10042 display string and the previous row comes from the same string and
10043 is empty. (Bug#9739) (Bug#9738)
10044
8fe012c4
SM
100452011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10046
10047 * doc.c (get_doc_string): Encode file name (bug#9735).
10048
0074aef2
EZ
100492011-10-12 Eli Zaretskii <eliz@gnu.org>
10050
79beb178
EZ
10051 * bidi.c (bidi_level_of_next_char):
10052 * xdisp.c (get_visually_first_element): Remove old incorrect
10053 comments regarding the Unicode Line Separator character.
10054
0074aef2
EZ
10055 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10056
6e4b3fbe
DA
100572011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10058
10059 * alloc.c (Fgc_status): Do not access beyond zombies array
10060 boundary if nzombies > MAX_ZOMBIES.
10061 * alloc.c (dump_zombies): Add missing format specifier.
10062
0324f3af
PE
100632011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10064
b5525cac
PE
10065 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10066 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10067
0324f3af
PE
10068 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10069 Some packages use them to denote characters with modifiers.
10070
e9b5f888
AS
100712011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10072
10073 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10074 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10075 matching a pp-number. Rename parameter var to var1.
10076
127827c0
SM
100772011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10078
10079 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10080
c8fd3bd0
GM
100812011-10-08 Glenn Morris <rgm@gnu.org>
10082
10083 * callint.c (Fcall_interactively): Give a more explicit error for the
10084 'c' case with a non-character input. (Bug#8479)
10085
352ec8ff
EZ
100862011-10-08 Eli Zaretskii <eliz@gnu.org>
10087
03669ccb
EZ
10088 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10089 lines.
7061c986
EZ
10090 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10091 lines that are hscrolled on the left.
03669ccb 10092
352ec8ff
EZ
10093 * dispnew.c (buffer_posn_from_coords): Account for a possible
10094 presence of header-line. (Bug#4426)
10095
a66cfb1c
SM
100962011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10097
6b02f655
SM
10098 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10099 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10100
7c5ee88e
PE
101012011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10102
10103 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10104 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10105 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10106 this makes Emacs dump core during garbage collection on rare
10107 occasions. sizeof is obviously inferior to offsetof here, so
10108 stick with offsetof.
10109 (GC_POINTER_ALIGNMENT): New macro.
10110 (mark_memory): Omit 3rd (offset) arg; caller changed.
10111 Don't assume EMACS_INT alignment is the same as pointer alignment.
10112
df1bbe5b
SM
101132011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10114
10115 * keyboard.c (read_key_sequence_remapped): New var.
10116 (read_key_sequence): Compute remapping in the right buffer.
10117 (command_loop_1): Use read_key_sequence's remapping directly.
10118
51553db6
SM
101192011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10120
32c1fffd
SM
10121 * dired.c (file_name_completion): Don't expand file name.
10122 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10123 before checking file name handler.
10124
51553db6
SM
10125 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10126 they've been requested explicitly (bug#9591).
10127
b6bd1599 101282011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10129
10130 * keymap.c (Fsingle_key_description): Use make_specified_string
10131 instead of build_string to build string from push_key_description.
10132 (Bug#5193)
10133
f701dc2a
PE
101342011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10135
4222c55d
PE
10136 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10137 This fixes a Y2038 bug on 64-bit hosts.
10138 * buffer.c (reset_buffer):
10139 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10140 (Fclear_buffer_auto_save_failure):
10141 Use 0, not -1, to represent an unset failure time, since time_t
10142 might not be signed.
10143
f701dc2a
PE
10144 Remove dependency on glibc malloc internals.
10145 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10146 Move back here from lisp.h, but with their new implementations.
10147 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10148 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10149 * charset.c (charset_table_init): New static var.
10150 (syms_of_charset): Use it instead of xmalloc. This removes a
10151 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10152 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10153 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10154 Move back to alloc.c.
10155 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10156 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10157
9ceebf39
JD
101582011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10159
10160 * nsterm.m (windowDidResize): Call x_set_window_size only when
10161 ns_in_resize is true. Otherwise set pixelwidth/height and
10162 call change_frame_size (Bug#9628).
10163
cb993c58
PE
101642011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10165
3930c88b
PE
10166 Port --enable-checking=all to Fedora 14 x86-64.
10167 * charset.c (syms_of_charset): Also account for glibc malloc's
10168 internal overhead when calculating the initial malloc maximum.
10169
cb993c58
PE
10170 Port --enable-checking=all to Fedora 14 x86.
10171 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10172 Move to lisp.h.
10173 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10174 (overrun_check_realloc, overrun_check_free):
10175 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10176 That way, xmalloc returns a properly-aligned pointer even if
10177 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10178 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10179 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10180 into account when calculating the initial malloc maximum.
10181 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10182 Move here from alloc.c, so that charset.c can use it too.
10183 Properly align; the old code wasn't right for common 32-bit hosts
10184 when configured with --enable-checking=all.
10185 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10186 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10187
31bed486
EZ
101882011-09-29 Eli Zaretskii <eliz@gnu.org>
10189
04c70788 10190 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10191 use EDOM.
10192
fbcaa2f3
EZ
101932011-09-28 Eli Zaretskii <eliz@gnu.org>
10194
10195 * xdisp.c (compute_display_string_end): If there's no display
10196 string at CHARPOS, return -1.
10197
10198 * bidi.c (bidi_fetch_char): When compute_display_string_end
10199 returns a negative value, treat the character as a normal
10200 character not covered by a display string. (Bug#9624)
10201
a239d4e9
JB
102022011-09-28 Juanma Barranquero <lekktu@gmail.com>
10203
10204 * lread.c (Fread_from_string): Fix typo in docstring.
10205
88652fd5
EZ
102062011-09-27 Eli Zaretskii <eliz@gnu.org>
10207
10208 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10209 newline, reseat the iterator instead of bidi-iterating there one
10210 character at a time. (Bug#9610)
32c1fffd
SM
10211 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10212 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10213
ed497dd4
AS
102142011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10215
10216 * lread.c (readevalloop): Use correct code for NBSP.
10217 (read1): Likewise. (Bug#9608)
10218
b2bf61aa
MA
102192011-09-25 Michael Albinus <michael.albinus@gmx.de>
10220
10221 * dbusbind.c (Fdbus_register_signal): When service is not
10222 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10223
32bbb17c
GM
102242011-09-25 Glenn Morris <rgm@gnu.org>
10225
10226 * buffer.c (truncate-lines): Doc fix.
10227
94e0933e
CY
102282011-09-24 Chong Yidong <cyd@stupidchicken.com>
10229
10230 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10231 (Fset_window_next_buffers): Doc fix.
10232
cddde921
GM
102332011-09-24 Glenn Morris <rgm@gnu.org>
10234
10235 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10236
1260aef1
PE
102372011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10238
25b4bfa0
PE
10239 Fix minor problems found by static checking.
10240 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10241 * indent.c (Fvertical_motion): Fix == vs = typo.
10242
e3cbd34b
EZ
102432011-09-24 Eli Zaretskii <eliz@gnu.org>
10244
a66cfb1c
SM
10245 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10246 Default value is now t. Doc fix.
6bf7006f 10247
e3cbd34b 10248 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10249 logic when moving up, not only when moving down. Fix the
e3cbd34b 10250 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10251 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10252
10253 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10254 CHARPOS is covered by a display string which includes newlines.
10255 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10256 is covered by a display string with embedded newlines.
10257
a3de0cbd
MA
102582011-09-24 Michael Albinus <michael.albinus@gmx.de>
10259
10260 * dbusbind.c (Fdbus_register_signal): Add match rule to
10261 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10262 (Fdbus_register_method, Vdbus_registered_objects_table):
10263 Fix docstring.
a3de0cbd 10264
b260039d
JM
102652011-09-24 Jim Meyering <meyering@redhat.com>
10266
32c1fffd 10267 do not ignore write error for any output size
b260039d
JM
10268 The previous change was incomplete.
10269 While it makes emacs --batch detect the vast majority of stdout
10270 write failures, errors were still ignored whenever the output size is
10271 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10272 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10273 && echo FAIL: ignored write error
10274 FAIL: ignored write error
10275 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10276 && echo FAIL: ignored write error
10277 FAIL: ignored write error
10278 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10279
8eca8a7c
AS
102802011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10281
10282 * emacs.c (Fkill_emacs): In noninteractive mode exit
10283 non-successfully if a write error occurred on stdout. (Bug#9574)
10284
3341db62
EZ
102852011-09-21 Eli Zaretskii <eliz@gnu.org>
10286
10287 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10288 the xassert test.
10289
10290 * dispextern.h (struct it): Update the comment documenting what
10291 can it->OBJECT be.
10292
8c203dbf
EZ
102932011-09-20 Eli Zaretskii <eliz@gnu.org>
10294
10295 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10296 a display string, extend search for cursor position to end of row.
10297 (find_row_edges): If the row ends in a newline from a display
10298 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10299 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10300 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10301 non-empty line. Fixes confusing cursor motion with arrow keys at
10302 the beginning of a line that starts with whitespace.
8c203dbf 10303
a4824228
LMI
103042011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10305
10306 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10307 (bug#9493).
10308
33ed493b
CY
103092011-09-18 Chong Yidong <cyd@stupidchicken.com>
10310
10311 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10312 boolean (Bug#9154).
10313
56cd55c8
EZ
103142011-09-18 Eli Zaretskii <eliz@gnu.org>
10315
10316 * xdisp.c (display_line): Record maximum and minimum buffer
10317 positions even if no glyphs were produced (e.g., by a zero-width
10318 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10319 buffer positions that will be removed from the glyph row because
10320 they don't fit.
c02dcedf
EZ
10321 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10322 column is beyond frame width: don't subtract 1 "pixel" when
10323 computing width of the stretch.
3e62b7e0
EZ
10324 (reseat_at_next_visible_line_start): Undo the change made on
10325 2011-09-17 that saved paragraph information and restored it after
10326 the call to `reseat'. (Bug#9545)
56cd55c8 10327
5ed99d36 103282011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10329
10330 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10331 and turn window cursor on if cleared (Bug#9415).
10332
5ed99d36 103332011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10334
10335 * search.c (boyer_moore): Take unibyte characters from pattern
10336 literally. (Bug#9458)
10337
9bade7b2
EZ
103382011-09-18 Eli Zaretskii <eliz@gnu.org>
10339
10340 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10341
e5e9d610
PE
103422011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10343
87e4427a
PE
10344 Fix minor problem found by static checking.
10345 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10346 initialized, to pacify gcc -Wuninitialized.
10347
e5e9d610
PE
10348 * fileio.c: Report proper errno when syscall falls.
10349 (Finsert_file_contents): Save and restore errno,
10350 so that report_file_error outputs the correct diagnostic.
10351 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10352
a1674f0b
EZ
103532011-09-18 Eli Zaretskii <eliz@gnu.org>
10354
10355 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10356
fbfb6dd4
EZ
103572011-09-17 Eli Zaretskii <eliz@gnu.org>
10358
10359 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10360 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10361
bb187662
EZ
103622011-09-17 Eli Zaretskii <eliz@gnu.org>
10363
1137e8b8 10364 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10365 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10366
10367 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10368 (bidi_find_paragraph_start): Search back for paragraph beginning
10369 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10370 (bidi_move_to_visually_next): Only trigger paragraph-related
10371 computations when the last character is a newline or at EOB, not
10372 just any NEUTRAL_B. (Bug#9470)
10373
bb187662
EZ
10374 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10375 truncated lines if point is covered by a display string. (Bug#9524)
10376
2e621251
PE
103772011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10378
10379 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10380 (cons_to_x_long): New function.
10381 (lisp_data_to_selection_data): Use it. Correct the test for
10382 short-versus-long data; it was negated. Break out of vector
10383 loop, for efficiency, when a long datum is discovered.
10384
91a15bc6
SM
103852011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10386
10387 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10388
b41c3a35
EZ
103892011-09-16 Eli Zaretskii <eliz@gnu.org>
10390
10391 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10392 GCC PR/17406) by declaring this function with external scope.
10393
7812ba2d
PE
103942011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10395
10396 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10397 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10398
cf7edc2a
AS
103992011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10400
10401 * editfns.c (Fformat): Correctly handle text properties on "%%".
10402
bd01620e
EZ
104032011-09-15 Eli Zaretskii <eliz@gnu.org>
10404
10405 * xterm.c (x_draw_composite_glyph_string_foreground):
10406 * w32term.c (x_draw_composite_glyph_string_foreground):
10407 * term.c (encode_terminal_code):
10408 * composite.c (composition_update_it, get_composition_id):
10409 * xdisp.c (get_next_display_element)
10410 (fill_composite_glyph_string): Add comments about special meaning
10411 of TAB characters in a composition.
10412
a02719a3
PE
104132011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10414
10415 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10416 This occurs when processing a multibyte format.
10417 Problem reported by Wolfgang Jenker.
a02719a3 10418
72589a3c
JB
104192011-09-15 Johan Bockgård <bojohan@gnu.org>
10420
10421 * xdisp.c (try_cursor_movement): Only check for exact match if
10422 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10423
1c14176c
PE
104242011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10425
10426 Remove unused external symbols.
10427 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10428 * xdisp.c (calc_pixel_width_or_height): Now static.
10429 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10430 * indent.c (check_display_width):
10431 * w32term.c: Fix comment to match code.
10432 * xterm.c, xterm.h (x_catching_errors): Remove.
10433
d2eea5b5
PE
104342011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10435
10436 * xselect.c: Use signed conversions more consistently (Bug#9498).
10437 (selection_data_to_lisp_data): Assume incoming selection data are
10438 signed integers, not unsigned. This is to be consistent with
10439 outgoing selection data, which was modified to use signed integers
10440 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10441 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10442 expects long, not unsigned long.
10443
46888499
EZ
104442011-09-14 Eli Zaretskii <eliz@gnu.org>
10445
10446 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10447 computation of loop end. Reported by Johan Bockgård
10448 <bojohan@gnu.org>.
10449
ef8ef9fb
CY
104502011-09-13 Chong Yidong <cyd@stupidchicken.com>
10451
10452 * frame.c (Fother_visible_frames_p): Function deleted.
10453
fa819fed
EZ
104542011-09-12 Eli Zaretskii <eliz@gnu.org>
10455
10456 * indent.c (compute_motion): Process display vector front to back
10457 rather than the other way around. (Bug#2496)
10458
2ba8e008
SM
104592011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10460
10461 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10462
20f53c69
CY
104632011-09-11 Chong Yidong <cyd@stupidchicken.com>
10464
10465 * minibuf.c (Fread_from_minibuffer): Doc fix.
10466
d562d7a4
EZ
104672011-09-11 Eli Zaretskii <eliz@gnu.org>
10468
10469 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10470 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10471
1c4d7f3d
LMI
104722011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10473
10474 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10475 value for non-existent files.
10476
b885bf36
EZ
104772011-09-11 Eli Zaretskii <eliz@gnu.org>
10478
10479 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10480 set its "size" to -1. This will set the modtime_size field of
10481 the corresponding buffer to -1, which is what
10482 verify-visited-file-modtime expects for files that do not exist.
10483 (Bug#9139)
10484
6612f0bf
PE
104852011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10486
10487 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10488 here ...
10489 * lisp.h: ... from here. push_key_description is no longer
10490 defined in keyboard.c, so its declaration should not be in
10491 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10492 logically belongs with push_key_description.
10493
dfb3f755
PE
104942011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10495
10496 * buffer.h: Include <sys/types.h> instead of <time.h>.
10497 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10498 Problem reported by Herbert J. Skuhra.
10499
3134906c
LMI
105002011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10501
10502 * xml.c (parse_region): Make the parsing work for
10503 non-comment-starting XML files again (bug#9144).
10504
8d903f4e
AS
105052011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10506
10507 * image.c (gif_load): Fix calculation of bottom and right corner.
10508 (Bug#9468)
10509
80ad64f4
EZ
105102011-09-10 Eli Zaretskii <eliz@gnu.org>
10511
10512 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10513 redisplay in small windows.
10514
208a048d
EZ
105152011-09-09 Eli Zaretskii <eliz@gnu.org>
10516
10517 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10518
9b1c252e
MR
105192011-09-08 Martin Rudalics <rudalics@gmx.at>
10520
10521 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10522 Operate on live windows only.
10523
2949f33b
JB
105242011-09-08 Juanma Barranquero <lekktu@gmail.com>
10525
10526 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10527
e08dcafd
EZ
105282011-09-07 Eli Zaretskii <eliz@gnu.org>
10529
10530 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10531 only under bidi iteration.
10532
115b96bd
JD
105332011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10534
10535 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10536
c8199d0f
PE
105372011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10538
10539 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10540 Without this fix, the command to link temacs failed due to an
10541 undefined symbol __builtin_isnan. This is because
10542 /usr/include/iso/math_c99.h #defines isnan(x) to
10543 __builtin_isnan(x), but the bundled gcc, which identifies itself
10544 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10545 a __builtin_isnan.
10546 * floatfns.c (isnan): #undef, and then #define to a clone of
10547 what's in data.c.
10548 (Fisnan): Always define, since it's always available now.
10549 (syms_of_floatfns): Always define isnan at the Lisp level.
10550
e39b275c 105512011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10552
10553 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10554
b2db44d9 105552011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10556
f4af5137 10557 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10558 The previous code assumed that file offsets (off_t values) fit in
10559 EMACS_INT variables, which is not true on typical 32-bit hosts.
10560 The code messed up by falsely reporting buffer overflow in cases
10561 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10562 when "big" contains more than 2**29 bytes, even though this
10563 inserts just one byte and does not overflow the buffer.
10564 (Finsert_file_contents): Store file offsets as off_t
10565 values, not as EMACS_INT values. Check for overflow when
10566 converting between EMACS_INT and off_t. When checking for
10567 buffer overflow or for overlap, take the offsets into account.
10568 Don't use EMACS_INT for small values where int suffices.
10569 When checking for overlap, fix a typo: ZV was used where
10570 ZV_BYTE was intended.
10571 (Fwrite_region): Don't assume off_t fits into 'long'.
10572 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10573
ecfc0a49
MA
105742011-09-05 Michael Albinus <michael.albinus@gmx.de>
10575
10576 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10577
6511acf2 105782011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10579
0999621a 10580 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10581
10582 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10583 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10584 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10585 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10586 (modify_event_symbol): Do not assume that the length of
10587 name_alist_or_stem is safe to alloca and fits in int.
10588 (Fexecute_extended_command): Likewise for function name and binding.
10589 (Frecursion_depth): Wrap around reliably on integer overflow.
10590 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10591 since some callers pass EMACS_INT values.
10592 (Fsingle_key_description): Don't crash if symbol name contains more
10593 than MAX_ALLOCA bytes.
10594 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10595 (get_minibuffer): Arg is now EMACS_INT, not int.
10596 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 10597 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
10598 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10599
2be7d702
PE
10600 * dbusbind.c (signature_cat): New function.
10601 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
10602 Do not overrun buffer; instead, report string overflow.
10603
9d1df220
PE
10604 * dispnew.c (add_window_display_history): Don't overrun buffer.
10605 Truncate instead; this is OK since it's just a log.
10606
33ef5c64
PE
10607 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10608 even if the time zone offset is outlandishly large.
10609 Don't mishandle offset == INT_MIN.
10610
66c6fdd5
PE
10611 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10612 when creating daemon; the previous buffer-overflow check was incorrect.
10613
d749b01b
PE
10614 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10615 which has the guts of the old verror function.
10616
b5cd1905
PE
10617 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10618 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10619
6e1a67fb
PE
10620 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10621 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 10622 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 10623 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
10624 length of string rather than counting it via multiple sprintfs;
10625 that's simpler and more reliable.
c21721cc
PE
10626 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10627 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10628 sprintf, in case result does not fit in int.
10629
c57b67fc
PE
10630 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10631 (fontset_from_font): Print it.
10632
8a401434
PE
10633 * frame.c (tty_frame_count): Now printmax_t, not int.
10634 (make_terminal_frame, set_term_frame_name): Print it.
10635 (x_report_frame_params): In X, window IDs are unsigned long,
10636 not signed long, so print them as unsigned.
10637 (validate_x_resource_name): Check for implausibly long names,
10638 and don't assume name length fits in 'int'.
10639 (x_get_resource_string): Don't blindly alloca invocation name;
10640 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10641 not fit in int.
10642
6e1a67fb
PE
10643 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10644 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
10645 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10646
0df02bf3
PE
10647 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10648 Use esprintf, not sprintf, in case result does not fit in int.
10649
48e30793
PE
10650 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10651 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10652 it as a large positive number.
10653 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10654 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10655
a66ff6d8
PE
10656 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10657 in case result does not fit in int.
10658
aca216ff
PE
10659 * print.c (float_to_string): Detect width overflow more reliably.
10660 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10661 buffer overrun. Don't assume list length fits in 'int'. Treat
10662 print length of 0 as 0, not as infinity; to be consistent with other
10663 uses of print length in this function. Don't overflow print length
10664 index. Don't assume hash table size fits in 'long', or that
10665 vectorlike size fits in 'unsigned long'.
10666
31c286f7
PE
10667 * process.c (make_process): Use printmax_t, not int, to format
10668 process-name gensyms.
10669
55e5faa1
PE
10670 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10671
80f2e268
PE
10672 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10673 to avoid potential buffer overrun.
10674
670741ab
PE
10675 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10676 if X resource line is longer than 512 bytes.
10677
b7163a50
PE
10678 * xfns.c (x_window): Make sprintf buffer a bit bigger
10679 to avoid potential buffer overrun.
10680
ae58ff1f
PE
10681 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10682
c43c8a6a
PE
10683 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10684
3f8236f4
PE
106852011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10686
53e9fe90 10687 Integer overflow fixes for scrolling, etc.
6511acf2
PE
10688 Without these, Emacs silently mishandles large integers sometimes.
10689 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
10690 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10691
6511acf2
PE
10692 * xdisp.c (try_window_id): Check Emacs fixnum range before
10693 converting to 'int'.
806add1d 10694
6511acf2 10695 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
10696 Check that an Emacs fixnum is in range before assigning it to 'int'.
10697 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10698 values converted from Emacs fixnums.
10699 (Frecenter): Don't wrap around a line count if it is out of 'int'
10700 range; instead, treat it as an extreme value.
10701 (Fset_window_configuration, compare_window_configurations):
10702 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10703
6511acf2
PE
10704 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10705 that can exceed INT_MAX. Check that EMACS_INT value is in range
10706 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
10707 (match_limit): Don't assume that a fixnum can fit in 'int'.
10708
6511acf2 10709 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
10710 exceed INT_MAX.
10711
6511acf2 10712 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
10713 (Fvertical_motion): Don't wrap around LINES values that don't fit
10714 in 'int'. Instead, treat them as extreme values. This is good
10715 enough for windows, which can't have more than INT_MAX lines anyway.
10716
fcb901a7
LMI
107172011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10718
0f2f6b6d
LMI
10719 * Require libxml/parser.h to avoid compilation warning.
10720
fcb901a7
LMI
10721 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10722
10723 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10724 since this reportedly can destroy thread storage.
10725
6e20a0d4
CY
107262011-08-30 Chong Yidong <cyd@stupidchicken.com>
10727
10728 * syntax.c (find_defun_start): Update all cache variables if
10729 exiting early (Bug#9401).
10730
148ae00e
EZ
107312011-08-30 Eli Zaretskii <eliz@gnu.org>
10732
f6cfbd8f
EZ
10733 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10734
148ae00e
EZ
10735 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10736 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10737 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10738
10739 * term.c (tty_append_glyph): New function.
10740 (produce_stretch_glyph): Static function and its prototype deleted.
10741
a66cfb1c
SM
10742 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10743 Add prototypes.
148ae00e 10744
c4a07a4c
PE
107452011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10746
10747 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10748 when checking :margin (Bug#9390).
10749 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 10750 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
10751 so that the name doesn't mislead. All uses changed.
10752
6bc8cd65
JB
107532011-08-28 Johan Bockgård <bojohan@gnu.org>
10754
10755 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10756 set_tty_hooks.
10757
dca4927e
EZ
107582011-08-27 Eli Zaretskii <eliz@gnu.org>
10759
10760 * xdisp.c (move_it_to): Don't bail out early when reaching
10761 position beyond to_charpos, if we are scanning backwards.
10762 (move_it_vertically_backward): When DY == 0, make sure we get to
10763 the first character in the line after the newline.
10764
f2cad773
PE
107652011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10766
10767 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10768 (ccl_driver): Do not generate an out-of-range pointer.
10769 (Fccl_execute_on_string): Remove unnecessary check for
10770 integer overflow, noted by Stefan Monnier in
10771 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10772 Remove a FIXME that didn't need fixing.
10773 Simplify the newly-introduced buffer reallocation code.
10774
0cae2cdb
JB
107752011-08-27 Juanma Barranquero <lekktu@gmail.com>
10776
10777 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10778
5fc295a4 107792011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 10780
70c60eb2 10781 Integer and memory overflow issues (Bug#9196).
726e0ab1 10782
d31850da
PE
10783 * doc.c (get_doc_string): Rework so that
10784 get_doc_string_buffer_size is the actual buffer size, rather than
10785 being 1 less than the actual buffer size; this makes xpalloc more
10786 convenient.
10787
a69fbedb
PE
10788 * image.c (x_allocate_bitmap_record, cache_image):
10789 * xselect.c (Fx_register_dnd_atom):
10790 Simplify previous changes by using xpalloc.
10791
fe5c5d37
PE
10792 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10793 since either will do and ptrdiff_t is convenient with xpalloc.
10794
0065d054
PE
10795 * charset.c (charset_table_size)
10796 (struct charset_sort_data.priority): Now ptrdiff_t.
10797 (charset_compare): Don't overflow if priorities differ greatly.
10798 (Fsort_charsets): Don't assume list length fits in int.
10799 Check for size-calculation overflow when allocating sort data.
10800 (syms_of_charset): Allocate an initial charset table that is
10801 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10802
10803 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10804
10805 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10806 The actual value is always <= INT_MAX, and leaving it unsigned made
10807 overflow checking harder.
10808
10809 * dispextern.h (struct glyph_matrix.rows_allocated)
10810 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10811 with xpalloc. The values are still always <= INT_MAX.
10812
10813 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10814
10815 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10816 (SAFE_NALLOCA): New macro.
10817
10818 * region-cache.c (struct boundary.pos, find_cache_boundary)
10819 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10820 (set_cache_region, invalidate_region_cache)
10821 (revalidate_region_cache, know_region_cache, region_cache_forward)
10822 (region_cache_backward, pp_cache):
10823 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10824 so that ptrdiff_t * can be passed to xpalloc.
10825 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10826 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10827 (pp_cache): Don't assume cache_len fits in int.
10828 * region-cache.h: Adjust extern decls to match.
10829
10830 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10831 EMACS_INT, since either will do, for xpalloc.
10832
10833 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10834 (xnmalloc, xnrealloc, xpalloc): New functions.
10835
726e0ab1
PE
10836 * bidi.c (bidi_shelve_header_size): New constant.
10837 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10838 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10839
51f30bc5 10840 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
10841 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10842 (overlay_strings):
10843 Don't update size of array until after memory allocation succeeds,
10844 because xmalloc/xrealloc may not return.
0065d054
PE
10845 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10846 now that we have proper integer overflow checking.
10847 (record_overlay_string, overlay_strings): Catch overflows when
10848 calculating size of overlay_str_buf.
726e0ab1 10849
0065d054
PE
10850 * callproc.c (Fcall_process): Check for size overflow when
10851 calculating size of args2.
10852 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10853 Normally we prefer signed values, but sticking with ptrdiff_t would
10854 require adding more-complicated checks.
726e0ab1
PE
10855
10856 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10857 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10858 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 10859 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
10860
10861 * character.c (Fstring): Check for size-calculation overflow.
10862
10863 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10864 unnecessary integer overflow. Check for size overflow.
10865 (encode_coding_object): Don't update size until xmalloc succeeds.
10866
10867 * composite.c (get_composition_id): Check for overflow in glyph
10868 length calculations.
10869
10870 Integer and memory overflow fixes for display code.
10871 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10872 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10873 (scrolling_window): Check for overflow in size calculations.
10874 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10875 Don't assume glyph table len fits in int.
10876 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10877 (row_table_size): Now ptrdiff_t, not int.
10878 (scrolling_window): Avoid overflow in size calculations.
10879 Don't update size until allocation succeeds.
10880 * fns.c (concat): Check for overflow in size calculations.
10881 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10882 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10883 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10884
10885 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10886 (get_doc_string): Check for size calculation overflow.
10887 Don't update size until allocation succeeds.
10888 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10889 EMACS_INT, where ptrdiff_t will do.
10890 (Fsubstitute_command_keys): Check for string overflow.
10891
10892 * editfns.c (set_time_zone_rule): Don't assume environment length
10893 fits in int.
10894 (message_length): Now ptrdiff_t, not int.
10895 (Fmessage_box): Don't update size until allocation succeeds.
10896 Don't assume message length fits in int.
10897 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10898
0065d054
PE
10899 * emacs.c (main): Do not reallocate argv, since there is a null at
10900 the end that can be overwritten, and this way there's no need to
10901 worry about size-calculation overflow.
10902 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
10903
10904 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10905 alloc succeeds.
10906 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10907
10908 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10909 (x_set_scroll_bar_width, x_figure_window_size):
10910 Check for integer overflow.
10911 (x_set_alpha): Do not assume XINT fits in int.
10912
10913 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10914 This is for the members text_lines, text_cols, total_lines, total_cols,
10915 where the system imposes an 'int' limit.
10916
10917 * fringe.c (Fdefine_fringe_bitmap):
10918 Don't update size until alloc works.
10919
10920 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10921 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10922
10923 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10924 Check for size-calculation overflow.
10925 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10926 do, as we prefer signed integers.
10927 (id_to_widget.max_size, id_to_widget.used)
10928 (xg_store_widget_in_map, xg_remove_widget_from_map)
10929 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10930 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10931 Use and return ptrdiff_t, not int.
10932 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10933 * gtkutil.h: Change prototypes to match the above.
10934
10935 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10936 are duplicate now that they've been promoted to lisp.h.
10937 (x_allocate_bitmap_record, x_alloc_image_color)
10938 (make_image_cache, cache_image, xpm_load):
10939 Don't update size until alloc is done.
10940 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10941 (x_detect_edges):
3256efce 10942 Check for size calculation overflow.
726e0ab1
PE
10943 (ct_colors_allocated_max): New constant.
10944 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10945 overflow.
3256efce 10946
726e0ab1
PE
10947 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10948 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10949 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10950 Use ptrdiff_t, not int, to count maps.
10951 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
10952 calculations. Don't update size until allocation succeeds.
10953 Redo calculations to avoid overflow.
726e0ab1
PE
10954 * keyboard.h: Change prototypes to match the above.
10955
10956 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10957 to count maps.
10958 (current_minor_maps): Check for size calculation overflow.
10959 * keymap.h: Change prototypes to match the above.
10960
10961 * lread.c (read1, init_obarray): Don't update size until alloc done.
10962
10963 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10964 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10965
726e0ab1
PE
10966 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10967 Now ptrdiff_t, not int.
10968 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10969 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10970
10971 * process.c (Fnetwork_interface_list): Check for overflow
10972 in size calculation.
10973
10974 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10975
10976 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10977 overflow. Don't bother calling xmalloc when xrealloc will do.
10978
10979 * search.c (Freplace_match): Check for size calculation overflow.
10980 (Fset_match_data): Don't assume list lengths fit in 'int'.
10981
10982 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10983 for command line length. Do not attempt to address one before the
10984 beginning of an array, as that's not portable.
10985
10986 * term.c (max_frame_lines): Remove; unused.
10987 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10988 not int.
10989 (encode_terminal_code, calculate_costs): Check for size
10990 calculation overflow.
10991 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10992 table lengths and related sizes. Don't update size until alloc
10993 done. Redo calculations to avoid overflow.
10994 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10995
10996 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10997 subtracting pointers.
10998 (gobble_line): Check for overflow more carefully. Don't update size
10999 until alloc done.
11000
11001 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11002 Don't update size until alloc done.
11003 Redo size calculations to avoid overflow.
11004 Check for size calculation overflow.
0065d054 11005 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11006
11007 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11008 Use ptrdiff_t, not int, for sizes.
11009 (store_mode_line_noprop_char): Don't update size until alloc done.
11010
0065d054
PE
11011 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11012 Use ptrdiff_t, not int, for sizes.
11013 (Finternal_make_lisp_face, cache_face):
11014 Check for size calculation overflow.
11015 (cache_face): Treat size calculation overflows as if they were
11016 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11017
11018 * xfns.c (x_encode_text, x_set_name_internal)
11019 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11020 sizes, since they can exceed INT_MAX in size. Check for size
11021 calculation overflow.
11022
0065d054
PE
11023 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11024 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11025 Don't update size until alloc done.
11026
0065d054 11027 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11028 as sprintf is limited to int lengths.
1d526e2f 11029
252c5ee1
PE
11030 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11031 (X_LONG_MIN): New macros.
864d7ce7
PE
11032 Use them to make the following changes clearer.
11033 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11034 This change doesn't affect the value now, but it may help remind
11035 future maintainers not to raise the value too much later.
11036 (SELECTION_QUANTUM): Remove, replacing with ...
11037 (selection_quantum): ... new function, which avoids overflow.
11038 All uses changed.
11039 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11040 assumption that selection length fits in 'int'.
11041 (x_reply_selection_request, x_handle_selection_request)
11042 (x_get_window_property, receive_incremental_selection)
11043 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11044 (lisp_data_to_selection_data, clean_local_selection_data):
11045 Use ptrdiff_t, not int, to record length of selection.
11046 (x_reply_selection_request, x_get_window_property)
11047 (receive_incremental_selection, x_property_data_to_lisp):
11048 Redo calculations to avoid overflow.
11049 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11050 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11051 something.
11052 (x_get_window_property, receive_incremental_selection)
11053 (lisp_data_to_selection_data, x_property_data_to_lisp):
11054 Check for size-calculation overflow.
11055 (x_get_window_property, receive_incremental_selection)
11056 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11057 Don't store size until memory allocation succeeds.
11058 (x_get_window_property): Plug memory leak on memory exhaustion.
11059 Don't double-block input; malloc is safe here. Don't assume 2**34
11060 - 4 fits in unsigned long. Add an xassert to check
11061 XGetWindowProperty overflow. Be more careful about overflow
11062 calculations, and distinguish size from memory overflow better.
11063 (receive_incremental_selection): When tracing, don't assume
11064 unsigned int is less than INT_MAX.
11065 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11066 harmful) conversions of unsigned short to int.
11067 (lisp_data_to_selection_data): Don't assume that integers
11068 in the range -65535 through -1 fit in an X unsigned short.
11069 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11070 result parameters unless successful. Rely on cons_to_unsigned
11071 to report problems with elements; the old code wasn't right anyway.
11072 (x_check_property_data): Check for int overflow; we cannot use
11073 a wider type due to X limits.
11074 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11075
726e0ab1 11076 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11077
0065d054
PE
11078 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11079 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11080 (x_color_cells): Don't store size until memory allocation succeeds.
11081 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11082 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11083 (x_term_init): Don't assume length fits in int (sprintf is limited
11084 to int size).
bc18e09d 11085
ebfa62c0
PE
11086 Use ptrdiff_t for composition IDs.
11087 * character.c (lisp_string_width):
11088 * composite.c (composition_table_size, n_compositions)
11089 (get_composition_id, composition_gstring_from_id):
11090 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11091 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11092 * window.c (Frecenter):
11093 Use ptrdiff_t, not int, for composition IDs.
11094 * composite.c (get_composition_id): Check for integer overflow.
11095 * composite.h: Adjust prototypes to match the above changes.
11096
d3411f89
PE
11097 Use ptrdiff_t for hash table indexes.
11098 * category.c (hash_get_category_set):
11099 * ccl.c (ccl_driver):
11100 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11101 * coding.c (coding_system_charset_list, detect_coding_system):
11102 * coding.h (struct coding_system.id):
11103 * composite.c (get_composition_id, gstring_lookup_cache):
11104 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11105 * image.c (xpm_get_color_table_h):
11106 * lisp.h (hash_lookup, hash_put):
11107 * minibuf.c (Ftest_completion):
11108 Use ptrdiff_t for hash table indexes, not int (which is too
11109 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11110 32-bit --with-wide-int hosts).
11111
e097a6fa
PE
11112 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11113 Add a FIXME comment about memory leaks.
11114 (syms_of_charset): Don't assume xmalloc returns.
11115
5637687f
PE
11116 Don't assume that stated character widths fit in int.
11117 * character.c (Fchar_width, c_string_width, lisp_string_width):
11118 * character.h (CHAR_WIDTH):
11119 * indent.c (MULTIBYTE_BYTES_WIDTH):
11120 Use sanitize_char_width to avoid undefined and/or bad behavior
11121 with outlandish widths.
a66cfb1c 11122 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11123 now that we have two such functions. All uses changed.
11124 (sanitize_char_width): New inline function.
11125
a2271ba2
PE
11126 Don't assume that tab-width fits in int.
11127 * character.h (sanitize_width): New inline function.
11128 (SANE_TAB_WIDTH): New macro.
11129 (ASCII_CHAR_WIDTH): Use it.
11130 * indent.c (sane_tab_width): Remove. All uses replaced by
11131 SANE_TAB_WIDTH (current_buffer).
11132 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11133
18c52557
PE
11134 * fileio.c: Integer overflow issues with file modes.
11135 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11136
caeeedc1
PE
11137 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11138 Remove unreachable code.
11139 (read_hex, load_charset_map_from_file): Check for integer overflow.
11140
6df6ae42 11141 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11142 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11143 (x_send_scroll_bar_event): Likewise. Check that the size does not
11144 exceed limits imposed by XClientMessageEvent, as well as the usual
11145 ptrdiff_t and size_t limits.
11146
b13995db
PE
11147 * keyboard.c: Overflow, signedness and related fixes.
11148 (make_lispy_movement): Use same integer type in forward decl
11149 that is used in the definition.
11150 (read_key_sequence, keyremap_step):
11151 Change bufsize argument back to int, undoing my 2011-03-30 change.
11152 We prefer signed types, and int is wide enough here.
11153 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11154 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11155 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11156 length, not size_t. Use ptrdiff_t for index, not int.
11157 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11158 possibility of integer overflow.
11159
13464394
PE
11160 Overflow, signedness and related fixes for images.
11161
11162 * dispextern.h (struct it.stack[0].u.image.image_id)
11163 (struct_it.image_id, struct image.id, struct image_cache.size)
11164 (struct image_cache.used, struct image_cache.ref_count):
11165 * gtkutil.c (update_frame_tool_bar):
11166 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11167 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11168 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11169 * nsmenu.m (update_frame_tool_bar):
11170 * xdisp.c (calc_pixel_width_or_height):
11171 * xfns.c (image_cache_refcount):
11172 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11173 on typical 64-bit hosts.
11174
11175 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11176 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11177 Omit unnecessary casts to int.
11178 (parse_image_spec): Check that integers fall into 'int' range
11179 when the callers expect that.
11180 (image_ascent): Redo ascent calculation to avoid int overflow.
11181 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11182 (lookup_image): Remove unnecessary tests.
11183 (xbm_image_p): Locals are now of int, not EMACS_INT,
11184 since parse_image_check makes sure they fit into int.
11185 (png_load, gif_load, svg_load_image):
11186 Prefer int to unsigned where either will do.
11187 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11188 old tiff_error_handler and tiff_warning_handler.
11189 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11190 stack buffer overflows. It uses only the features of vsnprintf
11191 that are common to both POSIX and native Microsoft.
11192 (tiff_error_handler, tiff_warning_handler): Use it.
11193 (tiff_load, gif_load, imagemagick_load_image):
11194 Don't assume :index value fits in 'int'.
11195 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11196 (imagemagick_load_image): Check that crop parameters fit into
11197 the integer types that MagickCropImage accepts. Don't assume
11198 Vimagemagick_render_type has a nonnegative value. Don't assume
11199 size_t fits in 'long'.
11200 (gs_load): Use printmax_t to print the widest integers possible.
11201 Check for integer overflow when computing image height and width.
11202
c11821d4
EZ
112032011-08-26 Eli Zaretskii <eliz@gnu.org>
11204
11205 * xdisp.c (redisplay_window): Don't force window start if point
11206 will be invisible in the resulting window. (Bug#9324)
11207
0c95fcf7
EZ
112082011-08-25 Eli Zaretskii <eliz@gnu.org>
11209
11210 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11211 the display spec is of the form `(space ...)'.
11212 (handle_display_spec): Return the value returned by
11213 handle_single_display_spec, not just 1 or zero.
11214 (handle_single_display_spec): If the display spec is of the form
11215 `(space ...)', and specifies display in the text area, return 2
11216 rather than 1.
fee65a97 11217 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11218 accurately, and prefer exact match for point under bidi.
11219 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11220
11221 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11222 into disp_prop; all users changed.
11223
11224 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11225 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11226 for the text covered by the display property.
11227
e4ed06f1
CY
112282011-08-25 Chong Yidong <cyd@stupidchicken.com>
11229
11230 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11231 Change return value to nil.
11232 (Frecord_buffer): Delete unused function.
11233
f67cdd7f
EZ
112342011-08-24 Eli Zaretskii <eliz@gnu.org>
11235
5980d4c6
EZ
11236 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11237 buffers, return left-to-right.
8610fe8b
EZ
11238 (set_cursor_from_row): Consider candidate row a win if its glyph
11239 represents a newline and point is on that newline. Fixes cursor
11240 positioning on the newline at EOL of R2L text within L2R
11241 paragraph, and vice versa.
11242 (try_cursor_movement): Check continued rows, in addition to
11243 continuation rows. Fixes unwarranted scroll when point enters a
11244 continued line of R2L text within an L2R paragraph, or vice versa.
11245 (cursor_row_p): Consider the case of point being equal to
11246 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11247 from the end of a short line to the beginning of a continued line
11248 of R2L text within L2R paragraph.
11249 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11250 composed characters.
5980d4c6 11251
f67cdd7f
EZ
11252 * bidi.c (bidi_check_type): Use xassert.
11253 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11254 members.
11255
bca633fb
EZ
112562011-08-23 Eli Zaretskii <eliz@gnu.org>
11257
11258 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11259 a character.
11260
4a5885a7
CY
112612011-08-23 Chong Yidong <cyd@stupidchicken.com>
11262
11263 * nsfont.m (ns_otf_to_script): Fix typo.
11264
0902a04e
KH
112652011-08-22 Kenichi Handa <handa@m17n.org>
11266
11267 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11268 extra slot even if the purpose is char-code-property-table.
11269
1a2e6670
EZ
112702011-08-23 Eli Zaretskii <eliz@gnu.org>
11271
8ddde651
EZ
11272 * xdisp.c (redisplay_window): When computing centering_position,
11273 account for the height of the header line. (Bug#8874)
11274
425cc014
EZ
11275 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11276 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11277 candidate is selected by the mouse, and that candidate has a
11278 composed character under the mouse.
11279
1a2e6670
EZ
11280 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11281 coordinates reported by pos-visible-in-window-p for a composed
11282 character in column zero.
11283
8b76d6f8
SM
112842011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11285
11286 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11287
dac347dd
EZ
112882011-08-22 Eli Zaretskii <eliz@gnu.org>
11289
11290 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11291 consider it a hit if to_charpos is anywhere in the range of the
11292 composed buffer positions.
11293
e013fb34
CY
112942011-08-22 Chong Yidong <cyd@stupidchicken.com>
11295
11296 * image.c (gif_load): Don't assume that each subimage has the same
11297 dimensions as the base image. Handle disposal method that is
11298 "undefined" by the gif spec (Bug#9335).
11299
bd1ba3e8
CY
113002011-08-20 Chong Yidong <cyd@stupidchicken.com>
11301
11302 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11303 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11304
54a1215b
EZ
113052011-08-19 Eli Zaretskii <eliz@gnu.org>
11306
823564e5
EZ
11307 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11308 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11309 from an Org mode buffer to a Speedbar frame.
11310
54a1215b
EZ
11311 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11312 a composition, take its buffer position from IT->cmp_it.charpos.
11313 Fixes cursor positioning at the beginning of a line that begins
11314 with a composed character.
11315
9778ebcc
EZ
113162011-08-18 Eli Zaretskii <eliz@gnu.org>
11317
0be6ee06
EZ
11318 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11319 character bidirectional type, use STRONG_L instead. Fixes crashes
11320 in a buffer produced by `describe-categories'.
11321
9778ebcc
EZ
11322 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11323 members before the level stack, so they would be saved and
11324 restored when copying iterator state. Fixes incorrect reordering
11325 around TABs covered by display properties.
11326
156bffbe
AS
113272011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11328
6b02f655 11329 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11330
72ad093b
CY
113312011-08-17 Chong Yidong <cyd@stupidchicken.com>
11332
11333 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11334 (internal_condition_case_2, internal_condition_case_n):
11335 Remove unnecessary aborts (Bug#9081).
72ad093b 11336
35774242
EZ
113372011-08-17 Eli Zaretskii <eliz@gnu.org>
11338
11339 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11340 has no `load' handler, try opening the file locally. (Bug#9311)
11341
db76dd85
KB
113422011-08-16 Ken Brown <kbrown@cornell.edu>
11343
11344 * gmalloc.c: Expand comment.
11345
b215eee5
EZ
113462011-08-16 Eli Zaretskii <eliz@gnu.org>
11347
11348 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11349 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11350
a4579d33
KB
113512011-08-16 Ken Brown <kbrown@cornell.edu>
11352
11353 Fix memory allocation problems in Cygwin build (Bug#9273).
11354
11355 * unexcw.c ( __malloc_initialized): Declare external variable.
11356 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11357
8b76d6f8
SM
11358 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11359 New variables.
a4579d33
KB
11360 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11361 dumped emacs.
11362 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11363 in the static heap.
11364 [CYGWIN] (special_realloc): New function.
11365 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11366 requests to realloc storage in the static heap.
11367
3ebec551
PE
113682011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11369
11370 * bidi.c (bidi_initialize): Remove unused local.
11371
9fd8be00
EZ
113722011-08-15 Eli Zaretskii <eliz@gnu.org>
11373
6b02f655
SM
11374 * bidimirror.h:
11375 * biditype.h: Remove file.
11376 * makefile.w32-in ($(BLD)/bidi.$(O)):
11377 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11378
11379 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11380
11381 * chartab.c: Improve commentary for the uniprop_table API.
11382
32413314
EZ
11383 * bidi.c (bidi_paragraph_init): Support zero value of
11384 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11385 (bidi_initialize): Use uniprop_table instead of including
11386 biditype.h and bidimirror.h.
32413314 11387
9fd8be00
EZ
11388 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11389 coordinates of the iterator when restoring from ppos_it.
11390 (Bug#9296)
11391
5cf2b69b
KH
113922011-08-14 Kenichi Handa <handa@m17n.org>
11393
11394 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11395 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11396
daf17d00
EZ
113972011-08-14 Eli Zaretskii <eliz@gnu.org>
11398
11399 * xdisp.c (move_it_in_display_line_to): Don't invoke
11400 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11401 ppos_it. Fixes vertical cursor motion when line beginning is
11402 covered by an image. (Bug#9296)
11403
08e3161a
JD
114042011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11405
11406 * nsterm.h (ns_run_ascript): Declare.
11407 (NSAPP_DATA2_RUNASSCRIPT): Define.
11408
11409 * nsfns.m (as_script, as_result, as_status): New static variables.
11410 (ns_run_ascript): New function.
5e617bc2 11411 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11412 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11413 the event loop. Get status from as_status (Bug#7276).
11414
11415 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11416 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11417 the event loop (Bug#7276).
11418
a3720aa2
AS
114192011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11420
11421 * gnutls.c (QCgnutls_bootprop_priority)
11422 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11423 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11424 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11425 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11426 (QCgnutls_bootprop_verify_hostname_error)
11427 (QCgnutls_bootprop_callbacks_verify): Rename from
11428 Qgnutls_bootprop_..., all uses changed.
11429
11430 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11431 uses changed.
11432
0a0d27fb
PE
114332011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11434
19d5c50c
PE
11435 * xfaces.c (Qframe_set_background_mode): Now static.
11436 * dispextern.h (Qframe_set_background_mode): Remove decl.
11437
0a0d27fb
PE
11438 * process.c (Fnetwork_interface_info): Declare local only if needed.
11439
377538cb
JD
114402011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11441
11442 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11443 (Fnetwork_interface_list): Allocate in increments of bytes instead
11444 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11445 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11446 sockaddr.
11447 (struct ifflag_def): notrailers is smart on OSX.
11448 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11449 Get hardware address with getifaddrs if available.
11450
08fff70c
EZ
114512011-08-12 Eli Zaretskii <eliz@gnu.org>
11452
11453 * xdisp.c (iterate_out_of_display_property): xassert that
11454 IT->position is set to within IT->object's boundaries. Break from
11455 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11456 when IT->position is set up wrongly due to some bug.
11457 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11458 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11459 entry. Force push_it to save on the stack the current
11460 buffer/string position, to be restored by pop_it. Fix flags in
11461 the iterator structure wrt the object coming from a display
11462 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11463 properties. (Bug#9284)
11464
7be1c708 114652011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11466
7be1c708
CY
11467 * fontset.c (fontset_get_font_group): Add proper type checks.
11468 (Bug#9172)
aac0c6e3 11469
7be1c708 114702011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11471
7be1c708
CY
11472 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11473 and LC_VERSION_MIN_MACOSX.
11474 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11475 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11476
97bb72a6
EZ
114772011-08-08 Eli Zaretskii <eliz@gnu.org>
11478
11479 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11480 no-display-properties-and-no-overlays under bidi display.
11481 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11482 properties and overlays.
97bb72a6 11483
d5617611
CY
114842011-08-08 Chong Yidong <cyd@stupidchicken.com>
11485
37e11a63
CY
11486 * editfns.c (Fset_time_zone_rule): Document relationship with the
11487 setenv function.
11488
d5617611
CY
11489 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11490 the font entity extracted from the cache (Bug#8109).
11491
58872834
CY
114922011-08-07 Chong Yidong <cyd@stupidchicken.com>
11493
11494 * composite.c (autocmp_chars): Don't reset point. That is done by
11495 restore_point_unwind (Bug#5984).
11496
75bfc667
JL
114972011-08-07 Juri Linkov <juri@jurta.org>
11498
11499 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11500 to show the arg `TIME' instead of `TIMEVAL'.
11501
d1410150
EZ
115022011-08-06 Eli Zaretskii <eliz@gnu.org>
11503
11504 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11505 display property strides EOL and includes a newline, as in
11506 longlines-mode. (Bug#9254)
75b771e4
EZ
11507 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11508 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11509
11510 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11511 is non-zero, even if the data buffer is NULL. Fixes a crash in
11512 vertical-motion with longlines-mode. (Bug#9254)
11513
35928349
EZ
115142011-08-05 Eli Zaretskii <eliz@gnu.org>
11515
ec7cc85b
EZ
11516 * bidi.c <bidi_cache_total_alloc>: Now static.
11517 (bidi_initialize): Initialize bidi_cache_total_alloc.
11518
8b76d6f8 11519 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11520 cache. (Bug#9221)
11521
11522 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11523 amount allocated this far in `bidi_cache_total_alloc'.
11524 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11525 non-zero, only free the data buffer without restoring the cache
11526 contents. All callers changed.
11527
11528 * dispextern.h (bidi_unshelve_cache): Update prototype.
11529
11530 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11531 (move_it_in_display_line, move_it_to)
11532 (move_it_vertically_backward, move_it_by_lines): Replace the call
11533 to xfree to an equivalent call to bidi_unshelve_cache.
11534 (move_it_in_display_line_to): Fix logic of returning
412b6358 11535 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11536
e2e2423b
EZ
115372011-08-05 Eli Zaretskii <eliz@gnu.org>
11538
11539 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11540 came from a string character with a `cursor' property. (Bug#9229)
11541
ae9e757a
JD
115422011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11543
11544 * Makefile.in (LIB_PTHREAD): New variable.
11545 (LIBES): Add LIB_PTHREAD (Bug#9216).
11546
11547 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11548 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11549
213bd7f2
AS
115502011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11551
6b02f655 11552 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11553
99aaf75f
JD
115542011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11555
11556 * xterm.c (x_find_topmost_parent): New function.
11557 (x_set_frame_alpha): Find topmost parent window with
11558 x_find_topmost_parent and set the property there also (bug#9181).
11559 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11560
c74e9d86
PE
115612011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11562
11563 * callproc.c (Fcall_process): Avoid vfork clobbering
11564 the local vars buffer, coding_systems, current_dir.
11565
640c8776
SM
115662011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11567
11568 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11569
f26d0e4c
PE
115702011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11571
8a10d76c
PE
11572 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11573 so that it is not optimized away.
11574
f26d0e4c
PE
11575 * xdisp.c (compute_display_string_pos): Remove unused local.
11576
55439c61
EZ
115772011-08-02 Eli Zaretskii <eliz@gnu.org>
11578
11579 Fix slow cursor motion and scrolling in large buffers with
11580 selective display, like Org Mode buffers. (Bug#9218)
11581
11582 * dispextern.h (struct bidi_it): New member disp_prop_p.
11583
11584 * xdisp.c: Remove one-slot cache of display string positions.
11585 (compute_display_string_pos): Accept an additional argument
5e617bc2 11586 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11587 for a display string or property. If found, set DISP_PROP_P
11588 non-zero.
11589
11590 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11591 DISP_PROP_P, and pass it to compute_display_string_pos.
11592 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
11593 non-zero. All callers of bidi_fetch_char changed.
11594
fb33fa43
SM
115952011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11596
11597 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11598
b099e063
DM
115992010-12-03 Don March <don@ohspite.net>
11600
11601 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11602 last character M-[char] is translated to ESC [char] (bug#7541).
11603
5cc7f7af
KH
116042011-08-02 Kenichi Handa <handa@m17n.org>
11605
d0fffa3f 11606 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
11607
11608 * chartab.c (uniprop_table): Make it non-static.
11609
525d5e6e
EZ
116102011-08-01 Eli Zaretskii <eliz@gnu.org>
11611
11612 * xdisp.c (forward_to_next_line_start): Accept additional argument
11613 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11614 on the newline.
11615 (reseat_at_next_visible_line_start): Use the bidi iterator state
11616 returned by forward_to_next_line_start to restore the state of
11617 it->bidi_it after backing up to previous newline. (Bug#9212)
11618
31011111
AS
116192011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11620
11621 * regex.c (re_comp): Protoize.
11622 (re_exec): Fix return type.
11623 (regexec): Fix type of `ret'. (Bug#9203)
11624
476371c4
PE
116252011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11626
e5d76069
PE
11627 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11628 This is needed if max-image-size is a floating-point number.
11629
9a79b20c
AS
116302011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11631
11632 * print.c (print_object): Print empty symbol as ##.
11633
11634 * lread.c (read1): Read ## as empty symbol.
11635
d8c2fa78
AA
116362011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11637
11638 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11639 setting frame foreground color (Bug#9175).
11640 (x_set_background_color): Likewise.
11641
ffe57a7a
AA
11642 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11643 contents (Bug#9176).
11644 (EmacsTooltip -init): Remove bezels and add shadows to
11645 tooltip windows.
11646
bf3492a5
AA
11647 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11648 or scroll bar (Bug#8470).
11649
d55e9c53
AA
11650 * nsfont.m (nsfont_open): Remove assignment to voffset and
11651 unnecessary vars hshink, expand, hd, full_height, min_height.
11652 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11653
11654 * nsterm.h (nsfont_info): Remove voffset field.
11655
d8c2fa78 116562011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
11657
11658 Implement strike-through and overline on NextStep (Bug#8863).
11659
11660 * nsfont.m (nsfont_open): Use underline position provided by font,
11661 instead of hard-coded value of 2.
11662 (nsfont_draw): Call ns_draw_text_decoration instead.
11663
11664 * nsterm.h: Add declaration for ns_draw_text_decoration.
11665
11666 * nsterm.m (ns_draw_text_decoration): New function for drawing
11667 underline, overline, and strike-through.
11668 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11669 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 11670 accommodate underlining, etc.
4843aac3 11671
4cc60b9b
EZ
116722011-07-28 Eli Zaretskii <eliz@gnu.org>
11673
bc7ece87
EZ
11674 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11675 default.
4cc60b9b 11676
476371c4
PE
116772011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11678
66606eea
PE
11679 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11680 Without this fix, if a signal arrives just after memory fills up,
11681 'malloc' might be invoked reentrantly.
11682
476371c4
PE
11683 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11684 In other words, assume that every image size is allowed, on non-X
11685 hosts. This assumption is probably wrong, but it lets Emacs compile.
11686
f3fcc40d
AS
116872011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11688
11689 * regex.c (re_iswctype): Convert return values to boolean.
11690
350c992f
EZ
116912011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11692
11693 * xdisp.c (compute_display_string_pos): Don't use cached display
11694 string position if the buffer had its restriction changed.
11695 (Bug#9184)
11696
5266b4bb
PE
116972011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11698
11699 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11700
2573a837 117012011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 11702
41f55ccd 11703 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 11704
39e378da
PE
11705 * bidi.c: Integer size and overflow fixes.
11706 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11707 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11708 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11709 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11710 (bidi_find_other_level_edge):
11711 Use ptrdiff_t instead of EMACS_INT where either will do.
11712 This works better on 32-bit hosts configured --with-wide-int.
11713 (bidi_cache_ensure_space): Check for size-calculation overflow.
11714 Use % rather than repeated addition, for better worst-case speed.
11715 Don't set bidi_cache_size until after xrealloc returns, because it
11716 might not return.
11717 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
11718 (bidi_cache_ensure_space): Also check that the bidi cache size
11719 does not exceed that of the largest Lisp string or buffer. See Eli
11720 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 11721
5e927815
PE
11722 * alloc.c (__malloc_size_t): Remove.
11723 All uses replaced by size_t. See Andreas Schwab's note
11724 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11725
ca4aa935
PE
11726 * image.c: Improve checking for integer overflow.
11727 (check_image_size): Assume that f is nonnull, since
11728 it is always nonnull in practice. This is one less thing to
11729 worry about when checking for integer overflow later.
11730 (x_check_image_size): New function, which checks for integer
11731 overflow issues inside X.
11732 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11733 This removes the need for a memory_full check.
11734 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11735 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11736 (xbm_read_bitmap_data): Change locals back to 'int', since
11737 their values must fit in 'int'.
11738 (xpm_load_image, png_load, tiff_load):
11739 Invoke x_create_x_image_and_pixmap earlier,
11740 to avoid much needless work if the image is too large.
11741 (tiff_load): Treat overly large images as if
11742 x_create_x_image_and_pixmap failed, not as malloc failures.
11743 (gs_load): Use x_check_image_size.
11744
5f8f9cc2
PE
11745 * gtkutil.c: Omit integer casts.
11746 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11747 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11748
5adf60bc
PE
11749 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11750
c8907a93
PE
11751 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11752 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11753 would wrongly return t on a 64-bit host.
11754
e3c25c68
PE
11755 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11756 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11757 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11758 and therefore cause GCC to emit a bogus diagnostic in some cases.
11759
3f791afe
PE
11760 * image.c: Integer signedness and overflow and related fixes.
11761 This is not an exhaustive set of fixes, but it's time to
11762 record what I've got.
11763 (lookup_pixel_color, check_image_size): Remove redundant decls.
11764 (check_image_size): Don't assume that arbitrary EMACS_INT values
11765 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11766 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11767 (tiff_load, imagemagick_load_image):
11768 Check for overflow in size calculations.
11769 (x_create_x_image_and_pixmap): Remove unnecessary test for
11770 xmalloc returning NULL; that can't happen.
11771 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11772 (xpm_color_bucket): Use better integer hashing function.
11773 (xpm_cache_color): Don't possibly over-allocate memory.
11774 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11775 (gif_memory_source):
11776 Use ptrdiff_t, not int or size_t, to record sizes.
11777 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11778 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11779 either works, as we prefer signed integers.
11780 (tiff_read_from_memory, tiff_write_from_memory):
11781 Return tsize_t, not size_t, since that's what the TIFF API wants.
11782 (tiff_read_from_memory): Don't fail simply because the read would
11783 go past EOF; instead, return a short read.
11784 (tiff_load): Omit no-longer-needed casts.
11785 (Fimagemagick_types): Don't assume size fits into 'int'.
11786
3cc5a532
PE
11787 Improve hashing quality when configured --with-wide-int.
11788 * fns.c (hash_string): New function, taken from sxhash_string.
11789 Do not discard information about ASCII character case; this
11790 discarding is no longer needed.
11791 (sxhash-string): Use it. Change sig to match it. Caller changed.
11792 * lisp.h: Declare it.
11793 * lread.c (hash_string): Remove, since we now use fns.c's version.
11794 The fns.c version returns a wider integer if --with-wide-int is
11795 specified, so this should help the quality of the hashing a bit.
11796
b312a492
PE
11797 * emacs.c: Integer overflow minor fix.
11798 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11799 Define only if GNU_LINUX.
11800 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11801
dfd153ae
PE
11802 * dispnew.c: Integer signedness and overflow fixes.
11803 Remove unnecessary forward decls, that were a maintenance hassle.
11804 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11805 All uses changed.
11806 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11807 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11808 (prepare_desired_row, line_draw_cost):
11809 Use int, not unsigned, where either works.
11810 (save_current_matrix, restore_current_matrix):
11811 Use ptrdiff_t, not size_t, where either works.
11812 (init_display): Check for overflow more accurately, and without
11813 relying on undefined behavior.
11814
a81d11a3
PE
11815 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11816 Remove, replacing with the new symbols in lisp.h. All uses changed.
11817 * fileio.c (make_temp_name):
11818 * filelock.c (lock_file_1, lock_file):
11819 * xdisp.c (message_dolog):
11820 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11821 Use pMd etc. instead.
11822 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11823 replacing the pWIDE etc. symbols removed from editfns.c.
11824
3300e6fd
PE
11825 * keyboard.h (num_input_events): Now uintmax_t.
11826 This is (very slightly) less likely to mess up due to wraparound.
11827 All uses changed.
11828
fd05c7e9
PE
11829 * buffer.c: Integer signedness fixes.
11830 (alloc_buffer_text, enlarge_buffer_text):
11831 Use ptrdiff_t rather than size_t when either will do, as we prefer
11832 signed integers.
11833
903fe15d
PE
11834 * alloc.c: Integer signedness and overflow fixes.
11835 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11836 (__malloc_size_t): Default to size_t, not to int.
11837 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11838 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11839 Prefer ptrdiff_t to size_t when either would do, as we prefer
11840 signed integers.
11841 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11842 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11843 Now const. Initialize with values that are in range even if char
11844 is signed.
11845 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11846 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11847 These functions do the right thing with sizes > 2**32.
11848 (check_depth): Now ptrdiff_t, not int.
11849 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11850 Adjust to new way of storing sizes. Check for size overflow bugs
11851 in rest of code.
11852 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11853 slightly wrong anyway, as it missed one instance of
11854 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11855 (refill_memory_reserve): Omit needless cast to size_t.
11856 (mark_object_loop_halt): Mark as externally visible.
11857
ac82cc6a
PE
11858 * xselect.c: Integer signedness and overflow fixes.
11859 (Fx_register_dnd_atom, x_handle_dnd_message):
11860 Use ptrdiff_t, not size_t, since we prefer signed.
11861 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11862 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11863 x_dnd_atoms_size and x_dnd_atoms_length.
11864
c2d1e36d
PE
11865 * doprnt.c: Prefer signed to unsigned when either works.
11866 * eval.c (verror):
11867 * doprnt.c (doprnt):
11868 * lisp.h (doprnt):
11869 * xdisp.c (vmessage):
11870 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11871 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11872 prefer signed arithmetic to avoid comparison confusion.
11873 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11874 but is a bit tricky.
11875
0e926e56
PE
11876 Assume freestanding C89 headers, string.h, stdlib.h.
11877 * data.c, doprnt.c, floatfns.c, print.c:
11878 Include float.h unconditionally.
11879 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11880 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11881 * regex.c: Likewise for stddef.h, string.h.
11882 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11883 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11884 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11885 (STDC_HEADERS): Remove obsolete defines.
11886 * sysdep.c: Include limits.h unconditionally.
11887
9cfdb3ec
PE
11888 Assume support for memcmp, memcpy, memmove, memset.
11889 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11890 * regex.c (memcmp, memcpy):
11891 Remove; we assume C89 now.
11892
11893 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11894 (__malloc_safe_bcopy): Remove; no longer needed.
11895
cf950e6b 11896 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
11897 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11898 well either way, and we prefer signed to unsigned.
11899
dbf38e02
LMI
119002011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11901
11902 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11903 closes the connection while we're reading (bug#9182).
11904
d6f0886c 119052011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 11906
d6f0886c
JD
11907 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11908 are specified (Bug#9168).
24e0f6b1 11909
2eb1f9e6
PE
119102011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11911
11912 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11913 Found by GCC static checking and --with-wide-int on a 32-bit host.
11914
22381272 119152011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
11916
11917 * xdisp.c (compute_display_string_pos): Fix logic of caching
11918 previous display string position. Initialize cached_prev_pos to
11919 -1. Fixes slow-down at the beginning of a buffer.
11920
f25e39b4
EZ
119212011-07-24 Eli Zaretskii <eliz@gnu.org>
11922
11923 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11924 for attrs[LFACE_FONTSET_INDEX].
11925
04c4b52e
PE
119262011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11927
11928 * xml.c (parse_region): Remove unused local
11929 that was recently introduced.
11930
c1734fbd
EZ
119312011-07-23 Eli Zaretskii <eliz@gnu.org>
11932
be18c5a5
EZ
11933 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11934 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11935
c1734fbd
EZ
11936 * xdisp.c (move_it_in_display_line_to): Record the best matching
11937 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
11938 exit if none of the characters scanned was an exact match.
11939 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
11940 when exact match is impossible due to invisible text, and the
11941 lines are truncated.
11942
a258d627
JD
119432011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11944
11945 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11946 for OSX >= 10.7.
11947
b6d5a689
EZ
119482011-07-22 Eli Zaretskii <eliz@gnu.org>
11949
0f74f785
EZ
11950 Fix a significant slow-down of cursor motion with C-n, C-p,
11951 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11952 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 11953 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
11954 (next_element_from_buffer): Call compute_stop_pos_backwards to
11955 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
11956 base_level_stop.
11957 (reseat): Don't look for prev_stop, as that could mean a very long
11958 run.
11959 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11960 <cached_disp_overlay_modiff>: Cache for last found display string
11961 position.
551918c1 11962 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
11963 about the same buffer in the same area of character positions, and
11964 the buffer wasn't changed since the time the display string
11965 position was cached.
551918c1 11966
b2d0c91a
EZ
119672011-07-22 Eli Zaretskii <eliz@gnu.org>
11968
11969 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11970 is an integer, which is important for empty lines. (Bug#9149)
11971
043604ee
CY
119722011-07-22 Chong Yidong <cyd@stupidchicken.com>
11973
11974 * frame.c (Fmodify_frame_parameters): In tty case, update the
11975 default face if necessary (Bug#4238).
11976
da4adb04
CY
119772011-07-21 Chong Yidong <cyd@stupidchicken.com>
11978
11979 * editfns.c (Fstring_to_char): No need to explain what a character
11980 is in the docstring (Bug#6576).
11981
9abd0532
LMI
119822011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11983
11984 * xml.c (parse_region): Make sure we always return a tree.
11985
36881d16
HK
119862011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11987
11988 * xml.c (parse_region): If a document contains only comments,
11989 return that, too.
11990
1e98674d
LMI
119912011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11992
11993 * xml.c (make_dom): Return comments, too.
11994
590bd467
PE
119952011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11996
11997 Port to OpenBSD.
11998 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11999 and the surrounding thread.
12000 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12001 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12002 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12003 timer goes off.
12004 * s/openbsd.h (BROKEN_SIGIO): Define.
12005 * unexelf.c (unexec) [__OpenBSD__]:
12006 Don't update the .mdebug section of the Alpha COFF symbol table.
12007
f41628b2
LMI
120082011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12009
12010 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12011 (bug#8460).
12012
b59b67c5
PE
120132011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12014
15e3a074
PE
12015 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12016 This fixes some race conditions on the permissions of any newly
12017 created file.
12018
41bed37d
PE
12019 * alloc.c (valid_pointer_p): Use pipe, not open.
12020 This fixes some permissions issues when debugging.
12021
b59b67c5
PE
12022 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12023 If fchown fails to set both uid and gid, try to set just gid,
12024 as that is sometimes allowed. Adjust the file's mode to eliminate
12025 setuid or setgid bits that are inappropriate if fchown fails.
12026
925a6be7
SM
120272011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12028
12029 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12030 to compare Lisp_Objects.
12031 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12032 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12033 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12034
52968808
AS
120352011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12036
0a6a104b
AS
12037 * lread.c (read_integer): Unread even EOF character.
12038 (read1): Likewise. Properly record start position of symbol.
12039
52968808
AS
12040 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12041 symbol character follows.
12042
9e381cdd
PE
120432011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12044
12045 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12046 This works around a problem with the previous change to Fcopy_file.
12047 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12048 and without this change, GCC might complain about discarding
12049 fchown's return value.
12050
b5641435
JB
120512011-07-16 Juanma Barranquero <lekktu@gmail.com>
12052
12053 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12054
a8031457
PE
120552011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12056
12057 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12058
dd889327
LMI
120592011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12060
750c33f7
LMI
12061 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12062 it's used from the C level.
12063
dd889327
LMI
12064 * process.c: Use the same condition for POLL_FOR_INPUT in both
12065 keyboard.c and process.c (bug#1858).
12066
87e86684
LM
120672011-07-09 Lawrence Mitchell <wence@gmx.li>
12068
12069 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12070 (Fgnutls_boot): Use it.
12071
64348f40
AS
120722011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12073
12074 * doc.c (Fsubstitute_command_keys): Revert last change.
12075
1d698799
LMI
120762011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12077
f863868c
LMI
12078 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12079 quotes the next character, and doesn't affect other longer
12080 sequences (bug#8935).
12081
1d698799
LMI
12082 * lread.c (syms_of_lread): Clarify that is isn't only
12083 `eval-buffer' and `eval-defun' that's affected by
12084 `lexical-binding' (bug#8460).
12085
aa4b6df6
EZ
120862011-07-15 Eli Zaretskii <eliz@gnu.org>
12087
12088 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12089 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12090
5d856da6
PE
120912011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12092
ad6042bb
PE
12093 Fix minor problems found by static checking.
12094 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12095 (elsz): Now a signed constant, not a size_t var. We prefer signed
12096 types to unsigned, to avoid integer comparison confusion. Without
12097 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12098 "cannot optimize loop, the loop counter may overflow", a symptom
12099 of the confusion.
f00bbb22 12100 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12101 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12102
6468f31c
LMI
121032011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12104
49080b10
LMI
12105 * search.c (Fre_search_backward): Mention `case-fold-search' in
12106 all the re_search_* functions (bug#8138).
12107
6468f31c
LMI
12108 * keyboard.c (Fopen_dribble_file): Document when the file is
12109 closed (bug#8056).
12110
c965adc5
EZ
121112011-07-14 Eli Zaretskii <eliz@gnu.org>
12112
df9733bf
EZ
12113 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12114 bidi_cache_idx.
12115
0bb23927
EZ
12116 Support bidi reordering of display and overlay strings.
12117 * xdisp.c (compute_display_string_pos)
12118 (compute_display_string_end): Accept additional argument STRING.
12119 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12120 (reseat_to_string): Initialize bidi_it->string.s and
12121 bidi_it->string.schars.
12122 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12123 NULL (avoids a crash in bidi_paragraph_init).
12124 Initialize itb.string.lstring.
0bb23927
EZ
12125 (init_iterator): Call bidi_init_it only of a valid
12126 buffer position was specified. Initialize paragraph_embedding to
12127 L2R.
12128 (reseat_to_string): Initialize the bidi iterator.
12129 (display_string): If we need to ignore text properties of
12130 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12131 original value of -1 will not work with bidi.)
12132 (compute_display_string_pos): First arg is now struct
12133 `text_pos *'; all callers changed. Support display properties on
12134 Lisp strings.
12135 (compute_display_string_end): Support display properties on Lisp
12136 strings.
12137 (init_iterator, reseat_1, reseat_to_string): Initialize the
12138 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12139 when iterating on a string not from display properties).
640c8776
SM
12140 (compute_display_string_pos, compute_display_string_end):
12141 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12142 arrow keys.
12143 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12144 base_level_stop; instead, set base_level_stop to BEGV.
12145 Fixes crashes in vertical-motion.
0bb23927
EZ
12146 (next_element_from_buffer): Improve commentary for when
12147 the iterator is before prev_stop.
12148 (init_iterator): Initialize bidi_p from the default value of
12149 bidi-display-reordering, not from buffer-local value. Use the
12150 buffer-local value only if initializing for buffer iteration.
12151 (handle_invisible_prop): Support invisible properties on strings
12152 that are being bidi-reordered.
12153 (set_iterator_to_next): Support bidi reordering of C strings and
12154 Lisp strings.
12155 (next_element_from_string): Support bidi reordering of Lisp
12156 strings.
12157 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12158 (display_string): Support display of R2L glyph rows.
12159 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12160 (init_iterator): Don't initialize it->bidi_p for strings
12161 here.
12162 (reseat_to_string): Initialize it->bidi_p for strings here.
12163 (next_element_from_string, next_element_from_c_string)
12164 (next_element_from_buffer): Add xassert's for correspondence
12165 between IT's object being iterated and it->bidi_it.string
12166 structure.
12167 (face_before_or_after_it_pos): Support bidi iteration.
12168 (next_element_from_c_string): Handle the case of the first string
12169 character that is not the first one in the visual order.
12170 (get_visually_first_element): New function, refactored from common
12171 parts of next_element_from_buffer, next_element_from_string, and
12172 next_element_from_c_string.
12173 (tool_bar_lines_needed, redisplay_tool_bar)
12174 (display_menu_bar): Force left-to-right direction. Add a FIXME
12175 comment for making that be controlled by a user option.
12176 (push_it, pop_it): Save and restore the state of the
12177 bidi iterator. Save and restore the bidi_p flag.
12178 (pop_it): Iterate out of display property for string iteration as
12179 well.
12180 (iterate_out_of_display_property): Support iteration over strings.
12181 (handle_single_display_spec): Set up it->bidi_it for iteration
12182 over a display string, and call bidi_init_it.
12183 (handle_single_display_spec, next_overlay_string)
12184 (get_overlay_strings_1, push_display_prop): Set up the bidi
12185 iterator for displaying display or overlay strings.
12186 (forward_to_next_line_start): Don't use the shortcut if
12187 bidi-iterating.
12188 (back_to_previous_visible_line_start): If handle_display_prop
12189 pushed the iterator stack, restore the internal state of the bidi
12190 iterator by calling bidi_pop_it same number of times.
12191 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12192 and we are bidi-iterating, don't decrement the iterator position;
12193 instead, set the first_elt flag in the bidi iterator, to produce
12194 the same effect.
12195 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12196 (push_display_prop): xassert that we are iterating a buffer.
12197 (push_it, pop_it): Save and restore paragraph_embedding member.
12198 (handle_single_display_spec, next_overlay_string)
12199 (get_overlay_strings_1, reseat_1, reseat_to_string)
12200 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12201 correctly. Don't assume unibyte strings are not bidi-reordered.
12202 (compute_display_string_pos)
12203 (compute_display_string_end): Fix handling the case of C string.
12204 (push_it, pop_it): Save and restore from_disp_prop_p.
12205 (handle_single_display_spec, push_display_prop): Set the
12206 from_disp_prop_p flag.
12207 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12208 (pop_it): Call iterate_out_of_display_property only if we are
12209 popping after iteration over a string that came from a display
12210 property. Fix a typo in popping stretch info. Add an assertion
12211 for verifying that the iterator position is in sync with the bidi
12212 iterator.
12213 (handle_single_display_spec, get_overlay_strings_1)
12214 (push_display_prop): Fix initialization of paragraph direction for
12215 string when that of the parent object is not yet determined.
12216 (reseat_1): Call bidi_init_it to resync the bidi
12217 iterator with IT's position. (Bug#7616)
12218 (find_row_edges): If ROW->start.pos gives position
12219 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12220 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12221 Reset the from_disp_prop_p flag.
12222 (SAVE_IT, RESTORE_IT): New macros.
12223 (pos_visible_p, face_before_or_after_it_pos)
12224 (back_to_previous_visible_line_start)
12225 (move_it_in_display_line_to, move_it_in_display_line)
12226 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12227 (try_scrolling, redisplay_window, display_line): Use them when
12228 saving a temporary copy of the iterator and restoring it back.
12229 (back_to_previous_visible_line_start, reseat_1)
12230 (init_iterator): Empty the bidi cache "stack".
12231 (move_it_in_display_line_to): If iterator ended up at
12232 EOL, but we never saw any buffer positions smaller than
12233 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12234 motion in bidi-reordered lines.
12235 (move_it_in_display_line_to): Record prev_method and prev_pos
12236 immediately before the call to set_iterator_to_next. Fixes cursor
12237 motion in bidi-reordered lines with stretch glyphs and strings
12238 displayed in margins. (Bug#8133) (Bug#8867)
12239 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12240 TO_CHARPOS.
640c8776
SM
12241 (pos_visible_p): Support positions in bidi-reordered lines.
12242 Save and restore bidi cache.
0bb23927
EZ
12243
12244 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12245 (bidi_paragraph_info): Delete unused struct.
12246 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12247 (bidi_cache_start): New variable.
12248 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12249 to zero.
12250 (bidi_cache_fetch_state, bidi_cache_search)
12251 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12252 (bidi_cache_find, bidi_peek_at_next_level)
12253 (bidi_level_of_next_char, bidi_find_other_level_edge)
12254 (bidi_move_to_visually_next): Compare cache index with
12255 bidi_cache_start rather than with zero.
12256 (bidi_fetch_char): Accept new argument STRING; all callers
12257 changed. Support iteration over a string. Support strings with
12258 display properties. Support unibyte strings. Fix the type of
12259 `len' according to what STRING_CHAR_AND_LENGTH expects.
12260 (bidi_paragraph_init, bidi_resolve_explicit_1)
12261 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12262 (bidi_level_of_next_char, bidi_move_to_visually_next):
12263 Support iteration over a string.
0bb23927
EZ
12264 (bidi_set_sor_type, bidi_resolve_explicit_1)
12265 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12266 can now be zero (for strings); special values 0 and -1 were
12267 changed to -1 and -2, respectively.
12268 (bidi_char_at_pos): New function.
12269 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12270 Call it instead of FETCH_MULTIBYTE_CHAR.
12271 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12272 initialized to valid values.
12273 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12274 values.
12275 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12276 the test for valid cached positions. Fix the logic for looking up
12277 the sentinel state in the cache. GCPRO the Lisp string we are
12278 iterating.
12279 (bidi_push_it, bidi_pop_it): New functions.
12280 (bidi_initialize): Initialize the bidi cache start stack pointer.
12281 (bidi_cache_ensure_space): New function, refactored from part of
12282 bidi_cache_iterator_state. Don't assume the required size is just
12283 one BIDI_CACHE_CHUNK away.
12284 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12285 (bidi_count_bytes, bidi_char_at_pos): New functions.
12286 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12287 always valid if bidi_cache_idx is valid.
12288 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12289 is valid if it's going to be used.
12290 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12291 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12292 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12293 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12294 (bidi_find_other_level_edge, bidi_cache_start_stack):
12295 All variables related to cache indices are now EMACS_INT.
c965adc5 12296
0bb23927
EZ
12297 * dispextern.h (struct bidi_string_data): New structure.
12298 (struct bidi_it): New member `string'. Make flag members be 1-bit
12299 fields, and put them last in the struct.
640c8776
SM
12300 (compute_display_string_pos, compute_display_string_end):
12301 Update prototypes.
0bb23927
EZ
12302 (bidi_push_it, bidi_pop_it): Add prototypes.
12303 (struct iterator_stack_entry): New members bidi_p,
12304 paragraph_embedding, and from_disp_prop_p.
12305 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12306 (bidi_shelve_cache, bidi_unshelve_cache):
12307 Declare prototypes.
0bb23927
EZ
12308
12309 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12310 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12311 and vector-like objects.
12312
12313 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12314 cache around display iteration.
12315
12316 * window.c (Fwindow_end, window_scroll_pixel_based)
12317 (displayed_window_lines, Frecenter): Save and restore the bidi
12318 cache around display iteration.
12319
3bbd2265
LMI
123202011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12321
12322 * editfns.c (Fdelete_region): Clarify the use of the named
12323 parameters (bug#6788).
12324
adc47434
MR
123252011-07-14 Martin Rudalics <rudalics@gmx.at>
12326
12327 * indent.c (Fvertical_motion): Set and restore w->pointm when
12328 saving and restoring the window's buffer (Bug#9006).
12329
837c31f8
LMI
123302011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12331
12332 * editfns.c (Fstring_to_char): Clarify just what is returned
12333 (bug#6576). Text by Eli Zaretskii.
12334
ac389d0c
JB
123352011-07-13 Juanma Barranquero <lekktu@gmail.com>
12336
12337 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12338
0be0ce47
EZ
123392011-07-13 Eli Zaretskii <eliz@gnu.org>
12340
12341 * buffer.c (mmap_find): Fix a typo.
12342
cd18e7e3
JB
123432011-07-13 Johan Bockgård <bojohan@gnu.org>
12344
12345 Fix execution of x selection hooks.
12346 * xselect.c (Qx_lost_selection_functions)
12347 (Qx_sent_selection_functions): New vars.
12348 (syms_of_xselect): DEFSYM them.
12349 (x_handle_selection_request): Pass Qx_sent_selection_functions
12350 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12351 (x_handle_selection_clear,x_clear_frame_selections):
12352 Pass Qx_lost_selection_functions rather than
12353 Vx_lost_selection_functions to Frun_hook_with_args.
12354
47ea7f44
PE
123552011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12356
ac389d0c 12357 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12358 The old code sometimes used this field without initializing it.
12359
47ea7f44
PE
12360 * alloc.c (gc_sweep): Don't read past end of array.
12361 In theory, the old code could also have corrupted Emacs internals,
12362 though it'd be very unlikely.
12363
bc985c87
AS
123642011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12365
12366 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12367 argument. (Bug#4026)
bc985c87 12368
0cf34688
LMI
123692011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12370
b3dadd76
LMI
12371 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12372 key" (bug#4257).
12373
0cf34688
LMI
12374 * window.c (Fset_window_start): Doc fix (bug#4199).
12375 (Fset_window_hscroll): Ditto.
12376
270768cd
PE
123772011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12378
077e3dda 12379 Fix minor new problems caught by GCC 4.6.1.
270768cd 12380 * term.c (init_tty): Remove unused local.
490011a6 12381 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12382 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12383 not used otherwise.
270768cd 12384
b1f58454
CY
123852011-07-12 Chong Yidong <cyd@stupidchicken.com>
12386
12387 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12388
22b9578d
LMI
123892011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12390
6e70ab07
LMI
12391 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12392 are the mini-buffer and the echo area (bug#3320).
12393
22b9578d
LMI
12394 * term.c (init_tty): Remove support for supdup, c10 and perq
12395 terminals, which are no longer supported (bug#1482).
12396
8974cc9f
JB
123972011-07-10 Johan Bockgård <bojohan@gnu.org>
12398
12399 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12400
a560d974
JD
124012011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12402
12403 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12404 for non-popups (Bug#3642).
12405
1dae0f0a
AS
124062011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12407
268c2c36 12408 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12409 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12410 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12411 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12412 * data.c (fmod): Likewise.
12413 * dispnew.c (swap_glyphs_in_rows): Likewise.
12414 * emacs.c (memory_warning_signal): Likewise.
12415 * floatfns.c (float_error): Likewise.
12416 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12417 (otf_open, font_otf_capability, generate_otf_features)
12418 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12419 Likewise.
12420 * image.c (pbm_read_file): Likewise.
12421 * indent.c (string_display_width): Likewise.
12422 * intervals.c (check_for_interval, search_for_interval)
12423 (inc_interval_count, count_intervals, root_interval)
12424 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12425 * lread.c (defalias): Likewise.
268c2c36 12426 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12427 * regex.c (set_image_of_range_1, set_image_of_range)
12428 (regex_grow_registers): Likewise.
12429 * sysdep.c (strerror): Likewise.
12430 * termcap.c (valid_filename_p, tprint, main): Likewise.
12431 * tparam.c (main): Likewise.
12432 * unexhp9k800.c (run_time_remap, save_data_space)
12433 (update_file_ptrs, read_header, write_header, calculate_checksum)
12434 (copy_file, copy_rest, display_header): Likewise.
12435 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12436 Likewise.
12437 * xdisp.c (check_it): Likewise.
12438 * xfaces.c (register_color, unregister_color, unregister_colors):
12439 Likewise.
12440 * xfns.c (print_fontset_result): Likewise.
12441 * xrdb.c (member, fatal, main): Likewise.
12442
99033785
PE
124432011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12444
12445 Fix minor problems found by static checking (Bug#9031).
12446 * chartab.c (char_table_set_range, map_sub_char_table):
12447 Remove unused locals.
12448 (uniprop_table): Now static.
12449 * composite.c (_work_char): Remove unused static var.
12450
9cb2ac56
JB
124512011-07-09 Juanma Barranquero <lekktu@gmail.com>
12452
12453 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12454
f25661f0
JD
124552011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12456
12457 * gtkutil.c (qttip_cb): Remove code without function.
12458
8278c4fe
EZ
124592011-07-09 Eli Zaretskii <eliz@gnu.org>
12460
12461 * w32.c (pthread_sigmask): New stub.
12462
1692ae2d 124632011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12464
8a6ebd58 12465 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12466 sigprocmask is portable only for single-threaded applications, and
12467 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12468 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12469 (LIBES): Use it.
12470 * callproc.c (Fcall_process):
12471 * process.c (create_process):
12472 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12473 Use pthread_sigmask, not sigprocmask.
123403e4 12474
1b854618
JD
124752011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12476
12477 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12478 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12479 wrong (Bug#8591).
12480
3fe4b549
JD
124812011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12482
0ce7e563
JD
12483 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12484 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12485 (xg_hide_tooltip): Fix comment.
12486
3fe4b549
JD
12487 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12488 in registerServicesMenuSendTypes.
12489 (validRequestorForSendType): Don't check ns_return_types.
12490
12491 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12492 ns_return_type.
12493
5df75e47
JR
124942011-07-08 Jason Rumney <jasonr@gnu.org>
12495
22610910
JR
12496 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12497 SH_SHOW for hidden windows (Bug#5482).
12498
5df75e47
JR
12499 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12500 frame struct members of non-existent frames (Bug#6284).
12501
699c10bd
JD
125022011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12503
4393663b
JD
12504 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12505 variable firstTime not needed on OSX >= 10.6.
12506 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12507 >= 10.5. Use setKnobProportion, setDoubleValue.
12508
12509 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12510 (MAC_OS_X_VERSION_10_5): Define if not defined.
12511 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12512 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12513 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12514
12515 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12516 cString and lossyCString on OSX >= 10.4.
4393663b 12517
58179cce 12518 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12519 sizeToFit on OSX >= 10.2.
12520
12521 * nsimage.m (allocInitFromFile): Don't use deprecated method
12522 bestRepresentationForDevice on OSX >= 10.6.
12523
12524 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12525 to avoid warning.
12526
12527 * emacs.c: Declare unexec_init_emacs_zone.
12528
a63e0781
JD
12529 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12530
699c10bd
JD
12531 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12532
12533 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12534 on svcsMenu (Bug#8842).
12535
12536 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12537 ns_return_types.
12538 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12539
12540 * nsterm.m (QUTF8_STRING): Declare.
12541 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12542 (validRequestorForSendType): Return type is (id).
12543 Change indexOfObjectIdenticalTo to indexOfObject.
12544 Check if we have local selection before returning self (Bug#8842).
12545 (writeSelectionToPasteboard): Put local selection into paste board
12546 if we have a local selection (Bug#8842).
12547 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12548
12549 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12550 (ns_get_local_selection): Declare.
12551
54e10184
LMI
125522011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12553
9888ff71
LMI
12554 * keymap.c (describe_map_tree): Don't insert a double newline at
12555 the end of the buffer (bug#1169) and return whether we inserted
12556 something.
12557
54e10184
LMI
12558 * callint.c (Fcall_interactively): Change "reading args" to
12559 "providing args" to try to clarify what it does (bug#1010).
12560
15fa4783
KH
125612011-07-07 Kenichi Handa <handa@m17n.org>
12562
12563 * composite.c (composition_compute_stop_pos): Ignore a static
12564 composition starting before CHARPOS (Bug#8915).
12565
12566 * xdisp.c (handle_composition_prop): Likewise.
12567
a8815b00
EZ
125682011-07-07 Eli Zaretskii <eliz@gnu.org>
12569
12570 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12571 (Bug#9015)
12572
ef7b981d 125732011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12574
12575 * character.h (unicode_category_t): New enum type.
12576
12577 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12578 (Qchar_code_property_table): New variable.
12579 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12580 (UNIPROP_COMPRESSED_FORM_P): New macros.
12581 (char_table_ascii): Uncompress the compressed values.
12582 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12583 Uncompress the compressed values.
ac389d0c 12584 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12585 (char_table_ref_and_range): Uncompress the compressed values.
12586 (sub_char_table_set): New arg is_uniprop. Callers changed.
12587 Uncompress the compressed values.
12588 (sub_char_table_set_range): Args changed. Callers changed.
12589 (char_table_set_range): Adjuted for the above change.
12590 (map_sub_char_table): Delete args default_val and parent. Add arg
12591 top. Give decoded values to a Lisp function.
640c8776 12592 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
12593 values to a Lisp function. Gcpro more variables.
12594 (uniprop_table_uncompress)
12595 (uniprop_decode_value_run_length): New functions.
12596 (uniprop_decoder, uniprop_decoder_count): New variables.
12597 (uniprop_get_decoder, uniprop_encode_value_character)
12598 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12599 New functions.
12600 (uniprop_encoder, uniprop_encoder_count): New variables.
12601 (uniprop_get_encoder, uniprop_table)
12602 (Funicode_property_table_internal, Fget_unicode_property_internal)
12603 (Fput_unicode_property_internal): New functions.
12604 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12605 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 12606 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
12607 char-code-property-alist.
12608
640c8776 12609 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
12610 Vunicode_category_table.
12611
640c8776 12612 * font.c (font_range): Adjust for the change of
c805dec0
KH
12613 Vunicode_category_table.
12614
76b397fb
DN
126152011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12616
12617 * m/iris4d.h: Remove file, move contents ...
12618 * s/irix6-5.h: ... here.
12619
22b4128e
PE
126202011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12621
12622 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
12623 * alloc.c (mark_buffer):
12624 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12625 (clone_per_buffer_values): Don't assume that
22b4128e
PE
12626 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12627 This isn't true in general, and it's particularly not true
12628 if Emacs is configured with --with-wide-int.
12629 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12630 New macros, used in the buffer.c change.
12631
869795d6
JD
126322011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12633
12634 * xsettings.c: Use both GConf and GSettings if both are available.
12635 (store_config_changed_event): Add comment.
12636 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12637 (store_tool_bar_style_changed): New functions.
5e617bc2 12638 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
12639 (struct xsettings): Move font inside HAVE_XFT.
12640 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 12641 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 12642 Move inside HAVE_XFT.
640c8776 12643 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
12644 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12645 also.
12646 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 12647 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 12648 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
12649 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12650 (parse_settings): Move check for font inside HAVE_XFT.
12651 (read_settings, apply_xft_settings): Add comment.
12652 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12653 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12654 call store_font_name_changed.
12655 (xft_settings_event): Add comment.
12656 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12657 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12658 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12659 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12660 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
12661 (xsettings_get_system_font, xsettings_get_system_normal_font):
12662 Add comment.
869795d6 12663
d8ed26bd
PE
126642011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12665
12666 Random fixes. E.g., (random) never returned negative values.
12667 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12668 subseconds part to the entropy, as that's a bit more random.
12669 Prefer signed to unsigned, since the signedness doesn't matter and
12670 in general we prefer signed. When given a limit, use a
12671 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12672 latter isn't right if USE_2_TAGS_FOR_INTS.
12673 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12674 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12675
cabf1cac
SM
126762011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12677
12678 * textprop.c (text_property_stickiness):
12679 Obey Vtext_property_default_nonsticky.
12680 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12681 * w32fns.c (syms_of_w32fns):
12682 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12683
6e9b2be9
PE
126842011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12685
12686 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12687 This is more efficient than Ffile_directory_p and avoids a minor race.
12688
90186c68
LMI
126892011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12690
7c301272
LMI
12691 * buffer.c (Foverlay_put): Say what the return value is
12692 (bug#7835).
12693
c4f2d8d4
LMI
12694 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12695 is a directory before asking whether to use the file name
12696 (bug#7564).
ad637907
LMI
12697 (barf_or_query_if_file_exists): Make the "File is a directory"
12698 error be more correct.
c4f2d8d4 12699
90186c68
LMI
12700 * fns.c (Frequire): Remove the mention of the .gz files, since
12701 that's installation-specific, but keep the mention of
12702 `get-load-suffixes'.
12703
da64016e
PE
127042011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12705
12706 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12707 Report string overflow if the output is too long.
12708
7d47b580
JB
127092011-07-04 Juanma Barranquero <lekktu@gmail.com>
12710
a555cb87
JB
12711 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12712 (syms_of_gnutls): Remove duplicate DEFSYM for
12713 Qgnutls_bootprop_verify_hostname_error, an error for
12714 Qgnutls_bootprop_verify_error (which is no longer used).
12715
7d47b580
JB
12716 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12717 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12718 Also (re)move comments that are misplaced or no longer relevant.
12719
1e49bfab
LMI
127202011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12721
12722 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12723
1485f4c0
CY
127242011-07-03 Chong Yidong <cyd@stupidchicken.com>
12725
12726 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12727 and background color parameters if they have been changed.
12728
a9ab721e
LMI
127292011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12730
12731 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12732
cf7cff57
PE
127332011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12734
2e13213d
PE
12735 * xsettings.c (SYSTEM_FONT): Define only when used.
12736 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12737
cf7cff57
PE
12738 * keymap.c (access_keymap_1): Now static.
12739
7a8e04f7
CY
127402011-07-02 Chong Yidong <cyd@stupidchicken.com>
12741
12742 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12743 leave any prefix arg for the up event (Bug#1586).
12744
61352f62
LMI
127452011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12746
69bb1ef7
LMI
12747 * lread.c (syms_of_lread): Mention single symbols defined by
12748 `defvar' or `defconst' (bug#7154).
12749
61352f62 12750 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 12751 (Frequire): Mention get-load-suffixes.
61352f62 12752
28545e04
MR
127532011-07-02 Martin Rudalics <rudalics@gmx.at>
12754
12755 * window.h (window): Remove clone_number slot.
12756 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12757 Remove.
12758 (make_parent_window, make_window, saved_window)
12759 (Fset_window_configuration, save_window_save): Don't deal with
12760 clone numbers.
12761 * buffer.c (Qclone_number): Remove declaration.
12762 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12763
3349e122
SM
127642011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12765
12766 Add multiple inheritance to keymaps.
12767 * keymap.c (Fmake_composed_keymap): New function.
12768 (Fset_keymap_parent): Simplify.
12769 (fix_submap_inheritance): Remove.
12770 (access_keymap_1): New function extracted from access_keymap to handle
12771 embedded parents and handle lists of maps.
12772 (access_keymap): Use it.
12773 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12774 (Fcopy_keymap): Handle embedded parents.
12775 (Fcommand_remapping, define_as_prefix): Simplify.
12776 (Fkey_binding): Simplify.
12777 (syms_of_keymap): Move minibuffer-local-completion-map,
12778 minibuffer-local-filename-completion-map,
12779 minibuffer-local-must-match-map, and
12780 minibuffer-local-filename-must-match-map to Elisp.
12781 (syms_of_keymap): Defsubr make-composed-keymap.
12782 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12783 (parse_menu_item): Trivial simplification.
12784
3279eb87
GM
127852011-07-01 Glenn Morris <rgm@gnu.org>
12786
12787 * Makefile.in (SETTINGS_LIBS): Fix typo.
12788
39cb9e56 127892011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
12790
12791 * coding.c (Fencode_coding_string): Record the last coding system
12792 used, as the function doc string says (bug#8738).
12793
0949d2b6
JD
127942011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12795
12796 * xsettings.c (store_monospaced_changed): Take new font as arg and
12797 check for change against current_mono_font.
12798 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12799 (emacs_settings_constructor, emacs_settings_get_property)
12800 (emacs_settings_set_property, emacs_settings_class_init)
12801 (emacs_settings_init, gsettings_obj): Remove.
12802 (something_changedCB): New function for HAVE_GSETTINGS.
12803 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12804 with value as argument.
12805 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12806 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 12807 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
12808 "changed".
12809
12810 * xgselect.c: Add defined (HAVE_GSETTINGS).
12811 (xgselect_initialize): Ditto.
12812
12813 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12814 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12815 xg_select.
12816
bbc6b304
PE
128172011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12818
12819 * eval.c (struct backtrace): Simplify and port the data structure.
12820 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12821 signed bit field, as this assumption is not portable and it makes
12822 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12823 "char debug_on_exit : 1" as this is not portable either; instead,
12824 use the portable "unsigned int debug_on_exit : 1". Remove unused
12825 member evalargs. Remove obsolete comments about cc bombing out.
12826
9851bfc5
JD
128272011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12828
51bb811f 12829 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
12830 Let HAVE_GSETTINGS override HAVE_GCONF.
12831 (store_monospaced_changed): New function.
12832 (EMACS_SETTINGS): A new type derived from GObject to handle
12833 GSettings notifications.
12834 (emacs_settings_constructor, emacs_settings_get_property)
12835 (emacs_settings_set_property, emacs_settings_class_init):
12836 New functions.
12837 (gsettings_client, gsettings_obj): New variables.
12838 (GSETTINGS_SCHEMA): New define.
12839 (something_changedCB): Call store_monospaced_changed.
12840 (init_gsettings): New function.
12841 (xsettings_initialize): Call init_gsettings.
12842 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12843 to NULL.
12844
640c8776 12845 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
12846 GCONF_CFLAGS/LIBS.
12847
5386012d
MR
128482011-06-29 Martin Rudalics <rudalics@gmx.at>
12849
12850 * window.c (resize_root_window, grow_mini_window)
12851 (shrink_mini_window): Rename Qresize_root_window to
12852 Qwindow_resize_root_window and Qresize_root_window_vertically to
12853 Qwindow_resize_root_window_vertically.
12854
f13e0b08
PE
128552011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12856
12857 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12858
94515237
JB
128592011-06-27 Juanma Barranquero <lekktu@gmail.com>
12860
12861 * makefile.w32-in: Redesign dependencies so they reflect more
12862 clearly which files are directly included by each source file,
12863 and not through other includes.
12864
e43b6e43
MR
128652011-06-27 Martin Rudalics <rudalics@gmx.at>
12866
12867 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12868 (sort_overlays, overlay_strings): When an overlay's clone number
12869 matches the window's clone number process the overlay even if
12870 the overlay's window property doesn't match the current window.
12871
d68443dc
MR
12872 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12873 (Fwindow_hchild): Rename to Fwindow_left_child.
12874 (Fwindow_next): Rename to Fwindow_next_sibling.
12875 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
12876 (resize_window_check): Rename to window_resize_check.
12877 (resize_window_apply): Rename to window_resize_apply.
12878 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12879 (Fdelete_other_windows_internal, resize_frame_windows)
12880 (Fsplit_window_internal, Fdelete_window_internal)
12881 (grow_mini_window, shrink_mini_window)
12882 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 12883
c7e73be5
JD
128842011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12885
12886 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12887 (emacs_fixed_set_min_size): Remove.
12888 (emacs_fixed_new): Take frame as argument.
12889
12890 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12891 (_EmacsFixedPrivate): Remove minwidth/height.
12892 Add struct frame *f.
12893 (emacs_fixed_init): Initialize priv->f.
12894 (get_parent_class, emacs_fixed_set_min_size): Remove.
12895 (emacs_fixed_new): Set priv->f to argument.
12896 (emacs_fixed_get_preferred_width)
12897 (emacs_fixed_get_preferred_height): Use min_width/height from
12898 frames size_hint to set minimum and natural (Bug#8919).
12899 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12900 and use min_width/height from frames size_hint to set
12901 min_width/height (Bug#8919).
12902
12903 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
12904 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12905 Fix indentation.
c7e73be5 12906
cf99dcf8
EZ
129072011-06-26 Eli Zaretskii <eliz@gnu.org>
12908
12909 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12910 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12911 called at ZV.
12912
029529ac
CY
129132011-06-26 Chong Yidong <cyd@stupidchicken.com>
12914
12915 * process.c (wait_reading_process_output): Bypass select if
12916 waiting for a cell while ignoring keyboard input, and input is
12917 pending. Suggested by Jan Djärv (Bug#8869).
12918
7a7ef429
PE
129192011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12920
12921 Use gnulib's dup2 module instead of rolling our own.
12922 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12923
11fdef7d 129242011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
12925
12926 * dispnew.c (scrolling_window): Before scrolling, turn off a
12927 mouse-highlight in the window being scrolled.
12928
cd3520a4
JB
129292011-06-24 Juanma Barranquero <lekktu@gmail.com>
12930
12931 Move DEFSYM to lisp.h and use everywhere.
12932
12933 * character.h (DEFSYM): Move declaration...
12934 * lisp.h (DEFSYM): ...here.
12935
12936 * gnutls.c:
12937 * minibuf.c:
12938 * w32menu.c:
12939 * w32proc.c:
12940 * w32select.c: Don't include character.h.
12941
12942 * alloc.c (syms_of_alloc):
12943 * buffer.c (syms_of_buffer):
12944 * bytecode.c (syms_of_bytecode):
12945 * callint.c (syms_of_callint):
12946 * casefiddle.c (syms_of_casefiddle):
12947 * casetab.c (init_casetab_once):
12948 * category.c (init_category_once, syms_of_category):
12949 * ccl.c (syms_of_ccl):
12950 * cmds.c (syms_of_cmds):
12951 * composite.c (syms_of_composite):
12952 * dbusbind.c (syms_of_dbusbind):
12953 * dired.c (syms_of_dired):
12954 * dispnew.c (syms_of_display):
12955 * doc.c (syms_of_doc):
12956 * editfns.c (syms_of_editfns):
12957 * emacs.c (syms_of_emacs):
12958 * eval.c (syms_of_eval):
12959 * fileio.c (syms_of_fileio):
12960 * fns.c (syms_of_fns):
12961 * frame.c (syms_of_frame):
12962 * fringe.c (syms_of_fringe):
12963 * insdel.c (syms_of_insdel):
12964 * keymap.c (syms_of_keymap):
12965 * lread.c (init_obarray, syms_of_lread):
12966 * macros.c (syms_of_macros):
12967 * msdos.c (syms_of_msdos):
12968 * print.c (syms_of_print):
12969 * process.c (syms_of_process):
12970 * search.c (syms_of_search):
12971 * sound.c (syms_of_sound):
12972 * syntax.c (init_syntax_once, syms_of_syntax):
12973 * terminal.c (syms_of_terminal):
12974 * textprop.c (syms_of_textprop):
12975 * undo.c (syms_of_undo):
12976 * w32.c (globals_of_w32):
12977 * window.c (syms_of_window):
12978 * xdisp.c (syms_of_xdisp):
12979 * xfaces.c (syms_of_xfaces):
12980 * xfns.c (syms_of_xfns):
12981 * xmenu.c (syms_of_xmenu):
12982 * xsettings.c (syms_of_xsettings):
12983 * xterm.c (syms_of_xterm): Use DEFSYM.
12984
4228cf16
TZ
129852011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12986
cd3520a4 12987 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 12988
7fcccf1e
PE
129892011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12990
7efb4e0e
PE
12991 Integer and buffer overflow fixes (Bug#8873).
12992
ff5844ad
PE
12993 * print.c (printchar, strout): Check for string overflow.
12994 (PRINTPREPARE, printchar, strout):
12995 Don't set size unless allocation succeeds.
12996
90532f02
PE
12997 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12998 for sizes. Check for string overflow more accurately.
12999 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13000
6d84508d
PE
13001 * macros.c: Integer and buffer overflow fixes.
13002 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13003 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13004 Use ptrdiff_t, not int, for sizes.
13005 Don't increment bufsize until after realloc succeeds.
13006 Check for size-calculation overflow.
13007 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13008
437b2cb4
PE
13009 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13010
8b9ac8b4
PE
13011 * lread.c: Integer overflow fixes.
13012 (read_integer): Radix is now EMACS_INT, not int,
13013 to improve quality of diagnostics for out-of-range radices.
13014 Calculate buffer size correctly for out-of-range radices.
13015 (read1): Check for integer overflow in radices, and in
13016 read-circle numbers.
82cb60d3
PE
13017 (read_escape): Avoid int overflow.
13018 (Fload, openp, read_buffer_size, read1)
13019 (substitute_object_recurse, read_vector, read_list, map_obarray):
13020 Use ptrdiff_t, not int, for sizes.
13021 (read1): Use EMACS_INT, not int, for sizes.
20270765 13022 Check for size overflow.
8b9ac8b4 13023
7fcccf1e
PE
13024 * image.c (cache_image): Check for size arithmetic overflow.
13025
bfbbd7e7
PE
13026 * lread.c: Integer overflow issues.
13027 (saved_doc_string_size, saved_doc_string_length)
13028 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13029 Now ptrdiff_t, not int.
13030 (read1): Don't assume doc string length fits in int. Check for
13031 out-of-range doc string lengths.
13032 (read_list): Don't assume file position fits in int.
39019e54 13033 (read_escape): Check for hex character overflow.
bfbbd7e7 13034
4e323265
LL
130352011-06-22 Leo Liu <sdl.web@gmail.com>
13036
13037 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13038 Move to minibuffer.el.
13039
85fece3e
PE
130402011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13041
20b84ce9 13042 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13043 The following patches are for when GLYPH_DEBUG && !XASSERT.
13044 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13045 * dispnew.c (flush_stdout):
13046 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13047 Mark as externally visible.
13048 * dispnew.c (check_window_matrix_pointers): Now static.
13049 * dispnew.c (window_to_frame_vpos):
13050 * xfns.c (unwind_create_frame):
13051 * xterm.c (x_check_font): Remove unused local.
13052 * scroll.c (CHECK_BOUNDS):
13053 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13054 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13055 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13056 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13057 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13058 Now static.
13059 (debug_method_add): Use va_list and vsprintf rather than relying
13060 on undefined behavior with wrong number of arguments.
13061 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13062 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13063 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13064 since we're not interested in debugging glyphs with old libraries.
13065 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13066 GCC 4.6.0's static checking.
13067
0766b489
PE
130682011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13069
31fd4b32
PE
13070 Integer overflow and signedness fixes (Bug#8873).
13071 A few related buffer overrun fixes, too.
13072
b79e8648
PE
13073 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13074
0766b489
PE
13075 * dispextern.h (struct face.stipple):
13076 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13077 (x_bitmap_mask, x_allocate_bitmap_record)
13078 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13079 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13080 (x_create_bitmap_from_xpm_data):
13081 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13082 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13083 (.bitmaps_last):
13084 * xfaces.c (load_pixmap):
13085 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13086 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13087 (.bitmaps_last, struct x_output.icon_bitmap):
13088 Use ptrdiff_t, not int, for bitmap indexes.
13089 (x_allocate_bitmap_record): Check for size overflow.
13090 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13091
b081724f
PE
13092 Use ptrdiff_t, not int, for overlay counts.
13093 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13094 * editfns.c (overlays_around, get_pos_property):
13095 * textprop.c (get_char_property_and_overlay):
13096 * xdisp.c (next_overlay_change, note_mouse_highlight):
13097 * xfaces.c (face_at_buffer_position):
21514da7
PE
13098 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13099 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13100 (Fnext_overlay_change, Fprevious_overlay_change)
13101 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13102 Use ptrdiff_t, not int, for sizes.
21514da7 13103 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13104
3de73e5e
PE
13105 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13106
2606c57b
PE
13107 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13108 (x_session_initialize): Do not assume string length fits in int.
13109
aaafe47a
PE
13110 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13111 This is unlikely, but can occur if DPI is outlandish.
13112
2674ddc8 13113 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13114 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13115
28154962
PE
13116 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13117 * xrdb.c (magic_file_p, search_magic_path):
13118 Omit last arg SUFFIX; it was always 0. All callers changed.
13119 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13120
7de51af5
PE
13121 * xfont.c (xfont_match): Avoid need for strlen.
13122
25ed6cc3
PE
13123 * xfns.c: Don't assume strlen fits in int.
13124 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13125
4eab31dd
PE
13126 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13127 not unsigned long, as we prefer signed integers. All callers changed.
13128 Detect integer overflow in repeat count.
13129 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13130 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13131
171e2a58
PE
13132 * termcap.c: Don't assume sizes fit in int and never overflow.
13133 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13134 (gobble_line): Check for size-calculation overflow.
13135
ad39faca 13136 * minibuf.c (Fread_buffer):
6e5bb2dc 13137 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13138 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13139 Don't assume string length fits in int.
13140
52c61c22 13141 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13142 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13143
b5b8c9e5
PE
13144 * font.c: Don't assume string length fits in int.
13145 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13146 Use ptrdiff_t, not int.
ccd6111c
PE
13147 (font_intern_prop): Don't assume string length fits in int.
13148 Don't assume integer property fits in fixnum.
13149 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13150
882f0d81 13151 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13152 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13153 Reformulate so as not to need the command string.
13154 Invoke gzip -cd rather than gunzip, as it's more portable.
13155 (lock_info_type, lock_file_1, lock_file):
13156 Don't assume pid_t and time_t fit in unsigned long.
13157 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13158 (current_lock_owner): Prefer signed type for sizes.
13159 Use memcpy, not strncpy, where memcpy is what is really wanted.
13160 Don't assume (via atoi) that time_t and pid_t fit in int.
13161 Check for time_t and/or pid_t out of range, e.g., via a network share.
13162 Don't alloca where an auto var works fine.
13163
93f4cf88
PE
13164 * fileio.c: Fix some integer overflow issues.
13165 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13166 Don't assume string length fits in int.
13167 (directory_file_name): Don't assume string length fits in long.
13168 (make_temp_name): Don't assume pid fits in int, or that its print
13169 length is less than 20.
13170
f3e92b69
PE
13171 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13172
1bfdaf10
PE
13173 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13174
35016e9a
PE
13175 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13176
3d1e65a1
PE
13177 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13178 We prefer signed integers, even for size calculations.
13179
0b963a93
PE
13180 * emacs.c: Don't assume string length fits in 'int'.
13181 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13182 (main): Don't invoke strlen when not needed.
13183
573f4b54
PE
13184 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13185 (XD_DEBUG_MESSAGE): Don't waste a byte.
13186
989f33ba
PE
13187 * callproc.c (getenv_internal_1, getenv_internal)
13188 (Fgetenv_internal):
965d34eb
PE
13189 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13190
e4d29b33
PE
13191 * lread.c (invalid_syntax): Omit length argument.
13192 All uses changed. This doesn't fix a bug, but it simplifies the
13193 code away from its former Hollerith-constant appearance, and it's
13194 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13195 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13196
eb49b136
PE
13197 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13198 This didn't break anything, but it didn't help either.
13199 It's confusing to put a bogus integer in a place where the actual
13200 value does not matter.
9f62aeb1 13201 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13202 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13203
15375a22
PE
13204 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13205 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13206 implementation.
b61cc01c
PE
13207 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13208 We prefer signed types, and the value cannot exceed the EMACS_INT
13209 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13210 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13211 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13212 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13213
53b2623d
PE
13214 * indent.c (sane_tab_width): New function.
13215 (current_column, scan_for_column, Findent_to, position_indentation)
13216 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13217 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13218
51cab52b 13219 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13220
f2ed8a70
PE
13221 * lisp.h (lint_assume): New macro.
13222 * composite.c (composition_gstring_put_cache):
13223 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13224
abe80cc6
PE
13225 * editfns.c, insdel.c:
13226 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13227
b02c740e
PE
13228 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13229
ebc96716
PE
13230 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13231
b4e50fa0 13232 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13233 Use much-faster test for byte-length change.
311d5d7c 13234 Don't assume string byte-length fits in 'int'.
a4cf38e4 13235 Check that character arg fits in 'int'.
85461888 13236 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13237
c0c1ee9f
PE
13238 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13239
a498d7f4
PE
13240 * fns.c (concat): Catch string overflow earlier.
13241 Do not rely on integer wraparound.
13242
51cab52b
PE
13243 * dispextern.h (struct it.overlay_strings_charpos)
13244 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13245 * xdisp.c (forward_to_next_line_start)
13246 (back_to_previous_visible_line_start)
13247 (reseat_at_next_visible_line_start, next_element_from_buffer):
13248 Don't arbitrarily truncate the value of 'selective' to int.
13249
76031fad
PE
13250 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13251
5eb55db9
PE
13252 * composite.c: Don't truncate sizes to 'int'.
13253 (composition_gstring_p, composition_reseat_it)
13254 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13255 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13256 not EMACS_UINT, for indexes.
5eb55db9 13257
0703a717
PE
13258 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13259
d6202519
PE
13260 * buffer.c: Include <verify.h>.
13261 (struct sortvec.priority, struct sortstr.priority):
8961a454 13262 Now EMACS_INT, not int.
c20998a7 13263 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13264 (struct sortstr.size, record_overlay_string)
13265 (struct sortstrlist.size, struct sortlist.used):
13266 Don't truncate size to int.
13267 (record_overlay_string): Check for size-calculation overflow.
d6202519 13268 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13269
d5a19415
JM
132702011-06-22 Jim Meyering <meyering@redhat.com>
13271
029529ac 13272 Don't leak an XBM-image-sized buffer
d5a19415
JM
13273 * image.c (xbm_load): Free the image buffer after using it.
13274
a9041e6c
PE
132752011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13276
13277 Port to Sun C.
13278 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13279 that Sun C diagnosed.
13280 * fns.c (secure_hash): Fix pointer signedness issue.
13281 * intervals.c (static_offset_intervals): New function.
13282 (offset_intervals): Use it.
13283
7f3f739f
LL
132842011-06-21 Leo Liu <sdl.web@gmail.com>
13285
13286 * deps.mk (fns.o):
13287 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13288 sha512.h.
13289
13290 * fns.c (secure_hash): Rename from crypto_hash_function and change
13291 the first arg to accept symbols.
5b66d427 13292 (Fsecure_hash): New primitive.
7f3f739f
LL
13293 (syms_of_fns): New symbols.
13294
76147d94
DD
132952011-06-20 Deniz Dogan <deniz@dogan.se>
13296
13297 * process.c (Fset_process_buffer): Clarify return value in
13298 docstring.
13299
7d7d0045
CY
133002011-06-18 Chong Yidong <cyd@stupidchicken.com>
13301
13302 * dispnew.c (add_window_display_history): Use BVAR.
13303
13304 * xdisp.c (debug_method_add): Use BVAR.
13305 (check_window_end, dump_glyph_matrix, dump_glyph)
13306 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13307
13308 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13309 Likewise.
13310
13311 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13312 check till after the cache is created in init_frame_faces.
13313
ff2bc410
SM
133142011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13315
13316 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13317
28177add
PE
133182011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13319
dd3482fe
PE
13320 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13321 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13322 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13323
393d71f3 13324 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13325 * fileio.c (Finsert_file_contents):
13326 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13327 Remove the old (too-loose) buffer overflow checks.
13328 They weren't needed, since make_gap checks for buffer overflow.
13329 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13330 The old code merely checked for Emacs fixnum overflow, and relied
13331 on undefined (wraparound) behavior. The new code avoids undefined
13332 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13333
2e6813b0 13334 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13335 Tune. Don't use wider integers than needed. Don't use alloca.
13336 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13337
599a9e4f
PE
13338 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13339
99561444
PE
13340 * insdel.c, lisp.h (buffer_overflow): New function.
13341 (insert_from_buffer_1, replace_range, replace_range_2):
13342 * insdel.c (make_gap_larger):
13343 * editfns.c (Finsert_char):
13344 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13345
28177add
PE
13346 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13347
e69dafad
PE
133482011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13349
4baa020d 13350 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13351
b1c46f02
PE
13352 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13353 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13354
e69dafad
PE
13355 * fileio.c: Don't assume EMACS_INT fits in off_t.
13356 (emacs_lseek): New static function.
13357 (Finsert_file_contents, Fwrite_region): Use it.
13358 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13359
566684ea
PE
13360 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13361
e6966cd6
PE
13362 * fns.c: Don't overflow int when computing a list length.
13363 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13364 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13365 truncation on 64-bit hosts. Check for QUIT every
13366 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13367 faster and is responsive enough.
13368 (Flength): Report an error instead of overflowing an integer.
13369 (Fsafe_length): Return a float if the value is not representable
13370 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13371 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13372 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13373
dd0b0efb
PE
13374 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13375 (header_size, word_size): New constants.
13376 (allocate_vectorlike): Don't check size overflow here.
13377 (allocate_vector): Check it here instead, since this is the only
13378 caller of allocate_vectorlike that could cause overflow.
13379 Check that the new vector's length is representable as a fixnum.
13380
86fe5cfe
PE
13381 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13382 The previous code was bogus. For example, next_almost_prime (32)
13383 returned 39, which is undesirable as it is a multiple of 3; and
13384 next_almost_prime (24) returned 25, which is a multiple of 5 so
13385 why was the code bothering to check for multiples of 7?
13386
80e88859
PE
13387 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13388
4a2f0ad6
PE
13389 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13390
f66c7cf8
PE
13391 Variadic C functions now count arguments with ptrdiff_t.
13392 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13393 Back then I didn't know that the Emacs coding style prefers signed int.
13394 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13395 were being counted with int, which may truncate counts on 64-bit
13396 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13397 * lisp.h (struct Lisp_Subr.function.aMANY)
13398 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13399 Arg counts are now ptrdiff_t, not size_t.
13400 All variadic functions and their callers changed accordingly.
13401 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13402 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13403 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13404 * callint.c (Fcall_interactively): Check arg count for overflow,
13405 to avoid potential buffer overrun. Use signed char, not 'int',
13406 for 'varies' array, so that we needn't bother to check its size
13407 calculation for overflow.
13408 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13409 * eval.c (apply_lambda):
13410 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13411 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13412 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13413
a1759b76
PE
13414 * callint.c (Fcall_interactively): Don't use index var as event count.
13415
d96be9fc
PE
13416 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13417 * mem-limits.h (SIZE): Remove; no longer used.
13418
a690a978 13419 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13420
578c21e6
PE
13421 Remove unnecessary casts.
13422 * xterm.c (x_term_init):
13423 * xfns.c (x_set_border_pixel):
13424 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13425 These aren't needed now that we assume ANSI C.
13426
96f53c6c
PE
13427 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13428 It's more likely to cause problems (due to unsigned overflow)
13429 than to cure them.
13430
83c77d31
PE
13431 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13432
ee2079f1
PE
13433 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13434
6da65536
PE
13435 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13436
7147c4a4
PE
13437 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13438
193e32d9
PE
13439 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13440
e5533da6
PE
13441 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13442
9910e595
PE
13443 GLYPH_CODE_FACE returns EMACS_INT, not int.
13444 * dispextern.h (merge_faces):
13445 * xfaces.c (merge_faces):
01103c44
PE
13446 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13447 Don't assume EMACS_INT fits in int.
9910e595 13448
2638320e
PE
13449 * character.h (CHAR_VALID_P): Remove unused parameter.
13450 * fontset.c, lisp.h, xdisp.c: All uses changed.
13451
045eb8d9
PE
13452 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13453
c1f134b5
PE
13454 * fns.c (concat): Minor tuning based on overflow analysis.
13455 This doesn't fix any bugs. Use int to hold character, instead
13456 of constantly refetching from Emacs object. Use XFASTINT, not
13457 XINT, for value known to be a character. Don't bother comparing
13458 a single byte to 0400, as it's always less.
13459
395fcb93 13460 * floatfns.c (Fexpt):
327eeec8
PE
13461 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13462
abbd3d23
PE
13463 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13464 for characters.
13465
684a03ef
PE
13466 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13467
0fed43f3
PE
13468 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13469 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13470 incorrectly succeed when S was a string, because 4294967386 was
13471 truncated before it was used.
13472
8fd02eb7
PE
13473 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13474 Otherwise, an out-of-range integer could cause undefined behavior
13475 on a 64-bit host.
13476
f8c86b69
PE
13477 * composite.c: Use int, not EMACS_INT, for characters.
13478 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13479 EMACS_INT, for values that are known to be in character range.
13480 This doesn't fix any bugs but is the usual style inside Emacs and
13481 may generate better code on 32-bit machines.
13482
34206dd2
PE
13483 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13484 This is for reasons similar to the recent CHAR_STRING fix.
13485 * charset.c (Fencode_char): Check that character arg is actually
13486 a character. Pass an int to ENCODE_CHAR.
13487 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13488 wider than 'int', as a compile-time check to prevent future regressions
13489 in this area.
13490
c5958d4c 13491 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13492
13493 Make sure a 64-bit char is never passed to CHAR_STRING.
13494 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13495 by silently ignoring the top 32 bits, allowing some values
13496 that were far too large to be valid characters.
13497 * character.h: Include <verify.h>.
13498 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13499 arguments are no wider than unsigned, as a compile-time check
13500 to prevent future regressions in this area.
13501 * data.c (Faset):
01103c44 13502 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13503 (Fsubst_char_in_region):
13504 * fns.c (concat):
13505 * xdisp.c (decode_mode_spec_coding):
13506 Adjust to CHAR_STRING's new requirement.
13507 * editfns.c (Finsert_char, Fsubst_char_in_region):
13508 * fns.c (concat): Check that character args are actually
13509 characters. Without this test, these functions did the wrong
13510 thing with wildly out-of-range values on 64-bit hosts.
13511
d37ca623
PE
13512 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13513 These casts should not be needed on 32-bit hosts, either.
13514 * keyboard.c (read_char):
13515 * lread.c (Fload): Remove casts to unsigned.
13516
ea204efb
PE
13517 * lisp.h (UNSIGNED_CMP): New macro.
13518 This fixes comparison bugs on 64-bit hosts.
13519 (ASCII_CHAR_P): Use it.
13520 * casefiddle.c (casify_object):
01103c44 13521 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13522 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13523 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13524 * dispextern.h (FACE_FROM_ID):
13525 * keyboard.c (read_char): Use UNSIGNED_CMP.
13526
41cb286c
PE
13527 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13528 not to EMACS_INT, to avoid GCC warning.
13529
4a1b9832
PE
13530 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13531
55daad71
PE
13532 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13533 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13534 isn't needed on 32-bit machines.
8f95c75c 13535
01103c44
PE
13536 * buffer.c (Fgenerate_new_buffer_name):
13537 Use EMACS_INT for count, not int.
0ceccced 13538 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13539
13540 * data.c (Qcompiled_function): Now static.
13541
c6f072e7
PE
13542 * window.c (window_body_lines): Now static.
13543
20ce5912
PE
13544 * image.c (gif_load): Rename local to avoid shadowing.
13545
9c4c5f81
PE
13546 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13547 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13548 * alloc.c (make_save_value): Integer argument is now of type
13549 ptrdiff_t, not int.
13550 (mark_object): Use ptrdiff_t, not int.
13551 * lisp.h (pD): New macro.
13552 * print.c (print_object): Use it.
13553
c0c5c8ae
PE
13554 * alloc.c: Use EMACS_INT, not int, to count objects.
13555 (total_conses, total_markers, total_symbols, total_vector_size)
13556 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13557 (total_free_floats, total_floats, total_free_intervals)
13558 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13559 Now EMACS_INT, not int. All uses changed.
13560 (Fgarbage_collect): Compute overall total using a double, so that
13561 integer overflow is less likely to be a problem. Check for overflow
13562 when converting back to an integer.
5a25e253
PE
13563 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13564 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13565 These were 'int' variables that could overflow on 64-bit hosts;
13566 they were never used, so remove them instead of repairing them.
211a0b2a 13567 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13568 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13569 Previously, this ceilinged at INT_MAX, but that doesn't work on
13570 64-bit machines.
e46bb31a 13571 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13572
c78baabf 13573 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13574 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13575 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13576 when a (possibly-narrower) signed value would do just as well.
13577 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13578
c9d624c6
PE
13579 * alloc.c: Catch some string size overflows that we were missing.
13580 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13581 for convenience in STRING_BYTES_MAX.
13582 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13583 The definition here is exact; the one in lisp.h was approximate.
13584 (allocate_string_data): Check for string overflow. This catches
13585 some instances we weren't catching before. Also, it catches
13586 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13587 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13588 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13589
c9d624c6
PE
13590 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13591 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13592 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 13593
353032ce
PE
13594 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13595
2bccce07
PE
13596 * alloc.c (Fmake_string): Check for out-of-range init.
13597
0ac30604
SM
135982011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13599
13600 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13601
c195f2de
JD
136022011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13603
13604 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13605 xg_get_default_scrollbar_width.
13606
13607 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13608 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13609 (style_changed_cb): Call update_theme_scrollbar_width and call
13610 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13611 all frames (Bug#8505).
13612 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13613 Call gtk_window_set_resizable if HAVE_GTK3.
13614 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13615 and height if HAVE_GTK3 (Bug#8505).
13616 (scroll_bar_width_for_theme): New variable.
13617 (update_theme_scrollbar_width): New function.
13618 (xg_get_default_scrollbar_width): Move code to
13619 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13620 (xg_initialize): Call update_theme_scrollbar_width.
13621
13622 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13623
13624 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13625
e10ac9f1
MR
136262011-06-12 Martin Rudalics <rudalics@gmx.at>
13627
13628 * frame.c (make_frame): Call other_buffer_safely instead of
13629 other_buffer.
13630
13631 * window.c (temp_output_buffer_show): Call display_buffer with
13632 second argument Vtemp_buffer_show_specifiers and reset latter
13633 immediately after the call.
13634 (Vtemp_buffer_show_specifiers): New variable.
13635 (auto_window_vscroll_p, next_screen_context_lines)
13636 (Vscroll_preserve_screen_position): Remove leading asterisks from
13637 doc-strings.
13638
2d3c217e 136392011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 13640
7b7f97e8 13641 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
13642 * buffer.c (Qclone_number): Remove for now, as it's unused.
13643 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13644 (record_buffer): Remove unused local.
13645 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13646 (set_frame_buffer_list): Remove; unused.
13647 * frame.h (other_visible_frames): Remove decl.
13648 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13649 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13650 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13651 if HAVE_GPM.
13652 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13653 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13654 Define only if HAVE_GPM.
13655 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13656 (update_hints_inhibit): Remove; never set. All uses removed.
13657 * widgetprv.h (emacsFrameClassRec): Remove decl.
13658 * window.c (delete_deletable_window): Now returns void, since it
13659 wasn't returning anything.
13660 (compare_window_configurations): Remove unused locals.
13661 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13662 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
13663 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13664 the same widths as pointers. This follows up on the 2011-05-06 patch.
13665 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13666 * xterm.h: Likewise.
13667 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13668
1384b89e
JB
136692011-06-12 Juanma Barranquero <lekktu@gmail.com>
13670
13671 * makefile.w32-in: Update dependencies.
13672 (LISP_H): Add lib/intprops.h.
13673
1100a63c
CY
136742011-06-11 Chong Yidong <cyd@stupidchicken.com>
13675
13676 * image.c (gif_load): Add animation frame delay to the metadata.
13677 (syms_of_image): Use DEFSYM. New symbol `delay'.
13678
6198ccd0
MR
136792011-06-11 Martin Rudalics <rudalics@gmx.at>
13680
13681 * window.c (delete_deletable_window): Re-add.
13682 (Fset_window_configuration): Rewrite to handle dead buffers and
13683 consequently deletable windows.
13684 (window_tree, Fwindow_tree): Remove. Supply functionality in
13685 window.el.
13686 (compare_window_configurations): Simplify code.
13687
b6e3633c
AS
136882011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13689
1ab0dee5
AS
13690 * image.c (imagemagick_load_image): Fix type mismatch.
13691 (Fimagemagick_types): Likewise.
13692
b6e3633c
AS
13693 * window.h (replace_buffer_in_windows): Declare.
13694
9397e56f
MR
136952011-06-11 Martin Rudalics <rudalics@gmx.at>
13696
13697 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13698 Qclone_number. Remove external declaration of Qdelete_window.
13699 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13700 code.
640c8776
SM
13701 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13702 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
13703 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13704 buffer list implementation.
13705 (other_buffer_safely): New function.
13706 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13707 calls to replace_buffer_in_windows and
13708 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13709 if allowed.
13710 (record_buffer): Inhibit quitting and rewrite using quittable
13711 functions. Run Qbuffer_list_update_hook if allowed.
13712 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
13713 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13714 Move switch-to-buffer to window.el.
9397e56f
MR
13715 (bury-buffer): Move to window.el.
13716 (Vbuffer_list_update_hook): New variable.
13717
13718 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13719 section.
13720
13721 * window.h (resize_frame_windows): Move up in code.
13722 (Fwindow_frame): Remove EXFUN.
13723 (replace_buffer_in_all_windows): Remove prototype.
13724 (replace_buffer_in_windows_safely): Add prototype.
13725
13726 * window.c: Declare Qdelete_window static again. Move down
13727 declaration of select_count.
13728 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13729 (Fother_window): Move to window.el.
13730 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13731 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13732 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13733 window.el.
13734 (replace_buffer_in_windows): Implement by calling
13735 Qreplace_buffer_in_windows.
13736 (replace_buffer_in_all_windows): Remove with some functionality
13737 moved into replace_buffer_in_windows_safely.
13738 (replace_buffer_in_windows_safely): New function.
13739 (select_window_norecord, select_frame_norecord): Move in front
13740 of run_window_configuration_change_hook. Remove now obsolete
13741 declarations.
640c8776
SM
13742 (Fset_window_buffer): Rewrite doc-string.
13743 Call Qrecord_window_buffer.
9397e56f
MR
13744 (keys_of_window): Move binding for other-window to window.el.
13745
b50691aa
CY
137462011-06-11 Chong Yidong <cyd@stupidchicken.com>
13747
13748 * dispextern.h (struct image): Replace data member, whose int_val
13749 and ptr_val fields were not used by anything, with a single
13750 lisp_val object.
13751
13752 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13753 (gif_clear_image, gif_load, imagemagick_load_image)
13754 (gs_clear_image, gs_load): Callers changed.
13755
3f754b86
PE
137562011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13757
cca69397
PE
13758 * buffer.h: Include <time.h>, for time_t.
13759 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13760
109e28d0
PE
13761 Fix minor problems found by static checking.
13762
60737f02
PE
13763 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13764
4b66faf3
PE
13765 Make identifiers static if they are not used in other modules.
13766 * data.c (Qcompiled_function, Qframe, Qvector):
13767 * image.c (QimageMagick, Qsvg):
13768 * minibuf.c (Qmetadata):
13769 * window.c (resize_window_check, resize_root_window): Now static.
13770 * window.h (resize_window_check, resize_root_window): Remove decls.
13771
109e28d0
PE
13772 * window.c (window_deletion_count, delete_deletable_window):
13773 Remove; unused.
46a4ce9e
PE
13774 (window_body_lines): Now static.
13775 (Fdelete_other_windows_internal): Mark vars as initialized.
13776 Make sure 'resize_failed' is initialized.
13777 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13778 (resize_window_apply): Remove unused local.
13779 * window.h (delete_deletable_window): Remove decl.
13780
109e28d0 13781 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
13782 (imagemagick_load_image): Fix pointer signedness problem by changing
13783 last arg from unsigned char * to char *. All uses changed.
13784 Also, fix a local for similar reasons.
13785 Remove unused locals. Remove locals to avoid shadowing.
13786 (fn_rsvg_handle_free): Remove; unused.
13787 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 13788 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 13789
3f754b86
PE
13790 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13791
2547adb1
CY
137922011-06-10 Chong Yidong <cyd@stupidchicken.com>
13793
13794 * image.c (gif_load): Fix omitted cast error introduced by
13795 2011-06-06 change.
13796
2c8e37d4
MR
137972011-06-10 Martin Rudalics <rudalics@gmx.at>
13798
13799 * window.h (resize_proportionally, orig_total_lines)
13800 (orig_top_line): Remove from window structure.
13801 (set_window_height, set_window_width, change_window_heights)
13802 (Fdelete_window): Remove prototypes.
13803 (resize_frame_windows): Remove duplicate declaration.
13804
440a42e3
EZ
138052011-06-10 Eli Zaretskii <eliz@gnu.org>
13806
13807 * window.h (resize_frame_windows, resize_window_check)
13808 (delete_deletable_window, resize_root_window)
13809 (resize_frame_windows): Declare prototypes.
13810
13811 * window.c (resize_window_apply): Make definition be "static" to
13812 match the prototype.
13813
562dd5e9
MR
138142011-06-10 Martin Rudalics <rudalics@gmx.at>
13815
13816 * window.c: Remove declarations of Qwindow_size_fixed,
13817 window_min_size_1, window_min_size_2, window_min_size,
13818 size_window, window_fixed_size_p, enlarge_window, delete_window.
13819 Remove static from declaration of Qdelete_window, it's
13820 temporarily needed by Fbury_buffer.
13821 (replace_window): Don't assign orig_top_line and
13822 orig_total_lines.
13823 (Fdelete_window, delete_window): Remove. Window deletion is
13824 handled by window.el.
640c8776
SM
13825 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13826 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
13827 (Fdelete_other_windows): Remove. Deleting other windows is
13828 handled by window.el.
13829 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13830 handled in window.el.
13831 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13832 Window minimum sizes are handled in window.el.
13833 (shrink_windows, size_window, set_window_height)
13834 (set_window_width, change_window_heights, window_height)
13835 (window_width, CURBEG, CURSIZE, enlarge_window)
13836 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13837 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13838 handled in window.el.
13839 (make_dummy_parent): Rename to make_parent_window and give it a
13840 second argument horflag.
13841 (make_window): Don't set resize_proportionally any more.
13842 (Fsplit_window): Remove. Windows are split in window.el.
13843 (save_restore_action, save_restore_orig_size)
13844 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13845 Resize mini windows in window.el.
13846 (grow_mini_window, shrink_mini_window): Implement by calling
13847 Qresize_root_window_vertically, resize_window_check and
13848 resize_window_apply.
640c8776
SM
13849 (saved_window, Fset_window_configuration, save_window_save):
13850 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
13851 resize_proportionally.
13852 (window_min_height, window_min_width): Move to window.el.
13853 (keys_of_window): Move bindings for delete-other-windows,
13854 split-window, delete-window and enlarge-window to window.el.
13855
13856 * buffer.c: Temporarily extern Qdelete_window.
13857 (Fbury_buffer): Temporarily call Qdelete_window instead of
13858 Fdelete_window (Fbury_buffer will move to window.el soon).
13859
13860 * frame.c (set_menu_bar_lines_1): Remove code handling
13861 orig_top_line and orig_total_lines.
13862
13863 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13864 set_window_height but set heights directly.
13865 (change_frame_size_1): Use resize_frame_windows.
13866
13867 * xdisp.c (init_xdisp): Don't use set_window_height but set
13868 heights directly.
13869
640c8776
SM
13870 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13871 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
13872 run_window_configuration_change_hook.
13873
13874 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13875 instead of change_window_heights and run
13876 run_window_configuration_change_hook.
13877
1a13852e
MR
138782011-06-09 Martin Rudalics <rudalics@gmx.at>
13879
13880 * window.c (replace_window): Rename second argument REPLACEMENT to
13881 NEW. New third argument SETFLAG. Rewrite.
13882 (delete_window, make_dummy_parent): Call replace_window with
13883 third argument 1.
13884 (window_list_1): Move down in code.
13885 (run_window_configuration_change_hook): Move set_buffer part
13886 before select_frame_norecord part in order to unwind correctly.
13887 Rename count1 to count.
13888 (recombine_windows, delete_deletable_window, resize_root_window)
13889 (Fdelete_other_windows_internal)
13890 (Frun_window_configuration_change_hook, make_parent_window)
13891 (resize_window_check, resize_window_apply, Fresize_window_apply)
13892 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
13893 (Fdelete_window_internal, Fresize_mini_window_internal):
13894 New functions.
1a13852e
MR
13895 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13896
f3d1777e
MR
138972011-06-08 Martin Rudalics <rudalics@gmx.at>
13898
496e208e
MR
13899 * window.h (window): Add some new members to window structure -
13900 normal_lines, normal_cols, new_total, new_normal, clone_number,
13901 splits, nest, prev_buffers, next_buffers.
13902 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 13903 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 13904
f3d1777e
MR
13905 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13906 Remove.
496e208e
MR
13907 (make_dummy_parent): Set new members of windows structure.
13908 (make_window): Move down in code. Handle new members of window
13909 structure.
13910 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13911 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13912 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13913 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
13914 (Fset_window_next_buffers, Fset_window_clone_number):
13915 New functions.
496e208e
MR
13916 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13917 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13918 Doc-string fixes.
13919 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13920 Argument WINDOW can be now internal window too.
13921 (Fwindow_use_time): Move up in code.
13922 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13923 Rewrite doc-string.
13924 (Fset_window_configuration, saved_window)
13925 (Fcurrent_window_configuration, save_window_save): Handle new
13926 members of window structure.
b9e809c2
MR
13927 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13928 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13929 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13930 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13931 Qget_mru_window, Qresize_root_window,
13932 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13933 Qauto_buffer_name; staticpro them.
f3d1777e 13934
abde8f8c
MR
139352011-06-07 Martin Rudalics <rudalics@gmx.at>
13936
13937 * window.c (Fwindow_total_size, Fwindow_left_column)
13938 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13939 (Fwindow_list_1): New functions.
13940 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
13941 (Fwindow_width, Fscroll_left, Fscroll_right):
13942 Use window_body_cols instead of window_box_text_cols.
13943 (delete_window, Fset_window_configuration):
13944 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
13945 (delete_all_subwindows): Take a window as argument and not a
13946 structure. Rewrite.
190b47e6
MR
13947 (window_loop): Remove handling of GET_LRU_WINDOW and
13948 GET_LARGEST_WINDOW.
13949 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
13950
13951 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
13952 window_box_text_cols. delete_all_subwindows now takes a
13953 Lisp_Object as argument.
abde8f8c 13954
640c8776
SM
13955 * indent.c (compute_motion, Fcompute_motion):
13956 Use window_body_cols instead of window_box_text_cols.
abde8f8c 13957
fa8a67e6
MR
13958 * frame.c (delete_frame): Call delete_all_subwindows with root
13959 window as argument.
13960
a54e3482
DC
139612011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13962
13963 * fns.c (Fputhash): Document return value.
13964
60002bf5
CY
139652011-06-06 Chong Yidong <cyd@stupidchicken.com>
13966
13967 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13968
0c671da6 139692011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 13970
b862a52a 13971 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 13972
be44ca6c
PE
13973 Check for overflow when converting integer to cons and back.
13974 * charset.c (Fdefine_charset_internal, Fdecode_char):
13975 Use cons_to_unsigned to catch overflow.
13976 (Fencode_char): Use INTEGER_TO_CONS.
13977 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13978 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13979 * data.c (long_to_cons, cons_to_long): Remove.
13980 (cons_to_unsigned, cons_to_signed): New functions.
13981 These signal an error for invalid or out-of-range values.
13982 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13983 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13984 * font.c (Ffont_variation_glyphs):
13985 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13986 * lisp.h: Include <intprops.h>.
13987 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13988 (cons_to_signed, cons_to_unsigned): New decls.
13989 (long_to_cons, cons_to_long): Remove decls.
13990 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13991 (Fprimitive_undo): Use CONS_TO_INTEGER.
13992 * xfns.c (Fx_window_property): Likewise.
13993 * xselect.c: Include <limits.h>.
13994 (x_own_selection, selection_data_to_lisp_data):
13995 Use INTEGER_TO_CONS.
13996 (x_handle_selection_request, x_handle_selection_clear)
13997 (x_get_foreign_selection, Fx_disown_selection_internal)
13998 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13999 (lisp_data_to_selection_data): Use cons_to_unsigned.
14000 (x_fill_property_data): Use cons_to_signed.
14001 Report values out of range.
14002
d1f3d2af
PE
14003 Check for buffer and string overflow more precisely.
14004 * buffer.h (BUF_BYTES_MAX): New macro.
14005 * lisp.h (STRING_BYTES_MAX): New macro.
14006 * alloc.c (Fmake_string):
14007 * character.c (string_escape_byte8):
14008 * coding.c (coding_alloc_by_realloc):
14009 * doprnt.c (doprnt):
14010 * editfns.c (Fformat):
14011 * eval.c (verror):
14012 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14013 since they may not be the same number.
14014 * editfns.c (Finsert_char):
14015 * fileio.c (Finsert_file_contents):
14016 Likewise for BUF_BYTES_MAX.
14017
dd52fcea
PE
14018 * image.c: Use ptrdiff_t, not int, for sizes.
14019 (slurp_file): Switch from int to ptrdiff_t.
14020 All uses changed.
14021 (slurp_file): Check that file size fits in both size_t (for
14022 malloc) and ptrdiff_t (for sanity and safety).
14023
7f9bbdbb
PE
14024 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14025 if b->modtime has its maximal value.
14026
dfe18f82
PE
14027 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14028
84acfcf0
PE
14029 Don't assume time_t can fit into int.
14030 * buffer.h (struct buffer.modtime): Now time_t, not int.
14031 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14032 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14033
ccd9a01a
PE
14034 Minor fixes for signed vs unsigned integers.
14035 * character.h (MAYBE_UNIFY_CHAR):
14036 * charset.c (maybe_unify_char):
14037 * keyboard.c (read_char, reorder_modifiers):
14038 XINT -> XFASTINT, since the integer must be nonnegative.
14039 * ftfont.c (ftfont_spec_pattern):
14040 * keymap.c (access_keymap, silly_event_symbol_error):
14041 XUINT -> XFASTINT, since the integer must be nonnegative.
14042 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14043 since it makes no difference and we prefer signed.
14044 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14045 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14046 nonnegative.
14047
d6d100dd
SM
140482011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14049
14050 * window.h (Fwindow_frame): Declare.
14051
2b6148e4
PE
140522011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14053
14054 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14055 (SPARE_MEMORY): Always define.
14056 (LARGE_REQUEST): Remove.
14057 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14058
f230ecc9
MR
140592011-06-06 Martin Rudalics <rudalics@gmx.at>
14060
727e958e
MR
14061 * lisp.h: Move EXFUNS for Fframe_root_window,
14062 Fframe_first_window and Fset_frame_selected_window to window.h.
14063
14064 * window.h: Move EXFUNS for Fframe_root_window,
14065 Fframe_first_window and Fset_frame_selected_window here from
14066 lisp.h.
14067
14068 * frame.c (Fwindow_frame, Fframe_first_window)
14069 (Fframe_root_window, Fframe_selected_window)
14070 (Fset_frame_selected_window): Move to window.c.
14071 (Factive_minibuffer_window): Move to minibuf.c.
14072 (Fother_visible_frames_p): New function.
14073
14074 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14075
f230ecc9
MR
14076 * window.c (decode_window, decode_any_window): Move up in code.
14077 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14078 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14079 (Fwindow_buffer): Move up and rewrite doc-string.
14080 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14081 (Fwindow_prev): New functions.
727e958e
MR
14082 (Fwindow_frame): Move here from frame.c. Accept any window as
14083 argument.
14084 (Fframe_root_window, Fframe_first_window)
14085 (Fframe_selected_window): Move here from frame.c. Accept frame
14086 or arbitrary window as argument. Update doc-strings.
14087 (Fminibuffer_window): Move up in code.
14088 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14089 (Fset_frame_selected_window): Move here from frame.c.
14090 Marginal rewrite.
727e958e
MR
14091 (Fselected_window, select_window, Fselect_window): Move up in
14092 code. Minor doc-string fixes.
f230ecc9 14093
4d09bcf6
PE
140942011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14095
14096 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14097 Do not assume that spare memory exists; that assumption is valid
14098 only if SYSTEM_MALLOC.
14099 (LARGE_REQUEST): New macro, so that the issue of large requests
14100 is separated from the issue of spare memory.
14101
810928a2
AS
141022011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14103
172418ad
AS
14104 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14105 format. (Bug#8806)
14106
43f862f7
AS
14107 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14108
810928a2
AS
14109 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14110 before statements.
14111
a059fe24
JD
141122011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14113
14114 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14115
14116 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14117
14118 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14119 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14120
989bf368
JB
141212011-06-05 Juanma Barranquero <lekktu@gmail.com>
14122
14123 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14124
4b80f674
CY
141252011-06-04 Chong Yidong <cyd@stupidchicken.com>
14126
14127 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14128 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14129 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14130 New error handlers.
4b80f674
CY
14131 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14132 Obey Vx_select_enable_clipboard_manager. Catch errors in
14133 x_clipboard_manager_save (Bug#8779).
14134 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14135 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14136
99a33b77 141372011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14138
14139 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14140
99a33b77 141412011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14142
14143 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14144 in the current matrix if keep_current_p is non-zero.
14145
8264569d
EZ
141462011-06-04 Eli Zaretskii <eliz@gnu.org>
14147
14148 * bidi.c (bidi_level_of_next_char): Fix last change.
14149
57f97249
EZ
141502011-06-03 Eli Zaretskii <eliz@gnu.org>
14151
fec2107c 14152 Support bidi reordering of text covered by display properties.
57f97249 14153
fec2107c
EZ
14154 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14155 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14156 (bidi_cache_search, bidi_cache_iterator_state)
14157 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14158 (bidi_level_of_next_char, bidi_move_to_visually_next):
14159 Support character positions inside a run of characters covered by a
fec2107c
EZ
14160 display string.
14161 (bidi_paragraph_init, bidi_resolve_explicit_1)
14162 (bidi_level_of_next_char): Call bidi_fetch_char and
14163 bidi_fetch_char_advance instead of FETCH_CHAR and
14164 FETCH_CHAR_ADVANCE.
14165 (bidi_init_it): Initialize new members.
14166 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14167 definitions.
14168 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14169 instead of using explicit *_CHAR codes.
d6d100dd
SM
14170 (bidi_resolve_explicit, bidi_resolve_weak):
14171 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14172 bidirectional text is supported only in multibyte buffers.
14173 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14174 it to initialize the frame_window_p member of struct bidi_it.
14175 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14176 (bidi_resolve_explicit, bidi_resolve_weak)
14177 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14178 bidi_it->nchars is non-positive.
14179 (bidi_level_of_next_char): Don't try to lookup the cache for the
14180 next/previous character if nothing is cached there yet, or if we
14181 were just reseat()'ed to a new position.
c40e2fb2 14182
0e14fe90
EZ
14183 * xdisp.c (set_cursor_from_row): Set start and stop points
14184 according to the row's direction when priming the loop that looks
14185 for the glyph on which to display cursor.
14186 (single_display_spec_intangible_p): Function deleted.
14187 (display_prop_intangible_p): Reimplement to call
14188 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14189 Accept 3 additional arguments needed by handle_display_spec.
14190 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14191 values: lists, `(when COND...)' forms, etc.
14192 (single_display_spec_string_p): Support property values that are
14193 lists with the argument STRING its top-level element.
14194 (display_prop_string_p): Fix the condition for processing a
14195 property that is a list to be consistent with handle_display_spec.
fec2107c 14196 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14197 last portion of handle_display_prop.
14198 (compute_display_string_pos): Accept additional argument
14199 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14200 value of a `display' property is a "replacing spec".
14201 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14202 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14203 the display property, but just return a value indicating whether
14204 the display property will replace the characters it covers.
14205 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14206 frame_window_p members of struct bidi_it.
d6d100dd
SM
14207 (compute_display_string_pos, compute_display_string_end):
14208 New functions.
fec2107c
EZ
14209 (push_it): Accept second argument POSITION, where pop_it should
14210 jump to continue iteration.
14211 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14212
fec2107c
EZ
14213 * keyboard.c (adjust_point_for_property): Adjust the call to
14214 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14215
14216 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14217 (bidi_init_it): Update prototypes.
14218 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14219 (compute_display_string_pos, compute_display_string_end):
14220 Declare prototypes.
fec2107c
EZ
14221 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14222 EMACS_INT.
fc6f18ce 14223
40087514 142242011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14225
57f53182
PE
14226 Malloc failure behavior now depends on size of allocation.
14227 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14228 * lisp.h: Change signatures accordingly.
14229 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14230 All callers changed. (Bug#8762)
14231
14232 * gnutls.c: Use Emacs's memory allocators.
14233 Without this change, the gnutls library would invoke malloc etc.
14234 directly, which causes problems on non-SYNC_INPUT hosts, and which
14235 runs afoul of improving memory_full behavior. (Bug#8761)
14236 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14237 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14238 xfree instead of the default malloc, realloc, free.
14239 (Fgnutls_boot): No need to check for memory allocation failure,
14240 since xmalloc does that for us.
14241
ac32cd99 14242 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14243 * category.c (hash_get_category_set):
14244 * ccl.c (ccl_driver):
14245 * charset.c (Fdefine_charset_internal):
14246 * charset.h (struct charset.hash_index):
14247 * composite.c (get_composition_id, gstring_lookup_cache)
14248 (composition_gstring_put_cache):
14249 * composite.h (struct composition.hash_index):
14250 * dispextern.h (struct image.hash):
14251 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14252 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14253 (hashfn_equal, hashfn_user_defined, make_hash_table)
14254 (maybe_resize_hash_table, hash_lookup, hash_put)
14255 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14256 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14257 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14258 * image.c (make_image, search_image_cache, lookup_image)
14259 (xpm_put_color_table_h):
14260 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14261 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14262 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14263 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14264 * alloc.c (allocate_vectorlike):
14265 Check for overflow in vector size calculations.
14266 * ccl.c (ccl_driver):
14267 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14268 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14269 need to be updated by these changes.
40087514
PE
14270 * fns.c (make_hash_table, maybe_resize_hash_table):
14271 Check for integer overflow with large hash tables.
0de4bb68
PE
14272 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14273 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14274 (SXHASH_REDUCE): New macro.
14275 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14276 Use it instead of discarding useful hash info with large hash values.
14277 (sxhash_float): New function.
14278 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14279 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14280 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14281 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14282 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14283 Adjust signatures to match updated version of code.
14284 (consing_since_gc): Now EMACS_INT, since a single hash table can
14285 use more than INT_MAX bytes.
14286
698d32e2
DN
142872011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14288
14289 Make it possible to build with GCC-4.6+ -O2 -flto.
14290
14291 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14292
fd6fa53f
SM
142932011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14294
14295 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14296 Call minibuffer-inactive-mode.
14297
864db017
JB
142982011-05-31 Juanma Barranquero <lekktu@gmail.com>
14299
14300 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14301 Update dependencies.
14302
2ad0baf4
DN
143032011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14304
14305 * data.c (init_data): Remove code for UTS, this system is not
14306 supported anymore.
14307
4fcc2638
DN
143082011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14309
14310 Don't force ./temacs to start in terminal mode.
14311
14312 * frame.c (make_initial_frame): Initialize faces in all cases, not
14313 only when CANNOT_DUMP is defined.
14314 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14315
c56e0fd5
DN
143162011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14317
14318 * dispnew.c (add_window_display_history): Use const for the string
14319 pointer. Remove declaration, not needed.
14320
333d54da 143212011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14322
55d4c1b2 14323 Use 'inline', not 'INLINE'.
333d54da 14324 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14325 * alloc.c, fontset.c (INLINE): Remove.
14326 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14327 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14328 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14329 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14330 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14331
738db178
DN
143322011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14333
14334 Make it possible to run ./temacs.
14335
14336 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14337 syms_of_callproc does the same thing. Remove test for
14338 "initialized", do it in the caller.
14339 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14340
620c53a6
SM
143412011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14342
14343 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14344 (read_minibuf): Use get_minibuffer.
14345 (syms_of_minibuf): Use DEFSYM.
14346 (Qmetadata): New var.
14347 * data.c (Qbuffer): Don't make it static.
14348 (syms_of_data): Use DEFSYM.
14349
e003a292
PE
143502011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14351
14352 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14353 (CCL_CODE_MIN): New macro.
14354
ed008a6d
PE
143552011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14356
3687c2ef
PE
14357 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14358
ed008a6d
PE
14359 * eval.c (Qdebug): Now static.
14360 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14361 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14362 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14363
d66c4c7c
CY
143642011-05-29 Chong Yidong <cyd@stupidchicken.com>
14365
14366 * image.c: Various fixes to ImageMagick code comments.
14367 (Fimagemagick_types): Doc fix.
14368
5fbc2025
PE
143692011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14370
0196f88a
PE
14371 Minor fixes prompted by GCC 4.6.0 warnings.
14372
14373 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14374
5fbc2025
PE
14375 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14376 (x_clipboard_manager_save_all): Move extern decl to ...
14377 * xterm.h: ... here, so that it can be checked for consistency.
14378
1dd3c2d9
CY
143792011-05-29 Chong Yidong <cyd@stupidchicken.com>
14380
14381 * xselect.c (x_clipboard_manager_save_frame)
14382 (x_clipboard_manager_save_all): New functions.
14383 (Fx_clipboard_manager_save): Lisp function deleted.
14384
14385 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14386 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14387
14388 * xterm.h: Update prototype.
14389
5ba6571d
WX
143902011-05-28 William Xu <william.xwl@gmail.com>
14391
14392 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14393 exiting (Bug#8239).
14394
3eaff834
JM
143952011-05-28 Jim Meyering <meyering@redhat.com>
14396
e1900994 14397 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14398 * fns.c (to_uchar): Define.
14399 (crypto_hash_function): Use it to convert some newly-signed
14400 variables to unsigned, to avoid sign-extension bugs. For example,
14401 without this change, (md5 "truc") would evaluate to
14402 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14403 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14404 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14405
0f6990a7
PE
144062011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14407
14408 Integer overflow fixes.
c8a9ca5a 14409
08686060
PE
14410 * dbusbind.c: Serial number integer overflow fixes.
14411 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14412 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14413 to hold a serial number that is too large for a fixnum.
14414 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14415 Check for serial numbers out of range. Decode any serial number
59568bf0 14416 that was so large that it became a float. (Bug#8722)
08686060 14417
2d1fc3c7
PE
14418 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14419 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14420 Use XFASTINT rather than XUINT when numbers are nonnegative.
14421 (xd_append_arg, Fdbus_method_return_internal):
14422 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14423 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14424 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14425 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14426 (Bug#8722)
2d1fc3c7 14427
c8a9ca5a
PE
14428 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14429
519e1d69
PE
14430 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14431
6df6ae42 14432 ccl: Add integer overflow checks.
30569699
PE
14433 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14434 (IN_INT_RANGE): New macros.
14435 (ccl_driver): Use them to check for integer overflow when
14436 decoding a CCL program. Many of the new checks are whether XINT (x)
14437 fits in int; it doesn't always, on 64-bit hosts. The new version
14438 doesn't catch all possible integer overflows, but it's an
847044ea 14439 improvement. (Bug#8719)
30569699 14440
c11285dc
PE
14441 * alloc.c (make_event_array): Use XINT, not XUINT.
14442 There's no need for unsigned here.
14443
fdccd48e
PE
14444 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14445 This follows up to the 2011-05-06 change that substituted uintptr_t
14446 for EMACS_INT. This case wasn't caught back then.
14447
37910ab2
PE
14448 Rework Fformat to avoid integer overflow issues.
14449 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14450 now (part of C89). Include <verify.h>.
14451 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14452 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14453 (Fformat): Avoid the prepass trying to compute sizes; it was only
14454 approximate and thus did not catch overflow reliably. Instead, walk
14455 through the format just once, formatting and computing sizes as we go,
14456 checking for integer overflow at every step, and allocating a larger
14457 buffer as needed. Keep track separately whether the format is
14458 multibyte. Keep only the most-recently calculated precision, rather
14459 than them all. Record whether each argument has been converted to
14460 string. Use EMACS_INT, not int, for byte and char and arg counts.
14461 Support field widths and precisions larger than INT_MAX. Avoid
14462 sprintf's undefined behavior with conversion specifications such as %#d
14463 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14464 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14465 formatting out-of-range floating point numbers with int
9173deec 14466 formats. (Bug#8668)
37910ab2 14467
2e6578fb
PE
14468 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14469
0ae6bdee
PE
14470 * data.c: Avoid integer truncation in expressions involving floats.
14471 * data.c: Include <intprops.h>.
14472 (arith_driver): When there's an integer overflow in an expression
14473 involving floating point, convert the integers to floating point
14474 so that the resulting value does not suffer from catastrophic
14475 integer truncation. For example, on a 64-bit host (* 4
14476 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14477 Do not rely on undefined behavior after integer overflow.
14478
de883a70
PE
14479 merge count_size_as_multibyte, parse_str_to_multibyte
14480 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14481 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14482 Check for integer overflow.
14483 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14484 since it's now a duplicate of the other. This is more of
14485 a character than a buffer op, so better that it's in character.c.
14486 * fns.c, print.c: Adjust to above changes.
14487
2ff916cb
PE
144882011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14489
14490 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14491
f1b54466
PE
144922011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14493
fb1ac845
PE
14494 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14495 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14496 (x_clipboard_manager_save): Now static.
14497 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14498
f1b54466
PE
14499 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14500 (crypto_hash_function): Now static.
14501 Fix pointer signedness problems. Avoid unnecessary initializations.
14502
a9f737ee
CY
145032011-05-27 Chong Yidong <cyd@stupidchicken.com>
14504
14505 * termhooks.h (Vselection_alist): Make it terminal-local.
14506
14507 * terminal.c (create_terminal): Initialize it.
14508
14509 * xselect.c: Support for clipboard managers.
14510 (Vselection_alist): Move to termhooks.h as terminal-local var.
14511 (LOCAL_SELECTION): New macro.
14512 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14513 (symbol_to_x_atom): Remove gratuitous arg.
14514 (x_handle_selection_request, lisp_data_to_selection_data)
14515 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14516 (x_own_selection, x_get_local_selection, x_convert_selection):
14517 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14518 (some_frame_on_display): Delete unused function.
14519 (Fx_own_selection_internal, Fx_get_selection_internal)
14520 (Fx_disown_selection_internal, Fx_selection_owner_p)
14521 (Fx_selection_exists_p): New optional frame arg.
14522 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14523 (x_handle_selection_clear): Don't treat other terminals with the
14524 same keyboard specially. Use the terminal-local Vselection_alist.
14525 (x_clear_frame_selections): Use Frun_hook_with_args.
14526
14527 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14528
14529 * xterm.h: Add support for those atoms.
14530
e067f0c1
CY
145312011-05-26 Chong Yidong <cyd@stupidchicken.com>
14532
14533 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14534 (converted_selections, conversion_fail_tag): New global variables.
14535 (x_selection_request_lisp_error): Free the above.
14536 (x_get_local_selection): Remove unnecessary code.
14537 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14538 of converted selections stored in converted_selections.
14539 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14540 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14541 (x_convert_selection): New function.
14542 (x_handle_selection_event): Simplify.
14543 (x_get_foreign_selection): Don't ignore incoming requests while
14544 waiting for an answer; this will fail when we implement
14545 SAVE_TARGETS, and seems unnecessary anyway.
14546 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14547 (Vx_sent_selection_functions): Doc fix.
14548
0f4aebc0
LL
145492011-05-26 Leo Liu <sdl.web@gmail.com>
14550
14551 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14552
e61124cd
YM
145532011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14554
14555 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14556
14557 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14558 for fringe update if it has periodic bitmap.
ac389d0c 14559 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14560 and fringe_bitmap_periodic_p.
14561
14562 * fringe.c (get_fringe_bitmap_data): New function.
14563 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14564 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14565 row. Mark glyph row for fringe update if periodicity changed.
14566
14567 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14568 for fringe update unless it has periodic bitmap.
14569
f16d9837
KH
145702011-05-25 Kenichi Handa <handa@m17n.org>
14571
14572 * xdisp.c (get_next_display_element): Set correct it->face_id for
14573 a static composition.
14574
e1b90ef6
LL
145752011-05-24 Leo Liu <sdl.web@gmail.com>
14576
14577 * deps.mk (fns.o):
14578 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14579
14580 * fns.c (crypto_hash_function, Fsha1): New function.
14581 (Fmd5): Use crypto_hash_function.
14582 (syms_of_fns): Add Ssha1.
14583
7400048f
PE
145842011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14585
14586 * gnutls.c: Remove unused macros.
14587 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14588 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14589 Remove macros that are defined and never used.
14590 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14591
abb71cf4
CY
145922011-05-22 Chong Yidong <cyd@stupidchicken.com>
14593
14594 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14595 (Fx_get_selection_internal): Minor cleanup.
14596 (Fx_own_selection_internal): Rename arguments for consistency with
14597 select.el.
14598
6307db39
PE
145992011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14600
14601 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14602
f3d4e0a4
CY
146032011-05-22 Chong Yidong <cyd@stupidchicken.com>
14604
14605 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14606
4d8ade89
YM
146072011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14608
14609 * dispnew.c (scrolling_window): Don't exclude the case that the
14610 last enabled row in the desired matrix touches the bottom boundary.
14611
32078c8d
GM
146122011-05-21 Glenn Morris <rgm@gnu.org>
14613
14614 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
14615 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14616 and add some more files.
32078c8d 14617
7285dc67
EZ
146182011-05-20 Eli Zaretskii <eliz@gnu.org>
14619
14620 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14621 report_file_error introduced by the change from 2011-05-07.
14622
89d1bd22
PE
146232011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14624
14625 * systime.h (Time): Define only if emacs is defined.
14626 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14627 where the include path doesn't have X11/X.h by default. See
14628 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14629
cd394be1 146302011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
14631
14632 * composite.c (find_automatic_composition): Fix previous change.
14633
b9704ad9
GM
146342011-05-20 Glenn Morris <rgm@gnu.org>
14635
14636 * lisp.mk: New file, split from Makefile.in.
14637 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14638 (shortlisp): Remove.
14639 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14640
4a720484
GM
146412011-05-19 Glenn Morris <rgm@gnu.org>
14642
14643 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14644 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14645 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14646 (lisp): Set the order to that of loadup.el.
14647 (shortlisp): Make it a copy of $lisp.
14648 (SOME_MACHINE_LISP): Remove.
14649 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14650 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14651
a28d4396
KH
146522011-05-18 Kenichi Handa <handa@m17n.org>
14653
14654 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14655 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14656 (find_automatic_composition): Mostly rewrite for efficiency.
14657
a2b1fa8e
JB
146582011-05-18 Juanma Barranquero <lekktu@gmail.com>
14659
14660 * makefile.w32-in: Update dependencies.
14661
8e1f5610
CS
146622011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14663
14664 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 14665 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 14666
7025ee00 146672011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 14668
cdfa6eab
PE
14669 Fix some integer overflow issues, such as string length overflow.
14670
06d6db33
PE
14671 * insdel.c (count_size_as_multibyte): Check for string overflow.
14672
2b4560a8
PE
14673 * character.c (lisp_string_width): Check for string overflow.
14674 Use EMACS_INT, not int, for string indexes and lengths; in
14675 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14676 the resulting string length overflows an EMACS_INT; instead,
14677 report a string overflow if no precision given. When checking for
14678 precision exhaustion, use a check that cannot possibly have
14679 integer overflow. (Bug#8675)
14680 * character.h (lisp_string_width): Adjust to new signature.
14681
cb93f9be
PE
14682 * alloc.c (string_overflow): New function.
14683 (Fmake_string): Use it. This doesn't change behavior, but saves
14684 a few bytes and will simplify future changes.
14685 * character.c (string_escape_byte8): Likewise.
14686 * lisp.h (string_overflow): New decl.
14687
1a1f3366
PE
14688 Fixups, following up to the user-interface timestamp change.
14689 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14690 for UI timestamps, instead of unsigned long.
9fbd6841
PE
14691 * msdos.c (mouse_get_pos): Likewise.
14692 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
14693 * w32gui.h (Time): Define by including "systime.h" rather than by
14694 declaring it ourselves. (Bug#8664)
14695
d4e3e4d3
PE
14696 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14697 * image.c (clear_image_cache): Likewise.
14698
f6a24d19
PE
14699 * term.c (term_mouse_position): Don't assume time_t wraparound.
14700
08dc5ae6
PE
14701 Be more systematic about user-interface timestamps.
14702 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
14703 and sometimes 'EMACS_UINT', to represent these timestamps.
14704 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
14705 This makes the code easier to follow, and makes it easier to catch
14706 integer overflow bugs such as Bug#8664.
14707 * frame.c (Fmouse_position, Fmouse_pixel_position):
14708 Use Time, not unsigned long, for user-interface timestamps.
14709 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14710 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14711 * keyboard.h (last_event_timestamp): Likewise.
14712 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14713 * menu.h (xmenu_show): Likewise.
14714 * term.c (term_mouse_position): Likewise.
14715 * termhooks.h (struct input_event.timestamp): Likewise.
14716 (struct terminal.mouse_position_hook): Likewise.
14717 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14718 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14719 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14720 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14721 what it was before.
14722 * menu.h, termhooks.h: Include "systime.h", for Time.
14723
8e55734a
PE
14724 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14725 Don't assume that the difference between two unsigned long values
14726 can fit into an integer. At this point, we know button_down_time
14727 <= event->timestamp, so the difference must be nonnegative, so
14728 there's no need to cast the result if double-click-time is
14729 nonnegative, as it should be; check that it's nonnegative, just in
14730 case. This bug is triggered when events are more than 2**31 ms
86db42d2 14731 apart (about 25 days). (Bug#8664)
8e55734a 14732
841f1b75 14733 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 14734 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 14735
3e26f69c
PE
14736 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14737 that always fit in int. Use a sentinel instead of a counter, to
14738 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
14739 * frame.h (struct frame): Use int for menu_bar_items_used
14740 instead of EMACS_INT, since it always fits in int.
3e26f69c 14741
5cc152c0
PE
14742 * menu.c (grow_menu_items): Check for int overflow.
14743
d89eb65e
PE
14744 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14745
5235bd3e
PE
14746 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14747 Before, the code was not consistent. These values cannot exceed
14748 2**31 - 1 so there's no need to make them unsigned.
14749 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14750 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14751 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14752 as modifiers.
14753 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14754
bc827e23
PE
14755 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14756 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14757 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14758 presumably because the widths might not match.
14759
78eb494e
PE
14760 * window.c (size_window): Avoid needless test at loop start.
14761
04f2d78b
CB
147622011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14763
14764 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14765
d2fc7e3d 147662011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
14767
14768 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14769
d2fc7e3d 147702011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
14771
14772 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14773 `width' to `bar_area_x' and `bar_area_width', respectively.
14774 (x_scroll_run): Take account of fringe background extension.
14775
04f2d78b
CB
14776 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14777 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
14778 `bar_area_width', respectively.
14779 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14780 background extension.
14781
79b70037
GM
147822011-05-10 Jim Meyering <meyering@redhat.com>
14783
14784 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14785
2f142cc5
JB
147862011-05-10 Juanma Barranquero <lekktu@gmail.com>
14787
14788 * image.c (Finit_image_library): Return t for built-in image types,
14789 like pbm and xbm. (Bug#8640)
14790
57679c86
AS
147912011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14792
14793 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14794
888c9e86
EZ
147952011-05-07 Eli Zaretskii <eliz@gnu.org>
14796
b0512a1d
EZ
14797 * w32console.c (Fset_screen_color): Doc fix.
14798 (Fget_screen_color): New function.
14799 (syms_of_ntterm): Defsubr it.
14800
7285dc67
EZ
14801 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14802 unlink the temporary file if Fcall_process didn't create it in the
14803 first place.
14804 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14805 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
14806 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14807 cue to call_process_cleanup not to close that handle.
14808
4d3fcc8e
BK
148092011-05-07 Ben Key <bkey76@gmail.com>
14810
14811 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14812 one of two shell specific rules, either bootstrap-temacs-CMD or
14813 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14814 to the previous implementation of the bootstrap-temacs rule.
14815 The bootstrap-temacs-CMD rule is similar to the previous
14816 implementation of the bootstrap-temacs rule except that it
14817 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14818 variable.
14819
14820 These changes, along with some changes to nt/configure.bat,
14821 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14822 earlier fix to add support for --cflags and --ldflags options
14823 that include quotes so that it works whether make uses cmd or
14824 sh as the shell.
14825
b4289b64
MA
148262011-05-06 Michael Albinus <michael.albinus@gmx.de>
14827
14828 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14829 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14830 is a constant.
14831 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14832 a string. Handle both cases.
14833 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14834 (Fdbus_register_method): Use Qinvalid_function.
14835
af4c0e28
JB
148362011-05-06 Juanma Barranquero <lekktu@gmail.com>
14837
14838 * makefile.w32-in: Update dependencies.
14839 (LISP_H): Add inttypes.h and stdin.h.
14840 (PROCESS_H): Add unistd.h.
14841
c51453d9
EZ
148422011-05-06 Eli Zaretskii <eliz@gnu.org>
14843
14844 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14845 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14846
8ff0ac3c 148472011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 14848
4c4b566b
PE
14849 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14850
aab2b9b5
PE
14851 * term.c (vfatal): Remove stray call to va_end.
14852 It's not needed and the C Standard doesn't allow it here anyway.
14853
c378da0b
PE
14854 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14855 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14856
288b08c7
PE
14857 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14858 bytes.
14859
e3601888
PE
14860 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14861
db6c0e74
PE
14862 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14863
dd5963ea
PE
14864 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14865
88c9450f
PE
14866 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14867
2f9442b8
PE
14868 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14869
c032b5f8
PE
14870 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14871 * charset.c (Fdefine_charset_internal): Don't initialize
14872 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 14873 32-bit int (Bug#8600).
a108c10b
PE
14874
14875 * lread.c (read_integer): Be more consistent with string-to-number.
14876 Use string_to_number to do the actual conversion; this avoids
14877 rounding errors and fixes some other screwups. Without this fix,
14878 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14879 (digit_to_number): Move earlier, for benefit of read_integer.
14880 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 14881 not a digit in any supported base. (Bug#8602)
a108c10b 14882
ad5f9eea
PE
14883 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14884
aec1708a
PE
14885 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14886 to match comment at start of function. This also removes a
14887 GCC warning about overflow in a 32+64-bit port.
14888
47be4ab5
PE
14889 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14890
371cac43
PE
14891 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14892 Reported by Stefan Monnier in
14893 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
14894 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14895 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 14896
d01a7826
PE
14897 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14898 (EMACS_UINTPTR): Likewise, with uintptr_t.
14899
7fd47d5c
PE
14900 * lisp.h: Prefer 64-bit EMACS_INT if available.
14901 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14902 on 32-bit hosts that have 64-bit int, so that they can access
14903 large files.
122b0c86
PE
14904 However, temporarily disable this change unless the temporary
14905 symbol WIDE_EMACS_INT is defined.
7fd47d5c 14906
8727937b
PE
14907 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14908
8ac068ac
PE
14909 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14910 This removes an assumption that EMACS_INT and long are the same
14911 width as pointers. The assumption is true for Emacs porting targets
14912 now, but we want to make other targets possible.
14913 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14914 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14915 In the rest of the code, change types of integers that hold casted
14916 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14917 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14918 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14919 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14920 No need to cast type when ORing.
14921 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14922 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14923 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14924 assume EMACS_INT is the same width as char *.
14925 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14926 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14927 Remove no-longer-needed casts.
14928 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14929 (xg_tool_bar_help_callback, xg_make_tool_item):
14930 Use EMACS_INTPTR to hold an integer
14931 that will be cast to void *; this can avoid a GCC warning
14932 if EMACS_INT is not the same width as void *.
14933 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14934 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14935 (current_message_1, set_message_1):
14936 Use a local to convert to proper width without a cast.
14937 * xmenu.c (dialog_selection_callback): Likewise.
14938
ede49d71
PE
14939 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14940 Also, don't assume VALBITS / RAND_BITS is less than 5,
14941 and don't rely on undefined behavior when shifting a 1 left into
14942 the sign bit.
14943 * lisp.h (get_random): Change signature to match.
14944
2f30ecd0
PE
14945 * lread.c (hash_string): Use size_t, not int, for hash computation.
14946 Normally we prefer signed values; but hashing is special, because
14947 it's better to use unsigned division on hash table sizes so that
14948 the remainder is nonnegative. Also, size_t is the natural width
14949 for hashing into memory. The previous code used 'int', which doesn't
14950 retain enough info to hash well into very large tables.
14951 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14952
2a866e7b
PE
14953 * dbusbind.c: Don't possibly lose pointer info when converting.
14954 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14955 Use XPNTR rather than XHASH, so that the high-order bits of
14956 the pointer aren't lost when converting through void *.
14957
51639eac
PE
14958 * eval.c (Fautoload): Don't double-shift a pointer.
14959
92394119
PE
14960 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14961
dbdb9a7c
JB
149622011-05-06 Juanma Barranquero <lekktu@gmail.com>
14963
14964 * gnutls.c (DEF_GNUTLS_FN):
14965 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14966
db7a0b4f
AS
149672011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14968
14969 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14970 marker. (Bug#8610)
14971
cd394be1 149722011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
14973
14974 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14975 New version that can reserve upto 2GB of heap space.
14976
f7ff1b0f 149772011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
14978
14979 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14980
639c109b
TZ
149812011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14982
14983 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14984 `gnutls_certificate_set_x509_key_file'.
14985
d2127135
JB
149862011-05-05 Juanma Barranquero <lekktu@gmail.com>
14987
14988 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14989 Update dependencies.
14990
e968f4f3
JB
149912011-05-04 Juanma Barranquero <lekktu@gmail.com>
14992
14993 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14994 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14995 Remove unused parameter `fildes'.
14996 * process.c (read_process_output, send_process): Don't pass it.
14997
84d358f0
JB
149982011-05-04 Juanma Barranquero <lekktu@gmail.com>
14999
15000 Fix previous change: the library cache is defined in w32.c.
15001 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15002 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15003
0898ca10
JB
150042011-05-04 Juanma Barranquero <lekktu@gmail.com>
15005
15006 Implement dynamic loading of GnuTLS on Windows.
15007
15008 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15009 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15010 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15011 Declare.
15012
15013 * gnutls.c (Qgnutls_dll): Define.
15014 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15015 (gnutls_*): Declare function pointers.
15016 (init_gnutls_functions): New function to initialize function pointers.
15017 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15018 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15019 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15020 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15021 (emacs_gnutls_write, emacs_gnutls_read)
15022 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15023 (Fgnutls_available_p): New function.
15024 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15025 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15026 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15027
15028 * image.c: Include w32.h.
15029 (Vimage_type_cache): Delete.
15030 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15031 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15032 (w32_delayed_load): Move to w32.c.
15033
15034 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15035
15036 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15037 (w32_delayed_load): Move from image.c. When loading a library, record
15038 its filename in the :loaded-from property of the library id.
15039 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15040 Initialize and staticpro them.
15041 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15042
15043 * process.c: Include lisp.h before w32.h, not after.
15044 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15045 instead of gnutls_record_check_pending.
15046
15047 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15048
ff4de4aa
TZ
150492011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15050
15051 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15052 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15053 as passed in.
15054
abe95abb
JD
150552011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15056
15057 * xterm.c (x_set_frame_alpha): Do not set property on anything
15058 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15059
e16e55d4
JB
150602011-05-02 Juanma Barranquero <lekktu@gmail.com>
15061
15062 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15063
bafcf6a5
JB
150642011-05-02 Juanma Barranquero <lekktu@gmail.com>
15065
15066 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15067 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15068 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15069 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15070 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15071 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15072 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15073 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15074 (Qgnutls_bootprop_callbacks_verify): Make static.
15075
e7a6747f
AS
150762011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15077
19ed11ba
AS
15078 * callproc.c: Indentation fixup.
15079
e7a6747f 15080 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15081 (wait_for_termination, interruptible_wait_for_termination):
15082 Move after wait_for_termination_1.
e7a6747f 15083
1ef14cb4
LMI
150842011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15085
15086 * sysdep.c (interruptible_wait_for_termination): New function
15087 which is like wait_for_termination, but allows keyboard
15088 interruptions.
15089
15090 * callproc.c (Fcall_process): Add (:file "file") as an option for
15091 the STDOUT buffer.
15092 (Fcall_process_region): Ditto.
15093
330d880c
EZ
150942011-04-30 Eli Zaretskii <eliz@gnu.org>
15095
8db90b73
EZ
15096 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15097 rather than `XVECTOR (FOO)->size'.
15098
330d880c
EZ
15099 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15100 inttypes.h, as a gnulib replacement is used if it not available in
15101 system headers.
15102
15cbd324
EZ
151032011-04-21 Eli Zaretskii <eliz@gnu.org>
15104
15105 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15106 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15107 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15108
15109 * coding.c (coding_alloc_by_realloc): Error out if destination
15110 will grow beyond MOST_POSITIVE_FIXNUM.
15111 (decode_coding_emacs_mule): Abort if there isn't enough place in
15112 charbuf for the composition carryover bytes. Reserve an extra
15113 space for up to 2 characters produced in a loop.
15114 (decode_coding_iso_2022): Abort if there isn't enough place in
15115 charbuf for the composition carryover bytes.
15116
151172011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15118
ae940cca
EZ
15119 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15120 aborting when %lld or %lll format is passed.
15121 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15122 %llo or %llx format is passed. (Bug#8545)
15123
03ab8921
EZ
15124 * window.c (window_scroll_line_based): Use a marker instead of
15125 simple variables to record original value of point. (Bug#7952)
15126
afda1437
EZ
15127 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15128 produced by %s or %c overflows available buffer space. (Bug#8545)
15129
f76dee0c
PE
151302011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15131
15132 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15133 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15134
fdc5744d
JB
151352011-04-28 Juanma Barranquero <lekktu@gmail.com>
15136
15137 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15138
638f053a
JB
151392011-04-28 Juanma Barranquero <lekktu@gmail.com>
15140
15141 * keyboard.c (Qdelayed_warnings_hook): Define.
15142 (command_loop_1): Run `delayed-warnings-hook'
15143 if Vdelayed_warnings_list is non-nil.
15144 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15145 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15146
d178f871
EZ
151472011-04-28 Eli Zaretskii <eliz@gnu.org>
15148
15149 * doprnt.c (doprnt): Don't return value smaller than the buffer
15150 size if the message was truncated. (Bug#8545).
15151
b124fd93
JB
151522011-04-28 Juanma Barranquero <lekktu@gmail.com>
15153
15154 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15155 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15156
e810457d
PE
151572011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15158
15159 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15160
ea51cceb
JB
151612011-04-27 Juanma Barranquero <lekktu@gmail.com>
15162
15163 * makefile.w32-in: Update dependencies.
15164
94dcfacf
EZ
151652011-04-27 Eli Zaretskii <eliz@gnu.org>
15166
15167 Improve `doprnt' and its usage. (Bug#8545)
15168 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15169 `format_end'. Remove support for %l as a conversion specifier.
15170 Don't use xrealloc. Improve diagnostics when the %l size modifier
15171 is used. Update the commentary.
15172
15173 * eval.c (verror): Simplify calculation of size_t.
15174
15175 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15176 messages.
15177
f61f41d7
PE
151782011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15179
15180 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15181 change.
15182
96fb4434
PE
151832011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15184
15185 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15186 This makes this file independent of the recent pseudovector change.
15187
671875da 151882011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15189
69e9b5a3
PE
15190 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15191
b5f869a7 15192 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15193 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15194 Remove unused local.
c8926152 15195 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15196
841a1577 15197 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15198 GCC 4.6.0 optimizes based on type-based alias analysis.
15199 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15200 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15201 != &v->size, and therefore "v->size = 1; b->size = 2; return
15202 v->size;" must therefore return 1. This assumption is incorrect
15203 for Emacs, since it type-puns struct Lisp_Vector * with many other
15204 types. To fix this problem, this patch adds a new type struct
f904488f 15205 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15206 and pseudovectors, and helps optimizing compilers not get fooled
15207 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15208 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15209 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15210 the size member.
eab3844f
PE
15211 (XSETPVECTYPE): Rewrite in terms of new macro.
15212 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15213 This is a bit clearer, and further avoids the possibility of
15214 undesirable aliasing.
15215 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15216 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15217 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15218 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15219 (ASIZE): Now uses header.size rather than size.
15220 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15221 to avoid the hassle of writing XVECTOR (foo)->header.size.
15222 (struct vectorlike_header): New type.
eab3844f
PE
15223 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15224 object, to help avoid aliasing.
15225 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15226 (SUBRP): Likewise, since Lisp_Subr is a special case.
15227 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15228 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15229 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15230 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15231 changed to be "header.size" and "header.next".
15232 * buffer.h (struct buffer): Likewise.
15233 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15234 * frame.h (struct frame): Likewise.
15235 * process.h (struct Lisp_Process): Likewise.
15236 * termhooks.h (struct terminal): Likewise.
15237 * window.c (struct save_window_data, struct saved_window): Likewise.
15238 * window.h (struct window): Likewise.
15239 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15240 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15241 * buffer.c (init_buffer_once): Likewise.
15242 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15243 special case.
15244 * process.c (Fformat_network_address): Use local var for size,
15245 for brevity.
15246
0df1eac5
PE
15247 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15248
847ab9d1 15249 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15250 * data.c (atof): Remove decl; no longer used or needed.
15251 (digit_to_number): Move to lread.c.
15252 (Fstring_to_number): Use new string_to_number function, to be
15253 consistent with how the Lisp reader treats infinities and NaNs.
15254 Do not assume that floating-point numbers represent EMACS_INT
15255 without losing information; this is not true on most 64-bit hosts.
15256 Avoid double-rounding errors, by insisting on integers when
15257 parsing non-base-10 numbers, as the documentation specifies.
15258 * lisp.h (string_to_number): New decl, replacing ...
15259 (isfloat_string): Remove.
bc0a5c13 15260 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15261 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15262 appears to have been a coding error. Similarly, do not accept
15263 strings like +-1e0 as floating point numbers. Do not report
15264 overflow for integer overflows unless the base is not 10 which
15265 means we have no simple and reliable way to continue.
15266 Break out the floating-point parsing into a new
15267 function string_to_number, so that Fstring_to_number parses
15268 floating point numbers consistently with the Lisp reader.
04f2d78b 15269 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15270 (E_CHAR, EXP_INT): Remove, replacing with ...
15271 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15272 (string_to_number): New function, replacing isfloat_string.
15273 This function checks for valid syntax and produces the resulting
15274 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15275 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15276 so that overflow for non-base-10 numbers is reported only when
15277 there's no portable and simple way to convert to floating point.
452f4150 15278
67769ffc
PE
15279 * textprop.c (set_text_properties_1): Rewrite for clarity,
15280 and to avoid GCC warning about integer overflow.
15281
c20db43f
PE
15282 * intervals.h (struct interval): Use EMACS_INT for members
15283 where EMACS_UINT might cause problems. See
15284 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15285 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15286 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15287 All uses changed.
37aa2f85
PE
15288 (offset_intervals): Tell GCC not to worry about length overflow
15289 when negating a negative length.
c20db43f 15290
2538aa2f
PE
15291 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15292 (overrun_check_free): Likewise.
15293
f2d3008d
PE
15294 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15295 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15296 word size.
15297
ec8df744
PE
15298 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15299 (gnutls_make_error): Rename local to avoid shadowing.
15300 (gnutls_emacs_global_deinit): ifdef out; not used.
15301 (Fgnutls_boot): Use const for pointer to readonly storage.
15302 Comment out unused local. Fix pointer signedness problems.
15303
640ee02d
PE
15304 * lread.c (openp): Don't stuff size_t into an 'int'.
15305 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15306 about possible signed overflow.
15307
6048fb2a
PE
15308 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15309 (GDK_KEY_g): Don't define if already defined.
15310 (xg_prepare_tooltip): Avoid pointer signedness problem.
15311 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15312
fa3c87e1
PE
15313 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15314 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15315
2172544b
PE
15316 * xfns.c (Fx_window_property): Simplify a bit,
15317 to make a bit faster and to avoid GCC 4.6.0 warning.
15318 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15319
9b821a21
PE
15320 * fns.c (internal_equal): Don't assume size_t fits in int.
15321
3c616cfa
PE
15322 * alloc.c (compact_small_strings): Tighten assertion a little.
15323
c2982e87
PE
15324 Replace pEd with more-general pI, and fix some printf arg casts.
15325 * lisp.h (pI): New macro, generalizing old pEd macro to other
15326 conversion specifiers. For example, use "...%"pI"d..." rather
15327 than "...%"pEd"...".
15328 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15329 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15330 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15331 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15332 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15333 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15334 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15335 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15336 64-bit hosts.
15337 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15338 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15339 * print.c (safe_debug_print, print_object): Likewise.
15340 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15341 to int.
6f04d126
PE
15342 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15343 avoiding the 0 flag, which is not portable.
c2982e87
PE
15344 * process.c (Fmake_network_process): Use pI to avoid cast.
15345 * region-cache.c (pp_cache): Likewise.
15346 * xdisp.c (decode_mode_spec): Likewise.
15347 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15348 behavior on 64-bit hosts with printf arg.
6f04d126 15349 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15350 (x_stop_queuing_selection_requests): Likewise.
15351 (x_get_window_property): Don't truncate byte count to an 'int'
15352 when tracing.
0b432f21 15353
5e073ec7
PE
15354 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15355 here, since it parses constructs like leading '-' and spaces,
15356 which are not wanted; and it overflows with large numbers.
15357 Instead, simply match F[0-9]+, which is what is wanted anyway.
15358
36372bf9
PE
15359 * alloc.c: Remove unportable assumptions about struct layout.
15360 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15361 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15362 (allocate_vectorlike, make_pure_vector): Use the new macros,
15363 plus offsetof, to remove unportable assumptions about struct layout.
15364 These assumptions hold on all porting targets that I know of, but
15365 they are not guaranteed, they're easy to remove, and removing them
15366 makes further changes easier.
15367
0b432f21
PE
15368 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15369 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15370 (string_overrun_cookie): Now const. Use initializers that
15371 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15372 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15373 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15374 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15375 multiple of sizeof (EMACS_INT); it need not be, if
15376 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15377 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15378
895009e1
JB
153792011-04-26 Juanma Barranquero <lekktu@gmail.com>
15380
15381 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15382
6a7a1b0b
TZ
153832011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15384
15385 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15386 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15387 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15388
841a1577 153892011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15390
15391 * lisp.h (Qdebug): List symbol.
895009e1 15392 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15393 * keyboard.c (debug-on-event): New variable.
15394 (handle_user_signal): Break into debugger when debug-on-event
15395 matches the current signal symbol.
15396
f2d3ba6f
DN
153972011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15398
15399 * alloc.c (check_sblock, check_string_bytes)
15400 (check_string_free_list): Convert to standard C.
15401
42ce4c63
TZ
154022011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15403
15404 * w32.c (emacs_gnutls_push): Fix typo.
15405
825cd63c
EZ
154062011-04-25 Eli Zaretskii <eliz@gnu.org>
15407
fb11d64d
EZ
15408 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15409 "cast to pointer from integer of different size".
15410
825cd63c
EZ
15411 Improve doprnt and its use in verror. (Bug#8545)
15412 * doprnt.c (doprnt): Document the set of format control sequences
15413 supported by the function. Use SAFE_ALLOCA instead of always
15414 using `alloca'.
15415
15416 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15417 is one byte too soon. Don't use xrealloc; instead xfree and
15418 xmalloc anew.
15419
e061a11b
TZ
154202011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15421
15422 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15423 callbacks stage.
15424
15425 * gnutls.c: Renamed global_initialized to
15426 gnutls_global_initialized. Added internals for the
15427 :verify-hostname-error, :verify-error, and :verify-flags
15428 parameters of `gnutls-boot' and documented those parameters in the
15429 docstring. Start callback support.
9173deec
JB
15430 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15431 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15432 on error. Return error code.
e061a11b
TZ
15433 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15434 (emacs_gnutls_read): Likewise.
15435 (Fgnutls_boot): Return handshake error code.
15436 (emacs_gnutls_handle_error): New function.
15437 (wsaerror_to_errno): Likewise.
15438
15439 * w32.h (emacs_gnutls_pull): Add prototype.
15440 (emacs_gnutls_push): Likewise.
15441
15442 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15443 (emacs_gnutls_push): Likewise.
15444
154452011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15446
15447 * process.c (wait_reading_process_output): Check if GnuTLS
15448 buffered some data internally if no FDs are set for TLS
15449 connections.
15450
15451 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15452 (LIBS): Link to USER_LIBS.
15453 ($(BLD)/gnutls.$(0)): New target.
15454
fa6996bc
EZ
154552011-04-24 Eli Zaretskii <eliz@gnu.org>
15456
eb35682e
EZ
15457 * xdisp.c (handle_single_display_spec): Rename the
15458 display_replaced_before_p argument into display_replaced_p, to
15459 make it consistent with the commentary. Fix typos in the
15460 commentary.
15461
e2ad650c
EZ
15462 * textprop.c (syms_of_textprop): Remove dead code.
15463 (copy_text_properties): Delete obsolete commentary about an
15464 interface that was deleted long ago. Fix typos in the description
15465 of arguments.
15466
1b2de274
EZ
15467 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15468 to changes in oldXMenu/XMenu.h from 2011-04-16.
15469 <menu_help_message, prev_menu_help_message>: Constify.
15470 (IT_menu_make_room): menu->help_text is now `const char **';
15471 adjust.
15472
15473 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15474 to changes in oldXMenu/XMenu.h from 2011-04-16.
15475 (struct XMenu): Declare `help_text' `const char **'.
15476
15477 * xfaces.c <Qunspecified>: Make extern again.
15478
15479 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15480 required by POSIX.
1b2de274 15481
762b15be
EZ
15482 * doc.c (get_doc_string): Improve the format passed to `error'.
15483
15484 * doprnt.c (doprnt): Improve commentary.
15485
15486 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15487
15488 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15489 them with etags.
15490
f1052e5d
EZ
15491 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15492 changes in globals.h immediately force recompilation.
762b15be
EZ
15493 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15494 $(CURDIR)/s/ms-w32.h.
15495 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15496
fa6996bc
EZ
15497 * character.c (Fchar_direction): Function deleted.
15498 (syms_of_character): Don't defsubr it.
15499 <char-direction-table>: Deleted.
15500
e6c3da20
EZ
155012011-04-23 Eli Zaretskii <eliz@gnu.org>
15502
15503 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15504 * doprnt.c: Include limits.h.
15505 (SIZE_MAX): New macro.
04f2d78b
CB
15506 (doprnt): Return a size_t value. 2nd arg is now size_t.
15507 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15508 Improve overflow protection. Support `l' modifier for integer
15509 conversions. Support %l conversion. Don't assume an EMACS_INT
15510 argument for integer conversions and for %c.
15511
15512 * lisp.h (doprnt): Restore prototype.
15513
15514 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15515 $(SRC)/character.h.
15516
15517 * Makefile.in (base_obj): Add back doprnt.o.
15518
15519 * deps.mk (doprnt.o): Add back prerequisites.
15520 (callint.o): Depend on character.h.
15521
15522 * eval.c (internal_lisp_condition_case): Include the handler
15523 representation in the error message.
15524 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15525 when breaking from the loop.
15526
15527 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15528
15529 * callint.c (Fcall_interactively): When displaying error message
15530 about invalid control letter, pass the character's codepoint, not
15531 a pointer to its multibyte form. Improve display of the character
15532 in octal and display also its hex code.
15533
15534 * character.c (char_string): Use %x to display the (unsigned)
15535 codepoint of an invalid character, to avoid displaying a bogus
15536 negative value.
15537
15538 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15539 `error', not SYMBOL_NAME itself.
15540
15541 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15542 character arguments to `error'.
15543
15544 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15545 to `error' in error message about FINAL_CHAR argument. Make sure
15546 FINAL_CHAR is a character, and use %c when it is passed as
15547 argument to `error'.
15548
4ffd0d6b 155492011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15550
15551 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15552
15553 * w32.c: Include <time.h>.
15554 (sys_localtime): New function.
15555
4ffd0d6b 155562011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15557
15558 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15559
4ffd0d6b 15560 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15561
4ffd0d6b 155622011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15563
4ffd0d6b
GM
15564 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15565 zombies (Bug#8467).
aac0c6e3 15566
04c56954
EZ
155672011-04-19 Eli Zaretskii <eliz@gnu.org>
15568
15569 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15570 gl_state.e_property when gl_state.object is Qt.
15571
15572 * insdel.c (make_gap_larger): Remove limitation of buffer size
15573 to <= INT_MAX.
15574
16a43933
CY
155752011-04-18 Chong Yidong <cyd@stupidchicken.com>
15576
15577 * xdisp.c (lookup_glyphless_char_display)
15578 (produce_glyphless_glyph): Handle cons cell entry in
15579 glyphless-char-display.
15580 (Vglyphless_char_display): Document it.
15581
15582 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15583 glyphless-char-display.
15584
4581706e
CY
155852011-04-17 Chong Yidong <cyd@stupidchicken.com>
15586
15587 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15588
15589 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15590
15591 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15592 definition for no-X builds.
15593
4887c6e2 155942011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 15595
fd35b6f9
PE
15596 Static checks with GCC 4.6.0 and non-default toolkits.
15597
5c1ccb01
PE
15598 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15599
006c5daa
PE
15600 * process.c (keyboard_bit_set): Define only if SIGIO.
15601 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15602 (send_process): Repair possible setjmp clobbering.
15603
efc736d3
PE
15604 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15605
4e2fe2e6
PE
15606 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15607
f97334a2
PE
15608 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15609
4e75f29d
PE
15610 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15611 Define only if needed.
15612
90efadd1
PE
15613 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15614 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 15615 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 15616
3c647824
PE
15617 * dispextern.h (struct redisplay_interface): Rename param
15618 to avoid shadowing.
e264f262 15619 * termhooks.h (struct terminal): Likewise.
761383f4 15620 * xterm.c (xembed_send_message): Likewise.
3c647824 15621
b58c5c4a
PE
15622 * insdel.c (make_gap_smaller): Define only if
15623 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15624
cad59032
PE
15625 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15626 it.
15627
c339dc2e
PE
15628 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15629 so that we aren't warned about unused symbols.
15630
91a3e27b
PE
15631 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15632
399c71d3 15633 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 15634
8ffc96f5
PE
15635 * xfns.c (x_real_positions): Mark locals as initialized.
15636
eef9bc79
PE
15637 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15638
098db9dd
PE
15639 * xterm.c: Fix problems found by static analysis with other toolkits.
15640 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
15641 (x_dispatch_event): Declare static if USE_GTK, and
15642 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 15643 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 15644 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
15645 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15646 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 15647
eb18f6cc
PE
15648 * xmenu.c (menu_help_callback): Pointer type fixes.
15649 Use const pointers when pointing at readonly data. Avoid pointer
15650 signedness clashes.
15651 (FALSE): Remove unused macro.
15652 (update_frame_menubar): Remove unused decl.
15653
1fe72bf8
PE
15654 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15655
60d9e1db
PE
15656 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15657 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15658 (single_menu_item): Rename local to avoid shadowing.
15659
39261c26
PE
15660 * keyboard.c (make_lispy_event): Remove unused local var.
15661
018c5e19
PE
15662 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15663 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15664
63d2b86e
PE
15665 * bitmaps: Change bitmaps from unsigned char back to the X11
15666 compatible char. Avoid the old compiler warnings about
15667 out-of-range initializers by using, for example, '\xab' rather
15668 than 0xab.
15669
aefd87e1
PE
15670 * xgselect.c (xgselect_initialize): Check vs interface
15671 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15672
bf501fb9
PE
15673 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15674
e9829fdf
PE
15675 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15676 to read-only memory.
15677
1086c095
PE
15678 * fns.c (vector): Remove; this old hack is no longer needed.
15679
2baccd04 15680 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 15681 Remove unused var.
dde42981 15682 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 15683
72391843 15684 * xrdb.c (x_load_resources): Omit unused local.
3565b346 15685
436c16df 15686 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 15687 (x_window): Rename locals to avoid shadowing.
dc5ddd85 15688 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 15689
92bb796d 15690 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 15691 (x_term_init): Remove local to avoid shadowing.
92bb796d 15692
764430a3 15693 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
15694
15695 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15696 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15697
d1dfb56c
EZ
156982011-04-16 Eli Zaretskii <eliz@gnu.org>
15699
c4354cb4
EZ
15700 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15701
d1dfb56c
EZ
15702 Fix regex.c, syntax.c and friends for buffers > 2GB.
15703 * syntax.h (struct gl_state_s): Declare character position members
15704 EMACS_INT.
15705
15706 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15707
04f2d78b
CB
15708 * textprop.c (verify_interval_modification, interval_of):
15709 Declare arguments EMACS_INT.
d1dfb56c
EZ
15710
15711 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15712 EMACS_INT.
15713
15714 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15715
15716 * indent.c (Fvertical_motion): Local variable it_start is now
15717 EMACS_INT.
15718
15719 * regex.c (re_match, re_match_2, re_match_2_internal)
15720 (bcmp_translate, regcomp, regexec, print_double_string)
15721 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15722 (re_compile_pattern, re_exec): Declare arguments and local
15723 variables `size_t' and `ssize_t' and return values `regoff_t', as
15724 appropriate.
15725 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15726 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15727 <compile_stack_type>: `size' and `avail' are now `size_t'.
15728
15729 * regex.h <regoff_t>: Use ssize_t, not int.
15730 (re_search, re_search_2, re_match, re_match_2): Arguments that
15731 specify buffer/string position and length are now ssize_t and
15732 size_t. Return type is regoff_t.
15733
613052cd
BK
157342011-04-16 Ben Key <bkey76@gmail.com>
15735
15736 * nsfont.m: Fixed bugs in ns_get_family and
15737 ns_descriptor_to_entity that were caused by using free to
15738 deallocate memory blocks that were allocated by xmalloc (via
15739 xstrdup). This caused Emacs to crash when compiled with
15740 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15741 --enable-checking=xmallocoverrun). xfree is now used to
15742 deallocate these memory blocks.
15743
4170f62f 157442011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 15745
71b41406
PE
15746 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15747
9587a89d
PE
15748 emacs_write: Accept and return EMACS_INT for sizes.
15749 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15750 et seq.
15751 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15752 Accept and return EMACS_INT.
15753 (emacs_gnutls_write): Return the number of bytes written on
15754 partial writes.
15755 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
15756 (emacs_read, emacs_write): Remove check for negative size, as the
15757 Emacs source code has been audited now.
9587a89d
PE
15758 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15759 (emacs_read, emacs_write): Use it.
273a5f82
PE
15760 * process.c (send_process): Adjust to the new signatures of
15761 emacs_write and emacs_gnutls_write. Do not attempt to store
15762 a byte offset into an 'int'; it might overflow.
9587a89d 15763 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 15764
3e047f51
PE
15765 * sound.c: Don't assume sizes fit in 'int'.
15766 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 15767 Return EMACS_INT, not int.
3e047f51 15768 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
15769 Accept EMACS_INT, not int.
15770 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
15771 record read return values.
15772
cc39a9db
BK
157732011-04-15 Ben Key <bkey76@gmail.com>
15774
c9d0ec6d
JB
15775 * keyboard.c (Qundefined): Don't declare static since it is used
15776 in nsfns.m.
15777 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15778 static since they are used in nsfont.m.
cc39a9db 15779
6c60eb9f
SM
157802011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15781
15782 * process.c (Qprocessp): Don't declare static.
15783 * lisp.h (Qprocessp): Declare again.
15784
7990b61a
JB
157852011-04-15 Juanma Barranquero <lekktu@gmail.com>
15786
15787 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15788
5d4cb038
PE
157892011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15790
8bd7b830 15791 Improve C-level modularity by making more things 'static'.
cd64ea1d 15792
e3b27b31
PE
15793 Don't publish debugger-only interfaces to other modules.
15794 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15795 (verify_bytepos, count_markers): Move decls to the only modules
15796 that need them.
15797 * region-cache.h (pp_cache): Likewise.
15798 * window.h (check_all_windows): Likewise.
15799 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15800
5d4cb038
PE
15801 * sysdep.c (croak): Now static, if
15802 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15803 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
15804
15805 * alloc.c (refill_memory_reserve): Now static if
15806 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15807 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 15808
e87b6180
PE
15809 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15810 Define only if USE_LUCID.
15811
ac64929e
PE
15812 * xrdb.c (x_customization_string, x_rm_string): Now static.
15813
6f37259d
PE
15814 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15815 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15816
1683e3ab
PE
15817 * xdisp.c (draw_row_with_mouse_face): Now static.
15818 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15819
de9c2632
PE
15820 * window.h (check_all_windows): Mark externally visible.
15821
2b96acb7
PE
15822 * window.c (window_deletion_count): Now static.
15823
15824 * undo.c: Make symbols static if they're not exported.
15825 (last_undo_buffer, last_boundary_position, pending_boundary):
15826 Now static.
15827
50436f33
PE
15828 * textprop.c (interval_insert_behind_hooks): Now static.
15829 (interval_insert_in_front_hooks): Likewise.
15830
64520e5c
PE
15831 * term.c: Make symbols static if they're not exported.
15832 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15833 (max_frame_lines, tty_set_terminal_modes):
15834 (tty_reset_terminal_modes, tty_turn_off_highlight):
15835 (get_tty_terminal): Now static.
15836 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15837 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 15838 HAVE_WINDOW_SYSTEM.
64520e5c
PE
15839 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15840 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15841
1fa53021
PE
15842 * sysdep.c: Make symbols static if they're not exported.
15843 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15844 Now static.
15845 (sigprocmask_set, full_mask): Remove; unused.
15846 (wait_debugging): Mark as visible.
15847 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15848 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15849
d4b43b22
PE
15850 * syntax.c (syntax_temp): Define only if !__GNUC__.
15851
b7c513d0
PE
15852 * sound.c (current_sound_device, current_sound): Now static.
15853
989b29ad
PE
15854 * search.c (searchbufs, searchbuf_head): Now static.
15855
13a55a78
PE
15856 * scroll.c (scroll_cost): Remove; unused.
15857 * dispextern.h (scroll_cost): Remove decl.
15858
de68a1fc
PE
15859 * region-cache.h (pp_cache): Mark as externally visible.
15860
40ccffa6
PE
15861 * process.c: Make symbols static if they're not exported.
15862 (process_tick, update_tick, create_process, chan_process):
15863 (Vprocess_alist, proc_buffered_char, datagram_access):
15864 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15865 (deactivate_process): Mark defn as static, as well as decl.
15866 * lisp.h (create_process): Remove decl.
15867 * process.h (chan_process, Vprocess_alist): Remove decls.
15868
ad64fc97
PE
15869 * print.c: Make symbols static if they're not exported.
15870 (print_depth, new_backquote_output, being_printed, print_buffer):
15871 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15872 (print_interval, print_number_index, initial_stderr_stream):
15873 Now static.
15874 * lisp.h (Fprinc): Remove decl.
15875 (debug_output_compilation_hack): Mark as externally visible.
15876
adddb265
PE
15877 * sysdep.c (croak): Move decl from here to syssignal.h.
15878 * syssignal.h (croak): Put it here, so the API can be checked when
15879 'croak' is called from dissociate_if_controlling_tty.
15880
1717ede2
PE
15881 * minibuf.c: Make symbols static if they're not exported.
15882 (minibuf_save_list, choose_minibuf_frame): Now static.
15883 * lisp.h (choose_minibuf_frame): Remove decl.
15884
fa5fb2bc
PE
15885 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15886
1e3890d1
PE
15887 * lread.c: Make symbols static if they're not exported.
15888 (read_objects, initial_obarray, oblookup_last_bucket_number):
15889 Now static.
15890 (make_symbol): Remove; unused.
15891 * lisp.h (initial_obarray, make_symbol): Remove decls.
15892
8a1414fa
PE
15893 * keyboard.c: Make symbols static if they're not exported.
15894 (single_kboard, recent_keys_index, total_keys, recent_keys):
15895 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15896 (this_single_command_key_start, echoing, last_auto_save):
15897 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15898 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15899 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15900 (Vlispy_mouse_stem, double_click_count):
15901 Now static.
15902 (force_auto_save_soon): Define only if SIGDANGER.
15903 (ignore_mouse_drag_p): Now static if
15904 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15905 (print_help): Remove; unused.
15906 (stop_character, last_timer_event): Mark as externally visible.
15907 * keyboard.h (ignore_mouse_drag_p): Declare only if
15908 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15909 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15910 * lisp.h (echoing): Remove decl.
15911 (force_auto_save_soon): Declare only if SIGDANGER.
15912 * xdisp.c (redisplay_window): Simplify code, to make it more
15913 obvious that ignore_mouse_drag_p is not accessed if !defined
15914 USE_GTK && !defined HAVE_NS.
15915
93ea6e8f
PE
15916 * intervals.c: Make symbols static if they're not exported.
15917 (merge_properties_sticky, merge_interval_right, delete_interval):
15918 Now static.
15919 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15920
77382fcc
PE
15921 * insdel.c: Make symbols static if they're not exported.
15922 However, leave prepare_to_modify_buffer alone. It's never
15923 called from outside this function, but that appears to be a bug.
15924 (combine_after_change_list, combine_after_change_buffer):
4889fc82 15925 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
15926 (adjust_after_replace_noundo): Remove; unused.
15927 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 15928 (signal_before_change): Remove decls.
77382fcc 15929
9306c32e
PE
15930 * indent.c (val_compute_motion, val_vmotion): Now static.
15931
cd44d2eb
PE
15932 * image.c: Make symbols static if they're not exported.
15933 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15934 if USE_GTK.
15935 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15936 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15937
ad9a7a06
PE
15938 * fringe.c (standard_bitmaps): Now static.
15939 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15940
81626931
PE
15941 * frame.c: Make symbols static if they're not exported.
15942 (x_report_frame_params, make_terminal_frame): Now static.
15943 (get_frame_param): Now static, unless HAVE_NS.
15944 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15945 (x_get_resource_string): Remove; not used.
15946 * frame.h (make_terminal_frame, x_report_frame_params):
15947 (x_get_resource_string); Remove decls.
15948 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15949 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15950
239f9db9
PE
15951 * font.c, fontset.c: Make symbols static if they're not exported.
15952 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15953 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15954 * font.c (font_close_object): Now static.
15955 * font.h (font_close_object): Remove.
15956 * fontset.c (FONTSET_OBJLIST): Remove.
15957 (free_realized_fontset) #if-0 the body, which does nothing.
15958 (face_suitable_for_char_p): #if-0, as it's never called.
15959 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
15960 * xfaces.c (face_at_string_position):
15961 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
15962 since 0 is always ASCII.
15963
dfcf3579
PE
15964 * fns.c (weak_hash_tables): Now static.
15965
5045092b
PE
15966 * fileio.c: Make symbols static if they're not exported.
15967 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15968 (Vwrite_region_annotation_buffers): Now static.
15969
57a96f5c
PE
15970 * eval.c: Make symbols static if they're not exported.
15971 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15972 * lisp.h (backtrace_list): Remove decl.
15973
35f08c38
PE
15974 * emacs.c: Make symbols static if they're not exported.
15975 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15976 (fatal_error_code, fatal_error_signal_hook, standard_args):
15977 Now static.
15978 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15979 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15980 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15981 * lisp.h (fatal_error_signal_hook): Remove decl.
15982 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15983
f44bd759
PE
15984 * editfns.c: Move a (normally-unused) function to its only use.
15985 * editfns.c, lisp.h (get_operating_system_release): Remove.
15986 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15987 worth the hassle of breaking this out.
15988
b532497d
PE
15989 * xterm.c: Make symbols static if they're not exported.
15990 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15991 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15992 (x_destroy_window, x_delete_display):
15993 Now static.
15994 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15995 (x_mouse_leave): Remove; unused.
15996 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15997 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15998 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15999 Remove decls.
16000 (x_mouse_leave): Declare only if WINDOWSNT.
16001 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16002 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16003 USE_X_TOOLKIT.
16004
1675728f
PE
16005 * ftxfont.c: Make symbols static if they're not exported.
16006 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16007 HAVE_FREETYPE.
16008 * font.h (ftxfont_driver): Likewise.
16009
e4cebfca
PE
16010 * xfns.c: Make symbols static if they're not exported.
16011 (x_last_font_name, x_display_info_for_name):
16012 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16013 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16014 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16015 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16016 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16017 (last_show_tip_args): Now static.
16018 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16019 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16020 (x_screen_planes): Remove; unused.
16021 * dispextern.h (x_screen_planes): Remove decl.
16022
5bf46f05
PE
16023 * dispnew.c: Make symbols static if they're not exported.
16024 * dispextern.h (redraw_garbaged_frames, scrolling):
16025 (increment_row_positions): Remove.
16026 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16027 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16028 Now static.
16029 (redraw_garbaged_frames): Remove; unused.
16030
435f4c28
PE
16031 * xfaces.c: Make symbols static if they're not exported.
16032 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16033 Remove decls.
16034 * xterm.h (defined_color): Remove decls.
16035 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16036 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16037 (menu_face_changed_default, defined_color, free_realized_face):
16038 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16039 (ascii_face_of_lisp_face): Remove; unused.
16040
8524aef3
PE
16041 * xdisp.c: Make symbols static if they're not exported.
16042 * dispextern.h (scratch_glyph_row, window_box_edges):
16043 (glyph_to_pixel_coords, set_cursor_from_row):
16044 (get_next_display_element, set_iterator_to_next):
16045 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16046 (show_mouse_face): Remove decls
16047 * frame.h (message_buf_print): Likewise.
16048 * lisp.h (pop_message, set_message, check_point_in_composition):
16049 Likewise.
16050 * xterm.h (set_vertical_scroll_bar): Likewise.
16051 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16052 (message_buf_print, scratch_glyph_row, displayed_buffer):
16053 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16054 (get_next_display_element, show_mouse_face, window_box_edges):
16055 (frame_to_window_pixel_xy, check_point_in_composition):
16056 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16057 (glyph_to_pixel_coords): Remove; unused.
16058
16390cd2
PE
16059 * dired.c (file_name_completion): Now static.
16060
16061 * dbusbind.c (xd_in_read_queued_messages): Now static.
16062
a25f4dfa
PE
16063 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16064 * data.c (circular_list_error): Remove.
16065
14a9c8df
PE
16066 * commands.h (last_point_position, last_point_position_buffer):
16067 (last_point_position_window): Remove decls.
16068 * keyboard.c: Make these variables static.
16069
04f2d78b
CB
16070 * coding.h (coding, code_convert_region, encode_coding_gap):
16071 Remove decls.
74ab6df5
PE
16072 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16073 (iso_code_class, detect_coding, code_convert_region): Now static.
16074 (encode_coding_gap): Remove; unused.
16075
38dfbee1
PE
16076 * chartab.c (chartab_chars, chartab_bits): Now static.
16077
a2cb4e63
PE
16078 * charset.h (charset_iso_8859_1): Remove decl.
16079 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16080 Now static.
16081
127198fd
PE
16082 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16083 * ccl.c (Vccl_program_table): Now static.
16084 (check_ccl_update): Remove; unused.
16085
d85b608f
PE
16086 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16087 * category.h: ... from here.
16088 * category.c (check_category_table, set_category_set): Now static.
16089
31cd66f3
PE
16090 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16091 * lisp.h: Remove these decls.
16092
c358e587
PE
16093 * buffer.c (buffer_count): Remove unused var.
16094
e78aecca
PE
16095 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16096 so that it's not optimized away.
16097 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16098 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16099 exported only to the debugger.
16100
e192d7d3 16101 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16102 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16103
92470028
PE
16104 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16105 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16106 was inaccessible from Lisp.
16107 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16108 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16109
244ed907
PE
16110 alloc.c: Import and export fewer symbols, and remove unused items.
16111 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16112 is defined.
16113 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16114 it's not optimized away by whole-program optimization.
16115 (message_enable_multibyte, free_misc): Remove.
16116 (catchlist, handlerlist, mark_backtrace):
16117 Declare only if BYTE_MARK_STACK.
16118 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16119 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16120 (message_enable_multibyte): Remove decl.
16121 (free_misc, interval_free_list, float_block, float_block_index):
16122 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16123 (cons_free_list, last_marked_index):
16124 Now static.
16125 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16126 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16127 (mark_backtrace): Define only if BYTE_MARK_STACK.
16128 * xdisp.c (message_enable_multibyte): Now static.
16129
61c2b50e 16130 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16131 This makes it easier for human readers (and static analyzers)
16132 to see whether these variables are used from other modules.
16133 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16134 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16135 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16136 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16137 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16138 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16139 * xmenu.c, xselect.c:
16140 Declare Q* vars static if they are not used in other modules.
16141 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16142 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16143 Remove decls of unexported vars.
16144 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16145
95c82688
PE
16146 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16147
16a97296
PE
16148 Make Emacs functions such as Fatom 'static' by default.
16149 This makes it easier for human readers (and static analyzers)
16150 to see whether these functions can be called from other modules.
16151 DEFUN now defines a static function. To make the function external
16152 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16153 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16154 (Finit_image_library):
16a97296
PE
16155 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16156 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16157 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16158 Remove decls, since these functions are now static.
16159 (Funintern, Fget_internal_run_time): New decls, since these functions
16160 were already external.
95c82688 16161
16a97296
PE
16162 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16163 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16164 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16165 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16166 * keyboard.c, keymap.c, lread.c:
16167 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16168 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16169 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16170 Mark functions with DEFUE instead of DEFUN,
16171 if they are used in other modules.
16172 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16173 decls for now-static functions.
16174 * buffer.h (Fdelete_overlay): Remove decl.
16175 * callproc.c (Fgetenv_internal): Mark as internal.
16176 * composite.c (Fremove_list_of_text_properties): Remove decl.
16177 (Fcomposition_get_gstring): New forward static decl.
16178 * composite.h (Fcomposite_get_gstring): Remove decl.
16179 * dired.c (Ffile_attributes): New forward static decl.
16180 * doc.c (Fdocumntation_property): New forward static decl.
16181 * eval.c (Ffetch_bytecode): New forward static decl.
16182 (Funintern): Remove extern decl; now in .h file where it belongs.
16183 * fileio.c (Fmake_symbolic_link): New forward static decl.
16184 * image.c (Finit_image_library): New forward static decl.
16185 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16186 * intervals.h (Fprevious_property_change):
16187 (Fremove_list_of_text_properties): Remove decls.
16188 * keyboard.c (Fthis_command_keys): Remove decl.
16189 (Fcommand_execute): New forward static decl.
16190 * keymap.c (Flookup_key): New forward static decl.
16191 (Fcopy_keymap): Now static.
16192 * keymap.h (Flookup_key): Remove decl.
16193 * process.c (Fget_process): New forward static decl.
16194 (Fprocess_datagram_address): Mark as internal.
16195 * syntax.c (Fsyntax_table_p): New forward static decl.
16196 (skip_chars): Remove duplicate decl.
16197 * textprop.c (Fprevious_property_change): New forward static decl.
16198 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16199 Now internal.
16200 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16201 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16202
785bbd42
PE
16203 * editfns.c (Fformat): Remove unreachable code.
16204
8b913b57
AS
162052011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16206
16207 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16208 change. (Bug#8496)
16209
a6744a35
EZ
162102011-04-13 Eli Zaretskii <eliz@gnu.org>
16211
16212 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16213 when at ZV. (Bug#8487)
16214
e7974947
AS
162152011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16216
baad03f0
AS
16217 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16218 (Bug#8437)
16219 * keyboard.c (parse_tool_bar_item): Likewise.
16220 * sound.c (sound_cleanup, alsa_close): Likewise.
16221 * termcap.c (tgetent): Likewise.
16222 * xfns.c (x_default_font_parameter): Likewise.
16223 * xsettings.c (read_and_apply_settings): Likewise.
16224
e7974947
AS
16225 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16226 (overrun_check_free): Protoize.
16227
28272684
PE
162282011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16229
16230 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16231 since callers should never pass a negative size.
16232 Change the signature to match that of plain 'read' and 'write'; see
16233 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16234 * lisp.h: Update prototypes of emacs_write and emacs_read.
16235
11997c76
EZ
162362011-04-11 Eli Zaretskii <eliz@gnu.org>
16237
16238 * xdisp.c (redisplay_window): Don't try to determine the character
16239 position of the scroll margin if the window start point w->startp
e896f03c 16240 is outside the buffer's accessible region. (Bug#8468)
11997c76 16241
8a2cbd72
EZ
162422011-04-10 Eli Zaretskii <eliz@gnu.org>
16243
16244 Fix write-region and its subroutines for buffers > 2GB.
16245 * fileio.c (a_write, e_write): Modify declaration of arguments and
16246 local variables to support buffers larger than 2GB.
16247 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16248
16249 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16250 argument, local variables, and return value.
16251
16252 * lisp.h: Update prototypes of emacs_write and emacs_read.
16253
16254 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16255
4073e537 162562011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16257
1ebfdcb6
PE
16258 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16259
b2ded58d
PE
16260 Fix more problems found by GCC 4.6.0's static checks.
16261
7d66342c
PE
16262 * xdisp.c (vmessage): Use a better test for character truncation.
16263
bbf47d44
PE
16264 * charset.c (load_charset_map): <, not <=, for optimization,
16265 and to avoid potential problems with integer overflow.
9248994d 16266 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16267 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16268 * editfns.c (Fformat): Likewise.
1e69125e 16269 * syntax.c (skip_chars): Likewise.
3befa583 16270
e3019616
PE
16271 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16272 This also lets GCC 4.6.0 generate slightly better loop code.
16273
becfa255
PE
16274 * callint.c (Fcall_interactively): <, not <=, for optimization.
16275 (Fcall_interactively): Count the number of arguments produced,
16276 not the number of arguments given. This is simpler and lets GCC
16277 4.6.0 generate slightly better code.
16278
dae0cd48
PE
16279 * ftfont.c: Distingish more carefully between FcChar8 and char.
16280 The previous code passed unsigned char * to a functions like
16281 strlen and xstrcasecmp that expect char *, which does not
16282 conform to the C standard.
16283 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16284 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16285 char * when the C standard requires it.
16286
76032d70
PE
16287 * keyboard.c (read_char): Remove unused var.
16288
eb3f1cc8
PE
16289 * eval.c: Port to Windows vsnprintf (Bug#8435).
16290 Include <limits.h>.
16291 (SIZE_MAX): Define if the headers do not.
16292 (verror): Do not give up if vsnprintf returns a negative count.
16293 Instead, grow the buffer. This ports to Windows vsnprintf, which
16294 does not conform to C99. Problem reported by Eli Zaretskii.
16295 Also, simplify the allocation scheme, by avoiding the need for
16296 calling realloc, and removing the ALLOCATED variable.
16297
70476b54
PE
16298 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16299
12020a9e
PE
16300 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16301 But keep the doprint source code for now, as we might revamp it
16302 and use it again (Bug#8435).
ea6c7ae6
PE
16303 * lisp.h (doprnt): Remove.
16304 * Makefile.in (base_obj): Remove doprnt.o.
16305 * deps.mk (doprnt.o): Remove.
16306
5fdb398c
PE
16307 error: Print 32- and 64-bit integers portably (Bug#8435).
16308 Without this change, on typical 64-bit hosts error ("...%d...", N)
16309 was used to print both 32- and 64-bit integers N, which relied on
16310 undefined behavior.
61bdb816 16311 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16312 * lisp.h (error, verror): Mark as printf-like functions.
16313 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16314 Report overflow in size calculations when allocating printf buffer.
16315 Do not truncate output string at its first null byte.
16316 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16317 Truncate the output at a character boundary, since vsnprintf does not
16318 do that.
16319 * charset.c (check_iso_charset_parameter): Convert internal
16320 character to string before calling 'error', since %c now has the
16321 printf meaning.
16322 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16323 overflow when computing char to be passed to 'error'. Do not
16324 pass Lisp_Object to 'error'; pass the integer instead.
16325 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16326 formatted with plain %d.
16327
b189fa66
PE
16328 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16329
bff87ef0
PE
16330 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16331
7e2cac20
PE
16332 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16333
ce4d90b5
PE
16334 * xterm.c (x_catch_errors): Remove duplicate declaration.
16335
266c9547
PE
16336 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16337
79c49ad2
PE
16338 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16339
368f4090
JM
163402011-04-10 Jim Meyering <meyering@redhat.com>
16341
16342 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16343 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16344 return ssize_t not "int", and use size_t as the buffer length.
16345 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16346 * gnutls.h: Update declarations.
16347 * process.c (read_process_output): Use ssize_t, to match.
16348 (send_process): Likewise.
16349
a32d4040
CY
163502011-04-09 Chong Yidong <cyd@stupidchicken.com>
16351
16352 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16353
8546720e 163542011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16355
04f2d78b
CB
16356 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16357 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16358
8546720e
GM
16359 * xterm.c (handle_one_xevent):
16360 * xmenu.c (create_and_show_popup_menu):
16361 * xselect.c (x_decline_selection_request)
16362 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16363
0a2f5c1a 163642011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16365
16366 Fix some uses of `int' instead of EMACS_INT.
16367 * search.c (string_match_1, fast_string_match)
16368 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16369 (scan_buffer, find_next_newline_no_quit)
16370 (find_before_next_newline, search_command, Freplace_match)
16371 (Fmatch_data): Make some `int' variables be EMACS_INT.
16372
16373 * xdisp.c (display_count_lines): 3rd argument and return value now
16374 EMACS_INT. All callers changed.
16375 (pint2hrstr): Last argument is now EMACS_INT.
16376
16377 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16378 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16379 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16380 (decode_coding_utf_16, decode_coding_emacs_mule)
16381 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16382 (decode_coding_ccl, decode_coding_charset)
16383 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16384 (decode_coding_iso_2022, decode_coding_emacs_mule)
16385 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16386 <char_offset, last_offset>: Declare EMACS_INT.
16387 (encode_coding_utf_8, encode_coding_utf_16)
16388 (encode_coding_emacs_mule, encode_invocation_designation)
16389 (encode_designation_at_bol, encode_coding_iso_2022)
16390 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16391 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16392 Declare EMACS_INT.
16393 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16394 (encode_invocation_designation): Last argument P_NCHARS is now
16395 EMACS_INT.
16396 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16397 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16398
16399 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16400 All users changed.
16401
16402 * ccl.c (Fccl_execute_on_string): Declare some variables
16403 EMACS_INT.
16404
8546720e 164052011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16406
16407 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16408
4e19a977
CS
164092011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16410
16411 * process.c (Fformat_network_address): Doc fix.
16412
87302331
R
164132011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16414
ee7683eb 16415 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16416
cbb59342
CY
164172011-04-08 Chong Yidong <cyd@stupidchicken.com>
16418
16419 * keyboard.c (read_char): Call Lisp function help-form-show,
16420 instead of using internal_with_output_to_temp_buffer.
16421 (Qhelp_form_show): New var.
e0d38eeb 16422 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16423
16424 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16425
16426 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16427
e67a13ab
CY
164282011-04-06 Chong Yidong <cyd@stupidchicken.com>
16429
04f2d78b
CB
16430 * process.c (Flist_processes): Remove to Lisp.
16431 (list_processes_1): Delete.
e67a13ab 16432
973f782d
EZ
164332011-04-06 Eli Zaretskii <eliz@gnu.org>
16434
7c106b1e
EZ
16435 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16436
973f782d
EZ
16437 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16438
41cf7d1a 164392011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16440
ca23cc88
PE
16441 Fix more problems found by GCC 4.6.0's static checks.
16442
f390e2d5
PE
16443 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16444
42eea0d0
PE
16445 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16446
b69769da 16447 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16448
f9541e84
PE
16449 * xdisp.c (vmessage): Mark as a printf-like function.
16450
13841b55
PE
16451 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16452
c136c10f
PE
16453 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16454
5e2d4a30
PE
16455 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16456 printf-like functions.
16457 (tiff_load): Add casts to remove these marks before passing them
16458 to system-supplied API.
16459
583f48b9
PE
16460 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16461
b25d760e
PE
16462 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16463 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16464 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16465 directly, rather than having caller test rule sign. This avoids
16466 some unnecessary tests.
16467 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16468 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16469 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16470
bc7b6697 16471 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16472 (xfont_open): Avoid unnecessary tests.
bc7b6697 16473
27ccc379
PE
16474 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16475
dcd5c89a
PE
16476 * composite.h, composite.c (composition_gstring_put_cache):
16477 Use EMACS_INT, not int, for length.
16478
b13a45c6
PE
16479 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16480 breaking out part of COMPOSITION_DECODE_RULE.
16481 (COMPOSITION_DECODE_RULE): Use it.
16482 * composite.c (get_composition_id): Remove unused local vars,
16483 by using the new macro.
16484
1e792e4d
PE
16485 * textprop.c (set_text_properties_1): Change while to do-while,
16486 since the condition is always true at first.
16487
dc6c6455 16488 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16489 (interval_deletion_adjustment): Return unsigned value.
16490 All uses changed.
dc6c6455 16491
aba7731a
PE
16492 * process.c (list_processes_1, create_pty, read_process_output):
16493 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16494 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16495 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16496 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16497 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16498
fdfc4bf3
PE
16499 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16500
fca8fe46 16501 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16502 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16503
06a0259a 16504 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16505 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16506 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16507
e7b9e80f
PE
16508 * print.c (print_error_message): Avoid int overflow.
16509
56201685
PE
16510 * font.c (font_list_entities): Redo for clarity,
16511 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16512
78834453 16513 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16514 (font_score): Avoid potential overflow in diff calculation.
78834453 16515
0bc0b309 16516 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16517 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16518
e610eaca
PE
16519 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16520
b895abce
PE
16521 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16522 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16523 can always succeed if overflow has undefined behavior.
16524
1f1d9321 16525 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16526 (wordify): Omit three unnecessary tests.
1f1d9321 16527
c59478bc
PE
16528 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16529 All callers changed. This avoids the need for an unused var.
16530
79b73827
PE
16531 * casefiddle.c (casify_region): Remove var that is set but not used.
16532
a4db5dfe
PE
16533 * dired.c (file_name_completion): Remove var that is set but not used.
16534
43aae36e
PE
16535 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16536
2a47c44d 16537 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16538 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16539
a37c69bf
PE
16540 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16541 Check for integer overflow on size calculations.
16542
328ab8e7
PE
16543 * buffer.c (Fprevious_overlay_change): Remove var that is set
16544 but not used.
16545
e5a2a5cb
PE
16546 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16547 Remove vars that are set but not used.
8d84a6eb 16548 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16549 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16550
a60e5f68
PE
16551 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16552
f661cb61 16553 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16554 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16555
f0397f5a
PE
16556 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16557 that are set but not used.
16558
8664db06 16559 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16560 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16561
6abdaa4a
PE
16562 * xselect.c (x_get_local_selection, x_handle_property_notify):
16563 Remove vars that are set but not used.
16564
0ce7538d 16565 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16566 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16567
9ae848fc
PE
16568 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16569 Remove var that is set but not used.
0b918413
PE
16570 (scroll_bar_windows_size): Now size_t, not int.
16571 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16572 Check for overflow.
9ae848fc 16573
a5a62657
PE
16574 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16575 (map_tty_color) [!defined MSDOS]: Likewise.
16576
5c5cdd39
PE
16577 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16578
66ebf983
PE
16579 * coding.c: Remove vars that are set but not used.
16580 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16581 All callers changed.
16582 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16583 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16584 (decode_coding_charset): Remove vars that are set but not used.
16585
1be4d761
PE
16586 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16587 that is set but not used.
16588
47553fa8
PE
16589 * print.c (print_object): Remove var that is set but not used.
16590
1f7196bf 16591 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16592 The gnulib version avoids calling malloc in the usual case,
16593 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16594 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16595 * filelock.c (current_lock_owner): Likewise.
16596 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16597 * sysdep.c: Include allocator.h, careadlinkat.h.
16598 (emacs_no_realloc_allocator): New static constant.
16599 (emacs_readlink): New function.
fdb61804
PE
16600 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16601 ../lib/careadlinkat.h.
d1fdcab7 16602
f84c17c7
SM
166032011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16604
16605 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16606 first non-nil return value).
16607
ef3862ad
JD
166082011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16609
16610 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16611 if not defined (Bug#8403).
16612
376a7006
JB
166132011-04-02 Juanma Barranquero <lekktu@gmail.com>
16614
16615 * xdisp.c (display_count_lines): Remove parameter `start',
16616 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16617 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16618 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16619 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16620 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16621 and thereabouts. All callers changed.
16622 (get_per_char_metric): Remove parameter `f', unused since
16623 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16624
6ca3801d
JM
166252011-04-02 Jim Meyering <meyering@redhat.com>
16626
16627 do not dereference NULL upon failed strdup
16628 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16629 (ns_get_family): Likewise.
16630
d8e2b5ba
JB
166312011-04-02 Juanma Barranquero <lekktu@gmail.com>
16632
16633 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16634
8c74fcbd
JD
166352011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16636
16637 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16638 later (Bug#8403).
16639
7200d79c
SM
166402011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16641
03408648 16642 Add lexical binding.
7200d79c 16643
03408648
SM
16644 * window.c (Ftemp_output_buffer_show): New fun.
16645 (Fsave_window_excursion):
16646 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16647
16648 * lread.c (lisp_file_lexically_bound_p): New function.
16649 (Fload): Bind Qlexical_binding.
16650 (readevalloop): Remove `evalfun' arg.
16651 Bind Qinternal_interpreter_environment.
16652 (Feval_buffer): Bind Qlexical_binding.
16653 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16654 Mark as dynamic.
16655 (syms_of_lread): Declare `lexical-binding'.
16656
16657 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16658
16659 * keyboard.c (eval_dyn): New fun.
16660 (menu_item_eval_property): Use it.
ca105506
SM
16661
16662 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 16663
03408648
SM
16664 * fns.c (concat, mapcar1): Accept byte-code-functions.
16665
16666 * eval.c (Fsetq): Handle lexical vars.
16667 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16668 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16669 (FletX, Flet): Obey lexical binding.
16670 (Fcommandp): Handle closures.
16671 (Feval): New `lexical' arg.
16672 (eval_sub): New function extracted from Feval. Use it almost
16673 everywhere where Feval was used. Look up vars in lexical env.
16674 Handle closures.
16675 (Ffunctionp): Move from subr.el.
16676 (Ffuncall): Handle closures.
16677 (apply_lambda): Remove `eval_flags'.
16678 (funcall_lambda): Handle closures and new byte-code-functions.
16679 (Fspecial_variable_p): New function.
16680 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16681 but without exporting it to Lisp.
23aba0ea 16682
23aba0ea 16683 * doc.c (Fdocumentation, store_function_docstring):
03408648 16684 * data.c (Finteractive_form): Handle closures.
23aba0ea 16685
03408648
SM
16686 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16687 interactive spec.
ba83908c 16688
04f2d78b
CB
16689 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16690 New byte-codes.
03408648
SM
16691 (exec_byte_code): New function extracted from Fbyte_code to handle new
16692 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 16693
03408648 16694 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 16695
03408648 16696 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 16697
e2abce01
JB
166982011-03-31 Juanma Barranquero <lekktu@gmail.com>
16699
16700 * xdisp.c (redisplay_internal): Fix prototype.
16701
63696a73 167022011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 16703
63696a73 16704 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
16705 (try_scrolling): Use it when setting scroll_limit.
16706 Limit scrolling to 100 screen lines.
63696a73
EZ
16707 (redisplay_window): Even when falling back on "recentering",
16708 position point in the window according to scroll-conservatively,
16709 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16710
16711 (try_scrolling): When point is above the window, allow searching
16712 as far as scroll_max, or one screenful, to compute vertical
16713 distance from PT to the scroll margin position. This prevents
16714 try_scrolling from unnecessarily failing when
16715 scroll-conservatively is set to a value slightly larger than the
16716 window height. Clean up the case of PT below the margin at bottom
16717 of window: scroll_max can no longer be INT_MAX. When aggressive
16718 scrolling is in use, don't let point enter the opposite scroll
16719 margin as result of the scroll.
16720 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
16721 threshold of 100 lines for never-recentering scrolling.
16722
e4cc2dfc
JB
167232011-03-31 Juanma Barranquero <lekktu@gmail.com>
16724
16725 * dispextern.h (move_it_by_lines):
16726 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16727 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16728 (message_log_check_duplicate): Remove parameters `prev_bol' and
16729 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16730 (redisplay_internal): Remove parameter `preserve_echo_area',
16731 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16732
16733 * indent.c (Fvertical_motion):
16734 * window.c (window_scroll_pixel_based, Frecenter):
16735 Don't pass `need_y_p' to `move_it_by_lines'.
16736
1c470562
SM
167372011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16738
44f230aa
SM
16739 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16740 steal a few bits to be more compact.
16741 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16742 Remove unneeded casts.
16743
1c470562
SM
16744 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16745
888adce9
ZK
167462011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16747
16748 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16749 binding" message (bug#7967).
16750
f838ed7b
PE
167512011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16752
77861b95
PE
16753 Fix more problems found by GCC 4.6.0's static checks.
16754
de6dbc14
PE
16755 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16756 Remove unused local var.
16757
f838ed7b
PE
16758 * editfns.c (Fmessage_box): Remove unused local var.
16759
792c7b2b
PE
16760 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16761 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16762 Omit unused local vars.
c499e557 16763 * window.c (shrink_windows): Omit unused local var.
b01a1c29 16764 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
16765 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16766 Omit unused local var.
16767
ba0165e1
PE
16768 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16769 Don't assume string length fits in int.
32ad8845 16770 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 16771 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 16772
3c59b4c9
PE
16773 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16774 instead of alloca (Bug#8344).
16775
a3eed478 16776 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 16777 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 16778
eb4d412d
PE
16779 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16780
1658b401
PE
16781 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16782 concerns.
16783
16784 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16785
16786 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 16787
9a2c6e05
PE
16788 * keyboard.c (syms_of_keyboard): Use the same style as later
16789 in this function when indexing through an array. This also
16790 works around GCC bug 48267.
16791
03d0a109
PE
16792 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16793
44f730c8
PE
16794 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16795
fe75f926
PE
16796 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16797 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16798
ffa8c828
PE
16799 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16800 This avoids undefined behavior on integer overflow, and is a bit
16801 more convenient anyway since it is compared to a size_t variable.
16802
c5101a77
PE
16803 Variadic C functions now count arguments with size_t, not int.
16804 This avoids an unnecessary limitation on 64-bit machines, which
16805 caused (substring ...) to crash on large vectors (Bug#8344).
16806 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16807 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 16808 All variadic functions and their callers changed accordingly.
c5101a77
PE
16809 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16810 * data.c (arith_driver, float_arith_driver): Likewise.
16811 * editfns.c (general_insert_function): Likewise.
16812 * eval.c (struct backtrace.nargs, interactive_p)
16813 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16814 (funcall_lambda, mark_backtrace): Likewise.
16815 * fns.c (concat): Likewise.
16816 * frame.c (x_set_frame_parameters): Likewise.
16817 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16818 0 if not found, not -1. All callers changed.
16819
dd3f25f7
PE
16820 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16821 (stack_copy_size): Now size_t, not int.
16822 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16823
461c2ab9
JB
168242011-03-28 Juanma Barranquero <lekktu@gmail.com>
16825
16826 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16827 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16828 All callers changed.
16829
16830 * lisp.h (multibyte_char_to_unibyte):
16831 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16832 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16833 * character.h (CHAR_TO_BYTE8):
16834 * cmds.c (internal_self_insert):
16835 * editfns.c (general_insert_function):
16836 * keymap.c (push_key_description):
16837 * search.c (Freplace_match):
16838 * xdisp.c (message_dolog, set_message_1): All callers changed.
16839
f6d62986
SM
168402011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16841
16842 * keyboard.c (safe_run_hook_funcall): New function.
16843 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16844 don't set the hook to nil, but remove the offending function instead.
16845 (Qcommand_hook_internal): Remove, unused.
16846 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16847 Vcommand_hook_internal.
16848
16849 * eval.c (enum run_hooks_condition): Remove.
16850 (funcall_nil, funcall_not): New functions.
16851 (run_hook_with_args): Call each function through a `funcall' argument.
16852 Remove `cond' argument, now redundant.
16853 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16854 (Frun_hook_with_args_until_failure): Adjust accordingly.
16855 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16856
1db5b1ad
JB
168572011-03-28 Juanma Barranquero <lekktu@gmail.com>
16858
16859 * dispextern.h (string_buffer_position): Remove declaration.
16860
16861 * print.c (strout): Remove parameter `multibyte', unused since
16862 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16863
16864 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16865 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16866 All callers changed.
16867
16868 * w32.c (_wsa_errlist): Use braces for struct initializers.
16869
16870 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16871 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16872 All callers changed.
16873 (string_buffer_position): Likewise. Also, make static (it's never
16874 used outside xdisp.c).
16875 (cursor_row_p): Remove parameter `w', unused since
16876 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16877 (decode_mode_spec): Remove parameter `precision', introduced during
16878 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16879 All callers changed.
16880
5ffb62aa
JD
168812011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16882
16883 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16884
461c2ab9 168852011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
16886
16887 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16888 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16889 (ns_update_auto_hide_menu_bar): New functions.
16890 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16891 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16892 ns_constrain_all_frames.
16893 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16894 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16895
5c380ffb
JD
168962011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16897
16898 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16899
9af30bdf
GM
169002011-03-27 Glenn Morris <rgm@gnu.org>
16901
16902 * syssignal.h: Replace RETSIGTYPE with void.
16903 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16904 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16905 Replace SIGTYPE with void everywhere.
16906 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16907 * s/template.h (SIGTYPE): Remove commented out definition.
16908
e2abce01
JB
169092011-03-26 Eli Zaretskii <eliz@gnu.org>
16910
16911 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16912 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16913
f868cd8a
JB
169142011-03-26 Juanma Barranquero <lekktu@gmail.com>
16915
59eb0929
JB
16916 * w32.c (read_unc_volume): Use parameter `henum', instead of
16917 global variable `wget_enum_handle'.
16918
16919 * keymap.c (describe_vector): Remove parameters `indices' and
16920 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16921 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16922
f868cd8a
JB
16923 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16924
16925 * keyboard.c (timer_check): Remove parameter `do_it_now',
16926 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16927 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16928 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16929
16930 * keyboard.c (read_char):
16931 * w32menu.c (w32_menu_display_help):
16932 * xmenu.c (show_help_event, menu_help_callback):
16933 Adjust calls to `show_help_echo'.
16934
16935 * gtkutil.c (xg_maybe_add_timer):
16936 * keyboard.c (readable_events):
16937 * process.c (wait_reading_process_output):
16938 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16939
16940 * insdel.c (adjust_markers_gap_motion):
16941 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16942 (gap_left, gap_right): Don't call it.
16943
2ecf6fdb
CY
169442011-03-25 Chong Yidong <cyd@stupidchicken.com>
16945
16946 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16947 incurred during fontification.
16948
6b1f9ba4
JB
169492011-03-25 Juanma Barranquero <lekktu@gmail.com>
16950
16951 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16952 (DEFVAR_PER_BUFFER): Don't pass it.
16953
16954 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16955 (scrolling_window): Don't pass it.
16956
0f4a96b5
JB
169572011-03-25 Juanma Barranquero <lekktu@gmail.com>
16958
16959 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16960
16961 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16962 and `suffix'.
16963 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16964 of variables specific to SELinux and computation of `encoded_absname'.
16965
16966 * image.c (XPutPixel): Remove unused variable `height'.
16967
16968 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16969
16970 * unexw32.c (get_section_info): Remove unused variable `section'.
16971
16972 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16973 (system_process_attributes): Remove unused variable `sess'.
16974 (sys_read): Remove unused variable `err'.
16975
16976 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16977 (w32_wnd_proc): Remove unused variable `isdead'.
16978 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16979 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16980 (x_create_tip_frame): Remove unused variable `tem'.
16981
16982 * w32inevt.c (w32_console_read_socket):
16983 Remove unused variable `no_events'.
16984
16985 * w32term.c (x_draw_composite_glyph_string_foreground):
16986 Remove unused variable `width'.
16987
1149507c
JB
169882011-03-24 Juanma Barranquero <lekktu@gmail.com>
16989
16990 * w32term.c (x_set_glyph_string_clipping):
16991 Don't pass uninitialized region to CombineRgn.
16992
9c88f339
JB
169932011-03-23 Juanma Barranquero <lekktu@gmail.com>
16994
16995 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16996 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16997 (Fx_close_connection): Remove unused variable `i'.
16998
16999 * w32font.c (w32font_draw): Return number of glyphs.
17000 (w32font_open_internal): Remove unused variable `i'.
17001 (w32font_driver): Add missing initializer.
17002
17003 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17004 (fill_in_menu): Remove unused variable `items_added'.
17005
17006 * w32term.c (last_mouse_press_frame): Remove static global variable.
17007 (w32_clip_to_row): Remove unused variable `f'.
17008 (x_delete_terminal): Remove unused variable `i'.
17009
17010 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17011 (NOTHING): Remove unused static global variable.
17012 (uniscribe_check_otf): Remove unused variable `table'.
17013 (uniscribe_font_driver): Add missing initializers.
17014
dee091a3
JD
170152011-03-23 Julien Danjou <julien@danjou.info>
17016
17017 * term.c (Fsuspend_tty, Fresume_tty):
17018 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17019 * window.c (temp_output_buffer_show):
17020 * insdel.c (signal_before_change):
17021 * frame.c (Fhandle_switch_frame):
17022 * fileio.c (Fdo_auto_save):
17023 * emacs.c (Fkill_emacs):
17024 * editfns.c (save_excursion_restore):
17025 * cmds.c (internal_self_insert):
17026 * callint.c (Fcall_interactively):
17027 * buffer.c (Fkill_all_local_variables):
17028 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17029 Use Frun_hooks.
0f4a96b5 17030 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17031 unconditionally since it does the check itself.
dee091a3 17032
2c520ab5 170332011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17034
c9c49752
PE
17035 Fix more problems found by GCC 4.5.2's static checks.
17036
8abc3f12
PE
17037 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17038 the first time through the loop, since we know p0 < p1 then.
17039 This also avoids a gcc -Wstrict-overflow warning.
17040
a2d26660
PE
17041 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17042 leading to a memory leak, possible in functions like
17043 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17044 of objects (Bug#8318).
a2d26660 17045
916c72e9
PE
17046 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17047 that could (at least in theory) be that large.
17048
19ab8a18
PE
17049 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17050 This is less likely to overflow, and avoids undefined behavior if
17051 overflow does occur. All callers changed. Use strtoul to scan
17052 for the unsigned long integer.
b7cbbd6f
PE
17053 (pint2hrstr): Simplify and tune code slightly.
17054 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17055
f0641eff
PE
17056 * scroll.c (do_scrolling): Work around GCC bug 48228.
17057 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17058
7f650bb9
PE
17059 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17060 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17061 (validate_x_resource_name): Simplify count usage.
17062 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17063
37dd57d1
PE
17064 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17065 fail (Bug#8306).
81e56e61 17066
699979fc 17067 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17068
401bf9b4
PE
17069 * process.c (Fmake_network_process): Use socklen_t, not int,
17070 where POSIX says socklen_t is required in portable programs.
17071 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17072 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17073 (Fmake_network_process, server_accept_connection):
17074 (wait_reading_process_output, read_process_output):
17075 Likewise.
17076
b93aacde
PE
17077 * process.c: Rename or move locals to avoid shadowing.
17078 (list_processes_1, Fmake_network_process):
17079 (read_process_output_error_handler, exec_sentinel_error_handler):
17080 Rename or move locals.
4dc343ee 17081 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17082 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17083 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17084 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17085 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17086
af8a867c 17087 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17088 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17089 Include tparam.h instead, since it declares them.
af8a867c
PE
17090 * cm.h (PC): Remove extern decl; tparam.h now does this.
17091 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17092 * terminfo.c: Include tparam.h, to check interfaces.
17093 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17094 (tparam): Adjust signature to match interface in tparam.h;
17095 this removes some undefined behavior. Check that outstring and len
17096 are zero, which they always are with Emacs.
17097 * tparam.h (PC, BC, UP): New extern decls.
17098
0248044d 17099 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17100 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17101
8ff096c1 17102 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17103 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17104 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17105 (ftfont_list): Remove unused local.
49eaafba
PE
17106 (get_adstyle_property, ftfont_pattern_entity):
17107 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17108 Rename locals to avoid shadowing.
8ff096c1 17109
e2be39f6
PE
17110 * xfont.c (xfont_list_family): Mark var as initialized.
17111
c9735e30
PE
17112 * xml.c (make_dom): Now static.
17113
8f5201ae
PE
17114 * composite.c (composition_compute_stop_pos): Rename local to
17115 avoid shadowing.
b246f932
PE
17116 (composition_reseat_it): Remove unused locals.
17117 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17118 (composition_update_it): Mark var as initialized.
11b61122
PE
17119 (find_automatic_composition): Mark vars as initialized,
17120 with a FIXME (Bug#8290).
8f5201ae 17121
760fbc2c
PE
17122 character.h: Rename locals to avoid shadowing.
17123 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17124 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17125 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17126 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17127 to avoid shadowing.
17128
ff08eb85
PE
17129 * textprop.c (property_change_between_p): Remove; unused.
17130
fc7bf025
PE
17131 * intervals.c (interval_start_pos): Now static.
17132
235d7abc
PE
17133 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17134
44f230aa
SM
17135 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17136 Rename locals to avoid shadowing.
3e7d6594 17137
50060332
PE
17138 * sound.c (wav_play, au_play, Fplay_sound_internal):
17139 Fix pointer signedness.
d01f234b 17140 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17141 (wav_play): Initialize a variable to 0, to prevent undefined
17142 behavior (Bug#8278).
50060332 17143
c4fc4e30
PE
17144 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17145
918436ed
PE
17146 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17147
c939f91b
PE
17148 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17149 clobbering (Bug#8298).
b9c7f648
PE
17150 * sysdep.c (sys_subshell): Likewise.
17151 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17152
6bd8c144
PE
17153 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17154 This should get cleaned up, so that child_setup has the
17155 same signature on all platforms.
17156
7710357c 17157 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17158 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17159
c59da222
CY
171602011-03-22 Chong Yidong <cyd@stupidchicken.com>
17161
17162 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17163 not to be necessary, and produces flickering.
17164
66b87493
GM
171652011-03-20 Glenn Morris <rgm@gnu.org>
17166
17167 * config.in: Remove file.
17168
45b6f6d5
JB
171692011-03-20 Juanma Barranquero <lekktu@gmail.com>
17170
17171 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17172 are now in src/globals.h.
17173 (syms_of_minibuf): Remove spurious & from previous change.
17174
cd394be1 171752011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17176
17177 * minibuf.c (completing-read-function): New variable.
17178 (completing-read-default): Rename from completing-read.
17179 (completing-read): Call completing-read-function.
17180
b14e3e21
CY
171812011-03-19 Juanma Barranquero <lekktu@gmail.com>
17182
17183 * xfaces.c (Fx_load_color_file):
17184 Read color file from absolute filename (bug#8250).
17185
f2b726e6
JB
171862011-03-19 Juanma Barranquero <lekktu@gmail.com>
17187
17188 * makefile.w32-in: Update dependencies.
17189
09f6ff02
EZ
171902011-03-17 Eli Zaretskii <eliz@gnu.org>
17191
17192 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17193
29a6015a
PE
171942011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17195
a3a6c54e
PE
17196 Fix more problems found by GCC 4.5.2's static checks.
17197
b766f867
PE
17198 * process.c (make_serial_process_unwind, send_process_trap):
17199 (sigchld_handler): Now static.
17200
be02381c
PE
17201 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17202 That way, the code declares only the vars that it needs.
17203 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17204 * s/cygwin.h (PTY_ITERATION): Likewise.
17205 * s/darwin.h (PTY_ITERATION): Likewise.
17206 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17207
57048744
PE
17208 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17209 * process.c (allocate_pty): Don't declare stb unless it's needed.
17210
7914961c 17211 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17212 (CONSTANTLIM): Remove; unused.
17213 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17214 Define only if needed.
7914961c 17215
b3967b18
PE
17216 * unexelf.c (unexec): Name an expression,
17217 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17218 Use a different way to cause a compilation error if anyone uses
17219 n rather than nn, a way that does not involve shadowing.
73366a00 17220 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17221
29a6015a
PE
17222 * deps.mk (unexalpha.o): Remove; unused.
17223
43cfc33e 17224 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17225 * unexec.h: New file.
ce701a33
PE
17226 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17227 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17228 Depend on unexec.h.
17229 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17230 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17231 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17232 Change as necessary to match prototype in unexec.h.
ce701a33 17233
01f44d5a
PE
17234 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17235 shadowing.
4f63c6bb 17236 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17237
a6670b0b
PE
17238 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17239 Rename locals to avoid shadowing.
17240
cef2010d 17241 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17242 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17243
d4d7173a
PE
17244 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17245
f08b802a
PE
17246 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17247 warning when compiling print.c.
17248
3ddb0639
PE
17249 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17250 instead of using an uninitialized var.
5ad03b97 17251 (font_sort_entities): Mark var as initialized.
3ddb0639 17252
170a2692
PE
17253 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17254
e663c700
PE
17255 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17256 pointers to constants.
89bc529a 17257 (font_parse_fcname): Remove unused vars.
7b81e2d0 17258 (font_delete_unmatched): Now static.
ea838e10 17259 (font_get_spec): Remove; unused.
13a547c6
PE
17260 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17261 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17262 Rename or move locals to avoid shadowing.
e663c700 17263
2a80c887 17264 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17265 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17266
1384fa33 17267 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17268 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17269
8b2c52e9
PE
17270 * alloc.c (mark_backtrace): Move decl from here ...
17271 * lisp.h: ... to here, so that it can be checked.
17272
475545b5 17273 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17274 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17275 (lisp_indirect_variable): Name an expression,
17276 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17277 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17278
b1349114 17279 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17280 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17281 Use const pointer when appropriate.
b1349114 17282
a2928364
PE
17283 * lisp.h (get_system_name, get_operating_system_release):
17284 Move decls here, to check interfaces.
17285 * process.c (get_operating_system_release): Move decl to lisp.h.
17286 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17287 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17288 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17289 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17290 (Fformat_time_string, Fencode_time, Finsert_char):
17291 (Ftranslate_region_internal, Fformat):
17292 Rename or remove local vars to avoid shadowing.
9710023e 17293 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17294
a415e694
PE
17295 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17296 avoid shadowing.
17297
8ef4622d
PE
17298 * lisp.h (eassert): Check that the argument compiles, even if
17299 ENABLE_CHECKING is not defined.
17300
946f9a5b
PE
17301 * data.c (Findirect_variable): Name an expression, to avoid
17302 gcc -Wbad-function-cast warning.
112396d6 17303 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17304 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17305 (Fmake_variable_buffer_local, Fmake_local_variable):
17306 Mark variables as initialized.
52746918 17307 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17308
e5aab7e7 17309 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17310 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17311 Rename locals to avoid shadowing.
dff45157
PE
17312 (mark_stack): Move local variables into the #ifdef region where
17313 they're used.
7bc26fdb
PE
17314 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17315 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17316 needed otherwise.
17317 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17318 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17319 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17320
e5aab7e7
PE
17321 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17322 avoids undefined behavior in theory.
17323
4da60324
PE
17324 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17325
88043301
PE
17326 Use functions, not macros, for up- and down-casing (Bug#8254).
17327 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17328 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17329 to use the following functions instead of these macros.
17330 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17331 EMACS_INT, since callers assume the returned value fits in int.
17332 (upcase1): Likewise, for UPCASE_TABLE.
17333 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17334 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17335 the race-condition problem in the old DOWNCASE.
88043301 17336
19ed5445
PE
17337 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17338 Rename locals to avoid shadowing.
17339 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17340 (regex_compile, re_search_2, re_match_2_internal):
17341 Remove unused local vars.
952db0d7
PE
17342 (FREE_VAR): Rewrite so as not to use empty "else",
17343 which gcc can warn about.
da053e48 17344 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17345 (RETALLOC_IF): Define only if needed.
17346 (WORDCHAR_P): Likewise. This one is never needed, but is used
17347 only in a comment talking about a compiler bug, so put inside
17348 the #if 0 of that comment.
17349 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17350 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17351 Remove; unused.
19ed5445 17352
1f3561e4 17353 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17354 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17355 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17356
ded6f8f7
PE
17357 * search.c (simple_search): Remove unused var.
17358
dbd37a95
PE
17359 * dired.c (compile_pattern): Move decl from here ...
17360 * lisp.h: ... to here, so that it can be checked.
17361 (struct re_registers): New forward decl.
17362
7e47afad
PE
17363 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17364
85f24f61
PE
17365 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17366 All uses changed.
17367 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17368 Rename locals to avoid shadowing.
5671df8f 17369 (Fvertical_motion): Mark locals as initialized.
85f24f61 17370
181aa2be 17371 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17372 (casify_region): Mark local as initialized.
181aa2be 17373
930d429c
PE
17374 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17375
7082eac6
PE
17376 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17377 New macros, so that the caller can use some names other than
17378 gcpro1, gcpro2, etc.
17379 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17380 of the new macros.
17381 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17382 argument, for consistency with GCPRO2_VAR, etc: it is now the
17383 prefix of the variable, not the variable itself. All uses
17384 changed.
38b2c076
PE
17385 * dired.c (directory_files_internal, file_name_completion):
17386 Rename locals to avoid shadowing.
17387
15206ed9
PE
17388 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17389 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17390 dired.c's scmp function, had undefined behavior.
17391 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17392 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17393 * buffer.h: ... to here, because these macros use current_buffer,
17394 and the new implementation with inline functions needs to have
17395 current_buffer in scope now, rather than later when the macros
17396 are used.
17397 (downcase, upcase1): New static inline functions.
17398 (DOWNCASE, UPCASE1): Reimplement using these functions.
17399 This avoids undefined behavior in expressions like
17400 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17401 from race conditions in accessing the global variables
17402 case_temp1 and case_temp2.
17403 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17404 * lisp.h (case_temp1, case_temp2): Remove their decls.
17405 * character.h (ASCII_CHAR_P): Move from here ...
17406 * lisp.h: ... to here, so that the inline functions mentioned
17407 above can use them.
17408
4a6bea26
PE
17409 * dired.c (directory_files_internal_unwind): Now static.
17410
f14b7e14
PE
17411 * fileio.c (file_name_as_directory, directory_file_name):
17412 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17413 Now static.
2893f146
PE
17414 (file_name_as_directory): Use const pointers when appropriate.
17415 (Fexpand_file_name): Likewise. In particular, newdir might
17416 point at constant storage, so make it a const pointer.
fd4ead52 17417 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17418 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17419 signedness issues.
f839df0c
PE
17420 (Fset_file_times, Finsert_file_contents, auto_save_error):
17421 Rename locals to avoid shadowing.
f14b7e14 17422
5716756e 17423 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17424 (Ftry_completion, Fall_completions): Rename or remove locals
17425 to avoid shadowing.
5716756e 17426
b4c3046a
PE
17427 * marker.c (bytepos_to_charpos): Remove; unused.
17428
b45db522
PE
17429 * lisp.h (verify_bytepos, count_markers): New decls,
17430 so that gcc does not warn that these functions aren't declared.
17431
85876d07
PE
17432 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17433 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17434 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17435 (copy_text): Remove unused local var.
85876d07 17436
03d78a21 17437 * filelock.c (within_one_second): Now static.
b3dd38ab 17438 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17439
5df8f01b
PE
17440 * buffer.c (fix_overlays_before): Mark locals as initialized.
17441 (fix_start_end_in_overlays): Likewise. This function should be
17442 simplified by using pointers-to-pointers, but that's a different
17443 matter.
b1d876f1 17444 (switch_to_buffer_1): Now static.
8f54f30a
PE
17445 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17446 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17447
a70072c9 17448 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17449 Fix pointer signedness issue.
edced198
PE
17450 (sys_subshell): Mark local as volatile if checking for lint,
17451 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17452 (MAXPATHLEN): Define only if needed.
a70072c9 17453
a0977c44
PE
17454 * process.c (serial_open, serial_configure): Move decls from here ...
17455 * systty.h: ... to here, so that they can be checked.
17456
a884fdcc
PE
17457 * fns.c (get_random, seed_random): Move extern decls from here ...
17458 * lisp.h: ... to here, so that they can be checked.
17459
604efe86 17460 * sysdep.c (reset_io): Now static.
b8950c94 17461 (wait_for_termination_signal): Remove; unused.
604efe86 17462
38fc62d9
PE
17463 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17464 (copy_keymap_item, append_key, push_text_char_description):
17465 Now static.
1004a21a 17466 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17467 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17468 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17469 (describe_map_tree):
17470 Rename locals to avoid shadowing.
38fc62d9 17471
2f2650da
PE
17472 * keyboard.c: Declare functions static if they are not used elsewhere.
17473 (echo_char, echo_dash, cmd_error, top_level_2):
17474 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17475 (read_char, kbd_buffer_get_event, make_lispy_position):
17476 (make_lispy_event, make_lispy_movement, apply_modifiers):
17477 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17478 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17479 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17480 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17481 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17482
a053e86c 17483 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17484 (mark_kboards): Move decl here ...
17485 * alloc.c (mark_kboards): ... from here.
a053e86c 17486
4752793e
PE
17487 * lisp.h (force_auto_save_soon): New decl.
17488
74f10ca7 17489 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17490 (DEFINE_DUMMY_FUNCTION): New macro.
17491 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17492 Use it.
c03cd23f
PE
17493 (main): Add casts to avoid warnings
17494 if GCC considers string literals to be constants.
74f10ca7 17495
022e70d4
PE
17496 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17497
59d6fe83
PE
17498 * dbusbind.c: Pointer signedness fixes.
17499 (xd_signature, xd_append_arg, xd_initialize):
17500 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17501 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17502 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17503 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17504
78320123
PE
17505 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17506 if GCC considers string literals to be constants.
49cebcca 17507 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17508
35ac2a97
SM
175092011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17510
fb103ca9
SM
17511 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17512 (print_preprocess, print_object): New macro to fix last change.
17513
35ac2a97
SM
17514 * print.c (print_preprocess): Don't forget font objects.
17515
62973b41
JB
175162011-03-16 Juanma Barranquero <lekktu@gmail.com>
17517
17518 * emacs.c (USAGE3): Doc fixes.
17519
0e48bb22
AS
175202011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17521
17522 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17523 structure.
17524
7684e57b
JB
175252011-03-14 Juanma Barranquero <lekktu@gmail.com>
17526
17527 * lisp.h (VWindow_system, Qfile_name_history):
17528 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17529 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17530 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17531
17532 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17533 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17534
17535 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17536 * w32console.c (detect_input_pending, read_input_pending)
17537 (encode_terminal_code):
17538 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17539 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17540 (w32_system_caret_y, Qfile_name_history):
17541 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17542 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17543 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17544 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17545 * w32proc.c (Qlocal, report_file_error):
17546 * w32term.c (Vwindow_system, updating_frame):
17547 * w32uniscribe.c (initialized, uniscribe_font_driver):
17548 Remove unneeded extern declarations.
17549
2aa46d6c
CY
175502011-03-14 Chong Yidong <cyd@stupidchicken.com>
17551
c96bbc66 17552 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17553
cffc6f3b
CY
175542011-03-13 Chong Yidong <cyd@stupidchicken.com>
17555
17556 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17557 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17558 These macros can no longer be used for assignment.
17559
44f230aa
SM
17560 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17561 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17562 (record_buffer_markers, fetch_buffer_markers): New functions for
17563 recording and fetching special buffer markers.
17564 (set_buffer_internal_1, set_buffer_temp): Use them.
17565
17566 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17567
17568 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17569
17570 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17571 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17572
17573 * xdisp.c (hscroll_window_tree):
17574 (reconsider_clip_changes): Use PT instead of BUF_PT.
17575
d251f04b
EZ
175762011-03-13 Eli Zaretskii <eliz@gnu.org>
17577
17578 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17579 $(EMACS_ROOT)/lib/intprops.h.
17580
f0c77cd1
PE
175812011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17582
3eca4629
PE
17583 Fix more problems found by GCC 4.5.2's static checks.
17584
7c86ee98
PE
17585 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17586 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17587 (xg_free_frame_widgets): Make it clear that a local variable is
17588 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17589 (gdk_window_get_screen): Make it clear that this macro is needed
17590 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17591 (int_gtk_range_get_value): New function, which avoids a diagnostic
17592 from gcc -Wbad-function-cast.
17593 (xg_set_toolkit_scroll_bar_thumb): Use it.
17594 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17595 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
17596 (get_utf8_string, xg_get_file_with_chooser):
17597 Rename locals to avoid shadowing.
17598 (create_dialog): Move locals to avoid shadowing.
7c86ee98 17599
41729b81
PE
17600 * xgselect.c (xg_select): Remove unused var.
17601
f0c77cd1
PE
17602 * image.c (four_corners_best): Mark locals as initialized.
17603 (gif_load): Initialize transparent_p to zero (Bug#8238).
17604 Mark another local as initialized.
ec6cf4c6 17605 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 17606
ce0ad53d 17607 * image.c (clear_image_cache): Now static.
d5d5a617 17608 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 17609 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
17610 (x_edge_detection): Remove unnecessary cast that
17611 gcc -Wbad-function-cast diagnoses.
2037898d 17612 (gif_load): Fix pointer signedness.
6ae141d6
PE
17613 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17614 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 17615
33383987 176162011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 17617
d32df629
PE
17618 Improve quality of tests for time stamp overflow.
17619 For example, without this patch (encode-time 0 0 0 1 1
17620 1152921504606846976) returns the obviously-bogus value (-948597
17621 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17622 reports time overflow. See
17623 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
17624 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17625 * editfns.c: Include limits.h and intprops.h.
17626 (TIME_T_MIN, TIME_T_MAX): New macros.
17627 (time_overflow): Move earlier, to before first use.
17628 (hi_time, lo_time): New functions, for an accurate test for
17629 out-of-range times.
17630 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17631 (Fget_internal_run_time): Don't assume time_t fits in int.
17632 (make_time): Use list2 instead of Fcons twice.
17633 (Fdecode_time): More accurate test for out-of-range times.
17634 (check_tm_member): New function.
17635 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
17636 (lisp_time_argument): Don't rely on undefined left-shift and
17637 right-shift behavior when checking for time stamp overflow.
8be6f318 17638
fe31d94c
PE
17639 * editfns.c (time_overflow): New function, refactoring common code.
17640 (Fformat_time_string, Fdecode_time, Fencode_time):
17641 (Fcurrent_time_string): Use it.
17642
8be6f318
PE
17643 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17644 * dired.c (make_time): Move to ...
17645 * editfns.c (make_time): ... here.
17646 * systime.h: Note the move.
17647
09d9db2c 176482011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 17649
126bc0dc
YM
17650 * fringe.c (update_window_fringes): Remove unused variables.
17651
c47cbdfd
YM
17652 * unexmacosx.c (copy_data_segment): Also copy __got section.
17653 (Bug#8223)
17654
7ac80be9
EZ
176552011-03-12 Eli Zaretskii <eliz@gnu.org>
17656
c96bbc66 17657 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
17658 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17659 Constify `char *' arguments and their references according to
17660 prototypes in tparam.h.
17661
ecb0f94d 17662 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 17663
7ac80be9
EZ
17664 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17665 Adapt all references accordingly.
17666
17667 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17668
ef1fd07e
TT
176692011-03-11 Tom Tromey <tromey@redhat.com>
17670
17671 * buffer.c (syms_of_buffer): Remove obsolete comment.
17672
7ef4b50c
EZ
176732011-03-11 Eli Zaretskii <eliz@gnu.org>
17674
17675 * termhooks.h (encode_terminal_code): Declare prototype.
17676
17677 * msdos.c (encode_terminal_code): Don't declare prototype.
17678
17679 * term.c (encode_terminal_code): Now external again, used by
17680 w32console.c and msdos.c.
17681
44f230aa
SM
17682 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17683 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 17684
4b1ec863 176852011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 17686
1714f52b 17687 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 17688
4b1ec863
PE
17689 * fringe.c (update_window_fringes): Mark locals as initialized
17690 (Bug#8227).
17691 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 17692
524c7aa6
PE
17693 * alloc.c (mark_fringe_data): Move decl from here ...
17694 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17695 to check its interface.
17696 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17697
a5c0af81 17698 * fontset.c (free_realized_fontset): Now static.
7519b8cd 17699 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 17700 (fontset_font): Mark local as initialized.
a9a06e0b 17701 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 17702
b4716021
PE
17703 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17704
811e9bac 17705 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 17706 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
17707 (x_own_selection, Fx_disown_selection_internal): Rename locals
17708 to avoid shadowing.
17709 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 17710
7e3ab302
PE
17711 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17712 so that the caller can use some name other than gcpro1.
17713 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
17714 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17715 (Fx_backspace_delete_keys_p):
17716 Use them to avoid shadowing, and rename vars to avoid shadowing.
17717 (x_decode_color, x_set_name, x_window): Now static.
6b437900 17718 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 17719 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
17720 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17721 Remove unused locals.
7e3ab302
PE
17722 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17723 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17724 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17725 macros.
f78faa98 17726
e2b13473
PE
17727 * xterm.h (x_mouse_leave): New decl.
17728
77f23912
PE
17729 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17730 Remove unused functions.
cdf4ba58
PE
17731 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17732 (x_calc_absolute_position): Now static.
7411c686 17733 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 17734 Don't declare local "event" unless it's used.
ed7bf3a5
PE
17735 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17736 unless they are used.
38d0b34a
PE
17737 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17738 (x_fatal_error_signal): Remove; not used.
a6067996
PE
17739 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17740 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17741 (x_error_catcher, x_connection_closed, x_error_handler):
17742 (x_error_quitter, xembed_send_message, x_iconify_frame):
17743 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 17744 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 17745 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 17746
44f230aa
SM
17747 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17748 Rename or move locals to avoid shadowing.
6b463e58 17749 (tty_defined_color, merge_face_heights): Now static.
5967d051 17750 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
17751 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17752 does not deduce is never used uninitialized.
73719eba
PE
17753 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17754 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 17755
426994c3 17756 * terminal.c (store_terminal_param): Now static.
5489860b 17757
032f1620 17758 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 17759 (set_frame_menubar): Remove unused local.
d4323972 17760 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
17761 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17762 since they might point to immutable storage.
281585b0
PE
17763 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17764 since it's unused otherwise.
032f1620 17765
367c19e5 17766 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 17767 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
17768 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17769 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 17770 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
17771 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17772 does not deduce are never used uninitialized.
70739cbe 17773
07b48fa9
PE
17774 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17775
8868a238 17776 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
17777 * window.c (window_loop, size_window):
17778 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 17779
7e5cf297 17780 * window.c (display_buffer): Now static.
d6550a9f
PE
17781 (size_window): Mark variables that gcc -Wuninitialized
17782 does not deduce are never used uninitialized.
a586633d
PE
17783 * window.h (check_all_windows): New decl, to forestall
17784 gcc -Wmissing-prototypes diagnostic.
5b555da1 17785 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 17786
f6095868
PE
17787 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17788 shadowing.
17789 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
17790 Include <limits.h>.
17791 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17792 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
17793 (load_charset_map): Mark variables that gcc -Wuninitialized
17794 does not deduce are never used uninitialized.
53df7c11 17795 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 17796
f38b440c
PE
17797 * coding.c (coding_set_source, coding_set_destination):
17798 Use "else { /* comment */ }" rather than "else /* comment */;"
17799 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
17800 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17801 a block, when the outer 'i' will do.
17802 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17803 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17804 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17805 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17806 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17807 Rename locals to avoid shadowing.
17808 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
17809 * coding.c (emacs_mule_char, encode_invocation_designation):
17810 Now static, since they're not used elsewhere.
413bb2db 17811 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 17812 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
17813 (decode_coding_emacs_mule): Mark variables that gcc
17814 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
17815 (detect_coding_iso_2022): Initialize a local variable that might
17816 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 17817 this initialization is needed. (Bug#8211)
5f58e762
PE
17818 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17819 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17820 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17821 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17822 Remove unused macros.
f38b440c 17823
232b38b9 17824 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 17825 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 17826 * character.c (string_count_byte8): Likewise.
232b38b9 17827
fb90da1b
PE
17828 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17829 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17830
fb93dbc2
PE
17831 * chartab.c (copy_sub_char_table): Now static, since it's not used
17832 elsewhere.
5c156ace
PE
17833 (sub_char_table_ref_and_range, char_table_ref_and_range):
17834 Rename locals to avoid shadowing.
bbcd0949 17835 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 17836
7d3b3862 17837 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 17838 (BIDI_BOB): Remove unused macro.
7d3b3862 17839
6be7d3da
PE
17840 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17841 deduce are never used uninitialized.
c2ed9c8b 17842 * term.c (encode_terminal_code): Likewise.
6be7d3da 17843
75f8807f 17844 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 17845
50938595
PE
17846 * tparam.h: New file.
17847 * term.c, tparam.h: Include it.
17848 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17849 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17850 Move these decls to tparam.h, and make them agree with what
17851 is actually in tparam.c. The previous trick of using incompatible
17852 decls in different modules does not conform to the C standard.
17853 All callers of tparam changed to use tparam's actual API.
17854 * tparam.c (tparam1, tparam, tgoto):
17855 Use const pointers where appropriate.
17856
fbceeba2
PE
17857 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17858 * cm.h (struct cm): Likewise.
17859 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17860 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17861 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17862 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17863 (turn_on_face, init_tty): Likewise.
17864 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 17865
7f3f1250
PE
17866 * term.c (term_mouse_position): Rename local to avoid shadowing.
17867
e6ca6543
PE
17868 * alloc.c (mark_ttys): Move decl from here ...
17869 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17870
c40f8d15
AS
178712011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17872
17873 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17874
cfe0661d
JB
178752011-03-09 Juanma Barranquero <lekktu@gmail.com>
17876
17877 * search.c (compile_pattern_1): Remove argument regp, unused since
17878 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17879 (compile_pattern): Don't pass it.
17880
0afb4571
J
178812011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17882
17883 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17884 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17885 for ! HAVE_GTK3.
17886 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17887
17888 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17889
17890 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17891 gdk_window_get_screen, gdk_window_get_geometry,
17892 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17893 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17894 (xg_get_pixbuf_from_pixmap): New function.
17895 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17896 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17897 Call xg_get_pixbuf_from_pixmap instead of
17898 gdk_pixbuf_get_from_drawable.
17899 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17900 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17901 (xg_check_special_colors): Use GtkStyleContext and its functions
17902 for HAVE_GTK3.
17903 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17904 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17905 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
17906 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17907 Call gtk_widget_get_preferred_size.
0afb4571
J
17908 (xg_frame_resized): gdk_window_get_geometry only takes 5
17909 parameters.
44f230aa
SM
17910 (xg_win_to_widget, xg_event_is_for_menubar):
17911 Call gdk_x11_window_lookup_for_display.
0afb4571
J
17912 (xg_set_widget_bg): New function.
17913 (delete_cb): New function.
895009e1 17914 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 17915 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
17916 (xg_set_background_color): Call xg_set_widget_bg.
17917 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17918 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17919 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17920 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17921 if ! HAVE_GTK3.
17922 (update_frame_tool_bar): Call gtk_widget_hide.
17923 (xg_initialize): Use GDK_KEY_g.
17924
17925 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17926 if ! HAVE_GTK3
17927 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17928
17929 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17930 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17931 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17932
1c2cc4ef
JB
179332011-03-08 Juanma Barranquero <lekktu@gmail.com>
17934
17935 * w32xfns.c (select_palette): Check success of RealizePalette against
17936 GDI_ERROR, not zero.
17937
33383987 17938See ChangeLog.11 for earlier changes.
aac0c6e3
MR
17939
17940;; Local Variables:
17941;; coding: utf-8
aac0c6e3
MR
17942;; End:
17943
2f097256 17944 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
17945
17946 This file is part of GNU Emacs.
17947
17948 GNU Emacs is free software: you can redistribute it and/or modify
17949 it under the terms of the GNU General Public License as published by
17950 the Free Software Foundation, either version 3 of the License, or
17951 (at your option) any later version.
17952
17953 GNU Emacs is distributed in the hope that it will be useful,
17954 but WITHOUT ANY WARRANTY; without even the implied warranty of
17955 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17956 GNU General Public License for more details.
17957
17958 You should have received a copy of the GNU General Public License
17959 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.