* textmodes/rst.el: Fix compiler warning.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
a0942b9a
JD
12012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xterm.c (x_term_init): Call fixup_locale before and after calling
4 gtk_init (Bug#12392).
5
d07ff9db
CY
62012-09-23 Chong Yidong <cyd@gnu.org>
7
8 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
9 Vdynamic_library_alist.
10
11 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
12 (Fgnutls_available_p): Caller changed.
13
14 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
15 (Flibxml_parse_xml_region): Likewise.
16
17 * dispextern.h (struct image_type): Remove arg from init function.
18
19 * image.c (Finit_image_library, lookup_image_type)
20 (define_image_type): Remove now-unneeded second arg.
21 (init_xpm_functions, init_png_functions, init_jpeg_functions)
22 (init_tiff_functions, init_gif_functions, init_svg_functions):
23 Arglist and w32_delayed_load calling convention changed.
24 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 25 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 26
4d7e6e51
PE
272012-09-23 Paul Eggert <eggert@cs.ucla.edu>
28
29 Simplify and avoid signal-handling races (Bug#12471).
30 * alloc.c (die):
31 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
32 Avoid recursive loop if there's a fatal error in the function itself.
33 * atimer.c (pending_atimers):
34 * blockinput.h: Don't include "atimer.h"; no longer needed.
35 (interrupt_input_pending): Remove. All uses removed.
36 pending_signals now counts both atimers and ordinary interrupts.
37 This is less racy than having three separate pending-signal flags.
38 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
39 (input_blocked_p):
40 Rename from their upper-case counterparts BLOCK_INPUT,
41 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
42 INPUT_BLOCKED_P, and turn into functions. All uses changed.
43 This makes it easier to access volatile variables more accurately.
44 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
45 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
46 that's more reliable if the code is buggy and sets
47 interrupt_input_blocked to a negative value. All uses changed.
48 * atimer.c (deliver_alarm_signal):
49 Remove. No need to deliver this to the parent; any thread can
50 handle this signal now. All uses replaced by underlying handler.
51 * atimer.c (turn_on_atimers):
52 * dispnew.c (handle_window_change_signal):
53 * emacs.c (handle_danger_signal):
54 * keyboard.c (kbd_buffer_get_event):
55 Don't reestablish signal handler; not needed with sigaction.
56 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
57 (UNBLOCK_INPUT_TO):
58 Rework to avoid unnecessary accesses to volatile variables.
59 (UNBLOCK_INPUT_TO): Now a function.
60 (totally_unblock_input, unblock_input): New decls.
61 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
62 (init_data): Remove. Necessary stuff now done in init_signal.
63 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
64 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
65 (fatal_error_code): Remove; no longer needed.
66 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
67 it doesn't always backtrace. All uses changed. No need to reset
68 signal to default, since sigaction and/or die does that for us now.
69 Use emacs_raise (FOO), not kill (getpid (), FOO).
70 (main): Check more-accurately whether we're dumping.
71 Move fatal-error setup to sysdep.c
72 * floatfns.c: Do not include "syssignal.h"; no longer needed.
73 * gtkutil.c (xg_get_file_name, xg_get_font):
74 Remove no-longer-needed signal-mask manipulation.
75 * keyboard.c, process.c (POLL_FOR_INPUT):
76 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
77 * keyboard.c (read_avail_input): Remove.
78 All uses replaced by gobble_input.
79 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
80 (kbd_buffer_store_event_hold, gobble_input):
81 (record_asynch_buffer_change) [USABLE_SIGIO]:
82 (store_user_signal_events):
83 No need to mess with signal mask.
84 (gobble_input): If blocking input and there are terminals, simply
85 set pending_signals to 1 and return. All hooks changed to not
86 worry about whether input is blocked.
87 (process_pending_signals): Clear pending_signals before processing
88 them, in case a signal comes in while we're processing.
89 By convention callers now test pending_signals before calling us.
90 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
91 New functions, to support changes to blockinput.h.
92 (handle_input_available_signal): Now extern.
93 (reinvoke_input_signal): Remove. All uses replaced by
94 handle_async_input.
95 (quit_count): Now volatile, since a signal handler uses it.
96 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
97 callers changed. Block SIGINT only if not already blocked.
98 Clear sigmask reliably, even if Fsignal returns, which it can.
99 Omit unnecessary accesses to volatile var.
100 (quit_throw_to_read_char): No need to restore sigmask.
101 * keyboard.c (gobble_input, handle_user_signal):
102 * process.c (wait_reading_process_output):
103 Call signal-handling code rather than killing ourselves.
104 * lisp.h: Include <float.h>, for...
105 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
106 (pending_signals): Now volatile.
107 (syms_of_data): Now const if IEEE floating point.
108 (handle_input_available_signal) [USABLE_SIGIO]:
109 (terminate_due_to_signal, record_child_status_change): New decls.
110 * process.c (create_process): Avoid disaster if memory is exhausted
111 while we're processing a vfork, by tightening the critical section
112 around the vfork.
113 (send_process_frame, process_sent_to, handle_pipe_signal)
114 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
115 ignores SIGPIPE.
116 (send_process): No need for setjmp/longjmp any more, since the
117 SIGPIPE stuff is now gone. Instead, report an error if errno
118 is EPIPE.
119 (record_child_status_change): Now extern. PID and W are now args.
120 Return void, not bool. All callers changed.
121 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
122 Remove. All uses removed. This bug should be fixed now in a
123 different way.
124 (wait_for_termination_1): Use waitpid rather than sigsuspend,
125 and record the child status change directly. This avoids the
126 need to futz with the signal mask.
127 (process_fatal_action): Move here from emacs.c.
128 (emacs_sigaction_flags): New function, containing
129 much of what used to be in emacs_sigaction_init.
130 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
131 caught by emacs, to make races less likely.
132 (deliver_process_signal): Rename from handle_on_main_thread.
133 All uses changed.
134 (BACKTRACE_LIMIT_MAX): Now at top level.
135 (thread_backtrace_buffer, threadback_backtrace_pointers):
136 New static vars.
137 (deliver_thread_signal, deliver_fatal_thread_signal):
138 New functions, for more-accurate delivery of thread-specific signals.
139 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
140 (deliver_arith_signal): Handle in this thread, not
141 in the main thread, since it's triggered by this thread.
142 (maybe_fatal_sig): New function.
143 (init_signals): New arg DUMPING so that we can be more accurate
144 about whether we're dumping. Caller changed.
145 Treat thread-specific signals differently from process-general signals.
146 Block all signals while handling fatal error; that's safer.
147 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
148 on IEEE hosts.
149 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
150 Ignore SIGPIPE unless batch.
151 (emacs_backtrace): Output backtrace for the appropriate thread,
152 which is not necessarily the main thread.
153 * syssignal.h: Include <stdbool.h>.
154 (emacs_raise): New macro.
155 * xterm.c (x_connection_signal): Remove; no longer needed
156 now that we use sigaction.
157 (x_connection_closed): No need to mess with sigmask now.
158 (x_initialize): No need to reset SIGPIPE handler here, since
159 init_signals does this for us now.
160
8f4635e9
JD
1612012-09-23 Jan Djärv <jan.h.d@swipnet.se>
162
163 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
164 background rect may be larger (Bug#12445).
165
3296976d
CY
1662012-09-23 Chong Yidong <cyd@gnu.org>
167
168 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
169
d41e491e
PE
1702012-09-22 Paul Eggert <eggert@cs.ucla.edu>
171
172 * .gdbinit: Just stop at fatal_error_backtrace.
173 See Stefan Monnier's request in
174 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
175 Remove no-longer-used query of system type.
176
c88b867f
CY
1772012-09-22 Chong Yidong <cyd@gnu.org>
178
179 * search.c (Freplace_match): Doc fix (Bug#12325).
180
181 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
182
183 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
184 (Fline_end_position): Doc fix.
185
186 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
187
bb4d86b4
CY
1882012-09-22 Chong Yidong <cyd@gnu.org>
189
190 * dispextern.h (struct image_type): Add new slot, storing a type
191 initialization function.
192
193 * image.c (define_image_type): Call the image initializer function
194 if it is defined. Arguments and return value changed.
195 (valid_image_p, make_image): Callers changed.
196 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
197 (gif_type, imagemagick_type, svg_type, gs_type): Add
198 initialization functions.
199 (Finit_image_library): Call lookup_image_type.
200 (CHECK_LIB_AVAILABLE): Macro deleted.
201 (lookup_image_type): Call define_image_type here, rather than via
202 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
203 (syms_of_image): Move define_image_type calls for xbm_type and
204 pbm_type to lookup_image_type.
205
df9685f3
EZ
2062012-09-22 Eli Zaretskii <eliz@gnu.org>
207
208 * keyboard.c (timer_check_2): Move calculation of 'timers' and
209 'idle_timers' from here ...
210 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
211 lists, to avoid infloops when the timer does something stupid,
212 like reinvoke itself with the same or smaller time-out.
213 (Bug#12447)
214
8e17c9ba
MR
2152012-09-22 Martin Rudalics <rudalics@gmx.at>
216
217 * window.c (Fsplit_window_internal): Handle only Qt value of
218 Vwindow_combination_limit separately.
219 (Qtemp_buffer_resize): New symbol.
220 (Vwindow_combination_limit): New default value. Rewrite
221 doc-string.
222
589bd69b
EZ
2232012-09-22 Eli Zaretskii <eliz@gnu.org>
224
225 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
226 the new overlay string. (Bug#10159)
227
01108e3f
PE
2282012-09-22 Paul Eggert <eggert@cs.ucla.edu>
229
230 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
231 or that fprintf is async-signal-safe. POSIX doesn't require
232 either assumption.
233
82f8cd94
CY
2342012-09-22 Chong Yidong <cyd@gnu.org>
235
236 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
237 (Bug#8207).
238
3cccbd87
KH
2392012-09-22 Kenichi Handa <handa@gnu.org>
240
241 * composite.c (composition_reseat_it): Handle the case that a
242 grapheme cluster is not covered by a single font (Bug#12352).
243
09c01941
CY
2442012-09-21 Chong Yidong <cyd@gnu.org>
245
246 * image.c (define_image_type): Avoid adding duplicate types to
247 image_types (Bug#12463). Suggested by Jörg Walter.
248
acfa068f 2492012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
250
251 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
252 (print_load_command_name): Add case LC_DATA_IN_CODE.
253 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
254
acfa068f 2552012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
256
257 * eval.c (Frun_hook_with_args_until_success)
258 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
259
acfa068f 2602012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
261
262 * fileio.c (Ffile_selinux_context): Only call freecon when
263 lgetfilecon succeeded.
264 (Fset_file_selinux_context): Likewise. (Bug#12444)
265
acfa068f 2662012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
267
268 * xdisp.c (try_window_reusing_current_matrix): Under bidi
269 reordering, locate the cursor by calling set_cursor_from_row; if
270 that fails, clear the desired glyph matrix before returning a
271 failure indication to the caller. Fixes leaving garbled display
272 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
273 (compute_stop_pos_backwards): Fix a typo that caused crashes while
274 scrolling through multibyte text.
aa36e4d2 275
e99f70c8
SM
2762012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
277
278 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
279 calling mark_vectorlike since that's the one that marks the window.
280 (mark_discard_killed_buffers): Mark the final cdr.
281 * window.h (struct window): Move prev/next_buffers to the
282 non-standard fields.
283 * window.c (make_window): Initialize prev/next_buffers manually.
284
f75beb47
PE
2852012-09-20 Paul Eggert <eggert@cs.ucla.edu>
286
287 Omit unused arg EXPECTED from socket hooks.
288 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
289 * nsterm.m (ns_term_init):
290 * termhooks.h (struct terminal.read_socket_hook):
291 * w32inevt.c (w32_console_read_socket):
292 * w32term.c (w32_read_socket):
293 * xterm.c (XTread_socket):
294 Omit unused arg EXPECTED. All callers changed.
295 (store_user_signal_events): Return void, not int, since callers no
296 longer care about the return value. All uses changed.
297
b019b76a
JB
2982012-09-20 Juanma Barranquero <lekktu@gmail.com>
299
300 * w32gui.h (XParseGeometry): Do not declare.
301
05642592
PE
3022012-09-19 Paul Eggert <eggert@cs.ucla.edu>
303
e4bce92a
PE
304 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
305 Ignore 'expected'. See Eli Zaretskii in
306 <http://bugs.gnu.org/12471#8> (last line).
307
05642592
PE
308 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
309 (XParseGeometry): Now static. Substitute extremal values for
310 values that are out of range.
311
e543ae91
JD
3122012-09-19 Jan Djärv <jan.h.d@swipnet.se>
313
314 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
315
316 * nsfns.m (XParseGeometry): Remove.
317 (Fx_create_frame): Call x_set_offset to correctly interpret
318 top_pos in geometry.
319
320 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
321 (Fx_parse_geometry): If there is a space in string, call
322 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
323
45ba16c7
EZ
3242012-09-17 Eli Zaretskii <eliz@gnu.org>
325
c8b9f1bc
EZ
326 * search.c (scan_buffer): Use character positions in calls to
327 region_cache_forward and region_cache_backward, not byte
328 positions. (Bug#12196)
329
b4c932a2
EZ
330 * w32term.c (w32_read_socket): Set pending_signals to 1, like
331 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
332
45ba16c7
EZ
333 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
334 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
335 emacs_blocked_malloc, now deleted.
336
eeceac93
PE
3372012-09-17 Paul Eggert <eggert@cs.ucla.edu>
338
339 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
340 The workaround was for improving performance on Solaris 2.4, but
341 is getting in the way now. Emacs will still work if someone is
342 still running Solaris 2.4 in a museum somewhere; Sun dropped
343 support for Solaris 2.4 in 2003.
344 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
345 * process.c (create_process) [HAVE_WORKING_VFORK]:
346 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
347 since Emacs no longer uses vfork on that platform.
348
78f83752
GM
3492012-09-17 Glenn Morris <rgm@gnu.org>
350
351 * emacs.c: Use COPYRIGHT.
352
634b8cac
PE
3532012-09-16 Paul Eggert <eggert@cs.ucla.edu>
354
0caaedb1
PE
355 Remove configure's --without-sync-input option (Bug#12450).
356 When auditing signal-handling in preparation for cleaning it up,
357 I found that SYNC_INPUT has race conditions and would be a real
358 pain to fix. Since it's an undocumented and deprecated
359 configure-time option, now seems like a good time to remove it.
360 Also see <http://bugs.gnu.org/11080#16>.
361 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
362 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
363 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
364 (malloc_hysteresis):
365 (check_depth) [XMALLOC_OVERRUN_CHECK]:
366 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
367 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
368 (dont_register_blocks, bytes_used_when_reconsidered)
369 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
370 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
371 [!SYSTEM_MALLOC && !SYNC_INPUT]:
372 Remove. All uses removed.
373 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
374 implementation, one that depends on whether the new macro
375 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
376 is defined.
377 * atimer.c (run_timers, handle_alarm_signal):
378 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
379 (handle_async_input, process_pending_signals)
380 (handle_input_available_signal, init_keyboard):
381 * nsterm.m (ns_read_socket):
382 * process.c (wait_reading_process_output):
383 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
384 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
385 (emacs_write):
386 * xterm.c (XTread_socket):
387 Assume SYNC_INPUT.
388 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
389 * eval.c (handling_signal): Remove. All uses removed.
390 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
391 All uses replaced with the SYNC_INPUT version.
392 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
393 Remove decls.
394 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
395 Now static.
396
634b8cac
PE
397 * font.c (Ffont_shape_gstring): Remove unused local.
398
83da1b55
GM
3992012-09-16 Glenn Morris <rgm@gnu.org>
400
518650a5
GM
401 * Makefile.in (clean): No longer run nextstep's clean.
402
83da1b55
GM
403 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
404 (ns_frag): Remove.
405 (ns-app): Move here from ns.mk, and simplify.
406 (clean): Simplify nextstep entry.
407 * ns.mk: Remove file.
408
85a43e2e
KH
4092012-09-17 Kenichi Handa <handa@gnu.org>
410
411 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
412 not covert the last few charactes.
413
ba13e616 4142012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
415
416 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
417 here, but just check the validity of glyphs in the glyph-string.
418
a8c729af
MR
4192012-09-16 Martin Rudalics <rudalics@gmx.at>
420
421 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
422 any window as argument (Bug#12452).
423
c077c059
JD
4242012-09-16 Jan Djärv <jan.h.d@swipnet.se>
425
426 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
427 to ns_term_init to avoid memory leak.
428
429 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
430 explicit retain/release.
431 (ns_term_init): Only allow one display. Initialize outerpool and
432 ns_*_types.
433
39a57ad0
PE
4342012-09-15 Paul Eggert <eggert@cs.ucla.edu>
435
436 Port _setjmp fix to POSIXish hosts as well as Microsoft.
437 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
438 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
439 the Microsoft problem in a different way, by altering ../nt/config.nt.
440
7105c8cb
EZ
4412012-09-15 Eli Zaretskii <eliz@gnu.org>
442
443 * w32xfns.c:
444 * w32uniscribe.c:
445 * w32term.c:
446 * w32select.c:
447 * w32reg.c:
448 * w32proc.c:
449 * w32menu.c:
450 * w32inevt.c:
451 * w32heap.c:
452 * w32font.c:
453 * w32fns.c:
454 * w32console.c:
455 * w32.c:
456 * w16select.c: Remove inclusion of setjmp.h, as it is now included
457 by lisp.h. This completes removal of setjmp.h inclusion
458 erroneously announced in the previous commit. (Bug#12446)
459
460 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
461 more accurate.
462
463 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
464 not defined as a macro. The latter happens on MS-Windows.
465 (Bug#12446)
466
0328b6de
PE
4672012-09-15 Paul Eggert <eggert@cs.ucla.edu>
468
469 Port better to POSIX hosts lacking _setjmp (Bug#12446).
470 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 471 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
472 only reason for the instance was because "lisp.h" was included.
473 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
474 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
475 and _longjmp with the new symbols. Emacs already uses _setjmp if
476 available, so this change affects only POSIXish hosts that have
477 sigsetjmp but not _setjmp, such as some versions of Solaris and
478 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
479 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
480 (png_load_body) [HAVE_PNG]:
481 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
482 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
483 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
484 since PNG requires jmp_buf. This is the only exception to the
485 general rule that we now use sys_setjmp and sys_longjmp.
486 This exception is OK since this code does not change the signal
487 mask or longjmp out of a signal handler.
488
2af03429
PE
4892012-09-14 Paul Eggert <eggert@cs.ucla.edu>
490
491 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
492 Include "syssignal.h", for 'main_thread'.
493
2f294edf
DA
4942012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
495
496 Avoid out-of-range marker position (Bug#12426).
497 * insdel.c (replace_range, replace_range_2): Adjust
498 markers before overlays, as suggested by comments.
499 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
500 Remove redundant check before calling offset_intervals.
501
6b533e9c
MR
5022012-09-14 Martin Rudalics <rudalics@gmx.at>
503
504 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
505 current buffer (Bug#12387).
506
2a7931e3
JB
5072012-09-14 Juanma Barranquero <lekktu@gmail.com>
508
509 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
510
c18e885b
PE
5112012-09-13 Paul Eggert <eggert@cs.ucla.edu>
512
513 Use a more backwards-compatible timer format (Bug#12430).
514 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
515 vector element, not from the 4th, since PSECS is now at the end.
516 (Fcurrent_idle_time): Doc fix.
517
d59a1afb
DA
5182012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
519
520 Function to mark objects and remove killed buffers at once.
521 * alloc.c (discard_killed_buffers): Rename to ...
522 (mark_discard_killed buffers) ... new name. Add marking
523 of remaining objects. Fix comment. Adjust users.
524 (mark_object): Do not touch frame buffer lists here.
525 * frame.c (delete_frame): Reset frame buffer lists here.
526
5f0cb45a
PE
5272012-09-13 Paul Eggert <eggert@cs.ucla.edu>
528
8ea47e3a
PE
529 Better workaround for GNOME bug when --enable-gcc-warnings.
530 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
531 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
532 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
533
4a4bbad2
PE
534 Simplify SIGIO usage (Bug#12408).
535 The code that dealt with SIGIO was crufty and confusing, e.g., it
536 played tricks like "#undef SIGIO" but these tricks were not used
537 consistently. Simplify mostly by not #undeffing standard symbols,
538 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
539 or not as we please) rather than "defined SIGIO" (standard symbol
540 that we probably shouldn't #undef).
541 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
542 Modules that need it can include it.
543 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
544 * dispextern.h (ignore_sigio): New decl.
545 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
546 unconditionally, since it's now a no-op if !USABLE_SIGIO.
547 * emacs.c (shut_down_emacs):
548 * keyboard.c (kbd_buffer_store_event_hold):
549 Use ignore_sigio rather than invoking 'signal' directly.
550 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
551 for FIONREAD.
552 (FIONREAD, SIGIO): Do not #undef.
553 (tty_read_avail_input): Use #error rather than a syntax error.
554 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
555 for I_PIPE, used by SETUP_SLAVE_PTY.
556 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
557 * sysdep.c (croak): Remove; no longer needed. This bit of
558 temporary code, with Fred N. Fish's comment that it's temporary,
559 has been in Emacs since at least 1992!
560 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
561 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
562 * syssignal.h (croak): Remove decl.
563 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
564 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
565 now that we're termios-only.
566 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
567 * term.c (dissociate_if_controlling_tty): Use #error rather than
568 a run-time error.
569
5f0cb45a
PE
570 Work around GCC and GNOME bugs when --enable-gcc-warnings.
571 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
572 to work around GNOME bug 683906.
573 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
574 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
575 This works around GCC bug 54561.
576
40bce90b
PE
5772012-09-12 Paul Eggert <eggert@cs.ucla.edu>
578
579 More fixes for 'volatile' and setjmp/longjmp.
580 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
581 * image.c (struct png_load_context) [HAVE_PNG]: New type.
582 (png_load_body) [HAVE_PNG]:
583 (jpeg_load_body) [HAVE_JPEG]:
584 New function, with most of the old parent function's body.
585 (png_load) [HAVE_PNG]:
586 (jpeg_load) [HAVE_JPEG]:
587 Invoke the new function, to avoid longjmp munging our locals.
588 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
589 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
590 longjmp is passed 2, as the C standard doesn't guarantee this.
591 Instead, store the failure code into mgr->failure_code.
592
bfeae2cf
SM
5932012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
594
595 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
596 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
597 (syms_of_keyboard): Remove support for unread-command-char.
598
8099e36b
EZ
5992012-09-12 Eli Zaretskii <eliz@gnu.org>
600
601 * w32proc.c (sys_kill): If PID is our process ID and the signal is
602 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
603 violation. (Bug#12426)
604
92547ff9
PE
6052012-09-12 Paul Eggert <eggert@cs.ucla.edu>
606
607 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
608
45b82ad0
SM
6092012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
610
611 * eval.c: Add `inhibit-debugger'.
612 (Qinhibit_debugger): New symbol.
613 (call_debugger): Bind it instead of Qdebug_on_error.
614 (maybe_call_debugger): Test Vinhibit_debugger.
615 (syms_of_eval): Define inhibit-debugger.
616 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
617 (syms_of_xdisp): Remove inhibit-debug-on-message.
618
5779a1dc
PE
6192012-09-11 Paul Eggert <eggert@cs.ucla.edu>
620
50f2e553
PE
621 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
622 If a nonvolatile local variable is written before a _longjmp to
623 the frame containing the variable, and is read after the _longjmp,
624 the value read is indeterminate. Some local variables of type
625 'struct handler' and 'struct catchtag' are used in this way, so
626 mark each of their slots as volatile if the slot can be set before
627 _longjmp and read afterwards.
628 * lisp.h (struct handler): var and chosen_clause are now volatile.
629 (struct catchtag): val, next, and pdlcount are now volatile.
630
ae1d87e2
PE
631 * bidi.c (bidi_push_it, bidi_pop_it):
632 * fns.c (copy_hash_table):
633 * image.c (define_image_type):
634 * keyboard.c (kbd_buffer_store_event_hold):
635 * process.c (Fprocess_send_eof):
636 * xfaces.c (x_create_gc) [HAVE_NS]:
637 * xgselect.c (xg_select):
638 Prefer assignment to memcpy when either will do.
639
5779a1dc
PE
640 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
641 Use pointer-to-a-pointer to simplify and avoid a NILP check each
642 time an item is removed. No need to mark this function 'inline';
643 the compiler knows better than we do.
644
c4c9756b
JD
6452012-09-11 Jan Djärv <jan.h.d@swipnet.se>
646
647 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
648 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
649 to change_frame_size (Bug#12388).
650 (windowDidResize:): Pass YES to updateFrameSize.
651
652 * nsterm.h: Add delay parameter to updateFrameSize.
653
d73e321c
DA
6542012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
655
656 Discard killed buffers from deleted window and frame objects.
657 This reduces an amount of references to killed buffers and
658 helps GC to reclaim them faster.
659 * alloc.c (discard_killed_buffers): New function.
660 (mark_object): Use it for deleted windows and frames.
661 (mark_object): If symbol's value is set up for a killed buffer
662 or deleted frame, restore it's global binding.
663 * data.c (swap_in_global_binding): Add GC notice.
664 (swap_in_symval_forwarding): Use convenient set_blv_where.
665 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
666 * window.h: ... to here.
667
e578f381
DA
6682012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
669
670 Convenient macro to check whether the buffer is live.
671 * buffer.h (BUFFER_LIVE_P): New macro.
672 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
673 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
674
3057e615
YM
6752012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
676
677 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
678 composition cases (Bug#12364).
679
680 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
681 overhang of succeeding glyphs overlapping box cursor.
682
683 * w32term.c (x_draw_glyph_string): Likewise.
684
6fda35f2
PE
6852012-09-11 Paul Eggert <eggert@cs.ucla.edu>
686
c990426a
PE
687 Simplify, document, and port floating-point (Bug#12381).
688 The porting part of this patch fixes bugs on non-IEEE platforms
689 with frexp, ldexp, logb.
690 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
691 Now static.
692 * floatfns.c: Simplify discussion of functions that Emacs doesn't
693 support, by removing commented-out code and briefly listing the
694 C89 functions excluded. The commented-out stuff was confusing
695 maintenance, e.g., we thought we needed cbrt but it was commented out.
696 (logb): Remove decl; no longer needed.
697 (isfinite): New macro, if not already supplied.
698 (isnan): Don't replace any existing macro.
699 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
700 are present on all C89 platforms.
701 (Ffrexp): Do not special-case zero, as frexp does the right thing
702 for that case.
703 (Flogb): Do not use logb, as it doesn't have the desired meaning
704 on hosts that use non-base-2 floating point. Instead, stick with
705 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
706 frexp, to avoid getting an unspecified result.
707
6fda35f2
PE
708 * xdisp.c (Qinhibit_debug_on_message): Now static.
709
16130a58
JD
7102012-09-10 Jan Djärv <jan.h.d@swipnet.se>
711
712 * nsterm.m (ns_update_begin): Set clip path to whole view by using
713 NSBezierPath (Bug#12131).
714
d105a573
CY
7152012-09-10 Chong Yidong <cyd@gnu.org>
716
717 * fns.c (Fdelq, Fdelete): Doc fix.
718
ff55dfe8
PE
7192012-09-10 Paul Eggert <eggert@cs.ucla.edu>
720
721 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
722 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
723
e7032e7c
SM
7242012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
725
726 * lisp.h (make_lisp_ptr): New macro to replace XSET.
727 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
728 Use it.
729
e9957956
EZ
7302012-09-09 Eli Zaretskii <eliz@gnu.org>
731
aba05ce9
EZ
732 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
733 left fringe if the window has a left margin. This avoids leaving
734 traces of the cursor because its leftmost pixel is not drawn over.
735
e9957956
EZ
736 * dispnew.c (update_window_line): When the left margin area of a
737 screen line is updated, set the redraw_fringe_bitmaps_p flag of
738 that screen line. (Bug#12277)
739
f6196b87
PE
7402012-09-09 Paul Eggert <eggert@cs.ucla.edu>
741
742 Assume C89 or later for math functions (Bug#12381).
743 This simplifies the code, and makes it a bit smaller and faster,
744 and (most important) makes it easier to clean up signal handling
745 since we can stop worring about floating-point exceptions in
746 library code. That was a problem before C89, but the problem
747 went away many years ago on all practical Emacs targets.
748 * data.c, image.c, lread.c, print.c:
749 Don't include <math.h>; no longer needed.
750 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
751 might be autoconfigured, as that never happens.
752 * data.c (fmod):
753 * doprnt.c (DBL_MAX_10_EXP):
754 * print.c (DBL_DIG):
755 Remove. C89 or later always defines these.
756 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
757 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
758 (arith_error, domain_error, domain_error2):
759 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
760 no longer needed -- we simply return what C returns. All uses removed.
761 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
762 the wrapped code.
763 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
764 Remove. All uses expanded, as these macros are no longer used
765 more than once and are now more trouble than they're worth.
766 (Ftan): Use tan, not sin / cos.
767 (Flogb): Assume C89 frexp.
768 (fmod_float): Assume C89 fmod.
769 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
770 (init_floatfns): Remove. All uses removed.
771
9d7f1863
JD
7722012-09-08 Jan Djärv <jan.h.d@swipnet.se>
773
774 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
775 compositeToPoint for OSX < 10.6 (Bug#12390).
776
eabf0404
PE
7772012-09-08 Paul Eggert <eggert@cs.ucla.edu>
778
779 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
780 This produces more-accurate results.
781
0b3b1d23
JD
7822012-09-08 Jan Djärv <jan.h.d@swipnet.se>
783
784 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
785 changes (Bug#12088).
786
6dcef6ec
CY
7872012-09-08 Chong Yidong <cyd@gnu.org>
788
789 * syntax.c (Fstring_to_syntax): Doc fix.
790
aa7d57c5
JD
7912012-09-08 Jan Djärv <jan.h.d@swipnet.se>
792
793 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
794 in the internal border.
795 (x_set_window_size): Remove static variables and their usage.
796 (ns_redraw_scroll_bars): Fix NSTRACE arg.
797 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
798 fringe/internal border adjustment (Bug#11052).
799 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
800 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
801 (ns_fix_rect_ibw): Remove.
802 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
803 (ns_dumpglyphs_box_or_relief): Ditto.
804 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
805 adjustment.
806 (ns_dumpglyphs_image): Ditto.
fc0c31f8 807 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
808 border adjustment.
809 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
810 their usage. Add fringe_extended_p and its use as in other terms.
811 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
812 scroll bar was removed.
813 (updateFrameSize): New function.
814 (windowDidResize): Move code to updateFrameSize and call it.
815
816 * nsterm.h (EmacsView): Add updateFrameSize.
817
1a5432bc
CY
8182012-09-07 Chong Yidong <cyd@gnu.org>
819
b4f5313e
CY
820 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
821
1a5432bc
CY
822 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
823
1a4f1e9b
PE
8242012-09-07 Paul Eggert <eggert@cs.ucla.edu>
825
826 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
827 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
828 Problem introduced when merging patches. Noted by Eli Zaretskii in
829 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
830 * floatfns.c: Comment fix.
831 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
832 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
833 and anyway the declaration is harmless even if SIGDANGER is not defined.
834 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
835 defined BROKEN_FIONREAD). systty.h formerly did this, but other
836 source files not surprisingly expected syssignal.h to define, or
837 not define, SIGIO, and it's cleaner to do it that way, for consistency.
838 Include <sys/ioctl.h>, for FIONREAD.
839 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
840 This eliminates a problem whereby other files mysteriously had
841 to include "syssignal.h" before including "systty.h" if they
842 wanted to use "#ifdef SIGIO".
843
bc8000ff
EZ
8442012-09-07 Eli Zaretskii <eliz@gnu.org>
845
3e6d6928
EZ
846 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
847
848 * w32.c (sigemptyset): Empty the set.
849 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
850
bc8000ff
EZ
851 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
852
b4fa72f2
DA
8532012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
854
855 * alloc.c (mark_buffer): Revert unsafe marking optimization.
856 (mark_object): Likewise for frame objects.
857
30730c93
PE
8582012-09-07 Paul Eggert <eggert@cs.ucla.edu>
859
860 * syssignal.h (handle_on_main_thread): Always declare,
861 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
862 This ports to platforms without HAVE_PTHREAD.
863
2fe28299
PE
8642012-09-06 Paul Eggert <eggert@cs.ucla.edu>
865
866 Signal-handler cleanup (Bug#12327).
867 Emacs's signal handlers were written in the old 4.2BSD style with
868 sigblock and sigmask and so forth, and this led to some
869 inefficiencies and confusion. Rewrite these to use
870 pthread_sigmask etc. without copying signal sets around. Also,
871 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
872 'signal', and instead use functions that do not attempt to take
873 over the system name space. This patch causes Emacs's text
874 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
875 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
876 Do not include <signal.h> or "syssignal.h", as these
877 modules do not use signals.
878 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
879 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
880 Do not include <signal.h>, as "syssignal.h" does that for us now.
881 * atimer.c (sigmask_atimers): New function.
882 (block_atimers, unblock_atimers): New functions,
883 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
884 All uses replaced.
885 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
886 no longer needed here.
887 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 888 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
889 * sysdep.c (struct save_signal): New member 'action', replacing
890 old member 'handler'.
891 (save_signal_handlers, restore_signal_handlers):
892 Use sigaction instead of 'signal' to save and restore.
893 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
894 New function. All users of 'signal' modified to use set_sighandler
895 if they're writeonly, and to use sys_signal if they're read+write.
896 (emacs_sigaction_init, forwarded_signal): New functions.
897 (sys_signal): Remove. All uses replaced by calls to sigaction
898 and emacs_sigaction_init, or by direct calls to 'signal'.
899 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
900 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
901 all uses replaced by pthread_sigmask etc. calls.
902 * syssignal.h: Include <signal.h>.
903 (emacs_sigaction_init, forwarded_signal): New decls.
904 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
905 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
906 (sigmask, sys_sigmask): Remove; no longer needed.
907 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
908 (sigblock, sigunblock, sigfree):
909 (sigsetmask) [!defined sigsetmask]:
910 Remove. All uses replaced by pthread_sigmask.
911 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
912 no longer need to be replaced, and its typical old uses
913 are now done via emacs_sigaction_init and sigaction.
914 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
915 (sys_sigdel): Remove; unused.
916 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
917
0216c128
EZ
9182012-09-06 Eli Zaretskii <eliz@gnu.org>
919
920 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
921 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
922
c752cfa9
DA
9232012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
924
925 Explicitly mark buffer_defaults and buffer_local_symbols.
926 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
927 mark_local_symbols here.
928 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
929 since special buffers aren't marked here any more.
930 (allocate_buffer): Chain new buffer with all_buffers here...
931 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
932 not here.
933 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
934 (syms_of_buffer): Remove staticpro of the above.
935 (init_buffer_once): Set names for buffer_defaults and
936 buffer_local_symbols.
937
a864ef14
PE
9382012-09-06 Paul Eggert <eggert@cs.ucla.edu>
939
940 Use bool for booleans in font-related modules.
941 * font.c (font_intern_prop, font_style_to_value)
942 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
943 (generate_otf_features, font_check_otf_features, font_check_otf)
944 (font_match_p, font_list_entities, font_at):
945 * fontset.c (fontset_id_valid_p, reorder_font_vector
946 (fontset_find_font, Fset_fontset_font)
947 (face_suitable_for_char_p) [0]:
948 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
949 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
950 (m17n_flt_initialized, ftfont_shape_by_flt):
951 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
952 * nsfont.m (nsfont_draw):
953 * w32font.c (w32font_draw):
954 * w32term.c (x_draw_glyphless_glyph_string_foreground):
955 Use bool for booleans.
956 * font.h: Adjust to above API changes.
957 (struct font, struct font_driver, struct font_driver_list):
958 Use bool for booleans.
959 (struct font): Remove useless member encoding_type.
960 All users removed.
961 * fontset.c, xftfont.c: Omit unnecessary static decls.
962
0699fc18
DA
9632012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
964
965 * alloc.c (mark_object): Revert window marking code
966 since it's unsafe for the Fset_window_configuration.
967
20ef56db
PE
9682012-09-05 Paul Eggert <eggert@cs.ucla.edu>
969
2fe28299 970 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
971 Be more systematic about preserving errno whenever a signal
972 handler returns, even if it's not in the main thread. Do this by
973 renaming signal handlers to distinguish between signal delivery
974 and signal handling. All uses changed.
975 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
976 * data.c (deliver_arith_signal): Rename from arith_error.
977 * dispnew.c (deliver_window_change_signal): Rename from
978 window_change_signal.
979 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
980 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
981 * keyboard.c (deliver_input_available_signal): Rename from
982 input_available_signal.
983 (deliver_user_signal): Rename from handle_user_signal.
984 (deliver_interrupt_signal): Rename from interrupt_signal.
985 * process.c (deliver_pipe_signal): Rename from send_process_trap.
986 (deliver_child_signal): Rename from sigchld_handler.
987 * atimer.c (handle_alarm_signal):
988 * data.c (handle_arith_signal):
989 * dispnew.c (handle_window_change_signal):
990 * emacs.c (handle_fatal_signal, handle_danger_signal):
991 * keyboard.c (handle_input_available_signal):
992 * keyboard.c (handle_user_signal, handle_interrupt_signal):
993 * process.c (handle_pipe_signal, handle_child_signal):
994 New functions, with the actual signal-handling code taken from the
995 original respective signal handlers, sans the sporadic attempts to
996 preserve errno, since that's now done by handle_on_main_thread.
997 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
998 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
999 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1000 Move to sysdep.c.
1001 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1002 Move initialization of main_thread to sysdep.c's init_signals.
1003 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1004 our usage, and simplifies the mainline code.
1005 (record_child_status_change): New static function, as a helper
1006 for handle_child_signal, and with most of the old child handler's
1007 contents.
1008 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1009 (handle_child_signal): Use the above.
1010 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1011 Moved here from emacs.c.
1012 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1013 code moved here from emacs.c's main function.
1014 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
1015 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
1016 lets callers save and restore errno properly.
1017
e3ccf108
DA
10182012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1019
1020 Remove redundant or unused things here and there.
1021 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1022 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1023 * editfns.c (Fcompare_buffer_substrings): Likewise.
1024 * frame.h (struct terminal, struct font_driver_list):
1025 Remove redundant declarations.
1026 * window.h (Qleft, Qright): Likewise.
1027
697e1e39
DA
10282012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1029
1030 Do not mark objects from deleted buffers, windows and frames.
1031 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1032 (mark_object): Likewise for windows and frames.
1033
c1ca42ca
DA
10342012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1035
1036 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1037 buffer_defaults and buffer_local_symbols as valid objects.
1038 Return special value to denote them.
1039
014d93be
PE
10402012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1041
f75d7a91
PE
1042 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1043 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1044 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1045 (file_name_absolute_p, Fsubstitute_in_file_name):
1046 (check_executable, check_writable, Ffile_accessible_directory_p)
1047 (Fset_file_selinux_context, Fdefault_file_modes)
1048 (Finsert_file_contents, choose_write_coding_system)
1049 (Fwrite_region, build_annotations, a_write, e_write)
1050 (Fdo_auto_save):
1051 * filelock.c (boot_time_initialized, get_boot_time)
1052 (get_boot_time_1, lock_file_1, within_one_second):
1053 * floatfns.c (in_float):
1054 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1055 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1056 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1057 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1058 * window.c (compare_window_configurations):
1059 Use bool for booleans.
1060 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1061 (Fdefault_file_modes): Now mode_t, not int, for modes.
1062 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1063 (internal_delete_file): Now returns void, not a (boolean) int,
1064 since nobody was looking at the return value.
1065 * lisp.h, window.h: Adjust to above API changes.
1066
014d93be
PE
1067 * xdisp.c (set_message): Simplify and reindent last change.
1068
776f29e1
JB
10692012-09-05 Juanma Barranquero <lekktu@gmail.com>
1070
1071 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1072
7f7e0167
LI
10732012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1074
1075 * eval.c (call_debugger): Make the function non-static so that we
1076 can call it from set_message.
1077
1078 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1079 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1080
cf29dd84
PE
10812012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1082
1083 Give more-useful info on a fatal error (Bug#12328).
1084 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1085 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1086 of doing the work ourselves.
1087 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1088 do most of the work.
1089 (fatal_error_backtrace): New function, taken from the guts
1090 of the old fatal_error_signal, but with a new option to output
1091 a backtrace.
1092 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1093 info about the signal than just its number.
1094 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1095 * sysdep.c: Include <execinfo.h>
1096 (emacs_backtrace): New function, taken partly from the previous
1097 code of the 'die' function.
1098 (emacs_abort): Call fatal_error_backtrace rather than abort.
1099
972debf2
SM
11002012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1101
1102 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1103 eager (load-time) macro-expansion.
1104 * lisp.mk (lisp): Add macroexp.
1105
1088b922
PE
11062012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1107
1108 Simplify redefinition of 'abort' (Bug#12316).
1109 Do not try to redefine the 'abort' function. Instead, redo
1110 the code so that it calls 'emacs_abort' rather than 'abort'.
1111 This removes the need for the NO_ABORT configure-time macro
1112 and makes it easier to change the abort code to do a backtrace.
1113 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1114 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1115 Remove; sysdep.c's emacs_abort now takes its place.
1116 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1117 'abort' changed to use 'emacs_abort'.
1118 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1119 (abort) [!defined abort]: Rename to ...
1120 (emacs_abort): ... new name.
1121 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1122 the place of the old 'abort' in emacs.c.
1123 * w32.c, w32fns.c (abort): Do not #undef.
1124 * w32.c (emacs_abort): Rename from w32_abort.
1125
30934d33
EZ
11262012-09-04 Eli Zaretskii <eliz@gnu.org>
1127
1128 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1129 offsets[j].dv, since the y axis of the screen coordinates points
1130 down, while the y axis of the font definition coordinates points
1131 up. This fixes display of Arabic diacritics such as KASRA and
1132 KASRATAN. (Bug#11860)
1133
af26b72c
PE
11342012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1135
1136 Be more systematic about _setjmp vs setjmp.
1137 * alloc.c (test_setjmp, mark_stack):
1138 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1139 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1140 (png_load, my_error_exit, jpeg_load):
1141 * process.c (send_process_trap, send_process):
1142 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1143 The underscored versions are up to 30x faster on some hosts.
1144 Formerly, the code used setjmp+longjmp sometimes and
1145 _setjmp+_longjmp at other times, with no particular reason to
1146 prefer setjmp+longjmp.
1147
26d4541d
PE
11482012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1149
d42f4f0f 1150 Fix minor problem found by static checking.
26d4541d 1151 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1152
c5e28e39
MR
11532012-09-03 Martin Rudalics <rudalics@gmx.at>
1154
1155 * buffer.c (Fdelete_all_overlays): New function.
1156
3eab3ca9
CY
11572012-09-03 Chong Yidong <cyd@gnu.org>
1158
1159 * gtkutil.c: Add extern decl for Qxft.
1160
c04889f8
PE
11612012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1162
1882aa38
PE
1163 * emacs.c, eval.c: Use bool for boolean.
1164 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1165 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1166 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1167 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1168 (main, decode_env_path, Fdaemon_initialized):
1169 * eval.c (call_debugger, Finteractive_p, interactive_p):
1170 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1171 (maybe_call_debugger, Fbacktrace):
1172 * process.c (read_process_output, exec_sentinel):
1173 Use bool for booleans.
1174 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1175 All callers changed.
1176 * eval.c (interactive_p): Omit always-true boolean argument
1177 EXCLUDE_SUBRS_P. All callers changed.
1178 * dispextern.h, lisp.h: Reflect above API changes.
1179 * firstfile.c (dummy): Use the address of 'main', whose signature
1180 won't change, instead of the address of 'initialize', whose
1181 signature just changed from int to bool.
1182 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1183 * msdos.c (fatal_error_in_progress): ... from here.
1184 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1185 of incrementing it.
1186 (redisplay_internal, unwind_redisplay): Simply clear
1187 REDISPLAYING_P when unwinding, instead of saving its previous,
1188 always-false value and then restoring it.
1189
a411ac43
PE
1190 Clean up some extern decls.
1191 Mostly, this hoists extern decls out of .c files and into .h files.
1192 That way, we're more likely to catch errors if the interfaces change.
1193 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1194 declare xg_mark_data.
1195 * dispextern.h (x_frame_parm_handlers):
1196 * font.h (Qxft):
1197 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1198 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1199 (Qultra_bold, Qoblique, Qitalic):
1200 Move extern decl here from .c file.
1201 * alloc.c (xg_mark_data) [USE_GTK]:
1202 * doc.c (Qclosure):
1203 * eval.c (Qlexical_binding):
1204 * fns.c (time) [!HAVE_UNISTD_H]:
1205 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1206 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1207 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1208 * lread.c (Qinternal_interpreter_environment):
1209 * minibuf.c (Qbuffer):
1210 * process.c (QCfamily, QCfilter):
1211 * widget.c (free_frame_faces):
1212 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1213 * xfont.c (x_clear_errors):
1214 * xterm.c (x_frame_parm_handlers):
1215 Remove now-redundant extern decls.
1216 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1217 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1218 Now static.
1219 * xfaces.c: Remove unnecessary static decls.
1220 * xterm.c (updating_frame): Remove decl of nonexistent object.
1221
c04889f8
PE
1222 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1223 when building globals.h, as the objects that are not built on
1224 this host are not needed to compile C files on this host.
1225
8b339673
JD
12262012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1227
1228 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1229
1230 * frame.h: Add missing prototype for x_wm_set_size_hint.
1231
a08d4ba7
PE
12322012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1233
1234 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1235 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1236 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1237 (Fsubstitute_command_keys):
1238 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1239 (save_excursion_save, save_excursion_restore)
1240 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1241 (format_time_string, general_insert_function)
1242 (make_buffer_string, make_buffer_string_both)
1243 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1244 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1245 (copy_text, insert_1, insert_1_both, insert_from_string)
1246 (insert_from_string_before_markers, insert_from_string_1)
1247 (insert_from_buffer, insert_from_buffer_1, replace_range)
1248 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1249 (del_range_2, modify_region):
1250 * intervals.c (intervals_equal, balance_possible_root_interval)
1251 (adjust_intervals_for_insertion, merge_properties_sticky)
1252 (graft_intervals_into_buffer, lookup_char_property)
1253 (adjust_for_invis_intang, set_point_both)
1254 (get_property_and_range, compare_string_intervals)
1255 (set_intervals_multibyte_1, set_intervals_multibyte):
1256 * keyboard.c (decode_timer):
1257 Use bool for boolean.
1258 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1259 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1260
48c948de
CY
12612012-09-02 Chong Yidong <cyd@gnu.org>
1262
1263 * keymap.c (push_key_description): Print M-TAB as C-M-i
1264 (Bug#11758).
1265
6c49a40b
JB
12662012-09-02 Juanma Barranquero <lekktu@gmail.com>
1267
1268 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1269 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1270 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1271 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1272 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1273 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1274 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1275
4dfbd238
EZ
12762012-09-01 Eli Zaretskii <eliz@gnu.org>
1277
7e510e28
EZ
1278 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1279 more than one grapheme cluster passed to the shaper: compute the
1280 offset adjustment values separately for each cluster. (Bug#11860)
1281
4dfbd238
EZ
1282 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1283 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1284 about implicit conversions from integer to pointer.
1285
86571ae0
DC
12862012-09-01 Daniel Colascione <dancol@dancol.org>
1287
1288 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1289 system used too early.
1290
0e23ef9d
PE
12912012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1292
1293 Better seed support for (random).
1294 * emacs.c (main): Call init_random.
1295 * fns.c (Frandom): Set the seed from a string argument, if given.
1296 Remove long-obsolete Gentzel cruft.
1297 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1298 (init_random): New function.
1299
17a2cbbd
DC
13002012-09-01 Daniel Colascione <dancol@dancol.org>
1301
1302 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1303 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1304 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1305 x_wm_set_size_hint, x_query_colors, x_real_positions,
1306 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1307 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1308 all of which have been moved to common code.
1309
1310 * xfaces.c: Include TERM_HEADER instead of listing all possible
1311 window-system headers.
1312
1313 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1314 to match header.
1315
1316 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1317 directly accessing frame internals.
1318
f18cbb28 1319 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1320 globals_of_w32font.
1321
1322 * process.c: Include TERM_HEADER instead of listing all possible
1323 window-system headers.
1324
1325 * nsterm.h: Remove declarations now in frame.h. Define
1326 FRAME_X_SCREEN, FRAME_X_VISUAL.
1327
1328 * menu.c: Include TERM_HEADER instead of listing all possible
1329 window-system headers.
1330
1331 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1332 window system.
1333
1334 * keyboard.c: Include TERM_HEADER instead of listing all possible
1335 window-system headers.
1336
1337 * image.c: Include TERM_HEADER instead of listing all possible
1338 window-system headers. Declare Vlibrary_cache when compiling for
1339 Windows.
1340
1341 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1342 window system declarations.
1343
1344 * frame.h: Move common functions here: set_frame_menubar,
1345 x_set_window_size, x_sync, x_get_focus_frame,
1346 x_set_mouse_position, x_set_mouse_pixel_position,
1347 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1348 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1349 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1350 x_activate_menubar, x_real_positions, x_bitmap_icon,
1351 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1352 and x_query_colors.
1353
1354 * frame.c: Include TERM_HEADER instead of listing all possible
1355 window-system headers.
1356
1357 * font.c: Include TERM_HEADER instead of listing all possible
1358 window-system headers.
1359
1360 * emacs.c: Include TERM_HEADER.
1361
f18cbb28
EZ
1362 * dispnew.c: Include TERM_HEADER instead of listing all possible
1363 window-system headers.
17a2cbbd 1364
f18cbb28 1365 * ccl.h: Include character.h.
17a2cbbd
DC
1366
1367 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1368 the current window system; include in list of objects to link into
1369 Emacs.
1370
c650a5de
DA
13712012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1372
1373 Remove mark_ttys function and fix tty_display_info initialization.
1374 * lisp.h (mark_ttys): Remove prototype.
1375 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1376 to mark_ttys because all possible values of 'top_frame' slot are
1377 the frames which are reachable from Vframe_list.
1378 * term.c (mark_ttys): Remove.
1379 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1380
4e0f6479
DA
13812012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1382
1383 Change struct frame bitfields from unsigned char to unsigned.
1384 * frame.h (struct frame): Change type of 'display_preempted',
1385 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1386 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1387 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1388 bitfields from unsigned char to unsigned.
1389
8b96a52c
DA
13902012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1391
1392 Remove unused member of struct x_output and struct w32_output.
1393 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1394 * w32term.h (struct w32_output): Likewise.
1395
b4444c8a
JD
13962012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1397
1398 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1399 does not become zero (Bug#12234).
1400
b98521db
PE
14012012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1402
1403 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1404 for GCC 4.7.1 x86-64.
1405
31d02438
GM
14062012-08-30 Glenn Morris <rgm@gnu.org>
1407
1408 * lread.c (init_lread): For out-of-tree builds, only add the
1409 source directory's site-lisp dir to the load-path if it exists,
1410 consistent with in-tree builds. (Bug#12302)
1411
7f8941d8
JD
14122012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1413
1414 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 1415 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
1416 (windowShouldClose:): Set window_closed.
1417 (dealloc): New member, free button_values.
fc0c31f8
JB
1418 (process_dialog:): Make member function. Remove window argument,
1419 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
1420 in button_values.
1421 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 1422 with tag. Remove return self, declare return value as void.
7f8941d8
JD
1423 (addString:row:): Remove return self, declare return value as void.
1424 (addSplit): Remove return self, declare return value as void.
1425 (clicked:): Remove return self, declare return value as void.
fc0c31f8 1426 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
1427 (initFromContents:isQuestion:): Adjust call to process_dialog.
1428 Code formatting change.
1429 (timeout_handler:): Set timer_fired to YES.
1430 (runDialogAt:): Set timer_fired to NO.
1431 Handle click on close button as quit.
1432
1433 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1434 Add window_closed and button_values. Add void as return value for
1435 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1436 Add process_dialog as new member.
1437
eada0861 14382012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 1439
eada0861
GM
1440 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1441 is not one of the heaps we manage. (Bug#12242)
1442
14432012-08-28 Glenn Morris <rgm@gnu.org>
1444
1445 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1446
457294dd
MR
14472012-08-28 Martin Rudalics <rudalics@gmx.at>
1448
1449 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
1450 auto-buffer-name window parameter. Install revision of reverted
1451 fix.
457294dd 1452
4f2daf31
DA
14532012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1454
1455 Do not allow to set major mode for a dead buffer.
1456 * buffer.c (Fset_buffer_major_mode): Signal an error
1457 if the buffer is dead.
1458 (Fother_buffer, other_buffer_safely): Remove redundant
1459 nested declaration.
1460
66322887
DA
14612012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1462
1463 Always use set_buffer_if_live to restore original buffer at unwind.
1464 * buffer.h (record_unwind_current_buffer): New function.
1465 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1466 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1467 * undo.c, window.c: Adjust users.
1468 * buffer.c (set_buffer_if_live): Fix comment.
1469
a3d794a1
DA
14702012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1471
1472 Fix usage of set_buffer_internal.
1473 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1474 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1475 * coding.c (decode_coding): Omit redundant test.
1476 * fileio.c (decide_coding_unwind): Likewise.
1477 * fns.c (secure_hash): Likewise.
1478 * insdel.c (modify_region): Likewise.
1479 * keyboard.c (command_loop_1): Likewise.
1480 * print.c (PRINTFINISH): Likewise.
1481 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1482
59ea14cd
PE
14832012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1484
1485 * dispnew.c: Use bool for boolean.
1486 (frame_garbaged, display_completed, delayed_size_change)
1487 (fonts_changed_p, add_window_display_history)
1488 (add_frame_display_history, verify_row_hash)
1489 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1490 (row_equal_p, realloc_glyph_pool)
1491 (allocate_matrices_for_frame_redisplay)
1492 (showing_window_margins_p)
1493 (adjust_frame_glyphs_for_frame_redisplay)
1494 (build_frame_matrix_from_leaf_window, make_current)
1495 (mirrored_line_dance, mirror_line_dance, update_frame)
1496 (update_window_tree, update_single_window)
1497 (check_current_matrix_flags, update_window, update_text_area)
1498 (update_window_line, set_window_update_flags, scrolling_window)
1499 (update_frame_1, scrolling, buffer_posn_from_coords)
1500 (do_pending_window_change, change_frame_size)
1501 (change_frame_size_1, sit_for):
1502 Use bool for boolean.
1503 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1504 and remove last int (actually boolean) argument, which was always 0.
1505 All callers changed.
1506 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1507 * dispextern.h (struct composition_it): Use bool for boolean.
1508 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1509 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1510 * dired.c (file_name_completion):
1511 Use bool for boolean. (This was missed in an earlier change.)
1512
95072a94
MR
15132012-08-27 Martin Rudalics <rudalics@gmx.at>
1514
1515 * window.c (Fset_window_configuration): Revert first part of
1516 last change.
1517
0f19feff
JD
15182012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1519
1520 * nsterm.h (NSPanel): New class variable dialog_return.
1521
1522 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1523 dialog_return.
1524 (windowShouldClose:): Use stop instead of stopModalWithCode.
1525 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1526 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1527 event.
1528 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1529 modal loop returns.
1530
f10fe38f
PE
15312012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1532
de1339b0
PE
1533 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1534 * composite.c (find_composition, composition_gstring_p)
1535 (composition_reseat_it, find_automatic_composition):
1536 * data.c (let_shadows_buffer_binding_p)
1537 (let_shadows_global_binding_p, set_internal, make_blv)
1538 (Fmake_variable_buffer_local, Fmake_local_variable)
1539 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1540 (cons_to_signed, arith_driver):
1541 * dbusbind.c (xd_in_read_queued_messages):
1542 * dired.c (directory_files_internal, file_name_completion):
1543 Use bool for booleans.
1544 * dired.c (file_name_completion):
1545 * process.h (fd_callback):
1546 Omit int (actually boolean) argument. It wasn't being used.
1547 All uses changed.
1548 * composite.h, lisp.h: Reflect above API changes.
1549
f10fe38f
PE
1550 * cmds.c, coding.c: Use bool for booleans.
1551 * cmds.c (move_point, Fself_insert_command):
1552 * coding.h (struct composition status, struct coding_system):
1553 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1554 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1555 (emacs_mule_char, decode_coding_emacs_mule)
1556 (encode_coding_emacs_mule, detect_coding_iso_2022)
1557 (decode_coding_iso_2022, encode_invocation_designation)
1558 (encode_designation_at_bol, encode_coding_iso_2022)
1559 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1560 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1561 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1562 (encode_coding_raw_text, detect_coding_charset)
1563 (decode_coding_charset, encode_coding_charset, detect_eol)
1564 (detect_coding, get_translation_table, produce_chars)
1565 (consume_chars, reused_workbuf_in_use)
1566 (make_conversion_work_buffer, code_conversion_save)
1567 (decode_coding_object, encode_coding_object)
1568 (detect_coding_system, char_encodable_p)
1569 (Funencodable_char_position, code_convert_region)
1570 (code_convert_string, code_convert_string_norecord)
1571 (Fset_coding_system_priority):
1572 * fileio.c (Finsert_file_contents):
1573 Use bool for booleans.
1574 * coding.h, lisp.h: Reflect above API changes.
1575 * coding.c: Remove unnecessary static function decls.
1576 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1577 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1578 not a boolean 'int', since callers never look at the return value.
1579 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1580 * coding.h (decoding_buffer_size, encoding_buffer_size)
1581 (emacs_mule_string_char): Remove unused extern decls.
1582 (struct iso_2022_spec, struct coding_system):
1583 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1584 (struct emacs_mule_spec): Remove unused field 'full_support'.
1585 All initializations removed.
1586 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1587
5474c384
DA
15882012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1589
f10fe38f 1590 Fix spare memory change (Bug#12286).
5474c384
DA
1591 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1592 (valid_lisp_object_p): Likewise.
1593
c4b6914d
MR
15942012-08-27 Martin Rudalics <rudalics@gmx.at>
1595
1596 * window.c (Fset_window_configuration): Record any window's old
1597 buffer if it's replaced (see Bug#8789). If the new current
1598 buffer doesn't appear in the selected window, go to its old
1599 point (Bug#12208).
1600
35aaa1ea
DA
16012012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1602
1603 Special MEM_TYPE_SPARE to denote reserved memory.
1604 * alloc.c (enum mem_type): New memory type.
1605 (refill_memory_reserve): Use new type for spare memory.
1606 This prevents live_cons_p and live_string_p from incorrect
1607 detection of uninitialized objects from spare memory as live.
1608
6af64513
PE
16092012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1610
8b2e00a3
PE
1611 Spelling fixes.
1612 * Makefile.in (.PHONY): versioclean -> versionclean.
1613
b52d6985
PE
1614 Remove unused external symbols.
1615 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1616 * window.c (Qwindow_valid_p, decode_valid_window):
1617 Now static, not extern.
1618 * data.c (Qinterval): Remove; unused.
1619 (syms_of_data): Do not define 'interval'.
1620 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1621 * window.h (decode_valid_window):
1622 Remove decls.
1623
d5172d4f
PE
1624 * character.c, charset.c, chartab.c: Use bool for booleans.
1625 * character.c (lisp_string_width, string_count_byte8)
1626 (string_escape_byte8):
1627 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1628 (load_charset_map_from_file, map_charset_chars)
1629 (Fdefine_charset_internal, define_charset_internal)
1630 (Fdeclare_equiv_charset, find_charsets_in_text)
1631 (Ffind_charset_region, char_charset, Fiso_charset):
1632 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1633 (sub_char_table_set, sub_char_table_set_range)
1634 (char_table_set_range, optimize_sub_char_table)
1635 (map_sub_char_table):
1636 Use bool for boolean.
1637 * character.c (str_to_unibyte): Omit last boolean argument; it was
1638 always 0. All callers changed.
1639 * character.h, charset.h: Adjust to match previous changes.
1640 * character.h (char_printable_p): Remove decl of nonexistent function.
1641 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1642 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1643 are all boolean, so make them single-bit bitfields.
1644
6af64513
PE
1645 * lisp.h (ASET): Remove attempt to detect side effects.
1646 It was meant to be temporary and it often doesn't work,
1647 because when IDX has side effects the behavior of IDX==IDX
1648 is undefined. See Stefan Monnier in
1649 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1650
e1f29348
BR
16512012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1652
1653 * lisp.h (functionp): New function (extracted from Ffunctionp).
1654 (FUNCTIONP): Use it.
1655 * eval.c (Ffunctionp): Use it.
1656
17c05d74
PE
16572012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1658
0f46bc75
PE
1659 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1660 as that's faster and simpler than static storage. Don't bother
1661 with the g_main_context_query overhead if g_main_context_pending
1662 says no events are pending.
1663 (gfds, gfds_size): Remove these static vars.
1664 (xgselect_initialize): Remove; no longer needed.
1665 All uses and decls removed.
1666
ee4c0f69
PE
1667 * emacs.c (fatal_error_signal_hook): Remove.
1668 All uses removed. This leftover from old code was always 0.
1669
17c05d74
PE
1670 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1671 * casefiddle.c (casify_object, casify_region):
1672 * casetab.c (set_case_table):
1673 * category.c, category.h (word_boundary_p):
1674 * category.h (CHAR_HAS_CATEGORY):
1675 Use bool for booleans, instead of int.
1676
391ceac5
EZ
16772012-08-25 Eli Zaretskii <eliz@gnu.org>
1678
1679 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1680
2f221583
PE
16812012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1682
f4a681b0
PE
1683 On assertion failure, print backtrace if available.
1684 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1685 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1686 * Makefile.in (LIB_EXECINFO): New macro.
1687 (LIBES): Use it.
1688
2f221583
PE
1689 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1690 * bytecode.c (exec_byte_code):
1691 * callint.c (check_mark, Fcall_interactively):
1692 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1693 (getenv_internal, sync_process_alive, call_process_exited):
1694 * lisp.h (USE_SAFE_ALLOCA):
1695 Use bool for booleans, instead of int.
1696 * lisp.h, process.h: Adjust prototypes to match above changes.
1697 * callint.c (Fcall_interactively): Don't assume the mark's
1698 offset fits in 'int'.
1699
37ef52bb
PE
17002012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1701
1702 * buffer.c, buffer.h: Use bool for boolean.
1703 * buffer.c (reset_buffer_local_variables)
1704 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1705 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1706 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1707 (overlay_touches_p, overlay_strings, Foverlay_put)
1708 (report_overlay_modification, call_overlay_mod_hooks):
1709 (mmap_enlarge, mmap_set_vars):
1710 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1711 Use bool for booleans, instead of int.
1712 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1713 since the 1-or-0 return value is always ignored anyway.
1714 (mmap_initialized_p):
1715 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1716 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1717
2cc21167
PE
17182012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1719
1720 * bidi.c: Use bool for boolean.
1721 This is a bit more readable, and makes the text segment of bidi.o
1722 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1723 Presumably it's faster too.
1724 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1725 Now bool.
1726 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1727 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1728 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1729 (bidi_explicit_dir_char, bidi_level_of_next_char)
1730 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1731 Use bool for booleans, instead of int.
1732 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1733 (bidi_unshelve_cache): Adjust decls to match code.
1734
7db4ddf4
MR
17352012-08-23 Martin Rudalics <rudalics@gmx.at>
1736
1737 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1738 argument.
1739
b1bb8011
PE
17402012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1741
1742 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1743 * atimer.h: Include <stdbool.h>.
1744
ff687885
DN
17452012-08-22 Dan Nicolaescu <dann@gnu.org>
1746
1747 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1748 compile time tests instead of run time tests on systems that do
1749 not use them.
1750 (FRAME_MAC_P): Remove leftover from deleted code.
1751 * frame.c (syms_of_frame): Remove leftover from deleted code.
1752
4ce7a138
JD
17532012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1754
1755 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1756
d733ec6d
PE
17572012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1758
1759 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1760 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 1761 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
1762 (fontset_add): Return void, for FONTSET_ADD.
1763
d0d2d26f
PE
17642012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1765
fce31d69
PE
1766 * alloc.c: Use bool for booleans.
1767 (gc_in_progress, abort_on_gc)
1768 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1769 (dont_register_blocks) [GC_MALLOC_CHECK]:
1770 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1771 (check_string_bytes, make_specified_string, memory_full)
1772 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1773 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1774 (mark_stack, valid_pointer_p, make_pure_string)
1775 (Fgarbage_collect, survives_gc_p, gc_sweep):
1776 Use bool for booleans, instead of int.
1777 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1778 Remove unused local.
1779 * alloc.c (PURE_POINTER_P):
1780 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1781 * editfns.c (Fformat):
1782 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1783 (Fdo_auto_save):
1784 * fns.c (sweep_weak_table):
1785 * lisp.h (suppress_checking, push_message, survives_gc_p)
1786 (make_pure_string, gc_in_progress, abort_on_gc):
1787 * lread.c (readchar, read1):
1788 * print.c (Fprin1_to_string):
1789 * xdisp.c (push_message):
1790 Use bool for booleans affected directly or indirectly by
1791 alloc.c's changes.
1792
d0d2d26f
PE
1793 Make recently-introduced setters macros.
1794 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1795 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1796 (set_fontset_default, set_fontset_fallback): Rename from their
1797 upper-case counterparts, and make them functions rather than macros.
1798 This is more consistent with the other recently-introduced setters.
1799 These don't need to be inline, since they're local.
1800
d18e2bb6
JD
18012012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1802
1803 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1804 the loop (Bug#12247).
1805
1b9d9d16
PE
18062012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1807
1808 * lisp.h (vcopy): Use memcpy rather than our own loop.
1809 This fixes a performance regression introduced by the recent
1810 addition of vcopy. This means 'vcopy' will need to be modified
1811 for a copying collector, but that's OK. Also, tighten the
1812 checking in the assertion.
1813
b2f09701
EZ
18142012-08-21 Eli Zaretskii <eliz@gnu.org>
1815
1816 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1817 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1818 non-base glyph for the width of the base character, according to
e1f29348
BR
1819 what x_draw_composite_glyph_string_foreground expects.
1820 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
1821 expectations, to produce correct width of the composed character.
1822 Reverse the sign of the DU offset produced by ScriptPlace.
1823
9b994fed
PE
18242012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1825
1826 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1827
086ca913
DA
18282012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1829
1830 Avoid direct writes to contents member of struct Lisp_Vector.
1831 * lisp.h (vcopy): New function to copy data into vector.
1832 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1833 * fns.c (Ffillarray): Use ASET.
1834 * keyboard.c (timer_check_2): Use AREF and ASET.
1835 (append_tool_bar_item, Frecent_keys): Use vcopy.
1836 * lread.c (read_vector): Use ASET.
1837 * msdos.c (Frecent_doskeys): Use vcopy.
1838 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1839 (Finternal_merge_in_global_face): Use ASET and vcopy.
1840 * xfont.c (xfont_list_pattern): Likewise.
1841
5481664a
MR
18422012-08-21 Martin Rudalics <rudalics@gmx.at>
1843
1844 * window.c (Fwindow_point): For the selected window always return
1845 the position of its buffer's point.
1846 (Fset_window_point): For the selected window always go in its
1847 buffer to the specified position.
1848
6d470bdd
DA
18492012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1850
1851 Setter macros for fontsets.
1852 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1853 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1854 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1855 Adjust users.
1856
24564fe1
GM
18572012-08-20 Glenn Morris <rgm@gnu.org>
1858
1859 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1860 Don't assume that `ln -f' works.
1861
0a05a035
EZ
18622012-08-20 Eli Zaretskii <eliz@gnu.org>
1863
1864 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1865 and later about non-assignments with no effect. See discussion at
1866 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1867 details.
1868
e46f2325
DA
18692012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1870
1871 Inline setter functions for Lisp_Objects slots of struct specbinding.
1872 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1873 Adjust users.
1874
734fbd86
MR
18752012-08-20 Martin Rudalics <rudalics@gmx.at>
1876
1877 * window.c (select_window): Always make selected window's buffer
1878 current.
1879
f1a95992
DA
18802012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1881
1882 Use AREF and ASET for docstrings of category tables.
1883 * category.h (CATEGORY_DOCSTRING): Use AREF.
1884 (SET_CATEGORY_DOCSTRING): Use ASET.
1885 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1886
e83064be
DA
18872012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1888
1889 Inline setter functions for hash table members.
1890 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1891 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1892 (set_hash_key_and_value, set_hash_index, set_hash_next)
1893 (set_hash_hash): New functions.
1894 * charset.c, fns.c: Adjust users.
1895
4ce60d2e
DA
18962012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1897
1898 Inline getter and setter functions for per-buffer values.
1899 * buffer.h (per_buffer_default, set_per_buffer_default)
1900 (per_buffer_value, set_per_buffer_value): New functions.
1901 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1902 * buffer.c, data.c: Adjust users.
1903
c06c9690
JB
19042012-08-20 Juanma Barranquero <lekktu@gmail.com>
1905
1906 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1907
32bd4250
PE
19082012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1909
bad03192 1910 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
1911 as gnulib does this if the system doesn't.
1912 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
1913 Remove declaration. MS-Windows declares it on stdlib.h which is
1914 included by conf_post.h.
b69a6d22
PE
1915 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1916 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1917 * vm-limit.c: Include <unistd.h>, for 'environ'.
1918
22d7feb2
PE
1919 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1920 (start_of_data): Remove decl; mem-limits.h provides it.
1921
32bd4250
PE
1922 * xdisp.c (handle_invisible_prop): Make it a bit faster
1923 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1924
450809af
CY
19252012-08-19 Chong Yidong <cyd@gnu.org>
1926
1927 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1928 ends (Bug#3874).
1929
9e677988
AS
19302012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1931
6b1319ce
AS
1932 * .gdbinit: Use call instead of set when calling a function in the
1933 inferior.
1934
9e677988
AS
1935 * data.c (set_internal): Don't use set_blv_found.
1936 (Fkill_local_variable): Likewise.
1937
d7191076
AA
19382012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1939
1940 * nsfont.m (ns_ascii_average_width): Ensure the string
1941 ascii_printable is initialized with a null-terminated character
1942 array. Otherwise, it can contain undesired extra characters.
1943
e757f1c6
PE
19442012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1945
1946 port new setting code to Sun C 5.8 2005/10/13
1947 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1948 Return void, not Lisp_Object. Otherwise, the compiler
1949 complains about (A?B:C) where B is void and C is Lisp_Object
1950 when compiling CHAR_TABLE_SET, due to the recent change to
1951 the API of sub_char_table_set_contents.
1952
a999ce26
CY
19532012-08-18 Chong Yidong <cyd@gnu.org>
1954
1955 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1956 for the string case (Bug#3874).
1957
3f22b86f
PE
19582012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1959
39eb03f1
PE
1960 * buffer.h (BSET): Remove (Bug#12215).
1961 Replace all uses with calls to new setter functions.
1962 (bset_bidi_paragraph_direction, bset_case_canon_table)
1963 (bset_case_eqv_table, bset_directory, bset_display_count)
1964 (bset_display_time, bset_downcase_table)
1965 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1966 (bset_last_selected_window, bset_local_var_alist)
1967 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1968 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1969 (bset_width_table):
1970 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1971 (bset_auto_fill_function, bset_auto_save_file_format)
1972 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1973 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1974 (bset_cache_long_line_scans, bset_case_fold_search)
1975 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1976 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1977 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1978 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1979 (bset_header_line_format, bset_indicate_buffer_boundaries)
1980 (bset_indicate_empty_lines, bset_invisibility_spec)
1981 (bset_left_fringe_width, bset_major_mode, bset_mark)
1982 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1983 (bset_name, bset_overwrite_mode, bset_pt_marker)
1984 (bset_right_fringe_width, bset_save_length)
1985 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1986 (bset_scroll_up_aggressively, bset_selective_display)
1987 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1988 (bset_word_wrap, bset_zv_marker):
1989 * category.c (bset_category_table):
1990 * syntax.c (bset_syntax_table):
1991 New setter functions.
1992
6a09a33b
PE
1993 * process.h (PSET): Remove (Bug#12215).
1994 Replace all uses with calls to new setter functions.
1995 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1996 (PROCESS_INLINE): New macro.
1997 (pset_childp): New setter function.
1998 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1999 * process.c (PROCESS_INLINE):
2000 Define to EXTERN_INLINE, so that the corresponding functions
2001 are compiled into code.
2002 (pset_buffer, pset_command, pset_decode_coding_system)
2003 (pset_decoding_buf, pset_encode_coding_system)
2004 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2005 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2006 (pset_type, pset_write_queue): New setter functions.
2007
e8c17b81
PE
2008 * window.h (WSET): Remove (Bug#12215).
2009 Replace all uses with calls to new setter functions.
2010 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2011 (WINDOW_INLINE): New macro.
2012 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2013 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2014 (wset_total_lines, wset_vertical_scroll_bar)
2015 (wset_window_end_pos, wset_window_end_valid)
2016 (wset_window_end_vpos): New setter functions.
2017 * window.c (WINDOW_INLINE):
2018 Define to EXTERN_INLINE, so that the corresponding functions
2019 are compiled into code.
2020 (wset_combination_limit, wset_dedicated, wset_display_table)
2021 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2022 (wset_new_normal, wset_new_total, wset_next_buffers)
2023 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2024 (wset_prev_buffers, wset_right_fringe_width)
2025 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2026 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2027 (wset_window_parameters):
2028 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2029 (wset_column_number_displayed, wset_region_showing):
2030 New setter functions.
2031
3f22b86f
PE
2032 * termhooks.h (TSET): Remove (Bug#12215).
2033 Replace all uses with calls to new setter functions.
2034 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2035 (TERMHOOKS_INLINE): New macro.
2036 (tset_charset_list, tset_selection_alist): New setter functions.
2037 * terminal.c (TERMHOOKS_INLINE):
2038 Define to EXTERN_INLINE, so that the corresponding functions
2039 are compiled into code.
2040 (tset_param_alist): New setter function.
2041
742af32f
PE
20422012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2043
15dbb4d6
PE
2044 * keyboard.h (KSET): Remove (Bug#12215).
2045 Replace all uses with calls to new setter functions.
2046 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2047 (KEYBOARD_INLINE): New macro.
2048 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2049 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2050 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2051 New setter functions.
2052 * keyboard.c (KEYBOARD_INLINE):
2053 Define to EXTERN_INLINE, so that the corresponding functions
2054 are compiled into code.
2055 (kset_echo_string, kset_kbd_queue)
2056 (kset_keyboard_translate_table, kset_last_prefix_arg)
2057 (kset_last_repeatable_command, kset_local_function_key_map)
2058 (kset_overriding_terminal_local_map, kset_real_last_command)
2059 (kset_system_key_syms): New setter functions.
2060
f00af5b1
PE
2061 * frame.h (FSET): Remove (Bug#12215).
2062 Replace all uses with calls to new setter functions.
2063 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2064 (FRAME_INLINE): New macro.
2065 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2066 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2067 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2068 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2069 (fset_param_alist, fset_root_window, fset_scroll_bars)
2070 (fset_selected_window, fset_title, fset_tool_bar_items)
2071 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2072 * frame.c (FRAME_INLINE):
2073 Define to EXTERN_INLINE, so that the corresponding functions
2074 are compiled into code.
2075 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2076
0c94c8d6
PE
2077 A few more naming-convention fixes for getters and setters.
2078 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2079 and rename from buffer_overlays_set_before.
2080 (set_buffer_overlays_after): Move here from buffer.h, and rename
2081 from buffer_overlays_set_after.
2082 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2083 All uses changed.
2084 (set_buffer_intervals): Rename from buffer_set_intervals.
2085 * intervals.c (set_interval_object): Move here from intervals.h,
2086 and rename from interval_set_object.
2087 (set_interval_left): Move here from intervals.h, and rename from
2088 interval_set_left.
2089 (set_interval_right): Move here from intervals.h, and rename from
2090 interval_set_right.
2091 (copy_interval_parent): Move here from intervals.h, and rename from
2092 interval_copy_parent.
2093 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2094 (set_interval_plist): Rename from interval_set_plist.
2095 Return void, not Lisp_Object, since no caller uses the result.
2096 * lisp.h (string_intervals): Rename from string_get_intervals.
2097 (set_string_intervals): Rename from string_set_intervals.
2098
34dabdb7
PE
2099 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2100 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2101 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2102 All uses changed. See the end of
2103 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2104
742af32f
PE
2105 * lisp.h (CSET): Remove (Bug#12215).
2106 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2107 (set_char_table_purpose): New functions,
2108 replacing CSET. All uses changed. For example, replace
2109 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2110 "set_char_table_parent (char_table, parent);".
742af32f
PE
2111 The old version was confusing because it used the same name
2112 'parent' for two different things.
2113
a04e2c62
DA
21142012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2115
2116 Functions to get and set Lisp_Object fields of buffer-local variables.
2117 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2118 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2119 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2120 * data.c, eval.c, frame.c: Adjust users.
2121
383dcbf9
CY
21222012-08-17 Chong Yidong <cyd@gnu.org>
2123
2124 * xfaces.c (merge_face_vectors): If the target font specfies a
2125 font spec, make the font's attributes take precedence over
2126 directly-specified attributes.
2127 (merge_face_ref): Recognize :font.
2128
44386687
DA
21292012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2130
2131 Do not use memcpy for copying intervals.
2132 * intervals.c (reproduce_interval): New function.
2133 (reproduce_tree, reproduce_tree_obj): Use it.
2134 (reproduce_tree_obj): Remove prototype.
2135
927c7216
PE
21362012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2137
2138 * lisp.h (duration_to_sec_usec): Remove unused decl.
2139
93044f7b
AA
21402012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2141
2142 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2143 to an allocated instance of NSString, not to the class itself.
2144
9851e4a5
JB
21452012-08-17 Juanma Barranquero <lekktu@gmail.com>
2146
2147 * makefile.w32-in (C_CTYPE_H): New macro.
2148 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2149 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2150 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2151
620f13b0
PE
21522012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2153
2154 Use ASCII tests for character types.
2155 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2156 * xfns.c, xterm.c:
2157 Don't include <ctype.h>; was not needed.
2158 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2159 * sysdep.c, xfaces.c:
2160 Include <c-ctype.h> instead of <ctype.h>.
2161 * nsterm.m: Include <c-ctype.h>.
2162 * charset.c (read_hex):
2163 * doc.c (Fsnarf_documentation):
2164 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2165 (DRIVE_LETTER) [DOS_NT]:
2166 (Ffile_name_directory, Fexpand_file_name)
2167 (Fsubstitute_in_file_name):
2168 * font.c (font_parse_xlfd, font_parse_fcname):
2169 * frame.c (x_set_font_backend):
2170 * gtkutil.c (xg_get_font):
2171 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2172 * nsimage.m (hexchar):
2173 * nsterm.m (ns_xlfd_to_fontname):
2174 * sysdep.c (system_process_attributes):
2175 * xfaces.c (hash_string_case_insensitive):
2176 Use C-locale tests instead of locale-specific tests for character
2177 types, since we want the ASCII interpretation here, not the
2178 interpretation suitable for whatever happens to be the current locale.
2179
52162052
MR
21802012-08-16 Martin Rudalics <rudalics@gmx.at>
2181
2182 Consistently check windows for validity/liveness
2183 (Bug#11984, Bug#12025, Bug#12026).
2184 * lisp.h (CHECK_VALID_WINDOW): New macro.
2185 * window.c (decode_window): Rename to decode_live_window.
2186 (decode_valid_window, Fwindow_valid_p): New functions.
2187 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2188 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2189 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2190 (Fwindow_prev_sibling, Fwindow_combination_limit)
2191 (Fset_window_combination_limit, Fwindow_use_time)
2192 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2193 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2194 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2195 (Fwindow_hscroll, Fset_window_hscroll)
2196 (Fwindow_redisplay_end_trigger)
2197 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2198 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2199 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2200 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2201 (Fwindow_end, Fset_window_point, Fset_window_start)
2202 (Fpos_visible_in_window_p, Fwindow_line_height)
2203 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2204 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2205 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2206 (Fset_window_parameter, Fwindow_display_table)
2207 (Fset_window_display_table, Fdelete_other_windows_internal)
2208 (Fset_window_buffer, Fset_window_new_total)
2209 (Fset_window_new_normal, Fdelete_window_internal)
2210 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2211 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2212 (Fwindow_scroll_bars): Check whether argument window is a valid or
2213 live window. Update doc-strings.
2214 (syms_of_window): New symbol Qwindow_valid_p.
2215 * keyboard.c (Fposn_at_x_y): Check whether argument
2216 frame_or_window denotes a valid window.
2217
2751c80f
DA
22182012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2219
2220 Fix previous char table change.
2221 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2222 * chartab.c (optimize_sub_char_table): Likewise.
2223
032a42c8
CY
22242012-08-16 Chong Yidong <cyd@gnu.org>
2225
a2d19368
CY
2226 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2227
032a42c8
CY
2228 * xfont.c (xfont_open):
2229 * xftfont.c (xftfont_open): Set the font's max_width field.
2230
2231 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2232 min_width to space_width and average_width to the average over
2233 printable ASCII characters.
2234 (ns_char_width): Code cleanup.
2235 (ns_ascii_average_width): New utility function.
2236
2237 * font.h (struct font): Update comments.
2238
a098c930
DA
22392012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2240
032a42c8 2241 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2242 * lisp.h (CSET): New macro.
2243 (char_table_set_extras, char_table_set_contents)
2244 (sub_char_table_set_contents): New function.
2245 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2246 * syntax.c: Adjust users.
2247
8be3a09c
SM
22482012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2249
2250 * eval.c (eval_sub): Bind lexical-binding.
2251 * lread.c (Qlexical_binding): Make non-static.
2252
ac4845a6
JD
22532012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2254
ddee6515
JD
2255 * nsmenu.m (popupSession): Remove.
2256 (pop_down_menu): Remove endModalSession.
2257 (timeout_handler:): New method.
2258 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2259 Call runModalForWindow. Check timer_fired when it returns.
2260 If not set, cancel timer and break out of loop.
2261 Otherwise loop again, with a new timeout.
2262
2263 * nsterm.m: Include fcntl.h if present.
2264 (fd_entry, t_readfds, inNsSelect): Remove.
2265 (select_writefds, select_valid, select_timeout, selfds)
2266 (select_mutex, apploopnr): Add.
2267 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2268 Otherwise call kbd_buffer_store_event.
2269 (ns_send_appdefined): Remove release of fd_entry.
2270 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2271 Increment and decrement apploopnr.
2272 (ns_select): If no file descriptors, just do a NSTimer.
2273 Otherwise copy read/write masks and start select thread (fd_handler).
2274 Start main loop and wait for application defined event.
2275 Inform select thread to stop selecting after main loop is exited.
2276 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2277 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2278 (fd_handler:): Loop forever, wait for info from the main thread
2279 to either start or stop selecting. When select returns, send
2280 and appdefined event.
2281 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2282 If not call kbd_buffer_store_event.
2283
2284 * nsterm.h (EmacsApp): fd_handler takes id argument.
2285 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2286
ac4845a6
JD
2287 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2288
eb424fe3
EZ
22892012-08-15 Eli Zaretskii <eliz@gnu.org>
2290
2291 * region-cache.c (move_cache_gap): Update gap_len using the actual
2292 growth of the boundaries array. Do not change cache_len.
2293 (Bug#12196)
2294
4e6a86c6
DA
22952012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2296
2297 Generalize and cleanup font subsystem checks.
2298 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2299 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2300 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2301
5bf192ca
DA
23022012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2303
2304 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2305
f2045622
CY
23062012-08-15 Chong Yidong <cyd@gnu.org>
2307
8be3a09c
SM
2308 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2309 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2310 extract the font descriptor instead of just the font name.
2311 In that case, return a font spec instead of a string.
f2045622
CY
2312 (x_last_font_name): Move to this file from xfns.c.
2313
2314 * xfns.c (Fx_select_font): The return value can also be a font
2315 spec. Move x_last_font_name management to gtkutil.c.
2316
2317 * xfaces.c: Make font weight and style symbols non-static.
2318
7f6feb56
SM
23192012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2320
2321 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2322 (bug#12117).
2323
fecbd8ff
SM
23242012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2325
2326 * alloc.c (Fgarbage_collect): Use plural form consistently.
2327
9b8d5165
EZ
23282012-08-14 Eli Zaretskii <eliz@gnu.org>
2329
2330 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2331 iteration through the command loop. Fixes a problem whereby mouse
2332 movements are ignored until the first mouse click.
2333
f5d9e83a
PE
23342012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2335
2336 Use bool, not int, for Lisp booleans.
2337 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2338 makes Emacs a bit smaller and presumably a bit faster.
2339 * lisp.h: Include <stdbool.h>.
2340 (struct Lisp_Boolfwd, defvar_bool):
2341 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2342 * regex.c [!emacs]: Include <stdbool.h>.
2343 (false, true): Remove; <stdbool.h> does this for us now.
2344
55802e4a
CY
23452012-08-14 Chong Yidong <cyd@gnu.org>
2346
4abcdac8
CY
2347 * character.c (Fcharacterp): Doc fix (Bug#12076).
2348
2349 * data.c (Findirect_variable): Doc fix (Bug#11040).
2350
55802e4a
CY
2351 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2352
2353 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2354 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2355
8e99d072
BR
23562012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2357
2358 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2359 (bug#12022).
2360
08908aca
MR
23612012-08-14 Martin Rudalics <rudalics@gmx.at>
2362
2363 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2364 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2365 * minibuf.c (choose_minibuf_frame, read_minibuf):
2366 * w32fns.c (x_create_tip_frame):
2367 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2368 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2369
56120d6f
PE
23702012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2371
2372 * intervals.c (offset_intervals): Remove obsolete comment.
2373
67b77c0b
AS
23742012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2375
2376 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2377
f48b82fd
GR
23782012-08-14 Gergely Risko <gergely@risko.hu>
2379
2380 * coding.c (decode_coding): Record buffer modification before
2381 disabling undo_list (Bug#11773).
2382
fd318b54
DA
23832012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2384
2385 Revert and cleanup some recent overlay changes.
2386 * buffer.h (enum overlay_type): Remove.
2387 (buffer_get_overlays, buffer_set_overlays): Likewise.
2388 (buffer_set_overlays_before, buffer_set_overlays_after):
2389 New function. Adjust users.
2390 (unchain_both): Add eassert.
2391
41a62dd9
DA
23922012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2393
2394 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2395
5884c324
PE
23962012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2397
2398 * gtkutil.c (xg_mark_data): Don't assume C99.
2399
ca06f160
JD
24002012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2401
2402 * gtkutil.c (xg_frame_tb_info): New struct.
2403 (TB_INFO_KEY): New define.
2404 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2405 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2406 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2407 if not present.
2408 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 2409 is up to date. Otherwise store new data.
ca06f160
JD
2410 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2411
7864a3f7
DA
24122012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2413
2414 Use KSET for write access to Lisp_Object members of struct kboard.
2415 * keyboard.h (KSET): New macro.
2416 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2417 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2418 * xterm.c: Adjust users.
2419
4c31be61
DA
24202012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2421
2422 Use BSET for write access to Lisp_Object members of struct buffer.
2423 * buffer.h (BSET): New macro.
2424 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2425 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2426 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2427 * window.c, xdisp.c, xfns.c: Adjust users.
2428
14ae4239
BT
24292012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2430
2431 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2432
32bcadb4
JD
24332012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2434
3d29b2ce 2435 * nsterm.m (not_in_argv): New function.
fc0c31f8 2436 (application:openFile, application:openTempFile:):
3d29b2ce
JD
2437 (application:openFileWithoutUI:, application:openFiles:): Open file
2438 if not_in_argv returns non-zero (bug#12171).
2439
32bcadb4 2440 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
2441 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2442 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
2443 (xg_get_font_name): Use those functions/macros here.
2444 Reported by Frans Oilinki <moilinki@gmail.com>.
2445
9ff9402d 24462012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
2447
2448 * unexmacosx.c (copy_data_segment): Copy initialized data in
2449 statically linked libraries from input file rather than memory.
2450
db74a5fc
YM
2451 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2452 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2453 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2454
25e65510
GM
24552012-08-10 Glenn Morris <rgm@gnu.org>
2456
2457 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2458 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2459
7961135c
DA
24602012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2461
2462 Fix last change to allow compilation with low optimization levels.
2463 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2464 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2465
42b3a444
DA
24662012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2467
2468 Use common inline syntax in intervals.h.
2469 * intervals.h (INTERVALS_INLINE): New macro.
2470 Change all users from LISP_INLINE.
2471
9fb0c957
DA
24722012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2473
2474 Define Qnone once for all platforms.
2475 * frame.c (Qnone): Define here.
2476 (syms_of_frame): DEFSYM it.
2477 * lisp.h (Qnone): New declaration.
2478 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2479 * xfns.c: Remove duplication. Adjust users.
2480
65e8ee52
DA
24812012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2482
2483 Remove unused macros from intervals.h.
2484 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2485 * intervals.c: Adjust comment.
2486
9b855fd6
EZ
24872012-08-10 Eli Zaretskii <eliz@gnu.org>
2488
2489 * w32fns.c <w32_unicode_gui>: New static variable.
2490 (globals_of_w32fns): Initialize it according to os_subtype.
2491 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2492 testing os_subtype.
2493
39cb9e56 24942012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
2495 Eli Zaretskii <eliz@gnu.org>
2496
2497 Fix bug #10299 with Unicode characters sent by customized
2498 keyboards created by MSKLC.
2499 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2500 (w32_init_class): Use it to initialize the Emacs class with either
2501 ANSI or Unicode API calls.
2502 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2503 later.
2504 (w32_wnd_proc): If the character code sent by WM_CHAR or
2505 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2506 original message. Call DefWindowProcW on NT and later.
2507
9374581a
GM
25082012-08-10 Glenn Morris <rgm@gnu.org>
2509
4b94e8cf
GM
2510 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2511
9374581a
GM
2512 * lisp.h (DIRECTORY_SEP): Let configure set it.
2513
a2752828
DA
25142012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2515
2516 Use TSET for write access to Lisp_Object slots of struct terminal.
2517 * termhooks.h (TSET): New macro.
2518 * coding.c, terminal.c, xselect.c: Adjust users.
2519
cc92c454
SM
25202012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2521
2522 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2523 the failing expression, include them in the error message.
2524 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2525 * lisp.h (internal_condition_case_n): Update declaration.
2526
4cb3e6b3
DA
25272012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2528
2529 Inline functions to examine and change buffer overlays.
2530 * buffer.c (unchain_both): New function.
2531 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2532 (buffer_has_overlays): New function.
2533 (enum overlay_type): New enum.
2534 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2535 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2536
8707c1e5
DA
25372012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2538
2539 Inline functions to examine and change buffer intervals.
2540 * alloc.c (mark_interval_tree): Remove.
2541 (MARK_INTERVAL_TREE): Simplify.
2542 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2543 * intervals.c (buffer_balance_intervals): New function.
2544 (graft_intervals_into_buffer): Adjust indentation.
2545 (set_intervals_multibyte): Simplify.
2546 * buffer.h (BUF_INTERVALS): Remove.
2547 (buffer_get_intervals, buffer_set_intervals): New function.
2548 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2549 * intervals.c, textprop.c: Adjust users.
2550
ad8c997f
DA
25512012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2552
2553 Inline functions to examine and change string intervals.
2554 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2555 (string_get_intervals, string_set_intervals): New function.
2556 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2557 * lread.c, print.c, textprop.c: Adjust users.
2558
32ac3a6b
GM
25592012-08-08 Glenn Morris <rgm@gnu.org>
2560
2561 * lisp.mk (lisp): Remove language/persian.elc.
2562
77c7bcb1
DA
25632012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2564
2565 Cleanup intervals.
2566 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2567 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
2568 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2569 Adjust comment. Move under #if 0.
77c7bcb1
DA
2570 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2571 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2572
9c08a8d4
DA
25732012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2574
2575 Check total length of intervals with eassert.
2576 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2577 * intervals.c: Change all users to eassert.
2578
26d16b35
EZ
25792012-08-07 Eli Zaretskii <eliz@gnu.org>
2580
14ae4239
BT
2581 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2582 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
2583 INTERNAL_FIELD in Lisp_Cons.
2584
c644523b
DA
25852012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2586
2587 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2588 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2589 name since all xname users are fixed long time ago. Do not
2590 use INTERNAL_FIELD.
2591 (set_symbol_name, set_symbol_function, set_symbol_plist):
2592 (set_symbol_next, set_overlay_plist): New function.
2593 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2594 (struct Lisp_Overlay): Likewise.
2595 (CVAR, MVAR, SVAR): Remove.
2596 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2597 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2598 * xterm.c: Adjust users.
2599 * .gdbinit: Change to use name field of struct Lisp_Symbol
2600 where appropriate.
2601
6a3d20cc
DA
26022012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2603
2604 Basic functions to set Lisp_Object and pointer slots of intervals.
2605 * intervals.h (interval_set_parent, interval_set_object):
2606 (interval_set_left, interval_set_right, interval_set_plist):
2607 (interval_copy_parent): New function.
2608 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
2609 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2610 Adjust indentation.
6a3d20cc
DA
2611 (INTERVAL_SIZE): Remove. Adjust users.
2612 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2613
4d2b044c
DA
26142012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2615
2616 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2617 * process.h (PGET): Remove.
2618 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2619 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2620
d3d50620
DA
26212012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2622
2623 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2624 * window.h (WGET): Remove.
2625 (struct window): Do not use INTERNAL_FIELD.
2626 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2627 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2628 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2629 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2630 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2631 Adjust users.
2632
d10a51dc
CY
26332012-08-07 Chong Yidong <cyd@gnu.org>
2634
2635 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2636 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2637 (Fdelete_window_internal): Signal an error if the window is not on
2638 a live frame (Bug#12025).
2639
e69b0960
DA
26402012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2641
2642 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2643 * frame.h (FGET): Remove.
2644 (struct frame): Do not use INTERNAL_FIELD.
2645 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2646 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2647 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2648 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2649
25a20a3a
JB
26502012-08-06 Juanma Barranquero <lekktu@gmail.com>
2651
2652 * w32.c: Silence compiler warnings.
2653 (map_w32_filename): Remove unused variable `is_fat'.
2654 (chase_symlinks): Add parentheses around expression.
2655
1c6f11f4
GM
26562012-08-06 Glenn Morris <rgm@gnu.org>
2657
1db4583a
GM
2658 * sysdep.c: Respect BROKEN_GETWD.
2659
1c6f11f4
GM
2660 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2661 Let configure handle it.
2662 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2663
2b90362b
DA
26642012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2665
2666 Use GCALIGNMENT where appropriate.
2667 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2668 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2669 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2670
5f50daf2
EZ
26712012-08-06 Eli Zaretskii <eliz@gnu.org>
2672
14ae4239
BT
2673 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2674 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 2675
cbcc7007
SM
26762012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2677
2678 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2679 that should be sufficient for everyone.
2680
4d365fa4
JD
26812012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2682
2683 * keyboard.c (timer_check_2): Add break so timer_check returns next
2684 timeout.
2685
dd86bd82
DA
26862012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2687
2688 Fix Windows build errors introduced after converting to WGET and WSET.
2689 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2690 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2691
054e1668
JD
26922012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2693
2694 * nsterm.m (ns_frame_rehighlight): Use FSET.
2695
2696 * nsmenu.m (ns_update_menubar): Use FSET.
2697
21238f11
DA
26982012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2699
2700 Separate read and write access to Lisp_Object slots of Lisp_Process.
2701 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2702 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2703
077288cf
DA
27042012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2705
2706 Separate read and write access to Lisp_Object slots of struct window.
2707 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2708 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2709 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2710 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2711 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2712 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2713 Adjust users.
2714
71688bd7
DA
27152012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2716
2717 Fix Windows build errors introduced after converting to FGET and FSET.
2718 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2719 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2720 (w32_judge_scroll_bars): Change to use FSET.
2721 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2722
f99bac93
DA
27232012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2724
2725 Fix replacement typo.
2726 * window.c (replace_window): Set root_window instead of
2727 selected_window. This fixes a total window subsystem
2728 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2729
8c2a0f2d
GM
27302012-08-06 Glenn Morris <rgm@gnu.org>
2731
2732 * lisp.mk (lisp): Add language/persian.elc.
2733
edd74c35
DA
27342012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2735
2736 Separate read and write access to Lisp_Object slots of struct frame.
2737 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2738 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2739 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2740 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2741 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2742
8671676c
AS
27432012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2744
2745 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2746
663e2b3f
DA
27472012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2748
2749 Generalize common compile-time constants.
2750 * lisp.h (header_size, bool_header_size, word_size): Now here.
2751 (struct Lisp_Vector): Add comment.
2752 (struct Lisp_Bool_Vector): Move up to define handy constants.
2753 (VECSIZE, PSEUDOVECSIZE): Simplify.
2754 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2755 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2756 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2757 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2758 * xfont.c, xmenu.c: Use word_size where appropriate.
2759
d32e47af
LM
27602012-08-05 Lawrence Mitchell <wence@gmx.li>
2761
2762 * search.c (Freplace_match): Treat \? in the replacement text
2763 literally (Bug#8161).
2764
e5d9c0d1
CY
27652012-08-05 Chong Yidong <cyd@gnu.org>
2766
2767 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2768 * frame.c (Vdelete_frame_functions):
2769 * emacs.c (Vkill_emacs_hook): Doc fix.
2770
8da0576b
EZ
27712012-08-04 Eli Zaretskii <eliz@gnu.org>
2772
2773 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2774 --with-x-toolkit=no builds.
2775 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2776
02676e5d
CY
27772012-08-04 Chong Yidong <cyd@gnu.org>
2778
2779 * syntax.c (Fmodify_syntax_entry): Doc fix.
2780
97147da9
EZ
27812012-08-04 Eli Zaretskii <eliz@gnu.org>
2782
76151e2c
EZ
2783 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2784 * w32.c (init_environment): Change the default values of many
2785 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
2786 them into environment when they were not already defined.
2787 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 2788 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
2789 (check_windows_init_file): Now external, not static.
2790 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
2791 called when Vload_path is already set up.
2792
2793 * w32.h (check_windows_init_file): Add prototype.
2794
2795 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2796 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2797 compatibility with Posix platforms.
2798 (main): Move the call to check_windows_init_file to here from
2799 w32.c.
2800 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2801 any, in the DEFALT argument into the root of the Emacs build or
2802 installation tree, as appropriate.
2803
2804 * callproc.c (init_callproc_1): Call decode_env_path instead of
2805 doing its equivalent by hand.
2806 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2807 the code that sets Vexec_path run on MS-Windows.
2808
2809 * lread.c (init_lread): Add comments to #ifdef's.
2810
97147da9
EZ
2811 * msdos.c (dos_set_window_size, IT_update_begin)
2812 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2813 instead of direct references.
2814
185ee146
PE
28152012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2816
2817 Export DEFAULT_REHASH_* to GDB.
2818 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2819 Now constants, not macros.
2820
8834c57a
PE
28212012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2822
98c6f1e3
PE
2823 Remove unnecessary casts involving pointers.
2824 These casts are no longer needed now that we assume C89 or later,
2825 since they involve casting to or from void *.
2826 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2827 (make_pure_float, make_pure_vector):
2828 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2829 * macros.c (Fstart_kbd_macro):
2830 * menu.c (find_and_return_menu_selection):
2831 * minibuf.c (read_minibuf_noninteractive):
2832 * sysdep.c (closedir):
2833 * xdisp.c (x_produce_glyphs):
2834 * xfaces.c (compare_fonts_by_sort_order):
2835 * xfns.c (x_real_positions, select_visual):
2836 * xselect.c (x_stop_queuing_selection_requests)
2837 (x_get_window_property, x_get_window_property_as_lisp_data):
2838 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2839 Remove unnecessary pointer casts.
2840 * alloc.c (record_xmalloc): New function.
2841 * lisp.h (record_xmalloc): New decl.
2842 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2843 more like a function. This is because the pointer cast is not
2844 needed. All uses changed.
2845 * print.c (print_string, print_error_message): Avoid length recalc.
2846
8834c57a
PE
2847 Improve fix for macroexp crash with debugging (Bug#12118).
2848 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2849 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2850 not supposed to be invoked from the garbage collector.
2851 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2852 (gc_aset): New function, which is like ASET but can be
2853 used in the garbage collector.
2854 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2855 (set_hash_index): Use it instead of ASET.
2856
6dad7178
EZ
28572012-08-03 Eli Zaretskii <eliz@gnu.org>
2858
2859 Support symlinks on latest versions of MS-Windows.
2860 * w32.c: Include winioctl.h and aclapi.h.
2861 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2862 (revert_to_self): Forward declarations of static functions.
2863 <static BOOL g_b_init_get_security_info>:
2864 <g_b_init_create_symbolic_link>: New static flags.
2865 (globals_of_w32): Initialize them to zero.
2866 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2867 (map_w32_filename): Improve commentary. Simplify switch.
2868 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2869 headers (most versions of MinGW w32api don't).
2870 (get_security_info, create_symbolic_link)
2871 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2872 New functions.
2873 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2874 in the argument file name.
2875 (sys_access): Call unc_volume_file_attributes only if
2876 GetFileAttributes fails with network-related error codes.
2877 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2878 have the required privileges.
14ae4239 2879 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
2880 get_file_security_desc.
2881 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
2882 with addition of handling of symlinks and support for 'lstat'.
2883 If possible, get file's attributes and security information by
6dad7178
EZ
2884 handle, not by name. Produce S_IFLNK bit for symlinks, when
2885 called from 'lstat'.
2886 (stat, lstat): New functions, call 'stat_worker'.
2887 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2888 symlinks when the underlying filesystem supports them.
2889
f162bcc3
PE
28902012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2891
79ea6c20
PE
2892 Fix macroexp crash on Windows with debugging (Bug#12118).
2893 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2894 checking subscripts; problem introduced with the recent
2895 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2896 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2897 since it's used in non-static inline functions now.
2898
c0ce93fd
PE
2899 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2900 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 2901
f162bcc3
PE
2902 Use C99-style 'extern inline' if available.
2903 * buffer.h (BUFFER_INLINE):
2904 * category.h (CATEGORY_INLINE):
2905 * character.h (CHARACTER_INLINE):
2906 * charset.h (CHARSET_INLINE):
2907 * composite.h (COMPOSITE_INLINE):
2908 * dispextern.h (DISPEXTERN_INLINE):
2909 * lisp.h (LISP_INLINE):
2910 * systime.h (SYSTIME_INLINE):
2911 New macro, replacing 'static inline' in this header.
2912 * buffer.h, category.h, character.h, charset.h, composite.h:
2913 * dispextern.h, lisp.h, systime.h:
2914 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2915 * alloc.c (LISP_INLINE):
2916 * buffer.c (BUFFER_INLINE):
2917 * category.c (CATEGORY_INLINE):
2918 * character.c (CHARACTER_INLINE):
2919 * charset.c (CHARSET_INLINE):
2920 * composite.c (COMPOSITE_INLINE):
2921 * dispnew.c (DISPEXTERN_INLINE):
2922 * sysdep.c (SYSTIME_INLINE):
2923 Define to EXTERN_INLINE, so that the corresponding functions
2924 are compiled into code.
2925 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2926 (INLINE_HEADER_END): New macros.
2927 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2928 since it's used in non-static inline functions now.
a8333d03 2929 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 2930
837b365b
GM
29312012-08-02 Glenn Morris <rgm@gnu.org>
2932
d66b744d
GM
2933 * s/: Remove empty directory.
2934
837b365b
GM
2935 * s/ms-w32.h: Move to ../nt/inc.
2936 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2937 Update for new ms-w32.h location.
2938
13294f95
PE
29392012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2940
2941 Port to Solaris 8.
2942 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2943
90df0db3
GM
29442012-08-02 Glenn Morris <rgm@gnu.org>
2945
2946 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2947 hard-coding the path separator.
2948
4939150c
PE
29492012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2950
2951 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2952 This how ASET and AREF are supposed to work, and makes
2953 it easier to think about future improvements. See
2954 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2955 * charset.h (set_charset_attr): New function.
2956 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2957 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2958 (aref_addr): New function. All uses of &AREF(...) changed.
2959 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2960 (set_hash_index): New functions. All lvalue-style uses of
2961 HASH_KEY etc. changed.
2962 * keyboard.c (set_prop): New function. All lvalue-style uses
2963 of PROP changed.
2964
947b2afd
AA
29652012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2966
2967 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2968 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2969 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2970 * nsfns.m (ns_set_name_as_filename): Likewise.
2971 * nsmenu.m (ns_update_menubar): Likewise.
2972 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2973
4f5d0325
EZ
29742012-08-01 Eli Zaretskii <eliz@gnu.org>
2975
2008beae
EZ
2976 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2977 Adapt to latest changes in field names of the corresponding Lisp
288479f6 2978 objects.
2008beae 2979
4f5d0325
EZ
2980 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2981
fe3cc771
GM
29822012-08-01 Glenn Morris <rgm@gnu.org>
2983
2984 * s/msdos.h: Remove file.
2985 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2986 * Makefile.in (S_FILE): Remove.
2987 (config_h): Remove S_FILE.
2988
c90acc54
JB
29892012-08-01 Juanma Barranquero <lekktu@gmail.com>
2990
2991 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2992 Remove; moved to nt/config.nt.
2993
d8a05828
DA
29942012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2995
2996 Use INTERNAL_FIELD for conses and overlays.
2997 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2998 Remove obsolete comment.
2999 (MVAR): New macro.
3000 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3001 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3002
8271d590
DA
30032012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3004
3005 Use INTERNAL_FIELD for symbols.
3006 * lisp.h (SVAR): New macro. Adjust users.
3007 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3008 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3009
3193acd2
DA
30102012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3011
3012 Use INTERNAL_FIELD for processes.
3013 * process.h (PVAR): New macro. Adjust style.
3014 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3015 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3016
3a45383a
DA
30172012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3018
3019 Use INTERNAL_FIELD for windows.
3020 * window.h (WVAR): New macro.
3021 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3022 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3023 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3024 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3025 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3026 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3027
c1dbc63c
PE
30282012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3029
3030 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3031
5c0c0e8a
GM
30322012-08-01 Glenn Morris <rgm@gnu.org>
3033
3034 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3035 Move to configure.ac.
3036
552a99b4
JB
30372012-08-01 Juanma Barranquero <lekktu@gmail.com>
3038
3039 * makefile.w32-in (CONFIG_H): Update dependencies.
3040 (CONF_POST_H): New macro.
3041
3042 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3043
8d8e2dfe
GM
30442012-07-31 Glenn Morris <rgm@gnu.org>
3045
bc96620a
GM
3046 * Makefile.in (S_FILE): No longer set by configure.
3047
476b1b2d
GM
3048 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3049 is available.
3050 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3051
b2c7a106
GM
3052 * process.h (NULL_DEVICE):
3053 * emacs.c (SEPCHAR):
3054 * editfns.c (USER_FULL_NAME): Let configure set them.
3055
d53d062a
GM
3056 * s/README, s/template.h: Remove files.
3057
4515017f
GM
3058 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3059
8d8e2dfe
GM
3060 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3061 Move to configure.ac.
3062
5b20b3cc
EZ
30632012-07-31 Eli Zaretskii <eliz@gnu.org>
3064
1e0afd9a
EZ
3065 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3066 resulting renaming of 'struct frame' members.
3067
5b20b3cc
EZ
3068 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3069
3070 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3071 after introduction of FVAR.
3072
f1310128
JD
30732012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3074
79e721e0
JD
3075 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3076
3077 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3078 instead of compositeToPoint.
3079 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3080
8d7c7eed 3081 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3082
e34f7f79
DA
30832012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3084
3085 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3086 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3087 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3088 (BVAR): Change to use INTERNAL_FIELD.
3089 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3090 (KVAR): Change to use INTERNAL_FIELD.
3091 * frame.h (FVAR): New macro.
3092 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3093 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3094 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3095 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3096 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3097
c09bfb2f
DA
30982012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3099
3100 Miscellaneous fixes for non-default X toolkits.
3101 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3102 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3103 Move under #ifdef USE_LUCID.
3104 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3105 definition and usage to avoid warnings.
3106
14c114ae
JD
31072012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3108
3109 * nsterm.m (openFiles): Fix previous checkin.
3110
3bd21e82
PE
31112012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3112
3113 * indent.c (compute_motion): Remove unused local.
3114
c1529ded
GM
31152012-07-31 Glenn Morris <rgm@gnu.org>
3116
400d5621
GM
3117 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3118
268e2432
GM
3119 * conf_post.h [USG5_4]:
3120 Move remaining contents of s/usg5-4-common.h here.
3121 * s/usg5-4-common.h: Remove file.
3122
7552f3ee
GM
3123 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3124 * s/irix6-5.h: Remove file.
3125
6a381852
GM
3126 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3127 * s/darwin.h: Remove file.
3128
c1529ded
GM
3129 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3130 * s/hpux10-20.h: Remove file, which is now empty.
3131
b429a4ee
GM
31322012-07-30 Glenn Morris <rgm@gnu.org>
3133
3134 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3135 * Makefile.in (config_h): Add conf_post.h.
3136 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3137
adff3182
JD
31382012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3139
3140 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3141 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3142 (openFile, openTempFile, openFileWithoutUI, openFiles):
3143 Open files only if ns_do_open_file.
adff3182 3144
c32af1e4
PE
31452012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3146
7393bcbb
PE
3147 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3148 This no-op macro hasn't been needed for many years.
3149 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3150
c32af1e4
PE
3151 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3152 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3153 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3154 gdb_make_enums_visible.
3155 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3156 (DIRECTORY_SEP): Now a constant, not a macro.
3157
302fc036
EZ
31582012-07-30 Eli Zaretskii <eliz@gnu.org>
3159
3160 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3161 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3162
3163 * w32term.c <w32_keyboard_codepage>: Renamed from
3164 keyboard_codepage and now external. All users changed.
3165
3166 * w32term.h: Add declaration of w32_keyboard_codepage.
3167
3168 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3169 the codepage to translate keys to Unicode. If this argument is
3170 -1, use the value returned by GetConsoleCP. All callers changed.
3171
88fb40b4
PE
31722012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3173
0aee6912
PE
3174 Update .PHONY listings in makefiles.
3175 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3176 bootstrap-clean, distclean, maintainer-clean, versioclean,
3177 extraclean, frc.
3178
88fb40b4
PE
3179 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3180 This is a bit clearer. Fix some commentary typos.
3181
0a763bd1
GM
31822012-07-30 Glenn Morris <rgm@gnu.org>
3183
32bac6d6
GM
3184 * s/netbsd.h: Let configure include signal.h if needed.
3185 Remove file, which is now empty.
3186
b65e7c46
GM
3187 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3188 Let configure set them.
3189 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3190 No more need to undefine.
0a763bd1 3191
169304bd
AS
31922012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3193
3194 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3195 non-single-byte char when adding meta modifier. (Bug#12090)
3196
6cd7a139
DA
31972012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3198
3199 Convert safe_call to use variable number of arguments.
3200 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3201 (safe_call2): Fix comment.
3202 * lisp.h (safe_call): Adjust prototype.
3203 * coding.c (encode_coding_object): Change to use safe_call2.
3204 * xfaces.c (merge_face_heights): Change to use safe_call1.
3205
d34d6ffc
GM
32062012-07-30 Glenn Morris <rgm@gnu.org>
3207
7b8a48e4 3208 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3209 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3210
d34d6ffc
GM
3211 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3212 Remove empty files.
3213
03a660a6
PE
32142012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3215
3216 Export to GDB most of lisp.h's remaining object-like macros.
3217 * lisp.h (min, max): Move earlier, because they're used earlier now.
3218 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3219 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3220 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3221 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3222 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3223 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3224 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3225 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3226 Now constants, for GDB. They need not be macros.
3227 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3228 Now constants, for GDB, as well as macros, for static initializers.
3229 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3230 Move to after the definition of struct Lisp_Char_Table,
3231 since the former now needs that type defined.
3232 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3233 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3234 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3235 New enums, for gdb_make_enums_visible.
3236 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3237 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3238 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3239 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3240 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3241 enum maxargs, enum MAX_ALLOCA.
3242 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3243 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3244 no longer needed, now that they are done in lisp.h.
3245
e499d0ee
DA
32462012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3247
3248 Cleanup string bytes checking.
3249 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3250 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3251 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3252 (check_sblock, compact_small_strings): Simplify.
3253
d5040d2d
PE
32542012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3255
3256 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3257 These macros are confusing and no longer need to be defined, as
3258 the enum values now suffice. All uses replaced with definiens.
3259 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3260
7f259ae6
JB
32612012-07-29 Juanma Barranquero <lekktu@gmail.com>
3262
3263 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3264 ($(BLD)/w32console.$(O)): Update dependencies.
3265
7e63e0c3
DA
32662012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3267
3268 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3269 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3270 time. Adjust users.
3271 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3272
ffd817eb
JD
32732012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3274
3275 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3276 setting sitelisp (Bug#12010).
3277
417a7a0e
EZ
32782012-07-29 Eli Zaretskii <eliz@gnu.org>
3279
14ae4239 3280 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3281
3282 * w32heap.c (cache_system_info):
3283 * w32.c (sys_rename):
3284 * w32proc.c (find_child_console, sys_kill): All users changed.
3285
387d4d92
PE
32862012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3287
3288 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3289
55a6cca6
EZ
32902012-07-29 Eli Zaretskii <eliz@gnu.org>
3291
3292 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3293
dbcf001c
DA
32942012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3295
3296 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3297 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3298 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3299
e2688e4a
DA
33002012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3301
3302 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3303 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3304 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3305 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3306 (replace_range, replace_range_2, del_range_2): Change to eassert.
3307 * marker.c (byte_char_debug_check): Adjust style.
3308
b46a6a83
PE
33092012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3310
3311 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3312 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3313 long-ago-commented-out code that talks about "WIN32".
3314 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3315 All uses changed.
3316
e32a5799
PE
33172012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3318
3319 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3320 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3321 Simplify by using alignof.
3322 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3323 * lisp.h: Include <stdalign.h>.
3324 (GCALIGNMENT): New macro and constant.
3325 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3326 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3327 (stdalign): New macro, if not already defined.
3328
df81cd29
EZ
33292012-07-28 Eli Zaretskii <eliz@gnu.org>
3330
01bd1b0d
EZ
3331 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3332 * w32inevt.c: Include w32inevt.h.
3333 (w32_read_console_input): New inline function, calls either
3334 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3335 w32_console_unicode_input.
3336 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3337 (w32_kbd_patch_key, key_event): Use the codepage returned by
3338 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3339 (key_event): use uChar.UnicodeChar only if
3340 w32_console_unicode_input is non-zero.
3341
3342 * w32console.c: Include w32heap.h.
3343 <w32_console_unicode_input>: New global variable.
3344 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3345 family of Windows, zero otherwise.
3346
3347 * w32inevt.h: Declare w32_console_unicode_input.
3348
df81cd29
EZ
3349 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3350 --without-x. (Bug#11742)
3351
c20fdd9e
PE
33522012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3353
3354 Adjust GDB to reflect pvec_type changes (Bug#12036).
3355 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3356 2012-07-04 changes to pseudovector representation.
3357 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3358
32770973 33592012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3360
3361 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3362 bus address.
3363 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3364
3438fe21
EZ
33652012-07-27 Eli Zaretskii <eliz@gnu.org>
3366
bcfbc9de
EZ
3367 * alloc.c (listn): Fix the order the arguments are consed onto the
3368 list.
3369
3438fe21
EZ
3370 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3371 enumeration constants, as PURE and HEAP are too general, and clash
3372 with other headers and sources, such as gmalloc.c and the
3373 MS-Windows system headers. All users changed.
3374
eeaea515
DA
33752012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3376
3377 Revert last save_excursion_save and save_excursion_restore changes.
3378 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3379 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3380
073c88c2
DA
33812012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3382
3383 Fix recently-introduced typos in Windows port.
3384 Reported by Martin Rudalics <rudalics@gmx.at>.
3385 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 3386 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 3387
4706125e
PE
33882012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3389
3390 Improve GDB symbol export (Bug#12036).
3391 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3392 arms of an 'if', not using conditional expressions; otherwise GDB
3393 complains about the types in the unevaluated arm when the argument
3394 is an integer literal.
3395 (xgetint): Simplify expression.
3396 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3397 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3398 Zaretskii in <http://bugs.gnu.org/12036#13>.
3399 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3400 needed now that we have gdb_make_enums_visible.
3401 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3402 (enum enum_USE_LSB_TAG):
3403 New enum types, packaging up enums that need to be exported to GDB.
3404
694b6c97
DA
34052012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3406
3407 Utility function to make a list from specified amount of objects.
3408 * lisp.h (enum constype): New datatype.
3409 (listn): New prototype.
3410 * alloc.c (listn): New function.
3411 (Fmemory_use_count, syms_of_alloc): Use it.
3412 * buffer.c (syms_of_buffer): Likewise.
3413 * callint.c (syms_of_callint): Likewise.
3414 * charset.c (define_charset_internal): Likewise.
3415 * coding.c (syms_of_coding): Likewise.
3416 * keymap.c (syms_of_keymap): Likewise.
3417 * search.c (syms_of_search): Likewise.
3418 * syntax.c (syms_of_syntax): Likewise.
3419 * w32.c (init_environment): Likewise.
3420 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3421 * xdisp.c (syms_of_xdisp): Likewise.
3422 * xfns.c (syms_of_xfns): Likewise.
3423
6195f384
DA
34242012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3425
3426 Fast save_excursion_save and save_excursion_restore.
3427 * lisp.h (struct Lisp_Excursion): New data type.
3428 (PVEC_EXCURSION): New pseudovector type.
3429 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3430 to deal with it. Adjust comments.
3431 (init_marker, attach_marker): New prototype.
3432 (unchain_marker): Adjust prototype.
3433 * marker.c (attach_marker): Change to global.
3434 (init_marker): New function.
3435 * alloc.c (Fmake_marker, build_marker): Use it.
3436 (build_marker): More easserts.
3437 (mark_object): Handle struct Lisp_Excursion.
3438 * editfns.c (save_excursion_save, save_excursion_restore):
3439 Reimplement to use struct Lisp_Excursion. Add comments.
3440
5eceb8fb
PE
34412012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3442
3443 Fix export of symbols to GDB (Bug#12036).
3444 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3445 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3446 emacs.c, as this is a more-suitable home. Had this been done earlier
3447 the fix for 12036 would have avoided some of the problems noted in
3448 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3449 would have been more obvious.
562157c8
PE
3450 * emacs.c: Do not include <verify.h>; no longer needed.
3451 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
3452 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3453 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3454 Remove; now done in lisp.h.
3455 * lisp.h (PUBLISH_TO_GDB): New macro.
3456 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3457 (DATA_SEG_BITS): Use it.
3458 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3459 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3460 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3461 not be usable in #if. This simplifies things.
3462
d6749401
JB
34632012-07-26 Juanma Barranquero <lekktu@gmail.com>
3464
3465 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3466
1781b9e9
PE
34672012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3468
d89518db 3469 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
3470 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3471 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3472 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3473 Adjust to changes in lisp.h and emacs.c, by using
3474 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3475 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3476 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3477 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3478 instead of gdb_valbits.
3479 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3480 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3481 instead of gdb_array_mark_flag.
3482 (xboolvector): Get size from $->size, not $->header.size.
3483 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3484 (xreload, hook-run, hookpost-run): Remove.
3485 * emacs.c: Include <verify.h>.
3486 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3487 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3488 Remove.
3489 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3490 (gdb_USE_LSB_TAG): New enum constants.
3491 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3492 Also define these as enum constants, so they're visible to GDB.
3493 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3494 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3495 as constants, so they're visible to GDB.
3496 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3497 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3498 Now enum constants, not macros, so they're visible to GDB.
3499 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3500 more convenient now. All uses changed.
3501 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3502 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3503
3628596a
DA
35042012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3505
3506 Explicitly free restriction data that are not needed anymore.
3507 * editfns.c (save_restriction_restore): Free restriction data.
3508
7abaf5cc
SM
35092012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3510
3511 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3512 add argument, tune behavior, and adjust all callers.
3513
71f88e00
PE
35142012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3515
3516 Use typedef for EMACS_INT, EMACS_UINT.
3517 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3518 than macros. This simplifies debugging in the usual case, since
3519 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3520 and it allows expressions involving EMACS_INT casts.
3521 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3522
57ec3034
JD
35232012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3524
3525 * nsterm.m (ns_read_socket): Return early if there is a modal
3526 window (Bug#12043).
3527
8137e7b3
MR
35282012-07-25 Martin Rudalics <rudalics@gmx.at>
3529
3530 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3531 that FOCUS-FRAME can be omitted.
3532
04e9897c
DA
35332012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3534
3535 Adjust buffer text indirection counters at the end of Fkill_buffer.
3536 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3537 buffer is definitely dead. This should really fix an issue reported
3538 by Christoph Scholtes again. (Bug#12007).
3539 (init_buffer_once): Initialize indirection counters of
3540 buffer_defaults and buffer_local_symbols (for sanity and safety).
3541
8a0484e1
EZ
35422012-07-24 Eli Zaretskii <eliz@gnu.org>
3543
3544 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3545 and continuation glyphs on tooltip frames, leave them at zero.
3546 Avoids continued lines in tooltips. (Bug#11832)
3547
fa691a83
DA
35482012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3549
3550 Simplify copy_overlay.
04e9897c 3551 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
3552 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3553
436bc8e0
EZ
35542012-07-23 Eli Zaretskii <eliz@gnu.org>
3555
3556 * print.c (print_object): Don't crash when a frame's name is nil
3557 or invalid. (Bug#12025)
3558
3559 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3560 it signals an error when a tooltip frame is being created.
3561
d7a7fda3
DA
35622012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3563
3564 Cleanup miscellaneous objects allocation and initialization.
3565 * alloc.c (allocate_misc): Change to static. Add argument to
3566 specify the subtype. Adjust comment and users.
3567 (build_overlay): New function.
3568 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3569 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3570 (allocate_misc): Remove prototype.
3571 (build_overlay): Add prototype.
3572
35732012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
3574
3575 Swap buffer text indirection counters in Fbuffer_swap_text.
3576 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3577 This avoids crash reported by Christoph Scholtes at
3578 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3579
9d7fa573
JD
35802012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3581
3582 * nsmenu.m (Popdown_data): New struct.
3583 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3584 free Popdown_data.
3585 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3586 (initWithContentRect): Make imgView and contentView non-static
3587 and autorelease them. Also autorelease img and matrix (Bug#12005).
3588 (dealloc): Remove (Bug#12005).
3589
0dd6d66d
DA
35902012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3591
3592 Adjust consing_since_gc when objects are explicitly freed.
3593 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3594 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3595 (free_cons, free_misc): Subtract object size from consing_since_gc.
3596
d36d71df
DA
35972012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3598
3599 Simplify and cleanup markers positioning code.
3600 * marker.c (attach_marker): More useful eassert.
3601 (live_buffer, set_marker_internal): New function.
3602 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3603 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3604
fb9ea40f
PE
36052012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3606
3607 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3608 as it's limited by the amount of memory, not by INT_MAX.
3609
2d5c5f7d
EZ
36102012-07-21 Eli Zaretskii <eliz@gnu.org>
3611
07fb592e
EZ
3612 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3613 in special-event-map. See the discussion at
3614 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3615 for the reasons.
3616
37a9eac8 3617 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
3618 info.dwItemData. Fixes crashes on 64-bit Windows.
3619 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 3620
c4328746
JD
36212012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3622
fc0c31f8 3623 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 3624 (conversationIdentifier): Return value is NSInteger.
784051c4 3625 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 3626
6e5d1c12
CY
36272012-07-21 Chong Yidong <cyd@gnu.org>
3628
3629 * window.c (decode_any_window): Signal an error if the window is
3630 on a dead frame (Bug#11984).
3631
9928463d
DA
36322012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3633
3634 Add indirection counting to speed up Fkill_buffer.
3635 * buffer.h (struct buffer): New member.
3636 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3637 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3638 base buffer indirection counter.
3639 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3640 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3641 through buffer list if indirection counter is 0.
3642
f8643a6b
DA
36432012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3644
3645 Extend the value returned by Fgarbage_collect with heap statistics.
3646 * alloc.c (Qheap): New symbol.
3647 (syms_of_alloc): DEFSYM it.
3648 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3649 (Fmemory_free): Remove.
3650 (syms_of_alloc): Don't defsubr it.
3651 * buffer.c (Fcompact_buffer): Remove.
3652 (syms_of_buffer): Don't defsubr it.
3653
dac616ff
DA
36542012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3655
3656 Make maybe_gc inline.
3657 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3658 * lisp.h (consing_since_gc, gc_relative_threshold)
3659 (memory_full_cons_threshold): Revert declaration.
3660 (maybe_gc): Remove prototype, define as inline.
3661 * alloc.c: Remove old commented-out code.
3662 (consing_since_gc, gc_relative_threshold)
3663 (memory_full_cons_threshold): Revert to global.
3664 (maybe_gc): Remove.
3665
d7ea76b4
DA
36662012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3667
3668 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3669 * lisp.h (build_unibyte_string): New function.
3670 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3671 * sysdep.c, w32fns.c, xfns.c: Use it.
3672 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3673 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3674 Adjust users accordingly.
3675 * font.h (font_open_by_name): Adjust prototype.
3676
765e61e3
DA
36772012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3678
3679 Cleanup calls to Fgarbage_collect.
3680 * lisp.h (maybe_gc): New prototype.
3681 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3682 Remove declarations.
3683 * alloc.c (maybe_gc): New function.
3684 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3685 Make them static.
3686 * bytecode.c (MAYBE_GC): Use maybe_gc.
3687 * eval.c (eval_sub, Ffuncall): Likewise.
3688 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3689 to avoid dependency from auto-save feature.
3690
52b852c7
PE
36912012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3692
3693 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3694 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3695 'for_each_per_buffer_object_at'.
3696 All uses changed. It's better to use upper-case for macros that
3697 cannot be implemented as functions, to give the reader a clue
3698 that they're special.
3699
5db81e33
SM
37002012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3701
3702 * alloc.c (Fgarbage_collect): Tweak docstring.
3703
5b835e1d
DA
37042012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3705
3706 Tweak the value returned from Fgarbage_collect again.
3707 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3708 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3709 Adjust documentation.
3710 (total_vector_bytes): Rename to total_vector_slots, adjust
3711 accounting.
3712 (total_free_vector_bytes): Rename to total_free_vector_slots,
3713 adjust accounting.
3714 (Qstring_bytes, Qvector_slots): New symbols.
3715 (syms_of_alloc): DEFSYM them.
3716
9cd47b72
DA
37172012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3718
3719 Buffer compaction primitive which may be used from Lisp.
3720 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3721 (syms_of_buffer): Register Fcompact_buffer.
3722 * alloc.c (Fgarbage_collect): Use compact_buffer.
3723 * buffer.h (compact_buffer): New prototype.
3724 (struct buffer_text): New member.
3725
d17337e5
DA
37262012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3727
3728 New macro to iterate over all buffers, miscellaneous cleanups.
3729 * lisp.h (all_buffers): Remove declaration.
3730 * buffer.h (all_buffers): Add declaration, with comment.
3731 (for_each_buffer): New macro.
3732 * alloc.c (Fgarbage_collect, mark_object): Use it.
3733 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3734 (init_buffer): Likewise.
3735 * data.c (Fset_default): Likewise.
3736 * coding.c (code_conversion_restore): Remove redundant check
3737 for dead buffer.
3738 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3739
60cfd278
AS
37402012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3741
3742 Fix bug that created negative-length intervals.
3743 * intervals.c (merge_interval_right, merge_interval_left):
3744 Do not zero out this interval if it is absorbed by its children,
3745 as this interval's total length doesn't change in that case. See
3746 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3747
d06714cb
PE
37482012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3749
83713154
PE
3750 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3751 when invoking (make-bool-vector N t) and N is a positive
3752 multiple of 8 -- the last 8 bits were mistakenly cleared.
3753
d06714cb
PE
3754 Remove some struct layout assumptions in bool vectors.
3755 * alloc.c (bool_header_size): New constant.
3756 (header_size, word_size): Move earlier, as they're now used earlier.
3757 Use 'word_size' in a few more places, where it's appropriate.
3758 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3759 padding before the data member of a bool vector.
3760 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3761 than doing the check by hand with an abort ().
3762
464d5a5e
SM
37632012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3764
5fbc0409
SM
3765 * eval.c (Fdefvar): Don't check constants since we only set the var if
3766 it's not yet defined anyway (bug#11904).
3767
464d5a5e
SM
3768 * lisp.h (last_undo_boundary): Declare new var.
3769 * keyboard.c (command_loop_1): Set it.
3770 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3771 were auto-added by the command loop (bug#11774).
3772
8dc2e44a
AS
37732012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3774
3775 * w32font.c (Qsymbol): Remove local definition.
3776 (syms_of_w32font): Don't DEFSYM it.
3777
169925ec
DA
37782012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3779
3780 Fix sweep_vectors to handle large bool vectors correctly.
3781 * alloc.c (sweep_vectors): Account total_vector_bytes for
3782 bool vectors larger than VBLOCK_BYTES_MAX.
3783
5fbfb018
CY
37842012-07-18 Chong Yidong <cyd@gnu.org>
3785
3786 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3787 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3788
3ab6e069
DA
37892012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3790
3791 Return more descriptive data from Fgarbage_collect.
3792 Suggested by Stefan Monnier in
3793 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3794 * alloc.c (bounded_number): New function.
3795 (total_buffers, total_vectors): New variable.
3796 (total_string_size): Rename to total_string_bytes, adjust users.
3797 (total_vector_size): Rename to total_vector_bytes, adjust users.
3798 (sweep_vectors): Account total_vectors and total_vector_bytes.
3799 (Fgarbage_collect): New return value. Adjust documentation.
3800 (gc_sweep): Account total_buffers.
3801 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3802 (VECTOR_SIZE): Remove.
3803 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3804 (Qinterval, Qmisc): New symbols.
3805 (syms_of_data): Initialize them.
3806 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3807 (Qcons, Qbuffer): New declarations.
3808
6d02fe5b
PE
38092012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3810
3811 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3812 Round up, not down. Improve doc.
3813
b7ffe040
DA
38142012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3815
3816 Restore old code in allocate_string_data to avoid Faset breakage.
3817 Reported by Julien Danjou <julien@danjou.info> in
3818 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3819 * alloc.c (allocate_string_data): Restore old code with minor
3820 adjustments, fix comment to explain this subtle issue.
3821
4dc7c8d5
SM
38222012-07-17 Eli Zaretskii <eliz@gnu.org>
3823
3824 Remove FILE_SYSTEM_CASE.
3825 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3826
3827 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3828 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3829 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3830 call-process-region passes it through expand-file-name.
3831
3832 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3833
38342012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3835
3836 Fix crash when creating indirect buffer (Bug#11917)
3837 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3838 Don't handle unbound variables specially if non-zero.
3839 (Fbuffer_local_variables): Pass zero.
3840 (clone_per_buffer_values): Pass non-zero.
3841
38422012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3843
3844 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3845 to make the loop interruptible.
3846
38472012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3848
3849 * gnutls.c (emacs_gnutls_handshake): Only retry if
3850 GNUTLS_E_INTERRUPTED.
3851
cce7fefc
DA
38522012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3853
3854 Cleanup and convert miscellaneous checks to eassert.
3855 * alloc.c (mark_interval): Fix comment, partially rephrase
3856 old comment from intervals.h (see below).
3857 * intervals.c (find_interval, adjust_intervals_for_insertion)
3858 (delete_interval, adjust_intervals_for_deletion)
3859 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3860 Convert to eassert.
3861 (adjust_intervals_for_insertion, make_new_interval):
3862 Remove obsolete and unused code.
3863 * intervals.h (struct interval): Remove obsolete comment.
3864 * textprotp.c (erase_properties): Remove unused code.
3865 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3866 (Fremove_list_of_text_properties): Convert to eassert.
3867
9ea10cc3
CY
38682012-07-17 Chong Yidong <cyd@gnu.org>
3869
3870 * editfns.c (Finsert_char): Doc fix.
3871
3900d5de
DA
38722012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3873
3874 Fix previous change to make Fmemory_free always accurate.
3875 * alloc.c (make_interval): Update total_free_intervals.
3876 (make_float): Likewise for total_free_floats.
3877 (free_cons, Fcons): Likewise for total_free_conses.
3878 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3879 Likewise for total_free_vector_bytes.
3880 (Fmake_symbol): Likewise for total_free_symbols.
3881 (bytes_free): Remove.
3882
7098646f
DA
38832012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3884
3885 Simple free memory accounting feature.
3886 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3887 (sweep_vectors): Accumulate size of free vectors.
3888 (Fgarbage_collect): Setup bytes_free.
3889 (Fmemory_free): New function.
3890 (syms_of_alloc): Register it.
3891
22657b40
DA
38922012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3893
3894 Cleanup overlays checking.
3895 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3896 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3897 eassert and OVERLAYP.
3898 (sort_overlays): Change to use OVERLAYP.
3899
ddfc8813
RK
39002012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3901
3902 * editfns.c (Finsert_char): Make it interactive, and make the
3903 second arg optional. Copy interactive spec and docstring from
3904 ucs-insert.
3905
7c26cf3c
PE
39062012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3907
3908 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3909 Unlike the other wrapped functions, fabs has an unspecified
3910 effect on errno.
3911
5d127af9
JD
39122012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3913
3914 * nsterm.m (keyDown): Interpret flags without left/right bits
3915 as the left key (Bug#11670).
3916
6a0dd1d7
DA
39172012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3918
3919 Remove empty and useless init functions.
3920 * lisp.h (init_character_once, init_fns, init_image)
3921 (init_filelock, init_sound): Remove prototype.
3922 * character.c (init_character_once): Remove.
3923 * filelock.c (init_filelock): Likewise.
3924 * fns.c (init_fns): Likewise.
3925 * image.c (init_image): Likewise.
3926 * sound.c (init_sound): Likewise.
3927 * emacs.c (main): Adjust accordingly.
3928
7a6136fd
DA
39292012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3930
3931 * gtkutil.h: Tiny cleanups.
3932 (use_old_gtk_file_dialog): Remove useless declaration.
3933 (xg_uses_old_file_dialog): Add suggested const attribute.
3934
ce811ad9
EZ
39352012-07-15 Eli Zaretskii <eliz@gnu.org>
3936
3937 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3938 (bidi_paragraph_init): Use it to limit search forward for a strong
3939 directional character in abnormally large paragraphs full of
3940 neutral or weak characters. (Bug#11943)
3941
c9adfeaa
SF
39422012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3943
3944 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3945 the toolbar (Bug#9451).
3946 (xg_make_tool_item): Give the widget event box a transparent
3947 background.
3948
fff62aa9
DA
39492012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3950
3951 Cleanup basic allocation variables and functions.
3952 * alloc.c (ignore_warnings, init_intervals, init_float)
3953 (init_cons, init_symbol, init_marker): Remove.
3954 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3955 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3956 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3957 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3958 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3959 (staticidx, init_alloc_once, init_strings, free_ablock):
3960 Remove redundant initialization.
3961 * fns.c (init_weak_hash_tables): Remove.
3962 * lisp.h (init_weak_hash_tables): Remove prototype.
3963
9730daca
DA
39642012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3965
3966 Use zero_vector where appropriate.
3967 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3968 accordingly.
3969 * lisp.h (zero_vector): New declaration.
3970 * font.c (null_vector): Remove.
3971 (syms_of_font): Remove initialization and staticpro.
3972 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3973 * keymap.c (Faccessible_keymaps): Likewise.
3974
2e2d2a13
LL
39752012-07-15 Leo Liu <sdl.web@gmail.com>
3976
3977 * fringe.c: Fix typo in comments.
3978
cd276f6e
LL
39792012-07-14 Leo Liu <sdl.web@gmail.com>
3980
3981 * fringe.c: Add a new bitmap exclamation-mark.
3982
5a1131d9
EZ
39832012-07-14 Eli Zaretskii <eliz@gnu.org>
3984
3985 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3986
3987 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3988 (HAVE_MENUS): Don't define, defined by editing config.in with
3989 msdos/sed2v2.inp.
3990 (GMALLOC_INHIBIT_VALLOC): Don't define.
3991 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3992
22e983b7
JB
39932012-07-14 Juanma Barranquero <lekktu@gmail.com>
3994
3995 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3996
5b3f250f
GM
39972012-07-14 Glenn Morris <rgm@gnu.org>
3998
3999 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4000 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4001 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4002
33d63ff4
GM
40032012-07-13 Glenn Morris <rgm@gnu.org>
4004
5b633342
GM
4005 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4006
33d63ff4
GM
4007 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4008 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4009
b55b9f85
JD
40102012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4011
0dc8cf50
JD
4012 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4013 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4014 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4015 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4016 where appropriate.
4017 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4018 as boolean expression.
4019 (x_set_window_size): Remove unused variable toolbar.
4020 (ns_get_color_default, ns_mod_to_lisp): Remove.
4021 (ns_mouse_position): Remove unused variables xchar and ychar.
4022 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4023 (ns_set_vertical_scroll_bar): Remove unused variable count.
4024 (ns_delete_terminal): Remove unused variable i.
4025 (ns_term_init): Remove unused variables r, g and b.
4026 (mouseDown): Remove unused variable window.
4027 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4028 (initFrameFromEmacs): Remove unused variable vbextra.
4029 (mouseEntered): Remove unused variables p and dpyinfo.
4030 (mouseExited): Remove unused variables p and r.
4031 (ns_define_frame_cursor, ns_clear_frame_area)
4032 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4033 (menuDown): Assign [sender tag] to variable and cast the variable.
4034
4035 * nsterm.h (menuDown): Add id as type to argument sender.
4036 (ns_display_info_for_name): Add Lisp_Object argument.
4037 (ns_term_init): Add Lisp_Object argument.
4038 (ns_map_event_to_object): Add void argument.
4039 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4040 prototype with arguments and only declare if __OBJC__.
4041 (nxatoms_of_nsselect): Add void argument.
4042 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4043 (ns_alloc_autorelease_pool): Add void argument.
4044 (ns_release_autorelease_pool): Add void* argument.
4045 (ns_get_defaults_value): Add const char* argument.
4046
4047 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4048 (initFromContents): Use SSDATA where appropriate.
4049 (ns_update_menubar): Add braces to ambigous if-else.
4050 (initWithTitle): Put () around assignment in if statement.
4051 (ns_menu_show): Remove unused variables window and keymap.
4052 (update_frame_tool_bar): Remove unused variable selected_p.
4053 (initWithContentRect): Remove unused variable this_cmd_name.
4054
4055 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4056 appropriate.
4057 (setXBMColor): Remove unused variable len.
4058 (setPixmapData): Put () around assignment in loop statement.
4059
4060 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4061 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4062 where appropriate.
4063 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4064 around assignment in loop statement.
4065 (nsfont_open): Remove unused variable i.
4066 (nsfont_open): Remove unused variable len.
4067 (nsfont_draw): Remove unused variable cs.
4068
4069 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4070 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4071 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4072 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4073 (Fns_font_name, Fns_perform_service)
4074 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4075 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4076 (ns_set_name): Remove unused variable view.
4077 (x_set_menu_bar_lines): Remove unused variable olines.
4078 (x_set_tool_bar_lines): Remove unused variable root_window.
4079 (Fns_list_colors): Put () around assignment in while statement.
4080 (Fns_perform_service): Remove unused variable len.
4081 (Fns_display_usable_bounds): Remove unused variable top.
4082 (syms_of_nsfns): Remove unused variable i.
4083
b55b9f85
JD
4084 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4085 memcpy (Bug#11907).
4086
ed9265fc 40872012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4088
4089 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4090 and free it with DestroyExceptionInfo (Bug#11558).
4091
ef099b57
JB
40922012-07-13 Juanma Barranquero <lekktu@gmail.com>
4093
4094 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4095 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4096 Set here, not in nt/config.nt.
4097
ea814a5d
EZ
40982012-07-13 Eli Zaretskii <eliz@gnu.org>
4099
4100 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4101 cursor overflow into the last glyph on display line when the right
4102 fringe is off. (Bug#11832)
4103
1a952767
PE
41042012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4105
4106 * xdisp.c (produce_special_glyphs): Now static.
4107 * dispextern.h (produce_special_glyphs): Remove decl.
4108
983188fd
GM
41092012-07-13 Glenn Morris <rgm@gnu.org>
4110
8d7c7eed 4111 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4112 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4113
983188fd
GM
4114 * s/usg5-4-common.h (USG, USG5):
4115 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4116 * s/sol2-6.h (SOLARIS2):
4117 * s/irix6-5.h (IRIX6_5):
4118 * s/hpux10-20.h (USG, USG5, HPUX):
4119 * s/gnu-linux.h (USG, GNU_LINUX):
4120 * s/freebsd.h (BSD_SYSTEM):
4121 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4122 * s/cygwin.h (CYGWIN):
4123 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4124 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4125
d1e68667 41262012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4127
4128 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4129
6de0e799
GM
41302012-07-13 Glenn Morris <rgm@gnu.org>
4131
739ae010
GM
4132 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4133
dbee5793
GM
4134 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4135
6de0e799
GM
4136 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4137 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4138
b82da769
GM
41392012-07-12 Glenn Morris <rgm@gnu.org>
4140
4fae5a7a 4141 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4142
4143 * process.c (init_process_emacs): Rename from init_process.
4144 The old name is also the name of a Mach system call.
4145 * lisp.h, emacs.c: Update for this name change.
4146 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4147 longer needed.
4148
5a979817
EZ
41492012-07-12 Eli Zaretskii <eliz@gnu.org>
4150
4151 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4152 memmove call that removes glyphs covered by the left truncation
4153 glyph. Improve commentary.
4154 (display_line): Fix display of continuation glyphs on GUI frames
4155 when the right fringe is turned off and variable-size fonts are
4156 used in the window. Move the code that appends a stretch glyph to
4157 produce_special_glyphs, so that it could be used for truncation
4158 and continuation glyphs alike.
4159 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4160 glyph of a suitably computed width, to align the special glyphs at
4161 the window margin. Code moved from display_line. (Bug#11832)
4162
3e91a053
GM
41632012-07-12 Glenn Morris <rgm@gnu.org>
4164
ba9e4b84
GM
4165 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4166
4167 * s/gnu-linux.h, s/hpux10-20.h:
4168 Do not unconditionally define HAVE_XRMSETDATABASE.
4169
3e91a053
GM
4170 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4171
b300b1f4
PE
41722012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4173
4174 Fix typos that broke OS X build.
4175 Reported by Randal L. Schwartz in
4176 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4177 * nsterm.m (ns_timeout): Add missing local decl.
4178 (ns_get_color): snprintf -> sprintf, to fix typo.
4179
6e777848
GM
41802012-07-12 Glenn Morris <rgm@gnu.org>
4181
3f922c37
GM
4182 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4183 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4184 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4185 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4186
0ab7b23a
GM
4187 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4188 Move PTY_OPEN to configure.
4189
6e777848
GM
4190 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4191 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4192 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4193
4a7edc24
DA
41942012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4195
4196 Use empty_unibyte_string where applicable.
4197 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4198 * lread.c (read1): Likewise.
4199 * xsettings.c (syms_of_xsettings): Likewise.
4200
308aab79
GM
42012012-07-12 Glenn Morris <rgm@gnu.org>
4202
42bd1719
GM
4203 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4204 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4205 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4206 * s/hpux10-20.h (RUN_TIME_REMAP):
4207 * s/bsd-common.h (TABDLY): Move to configure.
4208
4209 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4210
4211 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4212
ea0bbd17 4213 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4214 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4215
4216 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4217
308aab79
GM
4218 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4219 * s/template.h: Move NARROWPROTO to configure.
4220
ee1cf5cf
GM
42212012-07-11 Glenn Morris <rgm@gnu.org>
4222
30fe9bf4
GM
4223 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4224 unused since 2011-01-17 change to systty.h.
4225
ee1cf5cf
GM
4226 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4227 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4228 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4229
63e47e07
PE
42302012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4231
4232 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4233
c43fb4c3
GM
42342012-07-11 Glenn Morris <rgm@gnu.org>
4235
4236 * s/darwin.h, s/gnu-linux.h, s/template.h:
4237 Move INTERRUPT_INPUT to configure.
4238
e8df9267
DA
42392012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4240
4241 Minor adjustments to interning code.
4242 * lisp.h (intern, intern_c_string): Redefine as static inline
4243 wrappers for intern_1 and intern_c_string_1, respectively.
4244 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4245 * lread.c (intern_1, intern_c_string_1, oblookup):
4246 Simplify Vobarray checking.
e8df9267
DA
4247 * font.c (font_intern_prop): Likewise. Adjust comment.
4248 * w32font.c (intern_font_name): Likewise.
4249
34348bd4
AS
42502012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4251
d96a1e0c
AS
4252 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4253
34348bd4
AS
4254 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4255 of Fcar/Fcdr if possible.
4256 * font.c (check_otf_features): Likewise.
4257 * fontset.c (Fnew_fontset): Likewise.
4258 * gnutls.c (Fgnutls_boot): Likewise.
4259 * minibuf.c (read_minibuf): Likewise.
4260 * msdos.c (IT_set_frame_parameters): Likewise.
4261 * xmenu.c (Fx_popup_dialog): Likewise.
4262 * w32menu.c (Fx_popup_dialog): Likewise.
4263
c8add24e
GM
42642012-07-11 Glenn Morris <rgm@gnu.org>
4265
4b575b3c
GM
4266 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4267 since nothing has defined it on these platforms.
4268
09f4e3b0
GM
4269 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4270 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4271
172bedef
GM
4272 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4273 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4274 Move CLASH_DETECTION to configure.
4275
249685df
GM
4276 * s/gnu.h: Remove file, which is now empty.
4277
c8add24e
GM
4278 * s/gnu.h, s/gnu-linux.h:
4279 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4280
b41253a3
JW
42812012-07-11 John Wiegley <johnw@newartisans.com>
4282
4283 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4284 function attribute, so we only use it if it exists in the
4285 compiler.
4286
d923b542
DA
42872012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4288
4289 Avoid call to strlen in fast_c_string_match_ignore_case.
4290 * search.c (fast_c_string_match_ignore_case): Change to use
4291 length argument. Adjust users accordingly.
4292 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4293
5ebbef1d
PE
42942012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4295
bb352260
PE
4296 Assume mkdir, rmdir.
4297 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4298 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4299
57054ddd
PE
4300 Assume rename.
4301 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4302
b747d3f7
PE
4303 Assume perror.
4304 * s/hpux10-20.h (HAVE_PERROR): Remove.
4305 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4306 Remove dummy definition, as this problem was obsolete long ago.
4307
5ebbef1d
PE
4308 Assume strerror.
4309 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4310
984e7f30
DA
43112012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4312
4313 Avoid calls to strlen in font processing functions.
4314 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4315 (font_open_by_name): Change to use length argument.
4316 Adjust users accordingly.
d923b542
DA
4317 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4318 Adjust prototypes.
4319 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4320 Change to return ptrdiff_t.
984e7f30
DA
4321 (xfont_list_pattern, xfont_match): Use length returned by
4322 xfont_decode_coding_xlfd.
4323 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4324
20e94fdd
GM
43252012-07-11 Glenn Morris <rgm@gnu.org>
4326
9d596af3
GM
4327 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4328 Move DONT_REOPEN_PTY to configure.
4329
20e94fdd
GM
4330 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4331 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4332
e99a530f
PE
43332012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4334
22ffb973
PE
4335 Remove "#define unix" that is no longer needed (Bug#11905).
4336 * s/aix4-2.h (unix): Remove; no longer needed.
4337
e9a9ae03
PE
4338 EMACS_TIME simplification (Bug#11875).
4339 This replaces macros (which typically do not work in GDB)
4340 with functions, typedefs and enums, making the code easier to debug.
4341 The functional style also makes code easier to read and maintain.
4342 * systime.h: Include <sys/time.h> on all hosts, not just if
4343 WINDOWSNT, since 'struct timeval' is needed in general.
4344 (EMACS_TIME): Now a typedef, not a macro.
4345 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4346 not macros.
4347 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4348 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4349 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4350 (EMACS_TIME_LE): Now functions, not macros.
4351 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4352 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4353 which are not functions. All uses rewritten to use:
4354 (make_emacs_time): New function.
4355 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4356 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4357 not functions. All uses rewritten to use the following, respectively:
4358 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4359 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4360 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4361 * fileio.c (Fcopy_file):
4362 * xterm.c (XTflash): Get the current time closer to when it's used.
4363 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4364
ffacb126
PE
4365 * bytecode.c (targets): Suppress -Woverride-init warnings.
4366
e99a530f
PE
4367 Simplify by avoiding confusing use of strncpy etc.
4368 * doc.c (Fsnarf_documentation):
4369 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4370 * frame.c (Fmake_terminal_frame):
4371 * gtkutil.c (get_utf8_string):
4372 * lread.c (openp):
4373 * nsmenu.m (ns_update_menubar):
4374 * regex.c (regerror):
4375 Prefer memcpy to strncpy and strncat when either will do.
4376 * fileio.c (Fsubstitute_in_file_name):
4377 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4378 (menu_separator_name_p):
4379 * nsmenu.m (ns_update_menubar):
4380 Prefer memcmp to strncmp when either will do.
4381 * nsterm.m: Include <ftoastr.h>.
4382 (ns_get_color):
4383 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4384 Prefer snprintf to strncpy.
4385 * nsterm.m (ns_term_init):
4386 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4387 * nsterm.m (ns_term_init):
4388 Avoid the need for strncpy, by using build_string or
4389 make_unibyte_string directly. Use dtoastr, not snprintf.
4390 * process.c (Fmake_network_process): Diagnose service names that
4391 are too long, rather than silently truncating them or creating
4392 non-null-terminated names.
4393 (Fnetwork_interface_info): Likewise, for interface names.
4394 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4395 Prefer sprintf to strncat.
4396 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4397 Prefer vsnprintf to vsprintf + strncpy.
4398
c59592b3
GM
43992012-07-10 Glenn Morris <rgm@gnu.org>
4400
4401 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4402 Clarify fallback case.
4403
7d7bbefd
DA
44042012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4405
4406 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4407 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4408 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 4409 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
4410 where argument type is known to be a Lisp_Cons.
4411
3a4c8000
TT
44122012-07-10 Tom Tromey <tromey@redhat.com>
4413
4414 * bytecode.c (BYTE_CODE_THREADED): New macro.
4415 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4416 (enum byte_code_op): New type.
4417 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4418 (exec_byte_code): Use them. Use token threading when applicable.
4419
2a0213a6
DA
44202012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4421
4422 Optimize pure C strings initialization.
4423 * lisp.h (make_pure_string): Fix prototype.
4424 (build_pure_c_string): New function, defined as static inline. This
4425 provides a better opportunity to optimize away calls to strlen when
4426 the function is called with compile-time constant argument.
4427 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4428 argument, adjust users accordingly. Use build_pure_c_string where
4429 appropriate.
4430 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4431 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4432 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4433
cb1caeaf
DA
44342012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4435
4436 Avoid calls to strlen in miscellaneous functions.
4437 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4438 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4439 * lread.c (openp): Likewise.
4440
c293e30c
DA
44412012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4442
4443 Avoid calls to strlen in path processing functions.
4444 * fileio.c (file_name_as_directory): Add comment. Change to add
4445 srclen argument and return the length of result. Adjust users
4446 accordingly.
4447 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
4448 swap 1st and 2nd arguments to obey the common convention.
4449 Adjust users accordingly.
c293e30c
DA
4450 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4451
9e059e3f
GM
44522012-07-10 Glenn Morris <rgm@gnu.org>
4453
d02eb359
GM
4454 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4455 Move PENDING_OUTPUT_COUNT definition to configure.
4456
882cf227
GM
4457 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4458 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4459 * s/gnu.h (DATA_START): Move definitions to configure.
4460
af6e839f
GM
4461 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4462 We include usg5-4-common.h, which defines them both.
4463
40289a12
GM
4464 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4465 O_RDONLY already includes it).
4466
9e059e3f
GM
4467 Stop ns builds setting the EMACSLOADPATH environment variable.
4468 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4469 Now it does not set EMACSLOADPATH, just returns the load-path string.
4470 * nsterm.h: Update accordingly.
4471 * lread.c [HAVE_NS]: Include nsterm.h.
4472 (init_lread) [HAVE_NS]: Use ns_load_path.
4473 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4474
7c4e8ec0
GM
44752012-07-09 Glenn Morris <rgm@gnu.org>
4476
d4f600ff
GM
4477 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4478 since the included bsd-common.h does so.
4479
cbb31951
GM
4480 Stop ns builds setting the EMACSPATH environment variable.
4481 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4482 (ns_init_paths): Do not set EMACSPATH.
4483 * nsterm.h (ns_exec_path): Add it.
4484 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4485 Use ns_exec_path.
4486
7c4e8ec0
GM
4487 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4488
26bccfae
PE
44892012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4490
a0bee46f
PE
4491 * process.c (wait_reading_process_output): 'waitchannels' was unset
4492 when read_kbd || !NILP (wait_for_cell); fix this.
4493
5994c183
PE
4494 Add GCC-style 'const' attribute to functions that can use it.
4495 * character.h (char_resolve_modifier_mask):
4496 * keyboard.h (make_ctrl_char):
4497 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4498 (init_character_once, next_almost_prime, init_fns, init_image)
4499 (flush_pending_output, init_sound):
4500 * mem-limits.h (start_of_data):
4501 * menu.h (finish_menu_items):
4502 Add ATTRIBUTE_CONST.
4503 * emacs.c (DEFINE_DUMMY_FUNCTION):
4504 Declare the dummy function with ATTRIBUTE_CONST.
4505 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4506 Add decls with ATTRIBUTE_CONST.
4507
26bccfae
PE
4508 Minor improvements to make_formatted_string.
4509 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4510 where int is good enough, as vsprintf returns an int.
4511 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4512
a8290ec3
DA
45132012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4514
4515 Use make_formatted_string to avoid double length calculation.
4516 * lisp.h (make_formatted_string): New prototype.
4517 * alloc.c (make_formatted_string): New function.
4518 * buffer.c (Fgenerate_new_buffer_name): Use it.
4519 * dbus.c (syms_of_dbusbind): Likewise.
4520 * editfns.c (Fcurrent_time_zone): Likewise.
4521 * filelock.c (get_boot_time): Likewise.
4522 * frame.c (make_terminal_frame, set_term_frame_name)
4523 (x_report_frame_params): Likewise.
4524 * image.c (gs_load): Likewise.
4525 * minibuf.c (get_minibuffer): Likewise.
4526 * msdos.c (dos_set_window_size): Likewise.
4527 * process.c (make_process): Likewise.
4528 * xdisp.c (ensure_echo_area_buffers): Likewise.
4529 * xsettings.c (apply_xft_settings): Likewise.
4530
d01ba2f1
GM
45312012-07-09 Glenn Morris <rgm@gnu.org>
4532
4533 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4534 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4535 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4536 * nsterm.h (ns_etc_directory): Add it.
4537 * callproc.c [HAVE_NS]: Include nsterm.h.
4538 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4539
f1f924b6
DA
45402012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4541
4542 Move marker debugging code under MARKER_DEBUG.
4543 * marker.c (MARKER_DEBUG): Move marker debugging code under
4544 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4545 for bootstrap with --enable-checking (~3x slowdown reported
4546 by Juanma Barranquero <lekktu@gmail.com>).
4547 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4548
ab531b66
PE
45492012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4550
4551 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4552 See <http://bugs.gnu.org/11825#29>.
4553
c4b3bc8a
EZ
45542012-07-08 Eli Zaretskii <eliz@gnu.org>
4555
4556 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4557 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
4558 (display_line): Add commentary about displaying truncation glyphs
4559 on GUI frames.
4560 (produce_special_glyphs): Move here from term.c.
4561
4562 * term.c (produce_special_glyphs): Move to xdisp.c.
4563
4564 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4565 section.
c4b3bc8a 4566
b676b881
AS
45672012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4568
f17c5273
AS
4569 * xdisp.c (display_line): Avoid warning about implicit declaration
4570 of FRAME_FONT.
4571
298819b9
AS
4572 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4573
b676b881
AS
4574 * lisp.h: Remove empty conditional.
4575
6045c4fd
PE
45762012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4577
b3350bf9
PE
4578 * lread.c (load_path_check): Now static.
4579
6045c4fd
PE
4580 Fix some minor --with-ns problems found by static checking.
4581 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4582 (x_set_font) [!HAVE_X_WINDOWS]:
4583 * image.c (xpm_load_image) [HAVE_NS]:
4584 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4585 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4586 Remove unused local.
4587 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4588 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4589 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4590 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4591 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4592 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4593 Fix pointer signedness problem.
4594 * xfaces.c (FRAME_X_FONT_TABLE):
4595 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4596
929e7845
GM
45972012-07-07 Glenn Morris <rgm@gnu.org>
4598
4599 * lread.c (load_path_check): New function, split from init_lread.
4600 (init_lread): Reorganize. Motivation:
4601 If EMACSLOADPATH is set, check/warn about that rather than the
4602 defaults, which we are not going to use. Hence we can remove
4603 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4604 Don't warn if site-lisp directories are missing.
4605 If not installed, start from a blank load-path, since
4606 PATH_LOADSEARCH refers to the eventual installation directories.
4607
58dd0aa4
EZ
46082012-07-07 Eli Zaretskii <eliz@gnu.org>
4609
4610 Support truncation and continuation glyphs on GUI frames, when
4611 fringes are disabled. (Bug#11832)
4612 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
4613 continuation glyphs even if on GUI frames.
4614 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
4615 or both, are absent.
4616 (start_display, move_it_in_display_line_to): Handle the case of a
4617 GUI frame without a fringe to display continuation or truncation
4618 glyphs.
4619 (insert_left_trunc_glyphs): Support GUI frames: make sure
4620 truncation glyphs overwrite enough glyphs from the current line to
4621 have sufficient space in pixels.
4622 (display_line): Support truncation and continuation glyphs on GUI
4623 frames. If some spare pixels are left on the line after inserting
4624 the truncation glyphs, fill that space with a stretch glyph of a
4625 suitably computed width.
4626
4627 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4628 produce_glyphs, to support GUI sessions.
4629
31571fd7
PE
46302012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4631
5a16b9bc
PE
4632 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4633
f3047c75
PE
4634 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4635
31571fd7
PE
4636 Do not require float-time's arg to fit in time_t (Bug#11825).
4637 This works better on hosts where time_t is unsigned, and where
4638 float-time is applied to the (negative) difference between two times.
4639 * editfns.c (decode_time_components): Last arg is now double *,
4640 not int *, and means to store all the result as a double, without
4641 worrying about whether the seconds part fits in time_t.
4642 All callers changed.
4643 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4644 All callers changed.
4645 (Ffloat_time): Do not fail merely because the specified time falls
4646 outside of time_t range.
4647
4516fbef
GM
46482012-07-07 Glenn Morris <rgm@gnu.org>
4649
4650 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4651 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4652 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4653
07adc2c6
JB
46542012-07-07 Juanma Barranquero <lekktu@gmail.com>
4655
4656 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4657 Update dependencies.
4658
4659 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4660
fd573f31
PE
46612012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4662
fee5959d
PE
4663 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4664 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4665 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4666 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4667 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4668 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4669
fd573f31
PE
4670 * xfont.c (compare_font_names): Redo to omit the need for casts.
4671
ddadbc0e
AS
46722012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4673
fca8d6b6
AS
4674 * xfns.c (Fx_change_window_property): Doc fix.
4675 * w32fns.c (Fx_change_window_property): Doc fix.
4676
ddadbc0e
AS
4677 * w32fns.c (Fx_window_property): Accept the same arguments as the
4678 X Windows version. Doc fix.
4679 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4680
ed9265fc 46812012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
4682 Eli Zaretskii <eliz@gnu.org>
4683
4684 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4685 Windows-specific code from nt/config.nt moved here.
4686 Obsolete settings removed.
4687
216ee680
PE
46882012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4689
4690 * process.c: Avoid unnecessary calls to gettime.
4691 (wait_reading_process_output): Don't get the time of day
4692 when gobbling data immediately and not waiting, as there's no need
4693 for it in that case. This removes a FIXME.
4694
bdd091e4
JD
46952012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4696
4697 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4698 is defined (Bug#11768).
4699
9d44f8ce
DA
47002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4701
4702 Fix marker debugging code.
4703 * marker.c (byte_char_debug_check): Do not perform the check
4704 if buffer is not multibyte.
090bd7cb
JB
4705 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4706 Call byte_char_debug_check with correct arguments.
9d44f8ce 4707
90fc4786
DA
47082012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4709
4710 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
4711 * marker.c (byte_char_debug_check, count_markers):
4712 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
4713 (byte_debug_flag): Remove.
4714 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4715 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4716
7b7ae965
DA
47172012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4718
4e57b342
DA
4719 Avoid code repetition in marker-related functions.
4720 * marker.c (attach_marker): New function.
4721 (Fset_marker, set_marker_restricted, set_marker_both)
4722 (set_marker_restricted_both): Use it.
4723 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4724 Consistently rename charno to charpos.
4725 (marker_position): Add eassert.
4726 (marker_byte_position): Convert to eassert.
4727
47282012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4729
4730 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 4731 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 4732 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 4733
657924ff
DA
47342012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4735
4736 Introduce fast path for the widely used marker operation.
4737 * alloc.c (build_marker): New function.
4738 * lisp.h (build_marker): New prototype.
4739 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4740 * composite.c (autocmp_chars): Likewise.
4741 * editfns.c (buildmark): Remove.
4742 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4743 (save_restriction_save): Use build_marker.
4744 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4745 * window.c (save_window_save): Likewise.
4746
041a49a6
DA
47472012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4748
4749 Do not use Fdelete_overlay in delete_all_overlays
4750 to avoid redundant calls to unchain_overlay.
4751 * buffer.c (drop_overlay): New function.
4752 (delete_all_overlays, Fdelete_overlay): Use it.
4753 * minibuf.c (get_minibuffer): Fix comment.
4754
7dca65a4
PE
47552012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4756
4757 Port to OpenBSD 5.1 amd64.
4758 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4759 This is needed for OpenBSD, and should be harmless on all BSD systems.
4760 Also, include <sys/sysctl.h>, as it should be available on all
4761 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4762 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4763 use p_pid member, not kp_proc.pid.
4764
8eb876e2
GM
47652012-07-06 Glenn Morris <rgm@gnu.org>
4766
4767 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4768
38182d90
PE
47692012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4770
4771 More xmalloc and related cleanup.
4772 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4773 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4774 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4775 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4776 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4777 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4778 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4779 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4780 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4781 * xterm.c:
4782 Omit needless casts involving void * pointers and allocation.
4783 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4784 as the former is more robust if P's type is changed.
4785 Prefer xzalloc to xmalloc + memset 0.
4786 Simplify malloc-or-realloc to realloc.
4787 Don't worry about xmalloc returning a null pointer.
4788 Prefer xstrdup to xmalloc + strcpy.
4789 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4790 growing it.
4791 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4792 alloca of a constant.
4793
6dd5a677
EZ
47942012-07-05 Eli Zaretskii <eliz@gnu.org>
4795
4796 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4797 hscroll is larger than the line width. Fixes long and futile
4798 looping inside extend_face_to_end_of_line (on a TTY) producing
4799 glyphs that are not needed and thrown away.
4800
6b312f0f
DA
48012012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4802
4803 * marker.c (set_marker_restricted_both): Simplify by using
4804 clip_to_bounds.
4805
f520ef9b
PE
48062012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4807
4808 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4809
383b7c95
JD
48102012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4811
4812 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4813 not defined (Bug#11768).
4814 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4815 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4816 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4817 followed by gtk_box_set_homogeneous (Bug#11768).
4818 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
4819 (update_theme_scrollbar_width, xg_create_scroll_bar):
4820 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
4821 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4822 (is_box_type): New function (Bug#11768).
4823 (xg_tool_item_stale_p): Call is_box_type.
5293d758 4824 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
4825 with default display (Bug#11768).
4826
d6e7bf45
EZ
48272012-07-05 Eli Zaretskii <eliz@gnu.org>
4828
4829 * xdisp.c (window_hscroll_limited): New function.
4830 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4831 coordinates when window's hscroll is set to insanely large
4832 values. (Bug#11857)
4833
431391ec
JB
48342012-07-05 Juanma Barranquero <lekktu@gmail.com>
4835
4836 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4837 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4838
23f86fce
DA
48392012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4840
4841 Cleanup xmalloc.
4842 * lisp.h (xzalloc): New prototype. Omit needless casts.
4843 * alloc.c (xzalloc): New function. Omit needless casts.
4844 * charset.c: Omit needless casts. Convert all calls to
4845 xmalloc with following memset to xzalloc.
4846 * dispnew.c: Likewise.
4847 * fringe.c: Likewise.
4848 * image.c: Likewise.
4849 * sound.c: Likewise.
4850 * term.c: Likewise.
4851 * w32fns.c: Likewise.
4852 * w32font.c: Likewise.
4853 * w32term.c: Likewise.
4854 * xfaces.c: Likewise.
4855 * xfns.c: Likewise.
4856 * xterm.c: Likewise.
4857 * atimer.c: Omit needless casts.
4858 * buffer.c: Likewise.
4859 * callproc.c: Likewise.
4860 * ccl.c: Likewise.
4861 * coding.c: Likewise.
4862 * composite.c: Likewise.
4863 * doc.c: Likewise.
4864 * doprnt.c: Likewise.
4865 * editfns.c: Likewise.
4866 * emacs.c: Likewise.
4867 * eval.c: Likewise.
4868 * filelock.c: Likewise.
4869 * fns.c: Likewise.
4870 * gtkutil.c: Likewise.
4871 * keyboard.c: Likewise.
4872 * lisp.h: Likewise.
4873 * lread.c: Likewise.
4874 * minibuf.c: Likewise.
4875 * msdos.c: Likewise.
4876 * print.c: Likewise.
4877 * process.c: Likewise.
4878 * region-cache.c: Likewise.
4879 * search.c: Likewise.
4880 * sysdep.c: Likewise.
4881 * termcap.c: Likewise.
4882 * terminal.c: Likewise.
4883 * tparam.c: Likewise.
4884 * w16select.c: Likewise.
4885 * w32.c: Likewise.
4886 * w32reg.c: Likewise.
4887 * w32select.c: Likewise.
4888 * w32uniscribe.c: Likewise.
4889 * widget.c: Likewise.
4890 * xdisp.c: Likewise.
4891 * xmenu.c: Likewise.
4892 * xrdb.c: Likewise.
4893 * xselect.c: Likewise.
4894
0497dc44
PE
48952012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4896
4897 * fileio.c (time_error_value): Check the right error number.
4898 Problem reported by Troels Nielsen in
4899 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4900
356e7178
PE
49012012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4902
4e71fd89
PE
4903 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4904 This should be fixed in a better way; see Eli Zaretskii in
4905 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4906 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4907
f0941253
PE
4908 * fileio.c (time_error_value): Rename from special_mtime.
4909 The old name's problems were noted by Eli Zaretskii in
4910 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4911
065c9eb4
PE
4912 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4913 This variable's comment says Emacs needs at least one GDB-visible
4914 symbol of type enum pvec_type, to work around GDB problems.
4915 The symbol's value doesn't matter.
4916
356e7178
PE
4917 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4918 that causes compilation to fail on pre-C99 compilers.
4919
ed9265fc 49202012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
4921
4922 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4923 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4924
3884d954
DA
49252012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4926
d209e2fb 4927 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
4928 headers for buffer_defaults and buffer_local_symbols.
4929 Reported by Juanma Barranquero <lekktu@gmail.com>.
4930
ee28be33
SM
49312012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4932
4933 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4934 * lisp.h (enum pvec_type): Use fewer bits.
4935 (PSEUDOVECTOR_SIZE_BITS): New constant.
4936 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4937 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4938 change in pvec_type.
4939 (PSEUDOVECTOR_TYPEP): New macro.
4940 (TYPED_PSEUDOVECTORP): Use it.
4941 * fns.c (internal_equal): Adapt code to extract pvectype.
4942 * emacs.c (gdb_pvec_type): Update type.
4943 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4944 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4945 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4946 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4947 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4948 abusing vector->header.next.nbytes.
4949 (live_vector_p): Use PVEC_TYPE.
4950 (mark_object): Adapt code to extract pvectype. Use switch.
4951
c7f2cd7f
PE
49522012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4953
4954 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4955 Tighten new eassert a bit.
4956
8ce70ed2
DA
49572012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4958
4959 Fix compilation with --enable-gcc-warnings and -O1
4960 optimization level.
4961 * doprnt.c (doprnt): Change type of tem to int, initialize
4962 to avoid compiler warning. Add eassert.
4963 * search.c (simple_search): Initialize match_byte to avoid
4964 compiler warning. Add eassert.
4965
dea7f1e5
PE
49662012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4967
24a212eb
PE
4968 Avoid weird behavior with large horizontal scrolls.
4969 Without this change, for example, large hscroll values would
4970 mess up Emacs's display on Fedora 15 x86, presumably due to
4971 overflows in int calculations in the display code.
4972 Also, if buffers had long lines, Emacs would freeze.
4973 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4974 (set_window_hscroll): New function, containing the old guts of
4975 Fset_window_hscroll. Return the clipped value.
4976 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4977 This avoids the need to check against PTRDIFF_MAX.
4978
dea7f1e5
PE
4979 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4980
76046526
DA
49812012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4982
4983 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4984
39adff0d
PE
49852012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4986
63807d47
PE
4987 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4988 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4989 since GCC 4.4.6 issues a bogus warning for them.
4990
39adff0d
PE
4991 Fix bugs in file timestamp newness comparisons.
4992 * fileio.c (Ffile_newer_than_file_p):
4993 * lread.c (Fload): Use full timestamp resolution of files,
4994 not just the 1-second resolution, so that files that are only
4995 slightly newer still count as newer.
4996 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4997 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4998
dbeed9a6
PE
49992012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5000
5001 * fileio.c: Improve handling of file time marker. (Bug#11852)
5002 (special_mtime): New function.
5003 (Finsert_file_contents, Fverify_visited_file_modtime):
5004 Use it to set special mtime values consistently.
5005
636334d6
AS
50062012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5007
5008 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5009 marker for non-existing file. (Bug#11852)
5010
e2017fe2
GM
50112012-07-03 Glenn Morris <rgm@gnu.org>
5012
5013 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5014 and did not make it into globals.h).
5015
404dbd37
TT
50162012-07-03 Tom Tromey <tromey@redhat.com>
5017
5018 * window.c (Fset_window_margins, Fset_window_fringes)
5019 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5020 * textprop.c (Fprevious_property_change): No longer static.
5021 * syntax.c (Fsyntax_table_p): No longer static.
5022 * process.c (Fget_process, Fprocess_datagram_address): No longer
5023 static.
5024 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5025 * keyboard.c (Fcommand_execute): No longer static.
5026 Remove EXFUN.
5027 * insdel.c (Fcombine_after_change_execute): No longer static.
5028 * image.c (Finit_image_library): No longer static.
5029 * fileio.c (Fmake_symbolic_link): No longer static.
5030 * eval.c (Ffetch_bytecode): No longer static.
5031 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5032 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5033 No longer static.
404dbd37
TT
5034 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5035 static.
5036 * dired.c (Ffile_attributes): No longer static.
5037 * composite.c (Fcomposition_get_gstring): No longer static.
5038 * callproc.c (Fgetenv_internal): No longer static.
5039
5040 * ccl.h: Remove EXFUNs.
5041 * buffer.h: Remove EXFUNs.
5042 * dispextern.h: Remove EXFUNs.
5043 * intervals.h: Remove EXFUNs.
5044 * fontset.h: Remove EXFUN.
5045 * font.h: Remove EXFUNs.
5046 * dosfns.c (system_process_attributes): Remove EXFUN.
5047 * keymap.h: Remove EXFUNs.
5048 * lisp.h: Remove EXFUNs.
5049 * w32term.h: Remove EXFUNs.
5050 * window.h: Remove EXFUNs.
5051 * xsettings.h: Remove EXFUN.
5052 * xterm.h: Remove EXFUN.
5053
8e4fd1e1
GM
50542012-07-03 Glenn Morris <rgm@gnu.org>
5055
5056 * lisp.h (Frandom): Make it visible to C.
5057 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5058 buffer for invisible buffers. (Bug#1229)
5059
ca95b3eb
DA
50602012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5061
5062 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5063 values which aren't power of 2.
14ae4239
BT
5064 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5065 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5066 accordingly.
5067
7555c33f
SM
50682012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5069
5070 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5071
5072 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5073
d12e8f5a
DA
50742012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5075
5076 * alloc.c (allocate_vector_block): Remove redundant
5077 calls to mallopt if DOUG_LEA_MALLOC is defined.
5078 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5079 avoid calls to mallopt if zero_vector is returned.
5080
296094c3
DA
50812012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5082
5083 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5084 is enabled, avoid dereferencing NULL current_sblock if
5085 running undumped.
5086
36429c89
DA
50872012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5088
5089 Cleanup basic buffer management.
5090 * buffer.h (struct buffer): Change layout to use generic vector
5091 marking code. Fix some comments. Change type of 'clip_changed'
5092 to bitfield. Remove unused #ifndef old.
5093 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5094 (GET_OVERLAYS_AT): Fix indentation.
5095 (for_each_per_buffer_object_at): New macro.
5096 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5097 (Fbuffer_local_variables): Use it.
5098 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5099 * alloc.c (allocate_buffer): Adjust to match new layout of
5100 struct buffer. Fix comment.
5101 (mark_overlay): New function.
5102 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5103 Lisp area of struct buffer.
5104 (mark_object): Use it. Adjust marking of misc objects
5105 and related comments.
5106
3b3e4cac
PE
51072012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5108
5109 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5110 wrapper that is not needed because the wrapped code is a no-op (zero
5111 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5112 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5113
cf5c0175
DA
51142012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5115
5116 * alloc.c (mark_buffer): Simplify. Remove prototype.
5117 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5118 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5119 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5120 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5121
ca26824c
GM
51222012-06-30 Glenn Morris <rgm@gnu.org>
5123
2e4c5312
GM
5124 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5125
ca26824c
GM
5126 * epaths.in (PATH_SITELOADSEARCH): New.
5127 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5128 This is rather than relying on --enable-locallisppath elements
5129 having "site-lisp" in their names. (Bug#10208#25, 11658)
5130
0d23c240
EZ
51312012-06-30 Eli Zaretskii <eliz@gnu.org>
5132
c9240d7a
EZ
5133 * w32proc.c (sys_select): Accept and ignore one more argument.
5134
5135 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5136
0d23c240 5137 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5138 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5139
5140 * sysdep.c: Don't include dos.h and dosfns.h.
5141
5142 * process.c (sys_select):
5143 * msdos.c (sys_select): Accept one more argument and ignore it.
5144
5145 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5146 adapt data types and code to that.
5147
5148 * dosfns.c:
5149 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5150 which clashes with the gnulib function of the same name.
5151
af5a5a98
AS
51522012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5153
c5e4379c
AS
5154 * font.c (font_style_to_value, font_style_symbolic)
5155 (font_prop_validate_style): Add type checks for values in
5156 font_style_table.
5157
af5a5a98
AS
5158 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5159 argument.
5160 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5161 uses.
5162
8d38f461
EZ
51632012-06-29 Eli Zaretskii <eliz@gnu.org>
5164
2e5a6631
EZ
5165 * xdisp.c (try_window_id): Undo last change.
5166
8d38f461
EZ
5167 * w32.c (getwd): Adjust commentary about startup_dir.
5168 (init_environment): Always call sys_access, even in non-MSVC
5169 builds. Don't chdir to the directory of the Emacs executable.
5170 This undoes code from 1997 which was justified by the need to
5171 "avoid conflicts when removing and renaming directories". But its
5172 downside was that every relative file name was being interpreted
5173 relative to the directory of the Emacs executable, which can never
5174 be TRT. In particular, it broke sys_access when called with
5175 relative file names.
5176 (sys_access): Map GetLastError to errno.
5177
2af3565e
DA
51782012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5179
5180 * window.h (struct window): Change type of 'fringes_outside_margins'
5181 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5182 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5183 Adjust comment.
5184 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5185 to ptrdiff_t.
5186
c8d3a25c 51872012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5188
c8d3a25c
GM
5189 * gnutls.c (emacs_gnutls_handshake):
5190 Add QUIT to make the loop interruptible.
57570cd3 5191
c8d3a25c 51922012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5193
c8d3a25c
GM
5194 * charset.c (init_charset): Make lack of etc/charsets fatal.
5195
3e984ee8
DA
51962012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5197
5198 * editfns.c (region_limit): Fix type mismatch.
5199
ef884f23
DA
52002012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5201
5202 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5203 undefined. Convert from xassert to eassert.
5204 * nsmenu.m: Convert from xassert to eassert.
5205 * nsterm.m: Likewise.
5206
7d7e0027
SM
52072012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5208
5209 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5210
aa754e6a
PE
52112012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5212
5213 Avoid integer overflow on scroll-left and scroll-right.
5214 * window.c (HSCROLL_MAX): New macro.
5215 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5216 overflow when requested scroll falls outside ptrdiff_t range.
5217
80b00b08
DA
52182012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5219
5220 * window.h (struct window): Change type of 'hscroll',
5221 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5222 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5223 Adjust users accordingly.
5224 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5225 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5226 from EMACS_INT to ptrdiff_t.
5227 (make_window): Omit redundant initialization.
5228
62b2bcf6
JB
52292012-06-28 Juanma Barranquero <lekktu@gmail.com>
5230
5231 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5232
45942c7d
DA
52332012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5234
5235 * window.h (struct window): Change type of 'use_time' and
5236 'sequence_number' from Lisp_Object to int.
5237 * frame.c (make_frame): Adjust users accordingly.
5238 * print.c (print_object): Likewise.
5239 * window.c (select_window, Fwindow_use_time, make_parent_window)
5240 (make_window): Likewise.
5241
e509cfa6
DA
52422012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5243
5244 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5245 enabled with --enable-checking=[all,glyphs] configure option.
5246 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5247 adjust comments accordingly.
5248 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5249 undefined, adjust comments accordingly.
5250 * image.c: Likewise.
5251 * scroll.c: Likewise.
5252 * w32fns.c: Likewise.
5253 * w32term.c: Likewise.
5254 * xdisp.c: Likewise.
5255 * xfaces.c: Likewise.
5256 * xfns.c: Likewise.
5257 * xterm.c: Likewise.
5258
a54e2c05
DA
52592012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5260
5261 Generalize run-time debugging checks.
5262 * dispextern.h (XASSERTS): Remove.
5263 * fontset.c (xassert): Remove.
5264 Convert from xassert to eassert.
5265 * alloc.c: Convert from xassert to eassert.
5266 * bidi.c: Likewise.
5267 * dispnew.c: Likewise.
5268 * fns.c: Likewise.
5269 * fringe.c: Likewise.
5270 * ftfont.c: Likewise.
5271 * gtkutil.c: Likewise.
5272 * image.c: Likewise.
5273 * keyboard.c: Likewise.
5274 * menu.c: Likewise.
5275 * process.c: Likewise.
5276 * scroll.c: Likewise.
5277 * sound.c: Likewise.
5278 * term.c: Likewise.
5279 * w32console.c: Likewise.
5280 * w32fns.c: Likewise.
5281 * w32term.c: Likewise.
5282 * window.c: Likewise.
5283 * xdisp.c: Likewise.
5284 * xfaces.c: Likewise.
5285 * xfns.c: Likewise.
5286 * xselect.c: Likewise.
5287 * xterm.c: Likewise.
5288
1ec4b7b2
SM
52892012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5290
5291 * fns.c (maybe_resize_hash_table): Output message when growing the
5292 purify-hashtable.
5293
2014308a
DA
52942012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5295
5296 * alloc.c (allocate_string_data): Remove dead code.
5297 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5298 avoid GCC warning about unused macro.
5299
246155eb
DA
53002012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5301
5302 * alloc.c (allocate_string): Omit intervals initialization.
5303 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5304 as in make_pure_string and make_pure_c_string.
5305
43184b7b
DA
53062012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5307
d209e2fb 5308 * alloc.c (allocate_string): Fix last change.
43184b7b 5309
3fe6dd74
DA
53102012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5311
d209e2fb 5312 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5313 to memset, add explicit initialization where appropriate.
5314
1ba6038a
GM
53152012-06-27 Glenn Morris <rgm@gnu.org>
5316
5317 * lisp.mk (lisp): Remove paths.elc.
5318
c89926a5
CY
53192012-06-27 Chong Yidong <cyd@gnu.org>
5320
5321 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5322
ed6b3510
JW
53232012-06-26 John Wiegley <johnw@newartisans.com>
5324
1ec4b7b2 5325 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5326 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5327
ed6b3510
JW
5328 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5329 when building with Clang.
5330
8edd4a2b
SM
53312012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5332
5333 * eval.c (Fapply): Allow calling it with a single argument.
5334
f6f62d1b
EZ
53352012-06-26 Eli Zaretskii <eliz@gnu.org>
5336
5337 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5338 _stricmp and _strnicmp.
5339 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5340
62efea5e
DA
53412012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5342
5343 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5344 allocated window.
5345 (allocate_process): Likewise for new process.
8edd4a2b 5346 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5347 (allocate_frame): Likewise.
5348 * frame.c (make_frame): Omit redundant initialization.
5349 * window.c (make_parent_window): Use memset.
5350 (make_window): Omit redundant initialization.
5351 * process.c (make_process): Omit redundant initialization.
5352 * terminal.c (create_terminal): Likewise.
5353
42997f4d
DA
53542012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5355
5356 * term.c (delete_tty): Remove redundant call to memset.
5357
1130ecfc
DA
53582012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5359
5360 * alloc.c: Remove build_string.
5361 * lisp.h: Define build_string as static inline. This provides
5362 a better opportunity to optimize away calls to strlen when the
5363 function is called with compile-time constant argument.
5364 * image.c (imagemagick_error): Convert to build_string.
5365 * w32proc.c (sys_spawnve): Likewise.
5366 * xterm.c (x_term_init): Likewise.
5367
cf38a720
PE
53682012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5369
99027bdd
PE
5370 Use sprintf return value instead of invoking strlen on result.
5371 In the old days this wasn't portable, since some sprintf
5372 implementations returned char *. But they died out years ago and
5373 Emacs already assumes sprintf returns int.
5374 Similarly for float_to_string.
5375 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5376 * ccl.c (ccl_driver):
5377 * character.c (string_escape_byte8):
5378 * data.c (Fnumber_to_string):
5379 * doprnt.c (doprnt):
5380 * print.c (print_object):
5381 * xdisp.c (message_dolog):
5382 * xfns.c (syms_of_xfns):
5383 Use sprintf or float_to_string result to avoid need to call strlen.
5384 * data.c (Fnumber_to_string):
5385 Use make_unibyte_string, since the string must be ASCII.
5386 * lisp.h, print.c (float_to_string): Now returns int length.
5387 * term.c (produce_glyphless_glyph):
5388 Use sprintf result rather than recomputing it.
5389
cf38a720
PE
5390 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5391 * Makefile.in (ALL_CFLAGS):
5392 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5393 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5394
3511c784
DA
53952012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5396
0a08eb21 5397 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
5398 strcasecmp if available.
5399 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5400
fb7da12e
AS
54012012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5402
5403 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5404 Avoid comma operator.
5405 * menu.c (push_submenu_start, push_submenu_end)
5406 (push_left_right_boundary, push_menu_pane): Likewise.
5407 * msdos.c (dos_rawgetc): Likewise.
5408
afa2ffd8
DA
54092012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5410
5411 * xfns.c (xic_create_fontsetname): Remove redundant calls
5412 to memset.
5413
b3b4476b
PE
54142012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5415
4495ff38
PE
5416 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5417 sprintf already null-terminates its output.
5418
b3b4476b
PE
5419 * xfns.c (x_window): Remove redundant cast.
5420
b00876c9
DA
54212012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5422
5423 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5424 `const char *' to `char *' to avoid compiler warning.
5425
d188e26b
PE
54262012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5427
885d1d74
PE
5428 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5429 instead of truncating it to 63 (admittedly a generous limit).
5430
d188e26b
PE
5431 * process.c: Fix spelling and caps in comments.
5432
e2f560b1
DN
54332012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5434
e86db54b 5435 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
5436 * sysdep.c (setpgrp): Remove definition, not used in this file.
5437
7583a3a1
JB
54382012-06-24 Juanma Barranquero <lekktu@gmail.com>
5439
5440 * makefile.w32-in: Update dependencies.
5441
696056c2
EZ
54422012-06-24 Eli Zaretskii <eliz@gnu.org>
5443
5444 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5445 (SYSTIME_H): Add nt/inc/sys/time.h.
5446
5447 * systime.h [WINDOWSNT]: Include sys/time.h.
5448
5449 * s/ms-w32.h (struct timespec): Definition moved from
5450 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5451
845ca893
PE
54522012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5453
5454 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5455 * buffer.h (buffer_slot_type_mismatch):
5456 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5457 * eval.c (unwind_to_catch):
5458 * image.c (my_png_error, my_error_exit):
5459 * keyboard.c (quit_throw_to_read_char, user_error)
5460 (Fexit_recursive_edit, Fabort_recursive_edit):
5461 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5462 (wrong_type_argument, buffer_overflow, __executable_start)
5463 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5464 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5465 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5466 (fatal):
5467 (child_setup) [!DOS_NT]:
5468 * lread.c (end_of_file_error, invalid_syntax):
5469 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5470 * puresize.h (pure_write_error):
5471 * search.c (matcher_overflow):
5472 * sound.c (sound_perror, alsa_sound_perror):
5473 * sysdep.c, syssignal.h (croak):
5474 * term.c (maybe_fatal, vfatal):
5475 * textprop.c (text_read_only):
5476 * undo.c (user_error):
5477 * unexmacosx.c (unexec_error):
5478 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5479 Use _Noreturn rather than NO_RETURN.
5480 No need for separate decl merely because of _Noreturn.
5481 * sound.c (sound_warning, parse_sound):
5482 Remove unnecessary forward decls.
5483
f1dd8073
PE
54842012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5485
5486 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5487 * lisp.h (WAIT_READING_MAX): New macro.
5488 * dispnew.c (Fsleep_for, sit_for):
5489 * keyboard.c (kbd_buffer_get_event):
5490 * process.c (Faccept_process_output):
5491 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5492 This improves on the previous patch, which introduced a bug
5493 when time_t is unsigned and as wide as intmax_t.
5494 See <http://bugs.gnu.org/9000#51>.
5495
b82c1755
EZ
54962012-06-23 Eli Zaretskii <eliz@gnu.org>
5497
5498 * dispnew.c (sit_for, Fsleep_for):
5499 * keyboard.c (kbd_buffer_get_event):
5500 * process.c (Faccept_process_output): Avoid compiler warnings when
5501 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5502
ca300656
JB
55032012-06-23 Juanma Barranquero <lekktu@gmail.com>
5504
049ec95b
JB
5505 * makefile.w32-in: Update dependencies.
5506
ca300656
JB
5507 * w32.c (ltime): Add return type and declare static.
5508 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5509
db7b8d06
PE
55102012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5511
5512 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5513 Privately reported by Herbert J. Skuhra.
5514 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5515 All uses changed.
5516 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5517 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5518
0bd8297f
EZ
55192012-06-23 Eli Zaretskii <eliz@gnu.org>
5520
96512555
EZ
5521 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5522 last argument of make_unibyte_string.
5523
0bd8297f
EZ
5524 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5525 language ID in the event parameters.
5526
5527 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5528 event.code, not the obscure "character set ID".
5529
63def6b6
CY
55302012-06-23 Chong Yidong <cyd@gnu.org>
5531
5532 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5533
e8a02204
EZ
55342012-06-23 Eli Zaretskii <eliz@gnu.org>
5535
388cdec0
EZ
5536 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5537 * w32.c (fdutimens): New function.
5538
5539 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5540
5541 * s/ms-w32.h (pselect): Redirect to sys_select.
5542
5543 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5544
e8a02204
EZ
5545 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5546 in the logic of incrementing and decrementing the value of
5547 use_relocatable_buffers.
5548
d054f3fb
PE
55492012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5550
5551 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5552 Privately reported by Herbert J. Skuhra.
5553 [__FreeBSD__]: Remove "*/" typo after "#include".
5554 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5555 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5556 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5557 Don't assume EMACS_TIME and struct timeval are the same type.
5558
d35af63c
PE
55592012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5560
5561 Support higher-resolution time stamps (Bug#9000).
5562 The time stamps are only nanosecond-resolution at the C level,
5563 since that's the best that any real-world system supports now.
5564 But they are picosecond-resolution at the Lisp level, as that's
5565 easy, and leaves room for future OS improvements.
5566
5567 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5568 (LIBES): Use it.
5569
5570 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5571 Don't get current time unless it's needed.
5572
5573 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5574 now provides it if it's absent.
5575 (start_atimer): Port to higher-res time stamps.
5576 Check for time stamp overflow. Don't get current time more
5577 often than is needed.
5578
5579 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5580 Include systime.h, not time.h.
5581 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5582
5583 * dired.c: Include stat-time.h.
5584 (Ffile-attributes): File times now have higher resolution.
5585
5586 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5587 (struct image): Timestamp now has higher resolution.
5588
5589 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5590 has at least microseconds now. All uses removed.
5591 (update_frame, update_single_window, update_window, update_frame_1)
5592 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 5593 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
5594
5595 * editfns.c (time_overflow): Now extern.
5596 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5597 (float-time, Fformat_time_string, Fcurrent_time_string)
5598 (Fcurrent_time_zone): Accept and generate higher-resolution
5599 time stamps.
5600 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5601 (decode_time_components, lisp_seconds_argument): New functions.
5602 (make_time): Now static.
5603 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5604 Report an error if the time is invalid, rather than having the caller
5605 do that.
5606
5607 * fileio.c: Include <stat-time.h>
5608 (Fcopy_file): Copy higher-resolution time stamps.
5609 Prefer to set the time stamp via a file descriptor if that works.
5610 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5611 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5612 (Fvisited_file_modtime, Fset_visited_file_modtime):
5613 Support higher-resolution time stamps.
5614
5615 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5616
5617 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5618
5619 * image.c (prepare_image_for_display, clear_image_cache)
5620 (lookup_image): Port to higer-resolution time stamps.
5621
5622 * keyboard.c (start_polling, bind_polling_period):
5623 Check for time stamp overflow.
5624 (read_char, kbd_buffer_get_event, timer_start_idle)
5625 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5626 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5627 Port to higher-resolution time stamps. Do not assume time_t is signed.
5628 (decode_timer): New function. Timers are now vectors of length 9,
5629 not 8, to accommodate the picosecond component.
5630 (timer_check_2): Use it.
5631
5632 * nsterm.m (select_timeout, timeval_subtract): Remove.
5633 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5634 as they're a bit more accurate and handle overflow better.
5635 (ns_select): Change prototype to be compatible with pselect.
5636 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5637 * nsterm.h (ns_select): Adjust prototype.
5638
5639 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5640 us-resolution time stamps.
5641 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5642
5643 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5644
5645 * lisp.h (time_overflow): New decl.
5646 (wait_reading_process_output): First arg is now intmax_t, not int,
5647 to accommodate larger waits.
5648
5649 * process.h (struct Lisp_Process.read_output_delay):
5650 Now counts nanoseconds, not microseconds.
5651 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5652 EMACS_HAS_USECS.
5653 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5654 (wait_reading_process_output):
5655 Port to ns-resolution time stamps.
5656 (Faccept_process_output, wait_reading_process_output):
5657 Check for time stamp overflow. Do not assume time_t is signed.
5658 (select_wrapper): Remove; we now use pselect.
5659 (Fprocess_attributes): Now generates ns-resolution time stamps.
5660
5661 * sysdep.c: Include utimens.h. Don't include utime.h
5662 or worry about struct utimbuf; gnulib does that for us now.
5663 (gettimeofday): Remove; gnulib provides a substitute.
5664 (make_timeval): New function.
5665 (set_file_times): Now sets ns-resolution time stamps.
5666 New arg FD; all uses changed.
5667 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5668 (system_process_attributes):
5669 Now returns ns-resolution time stamp. All uses changed.
5670 Check for time stamp overflow.
5671
5672 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5673 provides a substitute now.
5674
5675 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5676 since it guarantees struct timespec.
5677 (EMACS_TIME): Now struct timespec, so that we can support
5678 ns-resolution time stamps.
5679 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5680 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5681 (EMACS_USECS): Remove.
5682 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5683 so multiply the arg by 1000 before storing it.
5684 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5685 New macros.
5686 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5687 Port to ns-resolution time stamps.
5688 (EMACS_TIME_NEG_P): Remove; replaced by....
5689 (EMACS_TIME_SIGN): New macro.
5690 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5691 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5692 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5693 (make_timeval, make_lisp_time, decode_time_components): New decls.
5694 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5695 that it mishandled time_t overflow. You can't compare by subtracting!
5696 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5697 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5698
5699 * term.c: Include <sys/time.h>.
5700 (timeval_to_Time): New function, for proper overflow wraparound.
5701 (term_mouse_position, term_mouse_click): Use it.
5702
5703 * undo.c (record_first_change): Support higher-resolution time stamps
5704 in the undo buffer.
5705 (Fprimitive_undo): Use them when restoring time stamps.
5706
5707 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5708 (w32_get_internal_run_time):
5709 Port to higher-resolution Emacs time stamps.
5710 (ltime): Now accepts single 64-bit integer, as that's more convenient
5711 for callers.
5712
5713 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5714
5715 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5716 for compatibility with pselect. Support ns-resolution time stamps.
5717
5718 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5719
5720 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5721 Check for time stamp overflow, and support ns-resolution time stamps.
5722
5723 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5724 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5725 (timeval_subtract): Remove; no longer needed.
5726 (XTflash, XTring_bell, x_wait_for_event):
5727 Port to ns-resolution time stamps. Don't assume time_t is signed.
5728
b6a92dfe
CY
57292012-06-22 Chong Yidong <cyd@gnu.org>
5730
5731 * xdisp.c (x_consider_frame_title): Revert last change.
5732
d251c37c
EZ
57332012-06-22 Eli Zaretskii <eliz@gnu.org>
5734
5735 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5736 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5737 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5738 staticidx goes up to 1597 out of 1600 = 0x640.)
5739
f10deafb
PE
57402012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5741
5742 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5743 Otherwise, the umask might be mistakenly 0 while handling input signals.
5744
ec6de1e2
SM
57452012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5746
5747 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5748
28be1ada
DA
57492012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5750
5751 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5752 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5753 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5754 access to `contents' member of Lisp_Vector objects with AREF and ASET
5755 where appropriate.
5756
c6bf3022
CY
57572012-06-19 Chong Yidong <cyd@gnu.org>
5758
5759 * frame.c (delete_frame): When selecting a frame on a different
5760 text terminal, do not alter the terminal's top-frame.
5761
5762 * xdisp.c (format_mode_line_unwind_data): Record the target
5763 frame's selected window and its terminal's top-frame.
5764 (unwind_format_mode_line): Restore them.
5765 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5766 Callers changed.
5767 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5768 since tty frames can be explicitly named.
5769 (prepare_menu_bars): Likewise.
5770
5771 * term.c (Ftty_top_frame): New function.
5772
defd4196
PE
57732012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5774
5775 Port byte-code-meter to modern targets.
5776 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5777 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 5778 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
5779 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5780 (METER_1, METER_2): Simplify.
5781
1053a871
SM
57822012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5783
5784 * data.c (Fdefalias): Return `symbol' (bug#11686).
5785
b7e8d081
MR
57862012-06-18 Martin Rudalics <rudalics@gmx.at>
5787
5788 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
5789 gets killed during executing of this function (Bug#11665).
5790 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
5791 (Vkill_buffer_query_functions): In doc-string say that functions
5792 run by this hook should not change the current buffer.
5793
7ea2b339
PE
57942012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5795
5796 Fix recently-introduced process.c problems found by static checking.
5797 * process.c (write_queue_push, write_queue_pop, send_process):
5798 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5799 (write_queue_pop): Fix pointer signedness problem.
5800 (send_process): Remove unused local.
5801
96a313a1
CY
58022012-06-17 Chong Yidong <cyd@gnu.org>
5803
5804 * xdisp.c (redisplay_internal): No need to redisplay terminal
5805 frames that are not on top.
5806
20ca2e94
TN
58072012-06-17 Troels Nielsen <bn.troels@gmail.com>
5808
5809 * process.c (make_process): Initialize write_queue.
5810 (write_queue_push, write_queue_pop): New functions.
5811 (send_process): Use them to maintain correct ordering of process
5812 writes (Bug#10815).
5813
9a900ca9
PE
58142012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5815
310fbfa8
PE
5816 * lisp.h (eassert): Assume C89 or later.
5817 This removes the need for CHECK.
5818 (CHECK): Remove. Its comments about always evaluating its
5819 argument were confusing, as 'eassert' typically does not evaluate
5820 its argument.
5821
27bb1ca4
PE
5822 * coding.c (produce_chars): Use ptrdiff_t, not int.
5823
9a900ca9
PE
5824 * xterm.c (x_draw_underwave): Check for integer overflow.
5825 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5826
41b7f8bc 58272012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
5828
5829 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5830 referenced (Bug#11583).
5831
9b0e3eba
AA
58322012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5833
5834 Implement wave-style variant of underlining.
5835 * dispextern.h (face_underline_type): New enum.
5836 (face): Add field for underline type.
5837 * nsterm.m (ns_draw_underwave): New function.
5838 (ns_draw_text_decoration): Use it.
5839 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5840 New functions.
5841 (x_draw_glyph_string): Use them.
5842 * xfaces.c (Qline, Qwave): New Lisp objects.
5843 (check_lface_attrs, merge_face_ref)
1053a871
SM
5844 (Finternal_set_lisp_face_attribute, realize_x_face):
5845 Handle wave-style underline face attributes.
9b0e3eba
AA
5846 * xterm.c (x_draw_underwave): New function.
5847 (x_draw_glyph_string): Use it.
5848
0fb52f11
JB
58492012-06-16 Juanma Barranquero <lekktu@gmail.com>
5850
5851 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5852 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5853 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5854 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5855 ($(BLD)/w32select.$(O)): Update dependencies.
5856
e5560ff7
AS
58572012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5858
5859 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5860 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5861 * character.c (_fetch_multibyte_char_p): Remove.
5862 * alloc.c: Include "character.h" before "buffer.h".
5863 * bidi.c: Likewise.
5864 * buffer.c: Likewise.
5865 * bytecode.c: Likewise.
5866 * callint.c: Likewise.
5867 * callproc.c: Likewise.
5868 * casefiddle.c: Likewise.
5869 * casetab.c: Likewise.
5870 * category.c: Likewise.
5871 * cmds.c: Likewise.
5872 * coding.c: Likewise.
5873 * composite.c: Likewise.
5874 * dired.c: Likewise.
5875 * dispnew.c: Likewise.
5876 * doc.c: Likewise.
5877 * dosfns.c: Likewise.
5878 * editfns.c: Likewise.
5879 * emacs.c: Likewise.
5880 * fileio.c: Likewise.
5881 * filelock.c: Likewise.
5882 * font.c: Likewise.
5883 * fontset.c: Likewise.
5884 * fringe.c: Likewise.
5885 * indent.c: Likewise.
5886 * insdel.c: Likewise.
5887 * intervals.c: Likewise.
5888 * keyboard.c: Likewise.
5889 * keymap.c: Likewise.
5890 * lread.c: Likewise.
5891 * macros.c: Likewise.
5892 * marker.c: Likewise.
5893 * minibuf.c: Likewise.
5894 * nsfns.m: Likewise.
5895 * nsmenu.m: Likewise.
5896 * print.c: Likewise.
5897 * process.c: Likewise.
5898 * regex.c: Likewise.
5899 * region-cache.c: Likewise.
5900 * search.c: Likewise.
5901 * syntax.c: Likewise.
5902 * term.c: Likewise.
5903 * textprop.c: Likewise.
5904 * undo.c: Likewise.
5905 * unexsol.c: Likewise.
5906 * w16select.c: Likewise.
5907 * w32fns.c: Likewise.
5908 * w32menu.c: Likewise.
5909 * window.c: Likewise.
5910 * xdisp.c: Likewise.
5911 * xfns.c: Likewise.
5912 * xmenu.c: Likewise.
5913 * xml.c: Likewise.
5914 * xselect.c: Likewise.
5915
2f07e6af
EZ
59162012-06-16 Eli Zaretskii <eliz@gnu.org>
5917
1053a871
SM
5918 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5919 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 5920 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
5921 row.
5922 (handle_face_prop): Use chunk-relative overlay string index when
5923 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
5924 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5925 the rightmost. (Bug#11720)
2f07e6af 5926
29b83cec
AS
59272012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5928
5929 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5930 (CATEGORY_MEMBER): Enforce 1/0 value.
5931 * category.c (_temp_category_set): Remove.
5932
4c5501e9
EZ
59332012-06-16 Eli Zaretskii <eliz@gnu.org>
5934
5935 * window.c (Fdelete_other_windows_internal)
5936 (Fdelete_window_internal): Don't access frame's mouse highlight
5937 info of the initial frame. (Bug#11677)
5938
2b570124
PE
59392012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5940
e93864f9
PE
5941 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5942 Assume USE_2_TAGS_FOR_INTS.
5943 (xreload): Adjust $tagmask width to match recent lisp.h change.
5944
2b570124
PE
5945 Simplify lisp.h in minor ways that should not affect code.
5946 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5947 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5948 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5949 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5950 (INTTYPEBITS): New macro, for clarity.
5951 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
5952 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5953 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
5954 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5955 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5956
81755f69
JB
59572012-06-13 Juanma Barranquero <lekktu@gmail.com>
5958
5959 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5960
16192a57
GM
59612012-06-13 Glenn Morris <rgm@gnu.org>
5962
5963 * s/bsd-common.h (BSD4_3):
5964 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5965
646b5f55
AS
59662012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5967
5968 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5969 instead of union.
5970 (XLI, XIL): Define.
1053a871
SM
5971 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5972 Use them.
5973 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 5974 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 5975 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
5976 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5977 * frame.c (delete_frame): Remove outdated comment.
5978 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5979 USE_LISP_UNION_TYPE.
5980 (Fw32_unregister_hot_key): Likewise.
5981 (Fw32_toggle_lock_key): Likewise.
5982 * w32menu.c (add_menu_item): Likewise.
5983 (w32_menu_display_help): Use XIL instead of checking
5984 USE_LISP_UNION_TYPE.
5985 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5986 (init_heap): Likewise.
5987 * w32term.c (w32_read_socket): Update comment.
5988
1d3823c9
GM
59892012-06-13 Glenn Morris <rgm@gnu.org>
5990
c62ff706
GM
5991 * s/usg5-4-common.h, src/s/unixware.h:
5992 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5993
1d3823c9
GM
5994 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5995
bfe3e0a2
PE
59962012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5997
5998 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5999 * alloc.c (make_number) [!defined make_number]:
6000 Remove, as lisp.h always defines this now.
6001 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6002 (roundup_size): Verify that it is a power of 2.
6003 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6004 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6005 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6006 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6007 USE_LSB_TAG now is always defined to be either 0 or 1.
6008 All uses changed.
6009 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6010 code works fine either way, and efficiency is not a concern here,
6011 as the union type is for debugging, not for production.
6012 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6013 Use an inline function on all platforms when using the union type,
6014 since this is simpler and 'static inline' can be used portably
6015 within Emacs now.
6016 (LISP_INITIALLY_ZERO): New macro.
6017 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6018 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6019
45fa9c0f
GM
60202012-06-12 Glenn Morris <rgm@gnu.org>
6021
b4492cba
GM
6022 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6023
6024 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6025
45fa9c0f
GM
6026 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6027 Move BROKEN_SIGIO to configure.
6028
6029 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6030 Move NO_TERMIO to configure.
6031
0e25d334
CY
60322012-06-12 Chong Yidong <cyd@gnu.org>
6033
6034 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6035 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6036 MagickExportImagePixels is undefined.
6037
43682bb6
PE
60382012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6039
6040 * image.c (imagemagick_load_image): Remove unused label.
6041
a9be7d2b
GM
60422012-06-11 Glenn Morris <rgm@gnu.org>
6043
6044 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6045 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6046 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6047 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6048
3017f87f
SM
60492012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6050
6051 * alloc.c (make_byte_code): New function.
6052 (Fmake_byte_code): Use it. Don't purify here.
6053 * lread.c (read1): Use it as well to avoid extra allocation.
6054
1b9b4cf4
CY
60552012-06-11 Chong Yidong <cyd@gnu.org>
6056
6057 * image.c (imagemagick_load_image): Implement transparency.
6058
95988fcf
AS
60592012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6060
6061 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6062 account for preceding backslashes. (Bug#11663)
6063
cd4eb164
CY
60642012-06-09 Chong Yidong <cyd@gnu.org>
6065
6066 * term.c: Support italics in capable terminals (Bug#9652).
6067 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6068 (turn_on_face): Output using TS_enter_italic_mode if available.
6069 Don't handle unused blinking and alt-charset cases.
6070 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6071 and tty_alt_charset_p cases.
6072 (tty_capable_p, init_tty): Support italics.
6073
6074 * termchar.h (struct tty_display_info): Add field for italics.
6075 Remove unused blink field.
6076
6077 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6078 Handle slant.
6079
6080 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6081 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6082 tty_alt_charset_p. Add tty_italic_p.
6083
ff88beb8
MA
60842012-06-09 Michael Albinus <michael.albinus@gmx.de>
6085
6086 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6087 dbus_type_is_basic if available.
6088 (xd_extract_signed, xd_extract_unsigned): Rename from
6089 extract_signed and extract_unsigned, respectively. Adapt callers.
6090
44286096
CY
60912012-06-09 Chong Yidong <cyd@gnu.org>
6092
1682701f
CY
6093 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6094
44286096
CY
6095 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6096 case (Bug#9752).
6097
d86feb17
PE
60982012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6099
6100 * xdisp.c (vmessage): Treat frame message as multibyte.
6101 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6102 would generate the diagnostic "Making \302\247 buffer-local while
6103 let-bound!".
6104
d5c20fe8
EZ
61052012-06-08 Eli Zaretskii <eliz@gnu.org>
6106
6107 * dispnew.c (showing_window_margins_p): Undo last change, which
6108 was done due to an inadvertent commit.
6109 (adjust_frame_glyphs_for_frame_redisplay): Do call
6110 showing_window_margins_p.
6111
513749ee
SM
61122012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6113
6114 * eval.c (Fmake_var_non_special): New primitive.
6115 (syms_of_eval): Defsubr it.
6116 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6117
d4a8f5c1
JB
61182012-06-08 Juanma Barranquero <lekktu@gmail.com>
6119
6120 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6121 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6122
8bbbc977
EZ
61232012-06-08 Eli Zaretskii <eliz@gnu.org>
6124
6125 * alloc.c (allocate_vectorlike): Fix last change.
6126
f3372c87
DA
61272012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6128
6129 Block-based vector allocation of small vectors.
6130 * lisp.h (struct vectorlike_header): New field `nbytes',
6131 adjust comment accordingly.
6132 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6133 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6134 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6135 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6136 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6137 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6138 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6139 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6140 (roundup_size): New constant.
6141 (struct vector_block): New data type.
6142 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6143 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6144 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6145 (sweep_vectors): New functions.
6146 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6147 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6148 or equal to VBLOCK_BYTES_MAX.
6149 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6150 (init_alloc_once): Add call to init_vectors.
6151
4f18a4ed
SM
61522012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6153
6154 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6155
86f158bc
PE
61562012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6157
6158 * doprnt.c (doprnt): Truncate multibyte char correctly.
6159 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6160 would mishandle a string argument "Xc" if X was a multibyte
6161 character of length 2: it would truncate after X's first byte
6162 rather than including all of X.
6163
c5cfcbe0
CY
61642012-06-06 Chong Yidong <cyd@gnu.org>
6165
6166 * buffer.c (word_wrap): Doc fix.
6167
c05cf390
PE
61682012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6169
6170 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6171
0c3461de
GM
61722012-06-03 Glenn Morris <rgm@gnu.org>
6173
6174 * xdisp.c (tool-bar-style): Doc fix.
6175
c71232db
UM
61762012-06-03 Ulrich Müller <ulm@gentoo.org>
6177
6178 * Makefile.in (PAXCTL): Define.
6179 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6180 binary via PaX flags if the paxctl utility is available.
6181 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6182 Restore PaX flags to their default. (Bug#11398)
6183
383f7350
CY
61842012-06-03 Chong Yidong <cyd@gnu.org>
6185
6186 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6187 buffer (Bug#11226).
6188
5f2c76c6
CY
61892012-06-03 Chong Yidong <cyd@gnu.org>
6190
6191 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6192 (note_mode_line_or_margin_highlight): If there is no help echo,
6193 use mode-line-default-help-echo. Handle the case where the mouse
6194 position is past the end of the mode line string.
6195
6196 * buffer.c (buffer_local_value_1): New function, split from
6197 Fbuffer_local_value; can return Qunbound.
6198 (Fbuffer_local_value): Use it.
6199 (Vmode_line_format): Docstring tweaks.
6200
773d47f6
PE
62012012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6202
6203 * sysdep.c (system_process_attributes): Improve comment.
6204
f2d6a3df
SM
62052012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6206
6207 * keyboard.c: Export real-this-command to Elisp.
6208 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6209 and DEFVAR it. Update all users.
6210
63810350
PE
62112012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6212
7bd5c1f4
PE
6213 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6214
63810350
PE
6215 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6216 Convert pctcpu and pctmem to Lisp float properly.
6217 Let the compiler fold better, as 100.0/0x8000 is exact.
6218
a2821611
AS
62192012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6220
6221 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6222 cons_block.
6223
5fceba1d
PE
62242012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6225
6226 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6227
c98ff5dd
DA
62282012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6229
6230 For a 'struct window', replace some Lisp_Object fields to
6231 bitfields where appropriate, remove unused fields.
6232 * window.h (struct window): Remove unused 'last_mark_x' and
6233 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6234 change it's type from Lisp_Object to bitfield.
6235 Change type of 'force_start', 'optional_new_start',
6236 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6237 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6238
ca34e0be
PE
62392012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6240
6241 Pacify gcc -Wdouble-precision when using Xaw.
6242 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6243 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6244 Use 'float' consistently, rather than 'float' in most places
6245 and 'double' in a couple of places.
6246
efc00ab1 62472012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6248
6249 * xdisp.c (handle_stop): Detect whether we have overlay strings
6250 loaded by testing it->current.overlay_string_index to be
6251 non-negative, instead of checking whether n_overlay_strings is
6252 positive. (Bug#11587)
6253
efc00ab1 62542012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6255
6256 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6257
6258 * doc.c (Fsubstitute_command_keys): Doc fix.
6259
efc00ab1 62602012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6261
6262 * search.c (search_buffer): Remove calls to
6263 r_alloc_inhibit_buffer_relocation, as it is now called by
6264 maybe_unify_char, which was the cause of relocation of buffer text
6265 in bug#11519.
6266
efc00ab1 62672012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6268
6269 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6270 for the duration of call to load_charset, to avoid problems with
6271 callers of maybe_unify_char that access buffer text through C
6272 pointers.
6273
6274 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6275 decrement the inhibition flag, instead of just setting or
6276 resetting it.
6277
ba93a187
PE
62782012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6279
6280 Remove obsolete '#define static' cruft.
6281 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6282 This #undef was "temporary" in 2000; it is no longer needed
6283 now that '#define static' has gone away.
6284 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6285 (gray_bitmap_bits): Remove; no longer needed.
6286 All uses replaced with definiens.
6287 * xterm.c: Include "bitmaps/gray.xbm".
6288
9e4bf381
PE
62892012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6290
6291 Clean up __executable_start, monstartup when --enable-profiling.
6292 The following changes affect the code only when profiling.
6293 * dispnew.c (__executable_start): Rename from safe_bcopy.
6294 Define only on platforms that need it.
6295 * emacs.c: Include <sys/gmon.h> when profiling.
6296 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6297 (__executable_start): Remove decl, since lisp.h does it now.
6298 (safe_bcopy): Remove decl; no longer has that name.
6299 (main): Coalesce #if into single bit of code, for simplicity.
6300 Cast pointers to uintptr_t, since standard libraries want integers
6301 and not pointers.
6302 * lisp.h (__executable_start): New decl.
6303
32d72c2f
GM
63042012-05-31 Glenn Morris <rgm@gnu.org>
6305
6306 * image.c (Fimagemagick_types): Doc fix.
6307
baac5bc7
JM
63082012-05-30 Jim Meyering <meyering@redhat.com>
6309
6310 * callproc.c (Fcall_process_region): Include directory component
6311 in mkstemp error message (Bug#11586).
6312
72cb32cf
PE
63132012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6314
6315 * alloc.c, lisp.h (make_pure_vector): Now static.
6316
61b108cc
SM
63172012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6318
6319 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6320 Move to byte-run.el.
6321 (Fautoload): Do the hash-doc more carefully.
6322 * data.c (Fdefalias): Purify definition, except for keymaps.
6323 (Qdefun): Move from eval.c.
6324 * lisp.h (Qdefun): Remove.
6325 * lread.c (read1): Tiny simplification.
6326
471fe23d
TN
63272012-05-29 Troels Nielsen <bn.troels@gmail.com>
6328
934f3f58 6329 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6330 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6331 Bug#9642, but explicitly check that the buffer the overlay would
6332 be moved to is live and rearrange lines to make sure that errors
6333 will not put the overlay in an inconsistent state.
6334 (Fdelete_overlay): Cosmetics.
6335
85d0efd1
EZ
63362012-05-28 Eli Zaretskii <eliz@gnu.org>
6337
6338 * w32term.c (my_bring_window_to_top): New function.
6339 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6340 could be different from the original one.
6341 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6342 (Bug#11513)
6343
6344 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6345 by calling BringWindowToTop.
6346
6347 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6348 (WM_EMACS_END): Increase by one.
6349
da92a98c
PE
63502012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6351
6352 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6353 This avoids undefined behavior that might cause the eassert
6354 to not catch an out-of-range value.
6355
74d1f848
JB
63562012-05-28 Juanma Barranquero <lekktu@gmail.com>
6357
6358 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6359 Update dependencies.
6360
9e1a06fc
EZ
63612012-05-27 Eli Zaretskii <eliz@gnu.org>
6362
6363 * bidi.c (bidi_mirror_char): Fix last change.
6364
f3dd7312
AS
63652012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6366
6367 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6368 when referring to sectname field in printf format.
6369
81899c91
PE
63702012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6371
57b81a9f
PE
6372 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6373 Only r_alloc_inhibit_buffer_relocation needed to be added;
6374 the others were already declared.
6375
81899c91
PE
6376 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6377 before checking whether it's out of range. Put the check inside
6378 eassert. See
6379 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6380
33017faf 63812012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
6382
6383 * callproc.c (Fcall_process): Restore a line that was accidentally
6384 commented out in the 2011-02-13 change (bug#11547).
6385
33017faf 63862012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
6387
6388 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6389 defined on ralloc.c.
6390
6391 * buffer.c [REL_ALLOC]: Remove prototypes of
6392 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6393 they are now on lisp.h.
6394
6395 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6396
6397 * search.c (search_buffer): Use it to inhibit relocation of buffer
6398 text while re_search_2 is doing its job, because re_search_2 is
6399 passed C pointers to buffer text. (Bug#11519)
6400
23415acf
EZ
6401 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6402 Update value to 24.
6403
44e27368
EZ
6404 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6405 state after an additional call to move_it_in_display_line_to, keep
6406 the values of it->max_ascent and it->max_descent found for the
6407 entire line.
6408 (pos_visible_p): Revert the comparison against bottom_y to what it
6409 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6410 (Bug#11464)
6411
c1892f11
PE
64122012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6413
6414 Fix coding-related core dumps with gcc -ftrapv.
6415 The code was computing A - B, where A and B are pointers, and B is
6416 random garbage. This can lead to core dumps on platforms that
6417 have special pointer registers, and it also leads to core dumps on
6418 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6419 A - B only when B is initialized properly.
6420 * coding.c (coding_set_source, coding_set_destination): Return void.
6421 (coding_change_source, coding_change_destinations): New functions,
6422 with the old behaviors of coding_set_source and coding_set_destination.
6423 All callers that need an offset changed to use these new functions.
6424
eb7afdad
GM
64252012-05-26 Glenn Morris <rgm@gnu.org>
6426
6427 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6428
f12fdf02
EZ
64292012-05-26 Eli Zaretskii <eliz@gnu.org>
6430
53a63be6 6431 Extend mouse support on W32 text-mode console.
61b108cc
SM
6432 * xdisp.c (draw_row_with_mouse_face):
6433 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 6434
eb3f6f01 6435 * w32console.c: Include window.h.
61b108cc
SM
6436 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6437 New functions.
eb3f6f01
EZ
6438 (initialize_w32_display): Initialize mouse-highlight data.
6439
53a63be6
EZ
6440 * w32inevt.c: Include termchar.h and window.h.
6441 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6442 moves, call note_mouse_highlight. If help_echo changed, call
6443 gen_help_event to produce help-echo message in the echo area.
6444 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6445 highlight info.
6446
4cfd81f6
PE
64472012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6448
6449 * lread.c (read1): Simplify slightly to avoid an overflow warning
6450 with GCC 4.7.0 on x86-64.
6451
4446092a
EZ
64522012-05-26 Eli Zaretskii <eliz@gnu.org>
6453
6454 * bidi.c (bidi_mirror_char): Revert last change: an int is
6455 definitely wide enough here.
6456
42b2a986 64572012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 6458
42b2a986 6459 Fix integer width and related bugs (Bug#9874).
eb106a49 6460 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
6461 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6462 (string_bytes, check_sblock, allocate_string_data):
6463 (compact_small_strings, Fmake_bool_vector, make_string)
6464 (make_unibyte_string, make_multibyte_string)
6465 (make_string_from_bytes, make_specified_string)
6466 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6467 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6468 (mark_vectorlike):
6469 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6470 (allocate_pseudovector):
6471 Use int, not EMACS_INT, where int is wide enough.
6472 (inhibit_garbage_collection, Fgarbage_collect):
6473 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6474 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6475 int might not be wide enough.
6476 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6477 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6478 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6479 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6480 (bidi_level_of_next_char, bidi_move_to_visually_next):
6481 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6482 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6483 (Fkill_buffer, Fset_buffer_major_mode)
6484 (advance_to_char_boundary, Fbuffer_swap_text)
6485 (Fset_buffer_multibyte, overlays_at, overlays_in)
6486 (overlay_touches_p, struct sortvec, record_overlay_string)
6487 (overlay_strings, recenter_overlay_lists)
6488 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6489 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6490 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6491 (Foverlay_recenter, last_overlay_modification_hooks_used)
6492 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
6494 (validate_region): Omit unnecessary test for b <= e,
6495 since that's guaranteed by the previous test.
d311d28c
PE
6496 (adjust_overlays_for_delete): Avoid pos + length overflow.
6497 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6498 (report_overlay_modification):
6499 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6500 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6501 Omit pointer cast, which isn't needed anyway, and doesn't work
6502 after the EMACS_INT -> ptrdiff_t change.
02481186 6503 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
6504 * buffer.h: Adjust decls to match defn changes elsewhere.
6505 (struct buffer_text, struct buffer):
6506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6507 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
6508 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6509 not int, to avoid needless 32-bit limit on 64-bit hosts.
6510 (exec_byte_code): Use tighter memory-full test, one that checks
6511 for alloca overflow. Don't compute the address of the object just
6512 before an array, as that's not portable. Use EMACS_INT, not
6513 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
6514 * callint.c (Fcall_interactively):
6515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6516 * callproc.c (call_process_kill, Fcall_process):
6517 Don't assume pid_t fits into an Emacs fixnum.
6518 (call_process_cleanup, Fcall_process, child_setup):
6519 Don't assume pid_t fits into int.
6520 (call_process_cleanup, Fcall_process, delete_temp_file)
6521 (Fcall_process_region):
6522 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6523 (Fcall_process): Simplify handling of volatile integers.
6524 Use int, not EMACS_INT, where int will do.
6525 * casefiddle.c (casify_object, casify_region, operate_on_word)
6526 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6528 (casify_object): Avoid integer overflow when overallocating buffer.
6529 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 6530 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
6531 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6532 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6533 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6534 integers are now checked earlier. All uses replaced with XINT.
6535 (ccl_driver):
6536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6537 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
6538 (ccl_driver, Fregister_code_conversion_map):
6539 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
6540 (resolve_symbol_ccl_program): Check that vector header is in range.
6541 Always copy the vector, so that we can check its contents reliably
6542 now rather than having to recheck each instruction as it's being
6543 executed. Check that vector words fit in 'int'.
6544 (ccl_get_compiled_code, Fregister_ccl_program)
6545 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6546 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6547 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6548 contents are in range.
6549 (Fccl_execute_on_string): Check that status is in range.
6550 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6551 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6552 Accept and return EMACS_INT, not int, because callers can pass values
6553 out of 'int' range.
6554 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6555 (multibyte_chars_in_text, parse_str_as_multibyte)
6556 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6557 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6558 (string_escape_byte8, Fget_byte):
6559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 6560 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
6561 avoid mishandling large integers.
6562 * character.h: Adjust decls to match defn changes elsewhere.
6563 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6564 (Ffind_charset_region):
6565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6566 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6567 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 6568 Don't assume fixnum fits in int.
d311d28c
PE
6569 (load_charset_map_from_vector, Fmap_charset_chars):
6570 Remove now-unnecessary CHECK_NATNUMs.
6571 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
6572 Don't rely on undefined behavior with signed left shift overflow.
6573 Don't assume unsigned int fits into fixnum, or that fixnum fits
6574 into unsigned int. Don't require max_code to be a valid fixnum;
6575 that's not true for gb10830 4-byte on a 32-bit host. Allow
6576 invalid_code to be a cons, for the same reason. Require code_offset
6577 to be a character. Avoid int overflow if max_char is close
6578 to INT_MAX.
6579 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6580 this is intended anyway and avoids some undefined behavior.
6581 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6582 INDEX_TO_CODE_POINT, as that's what it expects.
6583 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
6584 * charset.h (DECODE_CHAR): Return int, not unsigned;
6585 this is what was intended anyway, and it avoids undefined behavior.
6586 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6587 integer-overflow issues.
6588 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6589 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6590 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
6591 * chartab.c (Fmake_char_table, Fset_char_table_range)
6592 (uniprop_get_decoder, uniprop_get_encoder):
6593 Don't assume fixnum fits in int.
6594 * cmds.c (move_point): New function, that does the gist of
6595 Fforward_char and Fbackward_char, but does so while checking
6596 for integer overflow more accurately.
c96e5d6a 6597 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
6598 (Fforward_line, Fend_of_line, internal_self_insert)
6599 (internal_self_insert):
6600 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6601 Fix a FIXME, by checking for integer overflow when calculating
6602 target_clm and actual_clm.
6603 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 6604 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
6605 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6606 (coding_alloc_by_making_gap, alloc_destination)
6607 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6608 (encode_coding_utf_16, detect_coding_emacs_mule)
6609 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6610 (detect_coding_iso_2022, decode_coding_iso_2022)
6611 (encode_invocation_designation, encode_designation_at_bol)
6612 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6613 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6614 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6615 (encode_coding_ccl, encode_coding_raw_text)
6616 (detect_coding_charset, decode_coding_charset)
6617 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6618 (produce_composition, produce_charset, produce_annotation)
6619 (decode_coding, handle_composition_annotation)
6620 (handle_charset_annotation, consume_chars, decode_coding_gap)
6621 (decode_coding_object, encode_coding_object, detect_coding_system)
6622 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6623 (code_convert_region, code_convert_string)
8f50130c
PE
6624 (Fdefine_coding_system_internal)
6625 (coding_set_source, coding_set_destination):
d311d28c
PE
6626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6627 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6628 (Fdefine_coding_system_internal):
6629 Don't assume fixnums fit in int.
6630 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 6631 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
6632 (Funencodable_char_position, Fcheck_coding_systems_region)
6633 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 6634 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 6635 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 6636 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 6637 Don't access memory outside of the args array.
d311d28c 6638 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
6639 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6640 result of ENCODE_CHAR.
d311d28c
PE
6641 * coding.h: Adjust decls to match defn changes elsewhere.
6642 (struct coding_system):
6643 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6644 * composite.c (get_composition_id, find_composition)
6645 (run_composition_function, update_compositions)
6646 (compose_text, composition_gstring_put_cache)
6647 (composition_gstring_p, composition_gstring_width)
6648 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6649 (composition_compute_stop_pos, composition_reseat_it)
6650 (composition_update_it, struct position_record)
6651 (find_automatic_composition, composition_adjust_point)
6652 (Fcomposition_get_gstring, Ffind_composition_internal):
6653 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6654 (update_compositions):
6655 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6656 * composite.h: Adjust decls to match defn changes elsewhere.
6657 (struct composition):
6658 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6659 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6660 Do not attempt to compute the address of the object just before a
6661 buffer; this is not portable.
6662 (Faref, Faset):
6663 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6664 (Faset): Use int, not EMACS_INT, where int is wide enough.
6665 (Fstring_to_number): Don't assume fixnums fit in int.
6666 (Frem): Don't assume arg is nonnegative.
6667 * dbusbind.c (xd_append_arg): Check for integers out of range.
6668 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 6669 (extract_signed, extract_unsigned): New functions.
243e0530
PE
6670 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6671 (xd_get_connection_references): Return ptrdiff_t, not int.
6672 All uses changed.
6673 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6674 (xd_read_message_1):
6675 Use int, not unsigned, where the dbus API uses int.
6676 (Fdbus_message_internal): Don't overflow mtype.
6677 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
6678 * dired.c (directory_files_internal, file_name_completion, scmp)
6679 (file_name_completion_stat):
6680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6681 (file_name_completion): Don't overflow matchcount.
6682 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6683 * dispextern.h: Adjust decls to match defn changes elsewhere.
6684 (struct text_pos, struct glyph, struct bidi_saved_info)
6685 (struct bidi_string_data, struct bidi_it, struct composition_it)
6686 (struct it):
6687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6688 (struct display_pos, struct composition_it, struct it):
6689 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6690 * dispnew.c (increment_matrix_positions)
6691 (increment_row_positions, mode_line_string)
6692 (marginal_area_string):
6693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 6694 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
6695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6696 (duration_to_sec_usec): New function, to check for overflow better.
6697 (Fsleep_for, sit_for): Use it.
6698 * doc.c (get_doc_string, store_function_docstring):
6699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6700 (get_doc_string, Fsnarf_documentation):
6701 Use int, not EMACS_INT, where int is wide enough.
6702 (get_doc_string):
6703 Use SAFE_ALLOCA, not alloca.
6704 Check for overflow when converting EMACS_INT to off_t.
6705 * doprnt.c (doprnt):
6706 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6707 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6708 Don't assume uid_t fits into fixnum.
6709 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6710 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6711 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6712 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6713 (general_insert_function)
6714 (Finsert_char, make_buffer_string, make_buffer_string_both)
6715 (update_buffer_properties, Fbuffer_substring)
6716 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6717 (Fsubst_char_in_region, check_translation)
6718 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6719 (transpose_markers, Ftranspose_regions):
6720 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6721 (clip_to_bounds): Move to lisp.h as an inline function).
6722 (Fconstrain_to_field): Don't assume integers are nonnegative.
6723 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6724 (Fsubst_char_in_region, Fsave_restriction):
6725 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6726 (Femacs_pid): Don't assume pid_t fits into fixnum.
6727 (lo_time): Use int, not EMACS_INT, when int suffices.
6728 (lisp_time_argument): Check for usec out of range.
6729 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
6730 (Fuser_login_name, Fuser_full_name): Signal an error
6731 if a uid argument is out of range, rather than relying on
6732 undefined behavior.
c8d5c857
PE
6733 (Fformat_time_string): Remove now-unnecessary check.
6734 lisp_time_argument checks for out-of-range usec now.
243e0530 6735 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
6736 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6737 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6738 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6739 (init_cmdargs, Fdump_emacs):
6740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6741 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6742 the bottom (typically) 32 bits of the fixnum.
6743 * eval.c (specpdl_size, call_debugger):
6744 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6745 (when_entered_debugger, Fbacktrace_debug):
6746 Don't assume fixnum can fit in int.
6747 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6748 the object just before a buffer; this is not portable.
6749 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6750 (grow_specpdl, unbind_to):
6751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6752 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6753 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 6754 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
6755 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6756 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6757 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6758 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6759 (a_write, e_write):
6760 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6761 (Fcopy_file, non_regular_nbytes, read_non_regular)
6762 (Finsert_file_contents):
6763 Use int, not EMACS_INT, where int is wide enough.
6764 (READ_BUF_SIZE): Verify that it fits in int.
6765 (Finsert_file_contents): Check that counts are in proper range,
6766 rather than assuming fixnums fit into ptrdiff_t etc.
6767 Don't assume fixnums fit into int.
125b3835 6768 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
6769 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6770 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
6771 (string_char_to_byte, string_byte_to_char)
6772 (string_make_multibyte, string_to_multibyte)
6773 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6774 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6775 (substring_both, Fdelete, internal_equal, Ffillarray)
6776 (Fclear_string, mapcar1)
6777 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6778 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6779 (larger_vector, make_hash_table, maybe_resize_hash_table)
6780 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6781 (Fmaphash, secure_hash):
6782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6783 (concat): Check for string index and length overflow.
6784 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6785 (Frequire):
6786 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6787 (larger_vector): New API (vec, incr_min, size_max) replaces old
6788 one (vec, new_size, init). This catches size overflow.
6789 INIT was removed because it was always Qnil.
6790 All callers changed.
6791 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6792 the upper bound on a hash table index size.
6793 (make_hash_table, maybe_resize_hash_table): Use it.
6794 (secure_hash): Computer start_byte and end_byte only after
6795 they're known to be in ptrdiff_t range.
6796 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6797 (Ffont_get_glyphs, Ffont_at):
6798 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6799 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6800 (Flist_fonts, Fopen_font):
6801 Don't assume fixnum can fit in int.
6802 (check_gstring): Don't assume index can fit in int.
6803 (font_match_p): Check that fixnum is a character, not a nonnegative
6804 fixnum, since the later code needs to stuff it into an int.
6805 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6806 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6807 conversion overflow issues.
6808 (Fopen_font): Check for integer out of range.
6809 (Ffont_get_glyphs): Don't assume index can fit in int.
6810 * font.h: Adjust decls to match defn changes elsewhere.
6811 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6812 integer overflow.
6813 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6814 printmax_t, where ptrdiff_t is wide enough.
6815 (Finternal_char_font):
6816 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6817 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6818 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6819 (Fset_frame_position, x_set_frame_parameters)
6820 (x_set_line_spacing, x_set_border_width)
6821 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6822 Check that fixnums are in proper range for system types.
6823 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6825 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6826 Use SAFE_ALLOCA_LISP, not alloca.
6827 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6828 intptr_t is wide enough.
6829 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6830 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6831 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6832 Check for fixnum out of range.
6833 * ftfont.c (ftfont_list): Don't assume index fits in int.
6834 Check that fixnums are in proper range for system types.
6835 (ftfont_shape_by_flt):
6836 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
6837 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6839 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6840 Check that fixnums are in proper range for system types.
6841 * gnutls.h: Adjust decls to match defn changes elsewhere.
6842 * gtkutil.c (xg_dialog_run):
6843 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6844 (update_frame_tool_bar):
6845 Check that fixnums are in proper range for system types.
6846 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 6847 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
6848 * indent.c (last_known_column, last_known_column_point):
6849 (current_column_bol_cache):
6850 (skip_invisible, current_column, check_display_width):
6851 (check_display_width, scan_for_column, current_column_1)
6852 (Findent_to, Fcurrent_indentation, position_indentation)
6853 (indented_beyond_p, Fmove_to_column, compute_motion):
6854 (Fcompute_motion, Fvertical_motion):
6855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6856 (last_known_column_modified): Use EMACS_INT, not int.
6857 (check_display_width):
6858 (Fcompute_motion):
6859 Check that fixnums and floats are in proper range for system types.
6860 (compute_motion): Don't assume index or fixnum fits in int.
6861 (compute_motion, Fcompute_motion):
6862 Use int, not EMACS_INT, when it is wide enough.
6863 (vmotion): Omit local var start_hpos that is always 0; that way
6864 we don't need to worry about overflow in expressions involving it.
6865 * indent.h: Adjust decls to match defn changes elsewhere.
6866 (struct position):
6867 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6868 Use int, not EMACS_INT, where int is wide enough.
6869 Remove unused members ovstring_chars_done and tab_offset;
6870 all uses removed.
6871 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6872 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6873 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6874 (make_gap, copy_text, insert, insert_and_inherit)
6875 (insert_before_markers, insert_before_markers_and_inherit)
6876 (insert_1, count_combining_before, count_combining_after)
6877 (insert_1_both, insert_from_string)
6878 (insert_from_string_before_markers, insert_from_string_1)
6879 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6880 (adjust_after_replace, adjust_after_insert, replace_range)
6881 (replace_range_2, del_range, del_range_1, del_range_byte)
6882 (del_range_both, del_range_2, modify_region)
6883 (prepare_to_modify_buffer, signal_before_change)
6884 (signal_after_change, Fcombine_after_change_execute):
6885 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6886 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6887 (balance_an_interval, split_interval_right, split_interval_left)
6888 (find_interval, next_interval, update_interval)
6889 (adjust_intervals_for_insertion, delete_node, delete_interval)
6890 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6891 (static_offset_intervals, offset_intervals)
6892 (merge_interval_right, merge_interval_left, make_new_interval)
6893 (graft_intervals_into_buffer, temp_set_point_both)
6894 (temp_set_point, set_point, adjust_for_invis_intang)
6895 (set_point_both, move_if_not_intangible, get_property_and_range)
6896 (get_local_map, copy_intervals, copy_intervals_to_string)
6897 (compare_string_intervals, set_intervals_multibyte_1):
6898 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6899 * intervals.h: Adjust decls to match defn changes elsewhere.
6900 (struct interval):
6901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6902 * keyboard.c (this_command_key_count, this_single_command_key_start)
6903 (before_command_key_count, before_command_echo_length, echo_now)
6904 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6905 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6906 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6907 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6909 (last_non_minibuf_size, last_point_position, echo_truncate)
6910 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6911 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6912 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6913 (stuff_buffered_input):
6914 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6915 (last_auto_save, command_loop_1, read_char):
6916 Use EMACS_INT, not int, to avoid integer overflow.
6917 (record_char): Avoid overflow in total_keys computation.
6918 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6919 * keyboard.h: Adjust decls to match defn changes elsewhere.
6920 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6921 (Fkey_description, Fdescribe_vector, Flookup_key):
6922 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6923 (click_position): New function, to check that positions are in range.
6924 (Fcurrent_active_maps):
6925 (describe_command):
6926 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6927 (Faccessible_keymaps, Fkey_description):
6928 (preferred_sequence_p):
6929 Don't assume fixnum can fit into int.
6930 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6931 Check for integer overflow in size calculations.
6932 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6933 avoid mishandling large integers.
6934 * lisp.h: Adjust decls to match defn changes elsewhere.
6935 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6936 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6937 (struct Lisp_Marker):
6938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6939 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
6940 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6941 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6942 All callers changed.
6943 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6944 Assume the arg has valid form, since it always does.
6945 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6946 unsigned integer system type.
6947 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6948 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6949 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6950 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6951 (duration_to_sec_usec): New decl.
6952 * lread.c (read_from_string_index, read_from_string_index_byte)
6953 (read_from_string_limit, readchar, unreadchar, openp)
6954 (read_internal_start, read1, oblookup):
6955 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6956 (Fload, readevalloop, Feval_buffer, Feval_region):
6957 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6958 (openp): Check for out-of-range argument to 'access'.
6959 (read1): Use int, not EMACS_INT, where int is wide enough.
6960 Don't assume fixnum fits into int.
6efdadfd 6961 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
6962 (read_filtered_event): Use duration_to_sec_usec
6963 to do proper overflow checking on durations.
d311d28c
PE
6964 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6965 in size calculation.
6966 (Fexecute_kbd_macro):
6967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6968 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6969 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6970 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6971 (set_marker_both, set_marker_restricted_both, marker_position)
6972 (marker_byte_position, Fbuffer_has_markers_at):
6973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6974 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 6975 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
6976 It now merely ensures that the menu is large enough, without
6977 necessarily growing it, as this avoids some integer overflow issues.
6978 All callers changed.
6979 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6980 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6981 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6982 Use SAFE_ALLOCA_LISP, not alloca.
6983 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6984 to EMACS_INT. Check that fixnums are in proper range for system types.
6985 * minibuf.c (minibuf_prompt_width, string_to_object)
6986 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6987 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6989 (get_minibuffer, read_minibuf_unwind):
6990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6991 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6992 this simplifies overflow checking. All callers changed.
6993 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6994 (Ftest_completion):
6995 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6996 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6997 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6998 Check that fixnums are in proper range for system types.
6999 (Fx_create_frame, Fx_show_tip):
7000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7001 * nsfont.m (ns_findfonts, nsfont_list_family):
7002 Don't assume fixnum fits in long.
7003 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7004 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7005 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7006 wide enough.
17fdb222 7007 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7008 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7009 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7010 (PRINTDECLARE, PRINTPREPARE):
7011 (strout, print_string):
7012 (print, print_preprocess, print_check_string_charset_prop)
7013 (print_object):
7014 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7015 (PRINTDECLARE):
7016 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7017 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7018 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7019 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7020 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7021 (print_error_message): Use SAFE_ALLOCA, not alloca.
7022 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7023 (print_depth, new_backquote_output, print_number_index):
7024 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7025 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7026 (Fset_process_window_size, Fformat_network_address)
7027 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7028 (sigchld_handler):
d311d28c 7029 Check that fixnums are in proper range for system types.
d44287d4 7030 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7031 Check for process-ids out of pid_t range rather than relying on
7032 undefined behavior.
e4d81efc 7033 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7034 (Fformat_network_address, read_process_output, send_process)
7035 (Fprocess_send_region, status_notify):
7036 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7037 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7038 (wait_reading_process_output, read_process_output, exec_sentinel):
7039 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7040 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7041 (Faccept_process_output): Use duration_to_sec_usec to do proper
7042 overflow checking on durations.
dde14581
PE
7043 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7044 Don't assume pid_t fits in int.
02481186
PE
7045 * process.h (struct Lisp_Process): Members tick and update_tick
7046 are now of type EMACS_INT, not int.
b62b53e8
PE
7047 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7048 configured --with-wide-int.
d311d28c
PE
7049 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7050 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7051 * search.c (looking_at_1, string_match_1):
7052 (fast_string_match, fast_c_string_match_ignore_case)
7053 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7054 (scan_newline, find_before_next_newline, search_command)
7055 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7056 (set_search_regs, wordify):
7057 (Freplace_match):
7058 (Fmatch_data):
7059 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7060 (string_match_1, search_buffer, set_search_regs):
7061 (Fmatch_data):
7062 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7063 (wordify): Check for overflow in size calculation.
7064 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7065 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7066 Check that fixnums are in proper range for system types.
7067 * sound.c (struct sound_device)
7068 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7069 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7070 (Fplay_sound_internal):
7071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7072 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7073 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7074 (Fparse_partial_sexp):
7075 Don't assume fixnums can fit in int.
7076 (struct lisp_parse_state, find_start_pos, find_start_value)
7077 (find_start_value_byte, find_start_begv)
7078 (update_syntax_table, char_quoted, dec_bytepos)
7079 (find_defun_start, prev_char_comend_first, back_comment):
7080 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7081 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7082 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7083 (Finternal_describe_syntax_value): Check that match_lisp is a
7084 character, not an integer, since the code stuffs it into int.
7085 (scan_words, scan_sexps_forward):
7086 Check that fixnums are in proper range for system types.
7087 (Fforward_word):
7088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7089 (scan_sexps_forward):
7090 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7091 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7092 * syntax.h: Adjust decls to match defn changes elsewhere.
7093 (struct gl_state_s):
7094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7095 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7096 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7097 * sysdep.c (wait_for_termination_1, wait_for_termination)
7098 (interruptible_wait_for_termination, mkdir):
7099 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7100 (emacs_read, emacs_write):
7101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7102 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7103 and double all fit in int.
d311d28c
PE
7104 * term.c (set_tty_color_mode):
7105 Check that fixnums are in proper range for system types.
7106 * termhooks.h (struct input_event):
7107 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7108 * textprop.c (validate_interval_range, interval_of)
7109 (Fadd_text_properties, set_text_properties_1)
7110 (Fremove_text_properties, Fremove_list_of_text_properties)
7111 (Ftext_property_any, Ftext_property_not_all)
7112 (copy_text_properties, text_property_list, extend_property_ranges)
7113 (verify_interval_modification):
7114 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7115 (Fnext_single_char_property_change)
7116 (Fprevious_single_char_property_change):
7117 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7118 (copy_text_properties):
7119 Check for integer overflow in index calculation.
d311d28c
PE
7120 * undo.c (last_boundary_position, record_point, record_insert)
7121 (record_delete, record_marker_adjustment, record_change)
7122 (record_property_change):
7123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7124 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7125 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7126 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7127 (Fx_hide_tip, Fx_file_dialog):
7128 * w32menu.c (set_frame_menubar):
7129 Use ptrdiff_t, not int, for consistency with rest of code.
7130 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7131 (select_window, Fdelete_other_windows_internal)
7132 (window_scroll_pixel_based, window_scroll_line_based)
7133 (Frecenter, Fset_window_configuration):
7134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7135 (Fset_window_hscroll, run_window_configuration_change_hook)
7136 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7137 (Fscroll_other_window, Frecenter):
d311d28c
PE
7138 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7139 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7140 Don't assume fixnum fits in int.
7141 (Fset_window_scroll_bars):
7142 Check that fixnums are in proper range for system types.
7143 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7144 (string_pos, c_string_pos, number_of_chars, init_iterator)
7145 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7146 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7147 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7148 (face_before_or_after_it_pos, handle_invisible_prop)
7149 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7150 (display_prop_intangible_p, string_buffer_position_lim)
7151 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7152 (get_overlay_strings_1, get_overlay_strings)
7153 (iterate_out_of_display_property, forward_to_next_line_start)
7154 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7155 (get_next_display_element, set_iterator_to_next)
7156 (get_visually_first_element, compute_stop_pos_backwards)
7157 (handle_stop_backwards, next_element_from_buffer)
7158 (move_it_in_display_line_to, move_it_in_display_line)
7159 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7160 (add_to_log, message_dolog, message_log_check_duplicate)
7161 (message2, message2_nolog, message3, message3_nolog
7162 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7163 (current_message_1, truncate_echo_area, truncate_message_1)
7164 (set_message, set_message_1, store_mode_line_noprop)
7165 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7166 (text_outside_line_unchanged_p, check_point_in_composition)
7167 (reconsider_clip_changes)
7168 (redisplay_internal, set_cursor_from_row, try_scrolling)
7169 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7170 (redisplay_window, find_last_unchanged_at_beg_row)
7171 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7172 (trailing_whitespace_p, find_row_edges, display_line)
7173 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7174 (display_mode_element, store_mode_line_string)
7175 (pint2str, pint2hrstr, decode_mode_spec)
7176 (display_count_lines, display_string, draw_glyphs)
7177 (x_produce_glyphs, x_insert_glyphs)
7178 (rows_from_pos_range, mouse_face_from_buffer_pos)
7179 (fast_find_string_pos, mouse_face_from_string_pos)
7180 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7182 (safe_call, init_from_display_pos, handle_fontified_prop)
7183 (handle_single_display_spec, load_overlay_strings)
7184 (with_echo_area_buffer, setup_echo_area_for_printing)
7185 (display_echo_area, echo_area_display)
7186 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7187 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7188 (redisplay_window, dump_glyph_row, display_mode_line)
7189 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7190 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7191 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7192 (handle_single_display_spec, build_desired_tool_bar_string)
7193 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7194 (get_specified_cursor_type):
7195 Check that fixnums are in proper range for system types.
7196 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7197 (Flookup_image_map):
7198 Don't assume fixnums fit in int.
7199 (compare_overlay_entries):
7200 Avoid mishandling comparisons due to subtraction overflow.
7201 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7202 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7203 (handle_tool_bar_click):
7204 Use int, not unsigned, since we prefer signed and the signedness
7205 doesn't matter here.
7206 (get_next_display_element, next_element_from_display_vector):
7207 Use int, not EMACS_INT, when int is wide enough.
7208 (start_hourglass): Use duration_to_sec_usec to do proper
7209 overflow checking on durations.
7210 * xfaces.c (Fbitmap_spec_p):
7211 Check that fixnums are in proper range for system types.
7212 (compare_fonts_by_sort_order):
7213 Avoid mishandling comparisons due to subtraction overflow.
7214 (Fx_family_fonts, realize_basic_faces):
7215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7216 (Fx_family_fonts):
7217 Don't assume fixnum fits in int.
7218 Use SAFE_ALLOCA_LISP, not alloca.
7219 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7220 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7221 (face_at_buffer_position, face_for_overlay_string)
7222 (face_at_string_position):
7223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7224 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7225 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7226 (Fx_show_tip):
7227 Check that fixnums are in proper range for system types.
7228 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7229 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7230 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7231 (Fx_change_window_property): Don't assume fixnums fit in int.
7232 * xfont.c (xfont_chars_supported):
7233 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7234 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7235 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7236 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7237 * xml.c (parse_region):
7238 * xrdb.c (magic_file_p):
7239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7240 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7241 (x_get_local_selection, x_reply_selection_request)
7242 (x_handle_selection_request, wait_for_property_change):
7243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7244 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7245 short is wide enough.
7246 (x_send_client_event): Don't assume fixnum fits in int.
7247 * xterm.c (x_x_to_emacs_modifiers):
7248 Don't assume EMACS_INT overflows nicely into int.
7249 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7250 may come from Lisp.
7251 (handle_one_xevent): NATNUMP can eval its arg twice.
7252 (x_connection_closed):
7253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254 * xterm.h: Adjust decls to match defn changes elsewhere.
7255 (struct scroll_bar): Use struct vectorlike_header
7256 rather than rolling our own approximation.
7257 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7258
c6574eb5
GM
72592012-05-25 Glenn Morris <rgm@gnu.org>
7260
7261 * lisp.mk (lisp): Update for more files being compiled now.
7262
e8d32c7e
SM
72632012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7264
48def666
SM
7265 * lread.c: Remove `read_pure' which makes no difference.
7266 (read_pure): Remove var.
7267 (unreadpure): Remove function.
7268 (readevalloop): Don't call read_list with -1 flag.
7269 (read1, read_vector): Don't test read_pure any more.
7270 (read_list): Simplify.
7271
e8d32c7e
SM
7272 * fileio.c, character.h: Minor style tweaks.
7273
4b2addb7
DA
72742012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7275
7276 * window.h (clip_changed): Remove useless declaration.
7277
584461b2
JB
72782012-05-22 Juanma Barranquero <lekktu@gmail.com>
7279
7280 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7281 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7282
34374650
PE
72832012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7284
7285 Remove src/m/*.
7286 This directory predates autoconf and is no longer needed nowadays.
7287 Move its few remaining bits of functionality to where they're needed.
7288 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7289 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7290 * m/template.h: Remove.
7291 * Makefile.in (M_FILE): Remove. All uses removed.
7292 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7293 * lisp.h (USE_LSB_TAG):
7294 * mem-limits.h (EXCEEDS_LISP_PTR):
7295 Use VAL_MAX, not VALBITS, in #if.
7296 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7297 (EMACS_UINT): Define unconditionally now.
7298 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7299 (BITS_PER_EMACS_INT): New constants, replacing
7300 what used to be in config.h, but not useful in #if.
7301 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7302 define them any more.
7303 (VAL_MAX): New macro.
7304 (VALMASK): Use it.
7305 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7306 BITS_PER_EMACS_INT, in #if.
7307 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7308 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7309 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7310 * s/ms-w32.h (DATA_START):
7311 Move here from removed file m/intel386.h.
7312 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7313 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7314
261cb4bb
PE
73152012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7316
7317 Assume C89 or later.
7318 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7319 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7320 (xrealloc):
7321 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7322 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7323 * textprop.c, tparam.c (NULL): Remove.
7324 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7325 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7326 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7327 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7328 * xterm.c (input_signal_count): Assume volatile works.
7329
ff23cd9f
KB
73302012-05-21 Ken Brown <kbrown@cornell.edu>
7331
7332 * xgselect.c (xg_select): Fix first argument in call to 'select'
7333 (bug#11508).
7334
1b170bc6
KB
73352012-05-20 Ken Brown <kbrown@cornell.edu>
7336
7337 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7338 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7339
b2f4d39f
KB
73402012-05-19 Ken Brown <kbrown@cornell.edu>
7341
7342 * xfns.c (x_in_use): Remove `static' qualifier.
7343 * xterm.h (x_in_use): Declare.
7344 * xgselect.c: Include xterm.h.
7345 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7346 and `display_arg' (bug#9754).
7347
003fdae2
PE
73482012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7349
9232a6d9
PE
7350 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7351
003fdae2
PE
7352 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7353 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7354
784b56e2
EZ
73552012-05-18 Eli Zaretskii <eliz@gnu.org>
7356
7357 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7358
7359 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7360 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7361
7362 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7363 reference to image_cache->refcount.
7364 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7365
a0a79cde
JL
73662012-05-17 Juri Linkov <juri@jurta.org>
7367
7368 * search.c (Fword_search_regexp, Fword_search_backward)
7369 (Fword_search_forward, Fword_search_backward_lax)
7370 (Fword_search_forward_lax): Move functions to isearch.el
7371 (bug#10145, bug#11381).
7372
b0572523
PE
73732012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7374
7375 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7376
9660f5fc
SM
73772012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7378
7379 * lread.c (init_obarray): Declare Qt and Qnil as special.
7380
4374de83
GM
73812012-05-14 Glenn Morris <rgm@gnu.org>
7382
7383 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 7384 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 7385
dc44c39a
PE
73862012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7387
078c97cb
PE
7388 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7389
dc44c39a
PE
7390 * unexaix.c: Port to more-recent AIX compilers.
7391 (report_error, report_error_1, make_hdr, copy_sym)
7392 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7393 Make arguments const char *, not char *, to avoid violations of C
7394 standard and to fix some AIX warnings reported by Gilles Pion.
7395
e18afed7 73962012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
7397
7398 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7399 already have overlays loaded.
7400 (handle_single_display_spec): Before returning without displaying
7401 fringe bitmap, synchronize the bidi iterator with the main display
7402 iterator, by calling iterate_out_of_display_property.
7403 (iterate_out_of_display_property): Detect buffer iteration by
7404 testing that it->string is a Lisp string.
7405 (get_next_display_element): When the current object is exhausted,
7406 and there's something on it->stack, call set_iterator_to_next to
7407 proceed with what's on the stack, instead of returning zero.
7408 (set_iterator_to_next): If called at the end of a Lisp string,
7409 proceed to consider_string_end without incrementing string
7410 position. Don't increment display vector index past the end of
7411 the display vector. (Bug#11417)
c8fb9dc6
EZ
7412 (pos_visible_p): Don't report a position visible when move_it_to
7413 stopped at the last line of window, which happens to be scanned
7414 backwards by the bidi iteration. (Bug#11464)
ac268e67 7415
e18afed7 74162012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
7417
7418 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7419 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
7420 are on a TTY, and thus unable to display on the fringes.
7421 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
7422 so we need to signal to the caller that this is a "replacing"
7423 display spec. This fixes display when the spec is invalid or we
7424 are on a TTY.
7425
e18afed7 74262012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
7427
7428 * unexaix.c (make_hdr): Fix typo in prototype.
7429 This bug broke the build on AIX. Problem reported by Gilles Pion.
7430
9d0a235a
MA
74312012-05-14 Michael Albinus <michael.albinus@gmx.de>
7432
7433 * keyboard.c (kbd_buffer_get_event): Read special events also in
7434 batch mode. (Bug#11415)
7435
9e6b06ed
GM
74362012-05-12 Glenn Morris <rgm@gnu.org>
7437
7438 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7439
c1a1d7a3
EZ
74402012-05-12 Eli Zaretskii <eliz@gnu.org>
7441
7442 * lisp.mk (lisp): Add newcomment.elc.
7443
3fe7cdc8
GM
74442012-05-12 Glenn Morris <rgm@gnu.org>
7445
7446 * Makefile.in (MKDIR_P): New, set by configure.
7447 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7448
53f7d2c0
PE
74492012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7450
7451 Remove unused function hourglass_started.
7452 * dispextern.h (hourglass_started):
7453 * w32fns.c (hourglass_started):
7454 * xdisp.c (hourglass_started): Remove.
7455
75aafb17
JB
74562012-05-10 Juanma Barranquero <lekktu@gmail.com>
7457
7458 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7459 Update dependencies.
7460
12959e8e
PE
74612012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7462
97107e2e
PE
7463 * xgselect.c (xg_select): Put maxfds+1 into a var.
7464 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7465
12959e8e
PE
7466 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7467
836d29b3
DA
74682012-05-10 Dave Abrahams <dave@boostpro.com>
7469
7470 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7471 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7472
5cb67954
MA
74732012-05-09 Michael Albinus <michael.albinus@gmx.de>
7474
7475 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7476 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7477 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7478 Initialize xd_registered_buses.
7479
3478ec45
PE
74802012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7481
b263a6b0
PE
7482 Untag more efficiently if USE_LSB_TAG.
7483 This is based on a proposal by YAMAMOTO Mitsuharu in
7484 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7485 For an admittedly artificial (nth 8000 longlist) benchmark on
7486 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7487 Emacs's overall text size by 1%.
7488 * lisp.h (XUNTAG): New macro.
7489 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7490 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7491 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7492 * eval.c (Fautoload):
7493 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7494 * frame.h (XFRAME): Use XUNTAG.
7495
3478ec45
PE
7496 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7497 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7498 Remove unportable assumptions about print widths of types like
7499 dbus_uint32_t.
7500 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7501 intptr_t when converting between pointer and integer, to avoid GCC
7502 warnings about wrong width.
7503
666b903b 75042012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
7505
7506 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7507 stack for each reader_thread, instead of defaulting to 8MB
7508 determined by the linker. This avoids failures in creating
7509 subprocesses on Windows 7, see the discussion in this thread:
7510 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7511
b120cc17
JC
75122012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7513
7514 Fix up display of the *Minibuf-0* buffer in the mini window.
7515 * keyboard.c (read_char): Don't clear the echo area if there's no
7516 message to clear.
7517 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 7518 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 7519
9a4b36f8
MA
75202012-05-07 Michael Albinus <michael.albinus@gmx.de>
7521
7522 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7523 batch mode.
7524
e5f9458f
CY
75252012-05-06 Chong Yidong <cyd@gnu.org>
7526
7527 * lisp.mk (lisp): Update.
7528
eceeb5fc 75292012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
7530
7531 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7532
71873e2b
SM
75332012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7534
7535 * data.c (PUT_ERROR): New macro.
7536 (syms_of_data): Use it. Add new error type `user-error'.
7537 * undo.c (user_error): New function.
7538 (Fprimitive_undo): Use it.
7539 * print.c (print_error_message): Adjust print style for `user-error'.
7540 * keyboard.c (user_error): New function.
7541 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7542
ab0fa4e4
PE
75432012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7544
7545 Do not limit current-time-string to years 1000..9999.
7546 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7547 (Fcurrent_time_string): Support any year that is supported by the
7548 underlying localtime representation. Don't use asctime, as it
7549 has undefined behavior for years outside the range -999..9999.
7550
7ed806a7
PE
75512012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7552
7553 Fix race conditions involving setenv, gmtime, localtime, asctime.
7554 Without this fix, interrupts could mess up code that uses these
7555 nonreentrant functions, since setting TZ invalidates existing
7556 tm_zone or tzname values, and since most of these functions return
7557 pointers to static storage.
7558 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7559 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7560 Grow the critical sections to include not just invoking
7561 localtime/gmtime, but also accessing these functions' results
7562 including their tm_zone values if any, and any related TZ setting.
7563 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
7564 so that the struct tm is saved in the critical section.
7565 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
7566 motivated by the fact that memory allocation needs to be outside
7567 the critical section.
7568
0c16dfed
DA
75692012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7570
7571 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7572 with RESET_INTERVAL.
7573
7574 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7575 Remove duplicated buffer name initialization.
7576
3f83ace8
JM
75772012-05-02 Jim Meyering <jim@meyering.net>
7578
7579 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7580
c7b8541e
JM
7581 * xfns.c (x_window): Use xstrdup (Bug#11375).
7582
90207a15 75832012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
7584
7585 * xdisp.c (pos_visible_p): If already at a newline from the
7586 display string before the 'while' loop, don't walk back the glyphs
7587 from it3.glyph_row. Solves assertion violation when the display
7588 string begins with a newline (egg.el). (Bug#11367)
7589
b593d6a9
AH
75902012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7591
7592 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7593 Move to simple.el.
7594
4737362e
GM
75952012-05-01 Glenn Morris <rgm@gnu.org>
7596
99cf43f9
GM
7597 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7598 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7599 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7600 All were removed before 23.1.
7601
9311dcff
GM
7602 * dispnew.c: Remove HAVE_LIBNCURSES test;
7603 it is always true on relevant platforms.
7604
4d5c6349
GM
7605 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7606 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7607
4737362e
GM
7608 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7609
74dd3a6b
AS
76102012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7611
7612 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7613 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7614 Remove.
7615
13c379ee
PE
76162012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7617
7618 Do not avoid creating empty evaporating overlays (Bug#9642).
7619 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7620 That is, do not delete an evaporating overlay if it becomes
7621 empty after its bounds are adjusted to fit within its buffer.
7622 This fix caused other problems, and I'm reverting it until we get
7623 to the bottom of them.
7624
a8e7d6d7 76252012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
7626
7627 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7628
a8e7d6d7 76292012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
7630
7631 * xdisp.c (pos_visible_p): If the window start position is beyond
7632 ZV, start the display from buffer beginning. Prevents assertion
7633 violation in init_iterator when the minibuffer window is scrolled
7634 via the scroll bar.
7635
7636 * window.c (window_scroll_pixel_based): Likewise.
7637
a8e7d6d7 76382012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
7639
7640 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7641
a8e7d6d7 76422012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
7643
7644 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7645 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7646
a8e7d6d7 76472012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 7648
b593d6a9
AH
7649 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7650 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 7651
1c6900d9
EZ
76522012-04-26 Eli Zaretskii <eliz@gnu.org>
7653
4c3fa1d9
EZ
7654 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7655 display element, check also the underlying string or buffer
7656 character. (Bug#11341)
7657
1c6900d9
EZ
7658 * w32menu.c: Include w32heap.h.
7659 (add_menu_item): If the call to AppendMenuW (via
7660 unicode_append_menu) fails, disable Unicode menus only if we are
7661 running on Windows 9X/Me.
7662
42bf8205
AS
76632012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7664
7665 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7666 (xgetint): Add missing shift for LSB tags.
7667
b1bac16e
MR
76682012-04-24 Martin Rudalics <rudalics@gmx.at>
7669
7670 * keyboard.c (read_char): Don't wipe echo area for select window
7671 events: These might get delayed via `mouse-autoselect-window'
7672 (Bug#11304).
7673
d69621cc
JB
76742012-04-24 Juanma Barranquero <lekktu@gmail.com>
7675
7676 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7677 manipulation of :loaded-from data.
7678
02fd101b
JB
76792012-04-23 Juanma Barranquero <lekktu@gmail.com>
7680
7681 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7682 now a cons (bug#11311).
7683
888bec30
PE
76842012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7685
89a438bd
PE
7686 Do not create empty overlays with the evaporate property (Bug#9642).
7687 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7688 if it becomes empty after its bounds are adjusted to fit within
7689 its buffer. Without this fix, in a nonempty buffer (let ((o
7690 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7691 yields an empty overlay that has the evaporate property, which is
7692 not supposed to happen.
7693
1068fe4d
PE
7694 Fix minor GTK3 problems found by static checking.
7695 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7696 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7697 (struct _EmacsFixedClass, emacs_fixed_get_type):
7698 Move decls here from emacsgtkfixed.h, since they needn't be public.
7699 (emacs_fixed_get_type): Now static.
7700 (emacs_fixed_class_init): Omit unused local.
7701 (emacs_fixed_child_type): Remove; unused.
7702 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7703 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7704 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7705 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7706 (EMACS_FIXED_GET_CLASS): Remove; unused.
7707 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7708
888bec30
PE
7709 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7710 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7711
de85e130
PE
77122012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7713
d0baac98 7714 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 7715 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
7716 (__malloc_size_t, __malloc_ptrdiff_t):
7717 Remove. All uses removed, replaced by the definiens if needed,
7718 since we can assume C89 or better now.
7719 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7720 (protect_malloc_state, align, get_contiguous_space)
7721 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7722 (malloc_atfork_handler_child, malloc_enable_thread)
7723 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7724 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7725 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7726 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7727 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7728 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7729 Define using prototypes, not old style.
7730 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7731 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7732 (align): Don't assume that signed integer overflow wraps around.
7733 Omit unused local var.
7734 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7735 (_free_internal_nolock, memalign, mallochook, reallochook):
7736 Omit no-longer-needed casts.
7737 (valloc): Use getpagesize, not __getpagesize.
7738 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7739 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7740
de85e130
PE
7741 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7742
dcbf5805
MA
77432012-04-22 Michael Albinus <michael.albinus@gmx.de>
7744
7745 Move functions from C to Lisp. Make non-blocking method calls
7746 the default. Implement further D-Bus standard interfaces.
7747
7748 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7749 (QCdbus_request_name_allow_replacement)
7750 (QCdbus_request_name_replace_existing)
7751 (QCdbus_request_name_do_not_queue)
7752 (QCdbus_request_name_reply_primary_owner)
7753 (QCdbus_request_name_reply_in_queue)
7754 (QCdbus_request_name_reply_exists)
7755 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7756 (QCdbus_registered_serial, QCdbus_registered_method)
7757 (QCdbus_registered_signal): New Lisp objects.
7758 (XD_DEBUG_MESSAGE): Use sizeof.
7759 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7760 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7761 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7762 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7763 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7764 (xd_signature, xd_append_arg): Allow float for integer types.
7765 (xd_get_connection_references): New function.
b593d6a9
AH
7766 (xd_get_connection_address): Rename from xd_initialize.
7767 Return cached address.
dcbf5805
MA
7768 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7769 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7770 level.
7771 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 7772 Return number of refcounts.
dcbf5805
MA
7773 (Fdbus_get_unique_name): Make stronger parameter check.
7774 (Fdbus_message_internal): New defun.
7775 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7776 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7777 (Fdbus_send_signal, Fdbus_register_service)
7778 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7779 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7780 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7781 (Vdbus_compiled_version, Vdbus_runtime_version)
7782 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7783 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7784 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
7785 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7786 Adapt docstring.
dcbf5805 7787
52828e02
PE
77882012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7789
da05bc4c
PE
7790 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7791 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7792 Do not assume ptrdiff_t is the same width as 'int'.
7793
52828e02
PE
7794 * alloc.c: Handle unusual debugging option combinations.
7795 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7796 since the two debugging options are incompatible.
7797 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7798 is defined.
7799 (mem_init, mem_insert, mem_insert_fixup):
7800 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7801 (NEED_MEM_INSERT): Remove; no longer needed.
7802
f01769f9
LL
78032012-04-22 Leo Liu <sdl.web@gmail.com>
7804
7805 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7806
5790543d
PE
78072012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7808
7809 * sysdep.c [__FreeBSD__]: Minor cleanups.
7810 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7811 Use Emacs indenting style more consistently. Avoid some casts.
7812 Use 'double' consistently rather than mixing 'float' and 'double'.
7813
b91b7e4d
EW
78142012-04-21 Eduard Wiebe <usenet@pusto.de>
7815
b593d6a9
AH
7816 * sysdep.c (list_system_processes, system_process_attributes):
7817 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 7818
6114eb15
AS
78192012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7820
7821 * lisp.mk (lisp): Update.
7822
2f38dff7
PE
78232012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7824
7825 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7826 It is never used otherwise.
7827
4ae29f89
SM
78282012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7829
7830 * print.c (print_preprocess): Only check print_depth if print-circle
7831 is nil.
7832 (print_object): Check for cycles even when print-circle is nil and
7833 print-gensym is t, but only check print_depth if print-circle is nil.
7834
f30d612a
CY
78352012-04-20 Chong Yidong <cyd@gnu.org>
7836
7837 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7838 set the status to "failed" and ensure that sentinel is run.
7839
c07a4c0b 78402012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
7841
7842 * process.c (Fset_process_inherit_coding_system_flag)
7843 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 7844 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 7845
c07a4c0b 78462012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
7847
7848 * xdisp.c (string_buffer_position_lim): Limit starting position to
7849 BEGV.
7850 (set_cursor_from_row): If called for a mode-line or header-line
7851 row, return zero immediately.
7852 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
7853 farther than the first row after the header line, if any.
7854 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
7855 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7856
c07a4c0b 78572012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 7858
4ae29f89
SM
7859 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7860 (bug#11238).
ad3a2b41 7861
c07a4c0b 78622012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 78632012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
7864
7865 configure: new option --enable-gcc-warnings (Bug#11207)
7866 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7867 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7868 (ALL_CFLAGS): Use new macros rather than old.
7869 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7870 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7871 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7872 -Wunused-result, -Wunused-variable. This should go away once
7873 the Emacs and Gnulib regex code is merged.
7874 (xmalloc, xrealloc): Now static.
7875
aba027e8
PE
78762012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7877
7878 * dired.c (Fsystem_groups): Remove unused local.
7879
e5a36063
GM
78802012-04-17 Glenn Morris <rgm@gnu.org>
7881
7882 * dired.c (Fsystem_users): Doc fix.
7883
316411f0
DA
78842012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7885
7886 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7887 (syms_of_dired): Add them.
7888
9426aba4
PE
78892012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7890
b62a57be
PE
7891 Fix minor alloc.c problems found by static checking.
7892 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7893 New extern decls, to avoid calling undeclared functions.
7894 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7895 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7896 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7897 (NEED_MEM_INSERT): New macro.
7898 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 7899 Remove one incorrect comment and fix another.
b62a57be 7900
3539f31f
PE
7901 Fix minor ralloc.c problems found by static checking.
7902 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7903 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7904 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7905 (r_alloc_sbrk): Now static.
7906
a041960a
PE
7907 Improve ralloc.c interface checking.
7908 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7909 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7910 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7911 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7912 [REL_ALLOC]: ... to here, to check interface.
7913 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7914 Remove decls. This fixes an "It stinks!".
7915
9426aba4
PE
7916 * alloc.c (which_symbols): Fix alignment issue / type clash.
7917
d55c12ed
AS
79182012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7919
7920 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7921 (struct Lisp_Misc_Any): Likewise.
7922 (struct Lisp_Free): Likewise.
7923 * alloc.c (union aligned_Lisp_Symbol): Define.
7924 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7925 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7926 (union aligned_Lisp_Misc): Define.
7927 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7928 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 7929 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 7930
b948ce8b
PE
79312012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7932
7933 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7934 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7935 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7936 * s/netbsd.h, s/sol2-6.h:
7937 Remove definition of GC_MARK_STACK, since the default now works.
7938 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7939 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7940 no longer the default.
7941 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7942
35dc09a1 79432012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 7944
35dc09a1
GM
7945 * lread.c (lisp_file_lexically_bound_p):
7946 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 7947
35dc09a1
GM
79482012-04-14 Eli Zaretskii <eliz@gnu.org>
7949
7950 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7951 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7952
79532012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7954
7955 * nsterm.m (constrainFrameRect): Always constrain when there is only
7956 one screen (Bug#10962).
7957
bcd86815
KB
79582012-04-13 Ken Brown <kbrown@cornell.edu>
7959
7960 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7961
c25df26e
RT
79622012-04-13 Reuben Thomas <rrt@sc3d.org>
7963
7964 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7965
0fc59f1e
DC
79662012-04-11 Daniel Colascione <dancol@dancol.org>
7967
7968 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7969 against is gone. It's better to use vfork now so that when Cygwin
7970 gains a new, working vfork, we use it automatically (bug#10398).
7971
de8c03dc
SM
79722012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7973
7974 * window.c (save_window_save): Obey window-point-insertion-type.
7975
2f097256
GM
79762012-04-11 Glenn Morris <rgm@gnu.org>
7977
7978 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7979
453b951e
SM
79802012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7981
7982 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7983
75f1671a 79842012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
7985
7986 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7987 (force_quit_count): New var.
7988 (handle_interrupt): Use it.
7989
2a8ce227
JB
79902012-04-10 Juanma Barranquero <lekktu@gmail.com>
7991
7992 * w32.c (w32_delayed_load): Record the full path of the library
7993 being loaded (bug#10424).
7994
935396c0
GM
79952012-04-09 Glenn Morris <rgm@gnu.org>
7996
05920a43
GM
7997 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7998 not just in the obarray, before snarfing them. (Bug#11036)
7999
935396c0
GM
8000 * Makefile.in ($(leimdir)/leim-list.el):
8001 Pass EMACS rather than BUILT_EMACS.
8002
a18ecafa
TZ
80032012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8004
8005 * process.c (make_process):
8006 * process.h: Add integer `gnutls_handshakes_tried' member to
8007 process struct.
8008
6bbef4e5
JC
8009 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8010 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8011
8012 * gnutls.c (gnutls_log_function2i): Convenience log function.
8013 (emacs_gnutls_read): Use new log functions,
8014 `gnutls_handshakes_tried' process member, and
8015 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8016 attempts per process (connection).
8017
b4d3bc10
CY
80182012-04-09 Chong Yidong <cyd@gnu.org>
8019
8020 * eval.c (Fuser_variable_p, user_variable_p_eh)
8021 (lisp_indirect_variable): Functions deleted.
8022 (Fdefvar): Caller changed.
8023
8024 * callint.c (Finteractive, Fcall_interactively):
8025 * minibuf.c (Fread_variable): Callers changed.
8026
70f4d973
EZ
80272012-04-09 Eli Zaretskii <eliz@gnu.org>
8028
8029 * xdisp.c (set_cursor_from_row): If the display string appears in
8030 the buffer at position that is closer to point than the position
8031 after the display string, display the cursor on the first glyph of
8032 the display string. Fixes cursor display when a 'display' text
8033 property immediately follows invisible text. (Bug#11094)
8034
cb3c2e3e
PE
80352012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8036
8037 composite.c: use 'double' consistently
8038 * composite.c (get_composition_id): Use 'double' consistently
8039 instead of converting 'float' to 'double' and vice versa; this is
8040 easier to understand and avoids a GCC warning.
8041
fd06db5d
GM
80422012-04-09 Glenn Morris <rgm@gnu.org>
8043
50fe702a
GM
8044 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8045 preparation for dumping it with emacs. (Bug#4789)
8046 (leimdir): New variable.
8047 ($(leimdir)/leim-list.el): New rule.
8048 (emacs$(EXEEXT)): Depend on leim-list.el.
8049
fd06db5d
GM
8050 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8051 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8052 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8053
55c131ee
AS
80542012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8055
8056 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8057 proper alignment.
8058
9209588f
JB
80592012-04-07 Juanma Barranquero <lekktu@gmail.com>
8060
8061 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8062 Remove unused local variable.
8063
e3fb2efb
PE
80642012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8065
8066 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8067 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8068 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8069 objects, as mark_maybe_pointer will catch them otherwise.
8070 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8071 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8072
b5385551
PE
80732012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8074
8075 Fix typo that broke non-Windows builds.
8076 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8077
9078ead6
EZ
80782012-04-07 Eli Zaretskii <eliz@gnu.org>
8079
8080 Support building on MS-Windows with libxml2.
8081
8082 * makefile.w32-in (OBJ2): Add xml.$(O).
8083 (GLOBAL_SOURCES): Add xml.c.
8084 ($(BLD)/xml.$(O)): New dependency list.
8085
8086 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8087 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8088 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8089 [!WINDOWSNT]: New macros.
8090 (init_libxml2_functions, libxml2_loaded_p): New functions.
8091 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8092 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8093 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8094 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8095 linked in).
6bbef4e5
JC
8096 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8097 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8098 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8099
8100 * emacs.c: Don't include libxml/parser.h.
8101 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8102 xmlCleanupParser directly.
8103
8104 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8105
3811fdf3
EZ
81062012-04-07 Eli Zaretskii <eliz@gnu.org>
8107
8108 * indent.c (Fvertical_motion): If there is a display string at
8109 point, use it.vpos to compute how many lines to backtrack after
8110 move_it_to point. (Bug#11133)
8111
2f8e16b2
EZ
81122012-04-06 Eli Zaretskii <eliz@gnu.org>
8113
8114 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8115 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8116 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8117 macros related to unification of CJK characters. For the details,
8118 see the discussion following the message here:
8119 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8120
3d439cd1
CY
81212012-04-04 Chong Yidong <cyd@gnu.org>
8122
8123 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8124
8bc53d00
EZ
81252012-04-01 Eli Zaretskii <eliz@gnu.org>
8126
8127 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8128 instead of alloca. (Bug#11138)
8129
3b0512a3
AS
81302012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8131
8132 * w32menu.c (is_simple_dialog): Properly check lisp types.
8133 (Bug#11141)
8134
8427ddd2
EZ
81352012-03-31 Eli Zaretskii <eliz@gnu.org>
8136
979022ef
EZ
8137 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8138 position we get to after a call to move_it_to fails the
8139 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8140 only if we wind up in a string from display property. (Bug#11063)
8141
a6b1c7cc
EZ
8142 * window.c (Fdelete_other_windows_internal): Invalidate the row
8143 and column information about mouse highlight, so that redisplay
8144 restores it after reallocating the glyph matrices. (Bug#7464)
8145
8427ddd2
EZ
8146 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8147 string comes from a `display' text property, use the buffer
8148 position of that property as if we actually saw that position in
8149 the row's glyphs.
697ba24b
EZ
8150 (move_it_by_lines): Remove the assertion that
8151 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8152 violated when there's a before-string at the beginning of a line.
8153 (Bug#11063)
8427ddd2 8154
65a0a738
EZ
81552012-03-30 Eli Zaretskii <eliz@gnu.org>
8156
8157 * xdisp.c (append_space_for_newline): If the default face was
8158 remapped, use the remapped face for the appended newline.
8159 (extend_face_to_end_of_line): Use the remapped default face for
8160 extending the face to the end of the line.
8161 (display_line): Call extend_face_to_end_of_line when the default
8162 face was remapped. (Bug#11068)
8163
581355cc
EZ
81642012-03-29 Eli Zaretskii <eliz@gnu.org>
8165
8166 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8167
e8fc049f
SM
81682012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8169
8170 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8171
4fb9a543
GM
81722012-03-27 Glenn Morris <rgm@gnu.org>
8173
8174 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8175 Doc fixes.
8176
679910f1
KH
81772012-03-26 Kenichi Handa <handa@m17n.org>
8178
8179 * dispextern.h (struct glyph): Fix previous change. Change the
8180 bit length of glyphless.ch to 25 (Bug#11082).
8181
90d49b7f
CY
81822012-03-26 Chong Yidong <cyd@gnu.org>
8183
8184 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8185 (command_loop_1): Use it; inhibit selection update for
8186 handle-select-window too (Bug#8996).
8187
f514f6f0
FP
81882012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8189
e8fc049f 8190 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8191
bf43fa51
KH
81922012-03-25 Kenichi Handa <handa@m17n.org>
8193
8194 * dispextern.h (struct glyph): Change the bit length of
8195 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8196
8a0c01dd
EZ
81972012-03-24 Eli Zaretskii <eliz@gnu.org>
8198
8199 * s/ms-w32.h (tzname): Include time.h before redirecting to
8200 _tzname. Fixes the MSVC build. (Bug#9960)
8201
7d1c3a76
AS
82022012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8203
8ed79523
AS
8204 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8205 characters.
8206
7d1c3a76
AS
8207 * xterm.c (XTread_socket): Only modify handling_signal if
8208 !SYNC_INPUT. (Bug#11080)
8209
e99a9b8b
EZ
82102012-03-23 Eli Zaretskii <eliz@gnu.org>
8211
8212 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8213 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8214 when fetching a multibyte character consumes more bytes than
8215 CHAR_BYTES returns, due to unification of CJK characters in
8216 string_char. (Bug#11073)
8217
5063c0e1
TN
82182012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8219
8220 * process.c (wait_reading_process_output): Handle pty disconnect
8221 by refraining from sending oneself a SIGCHLD (bug#10933).
8222
9f851fbd
CY
82232012-03-22 Chong Yidong <cyd@gnu.org>
8224
8225 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8226
5063c0e1 8227 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8228 Mark string as coming from a prefix property.
8229 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8230 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8231
fb5b8aca
CY
82322012-03-21 Chong Yidong <cyd@gnu.org>
8233
8234 * xfaces.c (Vface_remapping_alist): Doc fix.
8235
62356a1b
EZ
82362012-03-20 Eli Zaretskii <eliz@gnu.org>
8237
8238 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8239 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8240 Doc fixes.
62356a1b 8241
025de85b
CY
82422012-03-20 Chong Yidong <cyd@gnu.org>
8243
8244 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8245 to reflect default non-nil value of redisplay-dont-pause.
8246
4827f94e
KH
82472012-03-19 Kenichi Handa <handa@m17n.org>
8248
8249 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8250 it fit in a valid range (Bug#11003).
8251
e50a24a2
EZ
82522012-03-18 Eli Zaretskii <eliz@gnu.org>
8253
8254 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8255 that is not from display property, accept the row as a "cursor
8256 row" if one of the string's character has a non-nil `cursor'
8257 property. Fixes cursor positioning when there are newlines in
8258 overlay strings, e.g. in icomplete.el. (Bug#11035)
8259
9af5ed87
PE
82602012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8261
8262 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8263
d1f55f16
CY
82642012-03-12 Chong Yidong <cyd@gnu.org>
8265
8266 * eval.c (inhibit_lisp_code): Rename from
8267 inhibit_window_configuration_change_hook; move from window.c.
8268
8269 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8270 * window.c (run_window_configuration_change_hook)
8271 (syms_of_window): Callers changed.
8272
66c5eebd
CY
82732012-03-11 Chong Yidong <cyd@gnu.org>
8274
413df973
CY
8275 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8276
66c5eebd
CY
8277 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8278
1de11f56
CY
82792012-03-10 Chong Yidong <cyd@gnu.org>
8280
8281 * frame.c (other_visible_frames): Don't assume the selected frame
8282 is visible (Bug#10955).
8283
cae07000
SM
82842012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8285
8286 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8287
89c94350
JD
82882012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8289
8290 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8291 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8292 zero (Bug#10954).
8293
999dd333
GM
82942012-03-03 Glenn Morris <rgm@gnu.org>
8295
01a6dcc8 8296 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8297
de0100f2
EZ
82982012-03-02 Eli Zaretskii <eliz@gnu.org>
8299
8300 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8301 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8302 (redisplay_window, next_element_from_string): Fix typos in
8303 comments.
3e441275
EZ
8304 (redisplay_window): Pass to move_it_vertically the margin in
8305 pixels, not in screen lines.
de0100f2 8306
96a72ee9
GM
83072012-03-02 Glenn Morris <rgm@gnu.org>
8308
8309 * buffer.c (buffer-list-update-hook): Doc fix.
8310
312508d7
EZ
83112012-02-29 Eli Zaretskii <eliz@gnu.org>
8312
8313 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8314 push_it before setting up the iterator for the first overlay
8315 string, even if we have an empty string loaded.
8316 (next_overlay_string): If there's an empty string on the iterator
8317 stack, pop the stack. (Bug#10903)
8318
27f3c637
PE
83192012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8320
8321 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8322 Suggested by Stefan Monnier in
8323 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8324 * alloc.c (widen_to_Lisp_Object): New static function.
8325 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8326 and widening them to Lisp_Objects. This would work even if
8327 USE_LSB_TAG is defined and wide integers are used, which might
8328 happen in a future version of Emacs.
8329
3c9dfce6
CY
83302012-02-25 Chong Yidong <cyd@gnu.org>
8331
fa74b241
CY
8332 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8333 Doc fix.
8334
3c9dfce6
CY
8335 * xselect.c (Fx_selection_exists_p): Doc fix.
8336 (x_clipboard_manager_save_all): Print an informative message
8337 before saving to clipboard manager.
8338
9486df08
CY
83392012-02-24 Chong Yidong <cyd@gnu.org>
8340
8341 * keyboard.c (process_special_events): Handle all X selection
8342 requests in kbd_buffer, not just the next one (Bug#8869).
8343
f01d3321
CY
83442012-02-23 Chong Yidong <cyd@gnu.org>
8345
8346 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8347 call when setting menu-bar-lines and tool-bar-lines parameters.
8348 (unwind_create_frame_1): New helper function.
8349
8350 * window.c (inhibit_window_configuration_change_hook): New var.
8351 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8352 (syms_of_window): Initialize it.
f01d3321 8353
86b847b6
CY
83542012-02-22 Chong Yidong <cyd@gnu.org>
8355
8356 * xterm.c (x_draw_image_relief): Add missing type check for
8357 Vtool_bar_button_margin (Bug#10743).
8358
a59225b1
CY
83592012-02-21 Chong Yidong <cyd@gnu.org>
8360
8361 * fileio.c (Vfile_name_handler_alist): Doc fix.
8362
8363 * buffer.c (Fget_file_buffer): Protect against invalid file
8364 handler return value.
8365
310f5bd4
PE
83662012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8367
cb3a28cc
PE
8368 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8369 when computing $valmask.
8370
310f5bd4
PE
8371 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8372 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8373 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8374 It's useless in that case, and it can cause problems on hosts
8375 that allocate halves of EMACS_INT values separately.
8376 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8377 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8378 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8379 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8380 it avoids undefined behavior on hosts where shifting right by more
8381 than the word width has undefined behavior.
8382
2375c96a
CY
83832012-02-19 Chong Yidong <cyd@gnu.org>
8384
8385 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8386 (Funhandled_file_name_directory, Ffile_name_as_directory)
8387 (Fdirectory_file_name, Fexpand_file_name)
8388 (Fsubstitute_in_file_name): Protect against invalid file handler
8389 return values (Bug#10845).
8390
3eb49e71
EZ
83912012-02-18 Eli Zaretskii <eliz@gnu.org>
8392
8393 * .gdbinit (pitx): Fix incorrect references to fields of the
8394 iterator stack.
8395
7b926f3f
CY
83962012-02-17 Chong Yidong <cyd@gnu.org>
8397
8398 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8399
11273115
PE
84002012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8401
8402 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8403 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8404
c3a70e2b
CY
84052012-02-15 Chong Yidong <cyd@gnu.org>
8406
8407 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8408 marked as special. Also, starting docstrings with * is obsolete.
8409
0ca43699
AS
84102012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8411
8412 * gnutls.c (emacs_gnutls_write): Fix last change.
8413
2e8f3c56
LI
84142012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8415
8416 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8417 send_process.
8418
af70074f
SM
84192012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8420
8421 * keymap.c (Fsingle_key_description): Handle char ranges.
8422
95986d52
CY
84232012-02-12 Chong Yidong <cyd@gnu.org>
8424
afd83bd1
CY
8425 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8426 as that creates a dangerous corner case.
8427
95986d52
CY
8428 * window.c (Fdelete_window_internal): Invalidate the mouse
8429 highlight (Bug#9904).
8430
bd7da63e
GM
84312012-02-12 Glenn Morris <rgm@gnu.org>
8432
8433 * xselect.c (Fx_own_selection_internal)
8434 (Fx_get_selection_internal, Fx_disown_selection_internal)
8435 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8436 * nsselect.m (Fx_own_selection_internal)
8437 (Fx_disown_selection_internal, Fx_selection_exists_p)
8438 (Fx_selection_owner_p, Fx_get_selection_internal):
8439 Sync docs and argument specs with the xselect.c versions.
8440
77abcbc2
LI
84412012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8442
8443 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8444
90b671e2
EZ
84452012-02-11 Eli Zaretskii <eliz@gnu.org>
8446
1c0ca0b7
EZ
8447 * w32select.c (Fx_selection_exists_p): Sync doc string and
8448 argument list with xselect.c. (Bug#10783)
8449
8450 * w16select.c (Fx_selection_exists_p): Sync doc string and
8451 argument list with xselect.c. (Bug#10783)
90b671e2 8452
49241268
GM
84532012-02-10 Glenn Morris <rgm@gnu.org>
8454
8455 * fns.c (Fsecure_hash): Doc fix.
8456
f998bbe7 84572012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
8458
8459 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8460
0992bd9c
CY
84612012-02-07 Chong Yidong <cyd@gnu.org>
8462
8463 * buffer.c (Fbuffer_local_variables)
8464 (buffer_lisp_local_variables): Handle unbound vars correctly;
8465 don't let Qunbound leak into Lisp.
8466
af008560
GM
84672012-02-07 Glenn Morris <rgm@gnu.org>
8468
dd605cc4
GM
8469 * image.c (Fimagemagick_types): Doc fix.
8470
af008560
GM
8471 * image.c (imagemagick-render-type): Change it from a lisp object
8472 to an integer. Move the doc here from the lisp manual.
8473 Treat all values not equal to 0 the same.
8474
1449fa1d
CY
84752012-02-06 Chong Yidong <cyd@gnu.org>
8476
8477 * doc.c (store_function_docstring): Avoid applying docstring of
8478 alias to base function (Bug#2603).
8479
3723ec07
AS
84802012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8481
8482 * .gdbinit (pp1, pv1): Remove redundant defines.
8483 (pr): Use pp.
8484
79c1cc1e
CY
84852012-02-04 Chong Yidong <cyd@gnu.org>
8486
8487 * nsterm.m: Declare a global (Bug#10694).
8488
d7f29f8e
EZ
84892012-02-04 Eli Zaretskii <eliz@gnu.org>
8490
cae07000
SM
8491 * w32.c (get_emacs_configuration_options):
8492 Include --enable-checking, if specified, in the return value.
d7f29f8e 8493
3b95a6f9
MR
84942012-02-04 Martin Rudalics <rudalics@gmx.at>
8495
8496 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8497 after rounding frame sizes. (Bug#9723)
8498
d6fa96a6
EZ
84992012-02-04 Eli Zaretskii <eliz@gnu.org>
8500
8501 * keyboard.c (adjust_point_for_property): Don't position point
8502 before BEGV. (Bug#10696)
8503
df0b2940
PE
85042012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8505
8506 Handle overflow when computing char display width (Bug#9496).
8507 * character.c (char_width): Return EMACS_INT, not int.
8508 (char_width, c_string_width): Check for overflow when
8509 computing the width; this is possible now that individual
8510 characters can have unbounded width. Problem introduced
8511 by merge from Emacs 23 on 2012-01-19.
8512
6bee44d6
MA
85132012-02-02 Michael Albinus <michael.albinus@gmx.de>
8514
8515 * dbusbind.c (Fdbus_register_method): Mention the return value
8516 :ignore in the docstring.
8517
44f92739
GM
85182012-02-02 Glenn Morris <rgm@gnu.org>
8519
1b9f60cc
GM
8520 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8521
44f92739
GM
8522 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8523 Unconditionally set to t. (Bug#10673)
8524 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8525 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8526 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8527
c5d3843c
KH
85282012-02-02 Kenichi Handa <handa@m17n.org>
8529
8530 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8531 0, do not call append_composite_glyph.
8532
159462d4 85332012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
8534
8535 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8536 NULL (Bug#6988).
8537 (x_produce_glyphs): If the component of a composition is a null
8538 string, set it->pixel_width to 1 to avoid zero-width glyph.
8539
78cef877
EZ
85402012-02-01 Eli Zaretskii <eliz@gnu.org>
8541
8542 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8543 first 2 arguments are identical. This makes inserting large
8544 output from a subprocess an order of magnitude faster on
8545 MS-Windows, where all sbrk'ed memory is always contiguous.
8546
97897668
GM
85472012-01-31 Glenn Morris <rgm@gnu.org>
8548
8549 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 8550 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
8551 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8552
31fd3586
GM
85532012-01-29 Glenn Morris <rgm@gnu.org>
8554
8555 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8556
0e24a8b2
CY
85572012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8558
8559 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8560
cc0adcb0
CY
85612012-01-28 Chong Yidong <cyd@gnu.org>
8562
8563 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8564
acc28cb9
CY
85652012-01-26 Chong Yidong <cyd@gnu.org>
8566
9c69cfb7
CY
8567 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8568
acc28cb9
CY
8569 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8570 repeat counts (Bug#10507).
8571
48da7392
GM
85722012-01-26 Glenn Morris <rgm@gnu.org>
8573
8574 * lread.c (syms_of_lread): Doc fix.
8575
14af5f7f
CY
85762012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8577
8578 * coding.c (encode_designation_at_bol): Change return value to
8579 EMACS_INT.
8580
0b21c100
CY
85812012-01-25 Chong Yidong <cyd@gnu.org>
8582
8583 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8584
3c2907f7
CY
85852012-01-21 Chong Yidong <cyd@gnu.org>
8586
8587 * floatfns.c (Fcopysign): Make the second argument non-optional,
8588 since nil is not allowed anyway.
8589
959ad23f
AS
85902012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8591
8592 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8593 (send_process): Likewise.
8594
34a02f46
MR
85952012-01-19 Martin Rudalics <rudalics@gmx.at>
8596
8597 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
8598 (Vwindow_persistent_parameters): Do not use Qstate.
8599 Rewrite doc-strings.
34a02f46 8600
1259009a 86012012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
8602
8603 * character.c (char_width): New function.
70d4fdf6
GM
8604 (Fchar_width, c_string_width, lisp_string_width):
8605 Use char_width (Bug#9496).
25ed9e61 8606
6a6ee00d
MR
86072012-01-16 Martin Rudalics <rudalics@gmx.at>
8608
8609 * window.c (Vwindow_persistent_parameters): New variable.
8610 (Fset_window_configuration, save_window_save): Handle persistent
8611 window parameters.
8612
c85efaf7
EZ
86132012-01-14 Eli Zaretskii <eliz@gnu.org>
8614
8615 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8616 thrashing the stack of the thread. (Bug#9087)
8617
5944709e
PE
86182012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8619
8620 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8621
e71f5d99
EZ
86222012-01-11 Eli Zaretskii <eliz@gnu.org>
8623
8624 * xdisp.c (rows_from_pos_range): Handle the case where the
8625 highlight ends on a newline. (Bug#10464)
8626 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8627 he end column for display of highlight that ends on a newline
8628 before a R2L line.
8629
ce316182
GM
86302012-01-11 Glenn Morris <rgm@gnu.org>
8631
8632 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8633 from load-path also when installation-directory is nil. (Bug#10208)
8634
5b43da69
GM
86352012-01-10 Glenn Morris <rgm@gnu.org>
8636
74cc8ff9
GM
8637 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8638
7d8d6e4e
GM
8639 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8640 Update template values to be closer to their typical values these days.
5b43da69 8641
a0db8d43
EZ
86422012-01-09 Eli Zaretskii <eliz@gnu.org>
8643
8644 * xdisp.c (rows_from_pos_range): Accept additional argument
8645 DISP_STRING, and accept any glyph in a row whose object is that
8646 string as eligible for mouse highlight. Fixes mouse highlight of
8647 display strings from overlays. (Bug#10464)
8648
9a0115ab 86492012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 8650
b9110d6a 8651 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
8652 * fileio.c (auto_saving_dir_umask): New static var.
8653 (Fmake_directory_internal): Use it.
8654 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8655 creating the directory. The old code temporarily assigns
8656 too-generous permissions to the directory.
8657 (do_auto_save_eh): Clear it.
b9110d6a 8658 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
8659 that the var is always cleared.
8660
6c1bd3f3
EZ
86612012-01-07 Eli Zaretskii <eliz@gnu.org>
8662
8663 * search.c (scan_buffer): Pass character positions to
8664 know_region_cache, not byte positions. (Bug#6540)
8665
069d2b50
L
86662012-01-07 LynX <_LynX@bk.ru> (tiny change)
8667
8668 * w32.c (sys_rename): Report EXDEV when rename of a directory
8669 fails because the target is on another logical disk. (Bug#10284)
8670
75bf0d33
DB
86712012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8672
8673 * xterm.c (x_embed_request_focus): New function.
8674
8675 * xterm.h: Add prototype.
8676
8677 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8678
1c6e5a32
GM
86792012-01-05 Glenn Morris <rgm@gnu.org>
8680
8681 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8682
651e947e
EZ
86832012-01-01 Eli Zaretskii <eliz@gnu.org>
8684
8685 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8686 Load gnutls_transport_set_lowat only if GnuTLS version is below
8687 2.11.1.
8688 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8689 GnuTLS versions below 2.11.1.
8690
3778cdd8
AL
86912011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8692
8693 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8694 to the doc string advising against its use for altering the way
8695 windows are scrolled.
8696
0e5317f7
KH
86972011-12-28 Kenichi Handa <handa@m17n.org>
8698
8699 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8700 coding-system ASCII compatible only when it does not produce BOM
8701 on encoding (Bug#10383).
8702
93d5ca1f
JD
87032011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8704
8705 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8706 can scroll.
8707 (create_and_show_popup_menu): Always use menu_position_func for
8708 Gtk3 (Bug#10361).
8709
ca22b785
AS
87102011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8711
8712 * callint.c (Fcall_interactively): Don't truncate prompt string.
8713
d048e1e6
EZ
87142011-12-23 Eli Zaretskii <eliz@gnu.org>
8715
8716 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8717 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 8718 resumed from there (after widening). (Bug#10360)
d048e1e6 8719
5ccaba1f
JD
87202011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8721
8722 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8723
204ee57f
JD
87242011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8725
b81d40f0
JB
8726 * nsterm.m (x_free_frame_resources):
8727 Release f->output_data.ns->miniimage.
204ee57f
JD
8728 (ns_index_color): Fix indentation. Do not retain
8729 color_table->colors[i].
8730
8731 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8732 before returning.
8733
8734 * nsfns.m (x_set_background_color): Assign return value from
8735 ns_index_color to face-background instead of NSColor*.
8736 (ns_implicitly_set_icon_type): Fix indentation.
8737 Change assignment in for loop to comparison.
8738
8739 * emacs.c (ns_pool): New variable.
8740 (main): Assign ns_pool.
8741 (Fkill_emacs): Call ns_release_autorelease_pool.
8742
8743 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8744 autorelease fdesc, release fdAttrs and tdict.
8745 (ns_get_covering_families): Release charset.
8746 (ns_findfonts): Release NSFontDescriptor created with new.
8747 (ns_uni_to_glyphs): Fix indentation.
8748 (setString): Release attrStr before assigning new value.
8749
c803b2b7
JD
87502011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8751
678f4426
JD
8752 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8753 and NS_IMPL_COCOA.
8754 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8755 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8756
cd394be1 87572011-12-18 David Reitter <reitter@cmu.edu>
678f4426 8758
5fecd5fc
JD
8759 * nsterm.m (ns_term_init): Subscribe for notifications
8760 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8761 to method trackingNotification in EmacsMenu.
8762
8763 * nsmenu.m (trackingMenu): New variable.
3771cb17 8764 (trackingNotification): New method (from Aquamacs).
5fecd5fc 8765 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 8766 from Aquamacs (Bug#7030).
678f4426
JD
8767
87682011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 8769
c803b2b7
JD
8770 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8771 (symbol_to_nsstring): Fix indentation.
8772 (ns_symbol_to_pb): New function.
cae07000
SM
8773 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8774 (Fns_rotate_cut_buffers_internal): Remove.
8775 (Fns_store_selection_internal): Rename from
c803b2b7
JD
8776 Fns_store_cut_buffer_internal.
8777 (ns_get_foreign_selection, Fx_own_selection_internal)
8778 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
8779 (Fns_get_selection_internal, Fns_store_selection_internal):
8780 Use ns_symbol_to_pb and check if return value is nil.
8781 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8782 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
8783 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8784 renamed to Sns_store_selection_internal.
8785 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8786 and remove this function.
8787 (ns_handle_selection_clear): Remove, never used.
8788 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8789 here.
8790
e1b01a3a
KB
87912011-12-17 Ken Brown <kbrown@cornell.edu>
8792
8793 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8794 GID is unknown (Bug#10257).
8795
2adb6e85
PE
87962011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8797
8798 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8799 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8800 which caused a build failure on GNU/Linux IA-64. This problem was
8801 introduced by my 2011-10-07 patch.
8802
d1d7b339
JL
88032011-12-15 Juri Linkov <juri@jurta.org>
8804
8805 * image.c (imagemagick_error): New function. (Bug#10112)
8806 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8807 Use `imagemagick_error' where ImageMagick functions return
8808 `MagickFalse'.
8809 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8810 proper order.
8811
100d5755
KH
88122011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8813
8814 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8815 fill background (Bug#8992).
8816
454592a6
MR
88172011-12-13 Martin Rudalics <rudalics@gmx.at>
8818
8819 * window.c (Vwindow_combination_resize)
8820 (Vwindow_combination_limit): Use t instead of non-nil in
8821 doc-strings.
61d4b438
MR
8822 (Vrecenter_redisplay): Add first sentence of doc-string on
8823 separate line.
53524d93 8824 (Frecenter): Fix doc-string typo.
454592a6 8825
3633e3aa
KH
88262011-12-11 Kenichi Handa <handa@m17n.org>
8827
8828 * coding.c (Funencodable_char_position): Pay attention to the
8829 buffer text relocation (Bug#9389).
8830
7b9d523a 88312011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 8832
7b9d523a
JD
8833 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8834 gtk_init (Bug#10100).
8835
b73189c6
EZ
88362011-12-10 Eli Zaretskii <eliz@gnu.org>
8837
8838 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8839 IT->string is nil. (Bug#10263)
8840
f7dfe5d6
JD
88412011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8842
83faebb4
JD
8843 * nsterm.h (x_free_frame_resources): Declare.
8844
f7dfe5d6
JD
8845 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8846 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8847
8848 * nsterm.h (ns_get_defaults_value): Declare.
8849
8850 * nsterm.m (ns_default): Call ns_get_defaults_value.
8851
7cd4e72c
EZ
88522011-12-09 Eli Zaretskii <eliz@gnu.org>
8853
8854 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8855 (Bug#10170)
8856
b34d7317
YM
88572011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8858
8859 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8860 that where the value of an _OBJC_* symbol points to is in the .bss
8861 section (Bug#10240).
8862
76470ad1
KH
88632011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8864
8865 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 8866 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 8867
745fff94
KH
88682011-12-08 Kenichi Handa <handa@m17n.org>
8869
8870 * ftfont.c (get_adstyle_property): Fix previous change
8871 (Bug#10233).
8872
6e44397c
JB
88732011-12-07 Juanma Barranquero <lekktu@gmail.com>
8874
8875 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8876 dirs from the default value of EMACSLOADPATH (bug#10208).
8877
7efa6272
GM
88782011-12-07 Glenn Morris <rgm@gnu.org>
8879
8880 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8881 installation and source directories as well. (Bug#10208)
8882
f6fc4d87
CY
88832011-12-06 Chong Yidong <cyd@gnu.org>
8884
8885 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8886
2bf26180
GM
88872011-12-06 Glenn Morris <rgm@gnu.org>
8888
8889 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8890 as an error, not just -1. (Bug#10217)
8891
3a6ad4f0
CY
88922011-12-05 Chong Yidong <cyd@gnu.org>
8893
8894 * keyboard.c (process_special_events): New function.
8895 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8896
75a3b399
PE
88972011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8898
8899 * coding.c (encode_designation_at_bol): Don't use uninitialized
8900 local variable (Bug#9318).
8901
c3c9e25e
KH
89022011-12-05 Kenichi Handa <handa@m17n.org>
8903
8904 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8905 return Qnil (Bug#8046, Bug#10193).
8906
5eb05ea3
KH
89072011-12-05 Kenichi Handa <handa@m17n.org>
8908
8909 * coding.c (encode_designation_at_bol): New args charbuf_end and
8910 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
8911 (coding_set_source): Return how many bytes coding->source was
8912 relocated.
8913 (coding_set_destination): Return how many bytes
8914 coding->destination was relocated.
8915 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 8916 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
8917
89182011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8919
8920 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8921 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8922 macro (Bug#9318).
8923
89242011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8925
8926 The following changes are to fix Bug#9318.
8927
a79703f5 8928 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
8929 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8930 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 8931 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 8932
7dbda6df
JB
89332011-12-05 Juanma Barranquero <lekktu@gmail.com>
8934
8935 * lisp.h (process_quit_flag): Fix external declaration.
8936
6d5eb5b0
SM
89372011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8938
8939 Don't macro-inline non-performance-critical code.
8940 * eval.c (process_quit_flag): New function.
8941 * lisp.h (QUIT): Use it.
8942
a0c3fad0
JD
89432011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8944
8945 * nsfns.m (get_geometry_from_preferences): New function.
8946 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8947
6c07aac2
AS
89482011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8949
8950 * emacs.c (Qkill_emacs): Define.
8951 (syms_of_emacs): Initialize it.
8952 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8953 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
8954 (quit_throw_to_read_char): Add parameter `from_signal'.
8955 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
8956 * lisp.h (QUIT): Call Fkill_emacs if requested.
8957
c052ead4
JD
89582011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8959
8960 * widget.c (update_wm_hints): Return if wmshell is null.
8961 (widget_update_wm_size_hints): New function.
8962
8963 * widget.h (widget_update_wm_size_hints): Declare.
8964
8965 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8966 widget_update_wm_size_hints (Bug#10104).
8967
9e49252b
EZ
89682011-12-03 Eli Zaretskii <eliz@gnu.org>
8969
8970 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8971 before a newline, prepare the bidi iterator for consuming the
8972 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 8973 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 8974
02b16839
JL
89752011-12-02 Juri Linkov <juri@jurta.org>
8976
8977 * search.c (Fword_search_regexp): New Lisp function created from
8978 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8979 (Fword_search_backward, Fword_search_forward)
8980 (Fword_search_backward_lax, Fword_search_forward_lax):
8981 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8982 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8983
0068070e
SM
89842011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8985
8986 * fileio.c (Finsert_file_contents): Move after-change-function call
8987 to before the "handled:" label, since all "goto handled" appear in
8988 cases where the *-change-functions have already been properly called
8989 (bug#10117).
8990
3360a3fc
AS
89912011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8992
8993 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8994 waiting for input. (Bug#10169)
8995
73d6c093
EZ
89962011-11-30 Eli Zaretskii <eliz@gnu.org>
8997
8998 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8999 verifies glyph row's hash code--we have just reallocated the
9000 glyphs, so their contents can be complete garbage. (Bug#10164)
9001
febe6bea
JB
90022011-11-30 Juanma Barranquero <lekktu@gmail.com>
9003
9004 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9005
801a4313
EZ
90062011-11-30 Eli Zaretskii <eliz@gnu.org>
9007
9008 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9009 attributes are tested _before_ calling verify_row_hash, to protect
9010 against GCC re-ordering of the tests. (Bug#10164)
9011
2b56b87e
JD
90122011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9013
9014 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9015
9016 * xterm.c (handle_one_xevent): Only set async_visible and friends
9017 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9018 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9019 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9020
dbf31225
PE
90212011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9022
9023 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9024 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9025 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9026 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9027 All uses changed to use GCPRO1 etc.
9028 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9029 Revert to old implementation (i.e., before 2011-03-11).
9030
1305621b
YM
90312011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9032
9033 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9034 of scroll runs so as to avoid assigning disabled bogus rows and
9035 unnecessary graphics copy operations.
9036
8c9afb46
EZ
90372011-11-27 Eli Zaretskii <eliz@gnu.org>
9038
9039 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9040 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9041 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9042 (malloc, free, realloc, calloc): Redirect to e_* only when
9043 compiling Emacs.
9044
9045 * lisp.h (GCTYPEBITS): Move before first use.
9046 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9047 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9048 this macro definition.
9049
9050 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9051 _MSC_VER.
9052
54e9e3bf
JD
90532011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9054
6d5eb5b0
SM
9055 * gtkutil.c (xg_create_frame_widgets):
9056 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9057 present with Gtk+ 2.0.
9058
83aca1cb
PE
90592011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9060
9061 * fileio.c (Finsert_file_contents): Undo previous change; see
9062 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9063
5b76caa4
PE
90642011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9065
9066 Rename locals to avoid shadowing.
9067 * fileio.c (Finsert_file_contents):
9068 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9069 * process.c (wait_reading_process_output):
9070 Rename inner 'proc' to 'p' to avoid shadowing.
9071 Indent for consistency with usual Emacs style.
9072
8c535114
EZ
90732011-11-25 Eli Zaretskii <eliz@gnu.org>
9074
9075 * xdisp.c (redisplay_window): If cursor row is not fully visible
9076 after recentering, and scroll-conservatively is set to a large
9077 number, scroll window by a few more lines to make the cursor fully
9078 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9079 (start_display): Don't move to the next line if the display should
9080 start at a newline that is part of a display vector or an overlay
9081 string. (Bug#10119)
8c535114 9082
fa4fdb5c
JL
90832011-11-24 Juri Linkov <juri@jurta.org>
9084
9085 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9086 after the `MagickPingImage' call. (Bug#10112)
9087
90ec88df
CY
90882011-11-23 Chong Yidong <cyd@gnu.org>
9089
9090 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9091
56e2e794
MR
90922011-11-23 Martin Rudalics <rudalics@gmx.at>
9093
9094 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9095 making another buffer current. (Bug#10114)
9096
b6e64c41
GM
90972011-11-23 Glenn Morris <rgm@gnu.org>
9098
9099 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9100
6b21de18
CY
91012011-11-23 Chong Yidong <cyd@gnu.org>
9102
9103 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9104 using it (Bug#5984).
9105
b12cd789
EZ
91062011-11-22 Eli Zaretskii <eliz@gnu.org>
9107
9108 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9109 and header-lines, as they don't have one computed for them.
9110 (Bug#10098)
9111
9112 * .gdbinit (prow): Make displayed values more self-explaining.
9113 Add row's hash code.
9114
261b6fd4
LMI
91152011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9116
9117 * process.c (wait_reading_process_output): Fix asynchrounous
9118 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9119 (wait_reading_process_output): Add comment and URL.
261b6fd4 9120
e7cfd277
JD
91212011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9122
9123 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9124
a9b9b7f5
CY
91252011-11-21 Chong Yidong <cyd@gnu.org>
9126
9127 * window.c (Fnext_window, Fprevious_window): Doc fix.
9128
b0d15b4f
SM
91292011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9130
9131 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9132
fe7a3057
JB
91332011-11-20 Juanma Barranquero <lekktu@gmail.com>
9134
9135 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9136
d2999b1a
MR
91372011-11-20 Martin Rudalics <rudalics@gmx.at>
9138
9139 * window.c (Fset_window_combination_limit): Rename argument
9140 STATUS to LIMIT.
9141 (Vwindow_combination_limit): Remove "status" from doc-string.
9142
d5ff9cd0
AS
91432011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9144
9145 * m/ibms390.h: Remove.
9146 * m/ibms390x.h: Don't include "ibms390.h".
9147
a5bb9bd3
SM
91482011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9149
9150 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9151 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9152
cd1181db
JB
91532011-11-20 Juanma Barranquero <lekktu@gmail.com>
9154
9155 * casetab.c (Fset_case_table):
9156 * charset.c (Fcharset_after): Fix typos.
9157
615a3b8d 91582011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9159
17e845af
PE
9160 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9161 Otherwise, valgrind does not work on some platforms.
9162 Problem reported by Andreas Schwab in
6a0bf43d
PE
9163 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9164 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9165 is set, removing the need for VIRT_ADDRESS_VARIES.
9166 (PURE_P): Use a more-efficient implementation that needs just one
9167 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9168 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9169 to 4 (xorl, subq, cmpq, setbe).
9170 * alloc.c (pure): Always extern now, since that's the
9171 VIRT_ADDR_VARIES behavior.
9172 (PURE_POINTER_P): Use a single comparison, not two, for
9173 consistency with the new puresize.h.
9174 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9175 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9176 Remove VIRT_ADDR_VARIES no longer needed.
9177
f8fe6f96
EZ
91782011-11-19 Eli Zaretskii <eliz@gnu.org>
9179
9180 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9181 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9182 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9183 behave as if the cursor position were at the window margin.
9184
9185 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9186 and the cursor position is out of bounds, behave as if the cursor
9187 position were at the window margin. (Bug#10075)
9188
df05a53c
CY
91892011-11-18 Chong Yidong <cyd@gnu.org>
9190
9191 * window.c (Fwindow_combination_limit): Make first argument
9192 non-optional, since it is meaningless for live windows like the
9193 selected window.
61ccba97 9194
2071918e
DA
91952011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9196
9197 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9198
b50a28de
SM
91992011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9200
9201 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9202 (graft_intervals_into_buffer): Simplify.
9203
015137db
EZ
92042011-11-18 Eli Zaretskii <eliz@gnu.org>
9205
9206 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9207 hash values of the two rows.
9208 (copy_row_except_pointers): Preserve the used[] arrays and the
9209 hash values of the two rows. (Bug#10035)
68c95424 9210 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9211
9212 * xdisp.c (row_hash): New function, body extracted from
9213 compute_line_metrics.
9214 (compute_line_metrics): Call row_hash, instead of computing the
9215 hash code inline.
9216
9217 * dispnew.c (verify_row_hash): Call row_hash for computing the
9218 hash code of a row, instead of duplicating code from xdisp.c.
9219
9220 * dispextern.h (row_hash): Add prototype.
9221
a2addb04
TH
92222011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9223
9224 * frame.c (delete_frame): Don't delete the terminal when the last
9225 X frame is closed if emacs is built with GTK toolkit.
9226
df85d315
JB
92272011-11-17 Juanma Barranquero <lekktu@gmail.com>
9228
9229 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9230
a0c2d0ae
MR
92312011-11-17 Martin Rudalics <rudalics@gmx.at>
9232
9233 * window.c (Vwindow_splits): Rename to
9234 Vwindow_combination_resize. Suggested by Juri Linkov.
9235 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9236 of Vwindow_splits.
9237
58179cce
JB
92382011-11-16 Juanma Barranquero <lekktu@gmail.com>
9239
7877f373
JB
9240 * nsfns.m (Fns_font_name):
9241 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9242
b6f67890
MR
92432011-11-16 Martin Rudalics <rudalics@gmx.at>
9244
9245 * window.h (window): Rename slot "nest" to "combination_limit".
9246 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9247 (Fset_window_nest): Rename to Fset_window_combination_limit.
9248 (Vwindow_nest): Rename to Vwindow_combination_limit.
9249 (recombine_windows, make_parent_window, make_window)
9250 (Fsplit_window_internal, saved_window)
9251 (Fset_window_configuration, save_window_save): Rename all
9252 occurrences of window_nest to window_combination_limit.
9253
c7015153
JB
92542011-11-15 Juanma Barranquero <lekktu@gmail.com>
9255
9256 * image.c (imagemagick_load_image): Fix typo.
9257
322ad6ec
EZ
92582011-11-14 Eli Zaretskii <eliz@gnu.org>
9259
9260 * xdisp.c (display_line): Move the call to
9261 highlight_trailing_whitespace before the call to
9262 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9263 faces of all the glyphs to compute ROW's hash value.
9264 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9265
f067b8ec
JB
92662011-11-14 Juanma Barranquero <lekktu@gmail.com>
9267
9268 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9269 just return (bug#10044).
9270
1e5b2111
EZ
92712011-11-12 Eli Zaretskii <eliz@gnu.org>
9272
7ef3cbd5
EZ
9273 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9274 with user-defined heap size. Bump the default size of the temacs
9275 heap to 27MB, to avoid memory warning when running temacs.
9276 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9277
1e5b2111
EZ
9278 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9279 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9280 (verify_row_hash) [XASSERTS]: New function.
9281 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9282 that the hash value of glyph rows is correct.
1e5b2111 9283
89d61221
MR
92842011-11-12 Martin Rudalics <rudalics@gmx.at>
9285
9286 * window.h (window): Remove splits slot.
9287 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9288 (Fdelete_other_windows_internal, make_parent_window)
9289 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9290 (Fset_window_configuration, save_window_save): Don't deal with
9291 split status of windows.
9292 (saved_window): Remove splits slot.
9293 (Vwindow_splits): Rewrite doc-string.
9294
97f18cc8
JD
92952011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9296
9297 * xfns.c (unwind_create_frame):
9298 * nsfns.m (unwind_create_frame):
9299 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9300 Vframe_list (Bug#9999).
9301
22a648b4
DA
93022011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9303
0b381c7e 9304 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9305
659afede
KH
93062011-11-11 Kenichi Handa <handa@m17n.org>
9307
9308 * callproc.c (Fcall_process): Set the member dst_multibyte of
9309 process_coding.
9310
9ac0394b
KH
93112011-11-11 Johan Bockgård <bojohan@gnu.org>
9312
9313 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9314 avoid a crash (bug#9496).
9315
2fbdc249
CY
93162011-11-09 Chong Yidong <cyd@gnu.org>
9317
9318 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9319 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9320
ac6b1f81
PE
93212011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9322
9323 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9324
09db192c
PE
93252011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9326
9327 Avoid some portability problems by eschewing 'extern inline' functions.
9328 The trivial performance wins aren't worth the portability hassles; see
9329 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9330 et seq.
9331 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9332 (window_box_width, window_box_left, window_box_left_offset)
9333 (window_box_right, window_box_right_offset): Undo previous change,
9334 by removing the "extern"s.
9335 * intervals.c (adjust_intervals_for_insertion)
9336 (adjust_intervals_for_deletion): Undo previous change,
9337 making these static again.
9338 (offset_intervals, temp_set_point_both, temp_set_point)
9339 (copy_intervals_to_string): No longer inline.
9340 * xdisp.c (window_text_bottom_y, window_box_width)
9341 (window_box_height, window_box_left_offset)
9342 (window_box_right_offset, window_box_left, window_box_right)
9343 (window_box): No longer inline.
9344
105216ed
CY
93452011-11-08 Chong Yidong <cyd@gnu.org>
9346
9347 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9348 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9349 Signal an error if not a live window.
105216ed
CY
9350 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9351 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9352
ae9e237f
JB
93532011-11-07 Juanma Barranquero <lekktu@gmail.com>
9354
9355 * lisp.h (syms_of_abbrev): Remove declaration.
9356 Reported by CHENG Gao <chenggao@royau.me>.
9357
c7aa8333
EZ
93582011-11-07 Eli Zaretskii <eliz@gnu.org>
9359
9360 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9361 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9362 of temacs in GUI mode.
9363
be7f5545
MR
93642011-11-07 Martin Rudalics <rudalics@gmx.at>
9365
9366 * window.h: Declare delete_all_child_windows instead of
9367 delete_all_subwindows.
9368 * window.c (Fwindow_nest, Fset_window_nest)
9369 (Fset_window_new_total, Fset_window_new_normal)
9370 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9371 (delete_all_subwindows): Rename to delete_all_child_windows.
9372 (Fdelete_other_windows_internal, Fset_window_configuration):
9373 Call delete_all_child_windows instead of delete_all_subwindows.
9374 * frame.c (delete_frame): Call delete_all_child_windows instead
9375 of delete_all_subwindows.
9376
ca78dc43
PE
93772011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9378
9379 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9380 This is also needed for porting to any host where GC_MARK_STACK is
9381 not GC_MAKE_GCPROS_NOOPS.
9382 (which_symbols): Use it.
9383
a0241d01
KH
93842011-11-07 Kenichi Handa <handa@m17n.org>
9385
9386 * coding.c (coding_set_destination): Check coding->src_pos only
9387 when coding->src_object is a buffer (bug#9910).
9388
9389 * process.c (send_process): Set the member src_multibyte of coding
9390 to 0 (bug#9911) when sending a unibyte text.
9391
9392 * callproc.c (Fcall_process): Set the member src_multibyte of
9393 process_coding to 0 (bug#9912).
9394
a64bfdfa 93952011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
9396
9397 * xmenu.c (cleanup_widget_value_tree): New function.
9398 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9399 calling free_menubar_widget_value_tree directly (Bug#9830).
9400
cb41b32a
PE
94012011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9402
9403 Fix some portability problems with 'inline'.
9404 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9405 (window_box_width, window_box_left, window_box_left_offset)
9406 (window_box_right, window_box_right_offset): Declare extern.
9407 Otherwise, these inline functions do not conform to C99 and
9408 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9409 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9410 * intervals.c (adjust_intervals_for_insertion)
9411 (adjust_intervals_for_deletion): Now extern, because otherwise the
9412 extern inline functions 'offset_intervals' couldn't refer to it.
9413 (static_offset_intervals): Remove.
9414 (offset_intervals): Rewrite using the old contents of
9415 static_offset_intervals. The old version didn't conform to C99
9416 because an extern inline function contained a reference to an
9417 identifier with static linkage.
9418
b7041366
AS
94192011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9420
9421 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9422 GC.
9423
88a37c4d
EZ
94242011-11-06 Eli Zaretskii <eliz@gnu.org>
9425
9426 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9427 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9428 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9429 return Qleft_to_right.
9430
49745b39
CY
94312011-11-06 Chong Yidong <cyd@gnu.org>
9432
9433 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9434 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9435 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9436 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9437 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9438 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9439 (Fwindow_vscroll): Doc fix.
9440 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9441 argument, since it makes no sense to pass a live window and for
9442 consistency with window-child.
9443
1f05cd82
CS
94442011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9445
9446 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9447 support MSVC.
9448
22610910
JR
94492011-11-05 Jason Rumney <jasonr@gnu.org>
9450
9451 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9452 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9453 fonts (Bug#6029).
9454 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9455 bitwise arithmetic preventing use of unicode-sip and non-truetype
9456 opentype fonts.
9457
a06776b2
EZ
94582011-11-05 Eli Zaretskii <eliz@gnu.org>
9459
3ad924ba
EZ
9460 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9461 "emacs"-only part.
9462
a06776b2
EZ
9463 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9464 initialization code to keep similarity to xfns.c after changes
9465 from 2011-11-05.
9466
c9e7db78
JD
94672011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9468
a97f8f3f
JD
9469 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9470 (unwind_create_frame): New function (Bug#9943).
9471 (Fx_create_frame): Restructure code to be more similar to the one in
9472 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9473 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9474 Move terminal->reference_count++ just before making the frame official
9475 (Bug#9943).
9476
9477 * nsterm.m (x_free_frame_resources): New function.
9478 (x_destroy_window): Move code to x_free_frame_resources.
9479
c9e7db78 9480 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
9481 (Fx_create_frame, x_create_tip_frame):
9482 Move terminal->reference_count++ just before making the frame
75f1671a 9483 official. Move initialization of image_cache_refcount and
c9e7db78
JD
9484 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9485
a6fc3b5c
EZ
94862011-11-05 Eli Zaretskii <eliz@gnu.org>
9487
9488 Support MSVC build with newer versions of Visual Studio.
9489 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9490 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9491 nt/gmake.defs.
9492
9493 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9494 which are not supported by MSVC.
9495 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9496 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9497 bitfields.
9498 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9499 types in bitfields.
9500 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9501
9502 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9503
58179cce 95042011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
9505
9506 Support MSVC build with newer versions of Visual Studio.
9507 * w32.c: Don't include w32api.h for MSVC.
9508 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9509
9510 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9511 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9512 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9513 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9514 e_* cousins.
9515 (alloca) [_MSC_VER]: Define to _alloca.
9516
9517 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9518
9519 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9520
a58c13ed
EZ
95212011-11-04 Eli Zaretskii <eliz@gnu.org>
9522
9523 * xdisp.c (note_mouse_highlight): If either of
9524 previous/next-single-property-change returns nil, treat that as
9525 the beginning or the end of the buffer. (Bug#9955)
9526
fe0b6370
JD
95272011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9528
a58c13ed 9529 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
9530 label is not null (Bug#9951).
9531 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9532 may be NULL.
9533
89bd5ee1
EZ
95342011-11-04 Eli Zaretskii <eliz@gnu.org>
9535
9536 * window.c (Fwindow_body_size): Mention in the doc string that the
9537 return value is in frame's canonical units. (Bug#9949)
9538
84c3edb9
EZ
95392011-11-03 Eli Zaretskii <eliz@gnu.org>
9540
4e2fb5c7
EZ
9541 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9542
84c3edb9 9543 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 9544 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 9545 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 9546
bc17a887
EZ
95472011-11-01 Eli Zaretskii <eliz@gnu.org>
9548
9549 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9550 Don't stop backward scan on the continuation glyph, even though
9551 its CHARPOS is positive.
6d5eb5b0
SM
9552 (mouse_face_from_buffer_pos, note_mouse_highlight):
9553 Rename cover_string to disp_string.
bc17a887 9554
4ee88440
MR
95552011-11-01 Martin Rudalics <rudalics@gmx.at>
9556
9557 * window.c (temp_output_buffer_show): Don't use
9558 Vtemp_buffer_show_specifiers.
9559 (Vtemp_buffer_show_specifiers): Remove unused variable.
9560
c2ff3c02
EZ
95612011-10-30 Eli Zaretskii <eliz@gnu.org>
9562
9563 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9564 past the beginning of the current glyph matrix.
9565
58179cce 95662011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
9567
9568 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9569 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9570 HAVE_GTK3 (Bug#9869).
b77a6a7f 9571
3b574623
JD
9572 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9573 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9574
b77a6a7f
JD
9575 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9576
9577 * xterm.c: Declare x_handle_net_wm_state to return int.
9578 (handle_one_xevent): Check if we are iconified but don't have
9579 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9580 (get_current_wm_state): Return non-zero if not hidden,
9581 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9582 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9583 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9584 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9585
196e41e4
PE
95862011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9587
9588 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9589 so that this new function doesn't get optimized away by a
9590 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9591
021f2e1a
AS
95922011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9593
9594 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9595
8b058d44
EZ
95962011-10-29 Eli Zaretskii <eliz@gnu.org>
9597
9598 Fix the `xbytecode' command.
9599 * .gdbinit (xprintbytestr): New command.
b50a28de 9600 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
9601 (xbytecode): Print the byte-code string as well.
9602
4452fb80
EZ
96032011-10-29 Kim Storm <storm@cua.dk>
9604
8b058d44
EZ
9605 * alloc.c (which_symbols): New function.
9606
21b72067
AS
96072011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9608
9609 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9610 line. (Bug#9903)
9611
83ed7b5c
GM
96122011-10-29 Glenn Morris <rgm@gnu.org>
9613
9614 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9615 Not clear what it was for, and it causes various bugs. (Bug#9839)
9616
5a7a728b
EZ
96172011-10-28 Eli Zaretskii <eliz@gnu.org>
9618
9619 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9620 possible random value that matches one of those tested as
9621 condition to clear the mouse face.
9622
d3d0842f
CY
96232011-10-28 Chong Yidong <cyd@gnu.org>
9624
9625 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9626
31b39d13
DN
96272011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9628
9629 * window.c (make_window): Initialize phys_cursor_on_p.
9630
9aba6043
SM
96312011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9632
9633 * lisp.h (struct Lisp_Symbol): Update comments.
9634
c20992f4
JB
96352011-10-28 Juanma Barranquero <lekktu@gmail.com>
9636
9637 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9638
db4f02f2
EZ
96392011-10-28 Eli Zaretskii <eliz@gnu.org>
9640
9641 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9642 <oslsachem@gmail.com> for helping to debug this.
9643
9644 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9645 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9646 (g_b_init_get_glyph_outline_w): New static variables.
9647 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9648 (GetGlyphOutlineW_Proc): New typedefs.
9649 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
9650 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9651 New functions.
9652 (w32font_open_internal, compute_metrics):
9653 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
9654 instead of calling the "wide" APIs directly.
9655
9656 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9657
9658 * w32.h (syms_of_w32font): Add prototype.
9659
87e68db4
JB
96602011-10-27 Juanma Barranquero <lekktu@gmail.com>
9661
9662 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9663 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9664 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9665 (Fmove_to_window_line): Doc fix.
9666
435c1d67
CY
96672011-10-27 Chong Yidong <cyd@gnu.org>
9668
9669 * process.c (make_process): Set gnutls_state to NULL.
9670
9671 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9672 non-NULL, regardless of GNUTLS_INITSTAGE.
9673 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9674 an error. Set process slots as soon as we allocate them.
9675
9676 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9677
9c6c6f49
CY
96782011-10-27 Chong Yidong <cyd@gnu.org>
9679
9aba6043
SM
9680 * gnutls.c (emacs_gnutls_deinit): New function.
9681 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
9682 (Fgnutls_deinit, Fgnutls_boot): Use it.
9683
9684 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9685 (deactivate_process): Call emacs_gnutls_deinit.
9686
657d08d3
JB
96872011-10-27 Juanma Barranquero <lekktu@gmail.com>
9688
9689 * image.c (x_create_x_image_and_pixmap):
9690 * w32.c (sys_rename, w32_delayed_load):
9691 * w32font.c (fill_in_logfont):
9692 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9693
5430d399
JB
96942011-10-26 Juanma Barranquero <lekktu@gmail.com>
9695
9696 * w32fns.c (w32_default_color_map): New function,
9697 extracted from Fw32_default_color_map.
a7ef684b 9698 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 9699
fe0055fa
PE
97002011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9701
9702 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9703
e6346438
SM
97042011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9705
9706 * keyboard.c (test_undefined): New function (bug#9751).
9707 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9708
e112cc37
ET
97092011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9710
9711 * sysdep.c (init_sys_modes): Fix the check for the controlling
9712 terminal (Bug#6649).
9713
7b5d6677
EZ
97142011-10-20 Eli Zaretskii <eliz@gnu.org>
9715
9716 * dispextern.h (struct bidi_it): New member next_en_type.
9717
9718 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9719 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9720 current character, check also for next_en_type being WEAK_EN.
9721 (bidi_resolve_weak): Don't enter the expensive loop if the current
9722 position is before next_en_pos. Record the bidi type of the first
9723 non-ET, non-BN character we find, in addition to its position.
9724 (bidi_level_of_next_char): Invalidate next_en_type when
9725 next_en_pos is over-stepped.
9726
7da0b018
PE
97272011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9728
9729 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9730 * editfns.c: Rewrite current-time-zone so that it invokes
9731 the equivalent of (format-time-string "%Z") to get the time zone name.
9732 This fixes a bug when the time zone name contains characters that
9733 need converting from the system time locale to Emacs internal format.
9734 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9735 that patch fixed format-time-string to do the conversion, but
9736 I forgot to fix current-time-zone.
9737 (format_time_string): New function, containing most of
9738 what Fformat_time_string used to contain.
9739 (Fformat_time_string): Rewrite in terms of format_time_string.
9740 This doesn't change this function's behavior.
9741 (current-time-zone): Rewrite to use format_time_string.
9742 This fixes the bug reported by Michael Schierl in
9743 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9744 Jason Rumney's 2007-06-07 change worked around this bug, but
9745 didn't fix it.
9746 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9747
8547b010
EZ
97482011-10-19 Eli Zaretskii <eliz@gnu.org>
9749
9750 * xdisp.c (start_display): If the character at POS is displayed
9751 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
9752 (try_window_reusing_current_matrix): If a line ends in a display
9753 vector or the next line starts in a display vector, continue
9754 redrawing the window even though the character position of
9755 start_row was reached.
8547b010
EZ
9756 (Bug#9771, part 2)
9757
4e948d15
CY
97582011-10-18 Chong Yidong <cyd@gnu.org>
9759
9760 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9761 with nobreak-char-display too.
9762
4787455f
EZ
97632011-10-18 Eli Zaretskii <eliz@gnu.org>
9764
9765 Fix part 3 of bug#9771.
9766 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9767 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9768 non-neutral characters if the current character is a paragraph
9769 separator (a.k.a. Newline). This avoids running the same
9770 expensive loop twice, once when we consume the preceding newline
9771 and the other time when the line actually needs to be displayed.
9772 Avoid the loop when we see neutrals on the base embedding level
9773 following a character whose directionality is the same as the
9774 paragraph's. This avoids running the expensive loop when a line
9775 ends in a long sequence of neutrals, like control characters.
9776 Add assertion against STRONG_AL type. Slightly rearrange code
9777 that determines the type of a neutral given the first non-neutral
9778 that follows it.
9779 (bidi_level_of_next_char): Set next_en_pos to zero when
9780 invalidating its info.
9781
2c91f553
EZ
97822011-10-17 Eli Zaretskii <eliz@gnu.org>
9783
9784 * xdisp.c (push_display_prop): Determine whether to record string
9785 or buffer position by IT->string, not by IT->method. Allow
9786 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
9787 (move_it_vertically_backward): Don't look for character position
9788 immediately after the newline when in a continuation line.
9789 (Bug#9771, part 1)
2c91f553 9790
c7b08b0d
MR
97912011-10-15 Martin Rudalics <rudalics@gmx.at>
9792
9793 * window.c (coordinates_in_window): Rewrite and delabelize
9794 vertical border check. (Bug#5357) (Bug#9618)
9795
6b02f655
SM
97962011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9797
9798 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9799 errors in XSetWindowBorder (bug#9310).
9800
81d40c92
DA
98012011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9802
9803 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9804 avoid crash when xmalloc overrun checking is enabled.
9805
d4172c3b
EZ
98062011-10-13 Eli Zaretskii <eliz@gnu.org>
9807
9808 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9809 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9810 cursor motion with <left> and <right> arrow keys.
9811
9812 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9813 some callers set that themselves.
9814
b00eea75
EZ
98152011-10-12 Eli Zaretskii <eliz@gnu.org>
9816
9817 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9818 display string and the previous row comes from the same string and
9819 is empty. (Bug#9739) (Bug#9738)
9820
8fe012c4
SM
98212011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9822
9823 * doc.c (get_doc_string): Encode file name (bug#9735).
9824
0074aef2
EZ
98252011-10-12 Eli Zaretskii <eliz@gnu.org>
9826
79beb178
EZ
9827 * bidi.c (bidi_level_of_next_char):
9828 * xdisp.c (get_visually_first_element): Remove old incorrect
9829 comments regarding the Unicode Line Separator character.
9830
0074aef2
EZ
9831 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9832
6e4b3fbe
DA
98332011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9834
9835 * alloc.c (Fgc_status): Do not access beyond zombies array
9836 boundary if nzombies > MAX_ZOMBIES.
9837 * alloc.c (dump_zombies): Add missing format specifier.
9838
0324f3af
PE
98392011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9840
b5525cac
PE
9841 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9842 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9843
0324f3af
PE
9844 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9845 Some packages use them to denote characters with modifiers.
9846
e9b5f888
AS
98472011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9848
9849 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9850 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9851 matching a pp-number. Rename parameter var to var1.
9852
127827c0
SM
98532011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9854
9855 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9856
c8fd3bd0
GM
98572011-10-08 Glenn Morris <rgm@gnu.org>
9858
9859 * callint.c (Fcall_interactively): Give a more explicit error for the
9860 'c' case with a non-character input. (Bug#8479)
9861
352ec8ff
EZ
98622011-10-08 Eli Zaretskii <eliz@gnu.org>
9863
03669ccb
EZ
9864 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9865 lines.
7061c986
EZ
9866 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9867 lines that are hscrolled on the left.
03669ccb 9868
352ec8ff
EZ
9869 * dispnew.c (buffer_posn_from_coords): Account for a possible
9870 presence of header-line. (Bug#4426)
9871
a66cfb1c
SM
98722011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9873
6b02f655
SM
9874 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9875 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 9876
7c5ee88e
PE
98772011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9878
9879 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9880 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9881 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9882 this makes Emacs dump core during garbage collection on rare
9883 occasions. sizeof is obviously inferior to offsetof here, so
9884 stick with offsetof.
9885 (GC_POINTER_ALIGNMENT): New macro.
9886 (mark_memory): Omit 3rd (offset) arg; caller changed.
9887 Don't assume EMACS_INT alignment is the same as pointer alignment.
9888
df1bbe5b
SM
98892011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9890
9891 * keyboard.c (read_key_sequence_remapped): New var.
9892 (read_key_sequence): Compute remapping in the right buffer.
9893 (command_loop_1): Use read_key_sequence's remapping directly.
9894
51553db6
SM
98952011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9896
32c1fffd
SM
9897 * dired.c (file_name_completion): Don't expand file name.
9898 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9899 before checking file name handler.
9900
51553db6
SM
9901 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9902 they've been requested explicitly (bug#9591).
9903
b6bd1599 99042011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
9905
9906 * keymap.c (Fsingle_key_description): Use make_specified_string
9907 instead of build_string to build string from push_key_description.
9908 (Bug#5193)
9909
f701dc2a
PE
99102011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9911
4222c55d
PE
9912 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9913 This fixes a Y2038 bug on 64-bit hosts.
9914 * buffer.c (reset_buffer):
9915 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9916 (Fclear_buffer_auto_save_failure):
9917 Use 0, not -1, to represent an unset failure time, since time_t
9918 might not be signed.
9919
f701dc2a
PE
9920 Remove dependency on glibc malloc internals.
9921 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9922 Move back here from lisp.h, but with their new implementations.
9923 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9924 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9925 * charset.c (charset_table_init): New static var.
9926 (syms_of_charset): Use it instead of xmalloc. This removes a
9927 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9928 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9929 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9930 Move back to alloc.c.
9931 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9932 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9933
9ceebf39
JD
99342011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9935
9936 * nsterm.m (windowDidResize): Call x_set_window_size only when
9937 ns_in_resize is true. Otherwise set pixelwidth/height and
9938 call change_frame_size (Bug#9628).
9939
cb993c58
PE
99402011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9941
3930c88b
PE
9942 Port --enable-checking=all to Fedora 14 x86-64.
9943 * charset.c (syms_of_charset): Also account for glibc malloc's
9944 internal overhead when calculating the initial malloc maximum.
9945
cb993c58
PE
9946 Port --enable-checking=all to Fedora 14 x86.
9947 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9948 Move to lisp.h.
9949 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9950 (overrun_check_realloc, overrun_check_free):
9951 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9952 That way, xmalloc returns a properly-aligned pointer even if
9953 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9954 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9955 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9956 into account when calculating the initial malloc maximum.
9957 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9958 Move here from alloc.c, so that charset.c can use it too.
9959 Properly align; the old code wasn't right for common 32-bit hosts
9960 when configured with --enable-checking=all.
9961 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9962 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9963
31bed486
EZ
99642011-09-29 Eli Zaretskii <eliz@gnu.org>
9965
04c70788 9966 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
9967 use EDOM.
9968
fbcaa2f3
EZ
99692011-09-28 Eli Zaretskii <eliz@gnu.org>
9970
9971 * xdisp.c (compute_display_string_end): If there's no display
9972 string at CHARPOS, return -1.
9973
9974 * bidi.c (bidi_fetch_char): When compute_display_string_end
9975 returns a negative value, treat the character as a normal
9976 character not covered by a display string. (Bug#9624)
9977
a239d4e9
JB
99782011-09-28 Juanma Barranquero <lekktu@gmail.com>
9979
9980 * lread.c (Fread_from_string): Fix typo in docstring.
9981
88652fd5
EZ
99822011-09-27 Eli Zaretskii <eliz@gnu.org>
9983
9984 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9985 newline, reseat the iterator instead of bidi-iterating there one
9986 character at a time. (Bug#9610)
32c1fffd
SM
9987 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9988 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 9989
ed497dd4
AS
99902011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9991
9992 * lread.c (readevalloop): Use correct code for NBSP.
9993 (read1): Likewise. (Bug#9608)
9994
b2bf61aa
MA
99952011-09-25 Michael Albinus <michael.albinus@gmx.de>
9996
9997 * dbusbind.c (Fdbus_register_signal): When service is not
9998 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9999
32bbb17c
GM
100002011-09-25 Glenn Morris <rgm@gnu.org>
10001
10002 * buffer.c (truncate-lines): Doc fix.
10003
94e0933e
CY
100042011-09-24 Chong Yidong <cyd@stupidchicken.com>
10005
10006 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10007 (Fset_window_next_buffers): Doc fix.
10008
cddde921
GM
100092011-09-24 Glenn Morris <rgm@gnu.org>
10010
10011 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10012
1260aef1
PE
100132011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10014
25b4bfa0
PE
10015 Fix minor problems found by static checking.
10016 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10017 * indent.c (Fvertical_motion): Fix == vs = typo.
10018
e3cbd34b
EZ
100192011-09-24 Eli Zaretskii <eliz@gnu.org>
10020
a66cfb1c
SM
10021 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10022 Default value is now t. Doc fix.
6bf7006f 10023
e3cbd34b 10024 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10025 logic when moving up, not only when moving down. Fix the
e3cbd34b 10026 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10027 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10028
10029 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10030 CHARPOS is covered by a display string which includes newlines.
10031 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10032 is covered by a display string with embedded newlines.
10033
a3de0cbd
MA
100342011-09-24 Michael Albinus <michael.albinus@gmx.de>
10035
10036 * dbusbind.c (Fdbus_register_signal): Add match rule to
10037 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10038 (Fdbus_register_method, Vdbus_registered_objects_table):
10039 Fix docstring.
a3de0cbd 10040
b260039d
JM
100412011-09-24 Jim Meyering <meyering@redhat.com>
10042
32c1fffd 10043 do not ignore write error for any output size
b260039d
JM
10044 The previous change was incomplete.
10045 While it makes emacs --batch detect the vast majority of stdout
10046 write failures, errors were still ignored whenever the output size is
10047 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10048 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10049 && echo FAIL: ignored write error
10050 FAIL: ignored write error
10051 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10052 && echo FAIL: ignored write error
10053 FAIL: ignored write error
10054 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10055
8eca8a7c
AS
100562011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10057
10058 * emacs.c (Fkill_emacs): In noninteractive mode exit
10059 non-successfully if a write error occurred on stdout. (Bug#9574)
10060
3341db62
EZ
100612011-09-21 Eli Zaretskii <eliz@gnu.org>
10062
10063 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10064 the xassert test.
10065
10066 * dispextern.h (struct it): Update the comment documenting what
10067 can it->OBJECT be.
10068
8c203dbf
EZ
100692011-09-20 Eli Zaretskii <eliz@gnu.org>
10070
10071 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10072 a display string, extend search for cursor position to end of row.
10073 (find_row_edges): If the row ends in a newline from a display
10074 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10075 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10076 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10077 non-empty line. Fixes confusing cursor motion with arrow keys at
10078 the beginning of a line that starts with whitespace.
8c203dbf 10079
a4824228
LMI
100802011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10081
10082 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10083 (bug#9493).
10084
33ed493b
CY
100852011-09-18 Chong Yidong <cyd@stupidchicken.com>
10086
10087 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10088 boolean (Bug#9154).
10089
56cd55c8
EZ
100902011-09-18 Eli Zaretskii <eliz@gnu.org>
10091
10092 * xdisp.c (display_line): Record maximum and minimum buffer
10093 positions even if no glyphs were produced (e.g., by a zero-width
10094 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10095 buffer positions that will be removed from the glyph row because
10096 they don't fit.
c02dcedf
EZ
10097 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10098 column is beyond frame width: don't subtract 1 "pixel" when
10099 computing width of the stretch.
3e62b7e0
EZ
10100 (reseat_at_next_visible_line_start): Undo the change made on
10101 2011-09-17 that saved paragraph information and restored it after
10102 the call to `reseat'. (Bug#9545)
56cd55c8 10103
5ed99d36 101042011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10105
10106 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10107 and turn window cursor on if cleared (Bug#9415).
10108
5ed99d36 101092011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10110
10111 * search.c (boyer_moore): Take unibyte characters from pattern
10112 literally. (Bug#9458)
10113
9bade7b2
EZ
101142011-09-18 Eli Zaretskii <eliz@gnu.org>
10115
10116 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10117
e5e9d610
PE
101182011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10119
87e4427a
PE
10120 Fix minor problem found by static checking.
10121 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10122 initialized, to pacify gcc -Wuninitialized.
10123
e5e9d610
PE
10124 * fileio.c: Report proper errno when syscall falls.
10125 (Finsert_file_contents): Save and restore errno,
10126 so that report_file_error outputs the correct diagnostic.
10127 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10128
a1674f0b
EZ
101292011-09-18 Eli Zaretskii <eliz@gnu.org>
10130
10131 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10132
fbfb6dd4
EZ
101332011-09-17 Eli Zaretskii <eliz@gnu.org>
10134
10135 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10136 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10137
bb187662
EZ
101382011-09-17 Eli Zaretskii <eliz@gnu.org>
10139
1137e8b8 10140 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10141 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10142
10143 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10144 (bidi_find_paragraph_start): Search back for paragraph beginning
10145 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10146 (bidi_move_to_visually_next): Only trigger paragraph-related
10147 computations when the last character is a newline or at EOB, not
10148 just any NEUTRAL_B. (Bug#9470)
10149
bb187662
EZ
10150 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10151 truncated lines if point is covered by a display string. (Bug#9524)
10152
2e621251
PE
101532011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10154
10155 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10156 (cons_to_x_long): New function.
10157 (lisp_data_to_selection_data): Use it. Correct the test for
10158 short-versus-long data; it was negated. Break out of vector
10159 loop, for efficiency, when a long datum is discovered.
10160
91a15bc6
SM
101612011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10162
10163 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10164
b41c3a35
EZ
101652011-09-16 Eli Zaretskii <eliz@gnu.org>
10166
10167 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10168 GCC PR/17406) by declaring this function with external scope.
10169
7812ba2d
PE
101702011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10171
10172 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10173 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10174
cf7edc2a
AS
101752011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10176
10177 * editfns.c (Fformat): Correctly handle text properties on "%%".
10178
bd01620e
EZ
101792011-09-15 Eli Zaretskii <eliz@gnu.org>
10180
10181 * xterm.c (x_draw_composite_glyph_string_foreground):
10182 * w32term.c (x_draw_composite_glyph_string_foreground):
10183 * term.c (encode_terminal_code):
10184 * composite.c (composition_update_it, get_composition_id):
10185 * xdisp.c (get_next_display_element)
10186 (fill_composite_glyph_string): Add comments about special meaning
10187 of TAB characters in a composition.
10188
a02719a3
PE
101892011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10190
10191 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10192 This occurs when processing a multibyte format.
10193 Problem reported by Wolfgang Jenker.
a02719a3 10194
72589a3c
JB
101952011-09-15 Johan Bockgård <bojohan@gnu.org>
10196
10197 * xdisp.c (try_cursor_movement): Only check for exact match if
10198 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10199
1c14176c
PE
102002011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10201
10202 Remove unused external symbols.
10203 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10204 * xdisp.c (calc_pixel_width_or_height): Now static.
10205 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10206 * indent.c (check_display_width):
10207 * w32term.c: Fix comment to match code.
10208 * xterm.c, xterm.h (x_catching_errors): Remove.
10209
d2eea5b5
PE
102102011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10211
10212 * xselect.c: Use signed conversions more consistently (Bug#9498).
10213 (selection_data_to_lisp_data): Assume incoming selection data are
10214 signed integers, not unsigned. This is to be consistent with
10215 outgoing selection data, which was modified to use signed integers
10216 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10217 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10218 expects long, not unsigned long.
10219
46888499
EZ
102202011-09-14 Eli Zaretskii <eliz@gnu.org>
10221
10222 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10223 computation of loop end. Reported by Johan Bockgård
10224 <bojohan@gnu.org>.
10225
ef8ef9fb
CY
102262011-09-13 Chong Yidong <cyd@stupidchicken.com>
10227
10228 * frame.c (Fother_visible_frames_p): Function deleted.
10229
fa819fed
EZ
102302011-09-12 Eli Zaretskii <eliz@gnu.org>
10231
10232 * indent.c (compute_motion): Process display vector front to back
10233 rather than the other way around. (Bug#2496)
10234
2ba8e008
SM
102352011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10236
10237 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10238
20f53c69
CY
102392011-09-11 Chong Yidong <cyd@stupidchicken.com>
10240
10241 * minibuf.c (Fread_from_minibuffer): Doc fix.
10242
d562d7a4
EZ
102432011-09-11 Eli Zaretskii <eliz@gnu.org>
10244
10245 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10246 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10247
1c4d7f3d
LMI
102482011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10249
10250 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10251 value for non-existent files.
10252
b885bf36
EZ
102532011-09-11 Eli Zaretskii <eliz@gnu.org>
10254
10255 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10256 set its "size" to -1. This will set the modtime_size field of
10257 the corresponding buffer to -1, which is what
10258 verify-visited-file-modtime expects for files that do not exist.
10259 (Bug#9139)
10260
6612f0bf
PE
102612011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10262
10263 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10264 here ...
10265 * lisp.h: ... from here. push_key_description is no longer
10266 defined in keyboard.c, so its declaration should not be in
10267 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10268 logically belongs with push_key_description.
10269
dfb3f755
PE
102702011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10271
10272 * buffer.h: Include <sys/types.h> instead of <time.h>.
10273 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10274 Problem reported by Herbert J. Skuhra.
10275
3134906c
LMI
102762011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10277
10278 * xml.c (parse_region): Make the parsing work for
10279 non-comment-starting XML files again (bug#9144).
10280
8d903f4e
AS
102812011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10282
10283 * image.c (gif_load): Fix calculation of bottom and right corner.
10284 (Bug#9468)
10285
80ad64f4
EZ
102862011-09-10 Eli Zaretskii <eliz@gnu.org>
10287
10288 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10289 redisplay in small windows.
10290
208a048d
EZ
102912011-09-09 Eli Zaretskii <eliz@gnu.org>
10292
10293 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10294
9b1c252e
MR
102952011-09-08 Martin Rudalics <rudalics@gmx.at>
10296
10297 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10298 Operate on live windows only.
10299
2949f33b
JB
103002011-09-08 Juanma Barranquero <lekktu@gmail.com>
10301
10302 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10303
e08dcafd
EZ
103042011-09-07 Eli Zaretskii <eliz@gnu.org>
10305
10306 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10307 only under bidi iteration.
10308
115b96bd
JD
103092011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10310
10311 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10312
c8199d0f
PE
103132011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10314
10315 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10316 Without this fix, the command to link temacs failed due to an
10317 undefined symbol __builtin_isnan. This is because
10318 /usr/include/iso/math_c99.h #defines isnan(x) to
10319 __builtin_isnan(x), but the bundled gcc, which identifies itself
10320 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10321 a __builtin_isnan.
10322 * floatfns.c (isnan): #undef, and then #define to a clone of
10323 what's in data.c.
10324 (Fisnan): Always define, since it's always available now.
10325 (syms_of_floatfns): Always define isnan at the Lisp level.
10326
e39b275c 103272011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10328
10329 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10330
b2db44d9 103312011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10332
f4af5137 10333 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10334 The previous code assumed that file offsets (off_t values) fit in
10335 EMACS_INT variables, which is not true on typical 32-bit hosts.
10336 The code messed up by falsely reporting buffer overflow in cases
10337 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10338 when "big" contains more than 2**29 bytes, even though this
10339 inserts just one byte and does not overflow the buffer.
10340 (Finsert_file_contents): Store file offsets as off_t
10341 values, not as EMACS_INT values. Check for overflow when
10342 converting between EMACS_INT and off_t. When checking for
10343 buffer overflow or for overlap, take the offsets into account.
10344 Don't use EMACS_INT for small values where int suffices.
10345 When checking for overlap, fix a typo: ZV was used where
10346 ZV_BYTE was intended.
10347 (Fwrite_region): Don't assume off_t fits into 'long'.
10348 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10349
ecfc0a49
MA
103502011-09-05 Michael Albinus <michael.albinus@gmx.de>
10351
10352 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10353
6511acf2 103542011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10355
0999621a 10356 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10357
10358 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10359 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10360 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10361 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10362 (modify_event_symbol): Do not assume that the length of
10363 name_alist_or_stem is safe to alloca and fits in int.
10364 (Fexecute_extended_command): Likewise for function name and binding.
10365 (Frecursion_depth): Wrap around reliably on integer overflow.
10366 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10367 since some callers pass EMACS_INT values.
10368 (Fsingle_key_description): Don't crash if symbol name contains more
10369 than MAX_ALLOCA bytes.
10370 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10371 (get_minibuffer): Arg is now EMACS_INT, not int.
10372 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 10373 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
10374 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10375
2be7d702
PE
10376 * dbusbind.c (signature_cat): New function.
10377 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
10378 Do not overrun buffer; instead, report string overflow.
10379
9d1df220
PE
10380 * dispnew.c (add_window_display_history): Don't overrun buffer.
10381 Truncate instead; this is OK since it's just a log.
10382
33ef5c64
PE
10383 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10384 even if the time zone offset is outlandishly large.
10385 Don't mishandle offset == INT_MIN.
10386
66c6fdd5
PE
10387 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10388 when creating daemon; the previous buffer-overflow check was incorrect.
10389
d749b01b
PE
10390 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10391 which has the guts of the old verror function.
10392
b5cd1905
PE
10393 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10394 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10395
6e1a67fb
PE
10396 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10397 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 10398 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 10399 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
10400 length of string rather than counting it via multiple sprintfs;
10401 that's simpler and more reliable.
c21721cc
PE
10402 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10403 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10404 sprintf, in case result does not fit in int.
10405
c57b67fc
PE
10406 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10407 (fontset_from_font): Print it.
10408
8a401434
PE
10409 * frame.c (tty_frame_count): Now printmax_t, not int.
10410 (make_terminal_frame, set_term_frame_name): Print it.
10411 (x_report_frame_params): In X, window IDs are unsigned long,
10412 not signed long, so print them as unsigned.
10413 (validate_x_resource_name): Check for implausibly long names,
10414 and don't assume name length fits in 'int'.
10415 (x_get_resource_string): Don't blindly alloca invocation name;
10416 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10417 not fit in int.
10418
6e1a67fb
PE
10419 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10420 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
10421 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10422
0df02bf3
PE
10423 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10424 Use esprintf, not sprintf, in case result does not fit in int.
10425
48e30793
PE
10426 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10427 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10428 it as a large positive number.
10429 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10430 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10431
a66ff6d8
PE
10432 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10433 in case result does not fit in int.
10434
aca216ff
PE
10435 * print.c (float_to_string): Detect width overflow more reliably.
10436 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10437 buffer overrun. Don't assume list length fits in 'int'. Treat
10438 print length of 0 as 0, not as infinity; to be consistent with other
10439 uses of print length in this function. Don't overflow print length
10440 index. Don't assume hash table size fits in 'long', or that
10441 vectorlike size fits in 'unsigned long'.
10442
31c286f7
PE
10443 * process.c (make_process): Use printmax_t, not int, to format
10444 process-name gensyms.
10445
55e5faa1
PE
10446 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10447
80f2e268
PE
10448 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10449 to avoid potential buffer overrun.
10450
670741ab
PE
10451 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10452 if X resource line is longer than 512 bytes.
10453
b7163a50
PE
10454 * xfns.c (x_window): Make sprintf buffer a bit bigger
10455 to avoid potential buffer overrun.
10456
ae58ff1f
PE
10457 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10458
c43c8a6a
PE
10459 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10460
3f8236f4
PE
104612011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10462
53e9fe90 10463 Integer overflow fixes for scrolling, etc.
6511acf2
PE
10464 Without these, Emacs silently mishandles large integers sometimes.
10465 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
10466 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10467
6511acf2
PE
10468 * xdisp.c (try_window_id): Check Emacs fixnum range before
10469 converting to 'int'.
806add1d 10470
6511acf2 10471 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
10472 Check that an Emacs fixnum is in range before assigning it to 'int'.
10473 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10474 values converted from Emacs fixnums.
10475 (Frecenter): Don't wrap around a line count if it is out of 'int'
10476 range; instead, treat it as an extreme value.
10477 (Fset_window_configuration, compare_window_configurations):
10478 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10479
6511acf2
PE
10480 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10481 that can exceed INT_MAX. Check that EMACS_INT value is in range
10482 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
10483 (match_limit): Don't assume that a fixnum can fit in 'int'.
10484
6511acf2 10485 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
10486 exceed INT_MAX.
10487
6511acf2 10488 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
10489 (Fvertical_motion): Don't wrap around LINES values that don't fit
10490 in 'int'. Instead, treat them as extreme values. This is good
10491 enough for windows, which can't have more than INT_MAX lines anyway.
10492
fcb901a7
LMI
104932011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10494
0f2f6b6d
LMI
10495 * Require libxml/parser.h to avoid compilation warning.
10496
fcb901a7
LMI
10497 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10498
10499 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10500 since this reportedly can destroy thread storage.
10501
6e20a0d4
CY
105022011-08-30 Chong Yidong <cyd@stupidchicken.com>
10503
10504 * syntax.c (find_defun_start): Update all cache variables if
10505 exiting early (Bug#9401).
10506
148ae00e
EZ
105072011-08-30 Eli Zaretskii <eliz@gnu.org>
10508
f6cfbd8f
EZ
10509 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10510
148ae00e
EZ
10511 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10512 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10513 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10514
10515 * term.c (tty_append_glyph): New function.
10516 (produce_stretch_glyph): Static function and its prototype deleted.
10517
a66cfb1c
SM
10518 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10519 Add prototypes.
148ae00e 10520
c4a07a4c
PE
105212011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10522
10523 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10524 when checking :margin (Bug#9390).
10525 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 10526 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
10527 so that the name doesn't mislead. All uses changed.
10528
6bc8cd65
JB
105292011-08-28 Johan Bockgård <bojohan@gnu.org>
10530
10531 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10532 set_tty_hooks.
10533
dca4927e
EZ
105342011-08-27 Eli Zaretskii <eliz@gnu.org>
10535
10536 * xdisp.c (move_it_to): Don't bail out early when reaching
10537 position beyond to_charpos, if we are scanning backwards.
10538 (move_it_vertically_backward): When DY == 0, make sure we get to
10539 the first character in the line after the newline.
10540
f2cad773
PE
105412011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10542
10543 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10544 (ccl_driver): Do not generate an out-of-range pointer.
10545 (Fccl_execute_on_string): Remove unnecessary check for
10546 integer overflow, noted by Stefan Monnier in
10547 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10548 Remove a FIXME that didn't need fixing.
10549 Simplify the newly-introduced buffer reallocation code.
10550
0cae2cdb
JB
105512011-08-27 Juanma Barranquero <lekktu@gmail.com>
10552
10553 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10554
5fc295a4 105552011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 10556
70c60eb2 10557 Integer and memory overflow issues (Bug#9196).
726e0ab1 10558
d31850da
PE
10559 * doc.c (get_doc_string): Rework so that
10560 get_doc_string_buffer_size is the actual buffer size, rather than
10561 being 1 less than the actual buffer size; this makes xpalloc more
10562 convenient.
10563
a69fbedb
PE
10564 * image.c (x_allocate_bitmap_record, cache_image):
10565 * xselect.c (Fx_register_dnd_atom):
10566 Simplify previous changes by using xpalloc.
10567
fe5c5d37
PE
10568 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10569 since either will do and ptrdiff_t is convenient with xpalloc.
10570
0065d054
PE
10571 * charset.c (charset_table_size)
10572 (struct charset_sort_data.priority): Now ptrdiff_t.
10573 (charset_compare): Don't overflow if priorities differ greatly.
10574 (Fsort_charsets): Don't assume list length fits in int.
10575 Check for size-calculation overflow when allocating sort data.
10576 (syms_of_charset): Allocate an initial charset table that is
10577 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10578
10579 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10580
10581 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10582 The actual value is always <= INT_MAX, and leaving it unsigned made
10583 overflow checking harder.
10584
10585 * dispextern.h (struct glyph_matrix.rows_allocated)
10586 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10587 with xpalloc. The values are still always <= INT_MAX.
10588
10589 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10590
10591 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10592 (SAFE_NALLOCA): New macro.
10593
10594 * region-cache.c (struct boundary.pos, find_cache_boundary)
10595 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10596 (set_cache_region, invalidate_region_cache)
10597 (revalidate_region_cache, know_region_cache, region_cache_forward)
10598 (region_cache_backward, pp_cache):
10599 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10600 so that ptrdiff_t * can be passed to xpalloc.
10601 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10602 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10603 (pp_cache): Don't assume cache_len fits in int.
10604 * region-cache.h: Adjust extern decls to match.
10605
10606 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10607 EMACS_INT, since either will do, for xpalloc.
10608
10609 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10610 (xnmalloc, xnrealloc, xpalloc): New functions.
10611
726e0ab1
PE
10612 * bidi.c (bidi_shelve_header_size): New constant.
10613 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10614 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10615
51f30bc5 10616 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
10617 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10618 (overlay_strings):
10619 Don't update size of array until after memory allocation succeeds,
10620 because xmalloc/xrealloc may not return.
0065d054
PE
10621 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10622 now that we have proper integer overflow checking.
10623 (record_overlay_string, overlay_strings): Catch overflows when
10624 calculating size of overlay_str_buf.
726e0ab1 10625
0065d054
PE
10626 * callproc.c (Fcall_process): Check for size overflow when
10627 calculating size of args2.
10628 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10629 Normally we prefer signed values, but sticking with ptrdiff_t would
10630 require adding more-complicated checks.
726e0ab1
PE
10631
10632 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10633 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10634 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 10635 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
10636
10637 * character.c (Fstring): Check for size-calculation overflow.
10638
10639 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10640 unnecessary integer overflow. Check for size overflow.
10641 (encode_coding_object): Don't update size until xmalloc succeeds.
10642
10643 * composite.c (get_composition_id): Check for overflow in glyph
10644 length calculations.
10645
10646 Integer and memory overflow fixes for display code.
10647 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10648 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10649 (scrolling_window): Check for overflow in size calculations.
10650 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10651 Don't assume glyph table len fits in int.
10652 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10653 (row_table_size): Now ptrdiff_t, not int.
10654 (scrolling_window): Avoid overflow in size calculations.
10655 Don't update size until allocation succeeds.
10656 * fns.c (concat): Check for overflow in size calculations.
10657 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10658 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10659 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10660
10661 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10662 (get_doc_string): Check for size calculation overflow.
10663 Don't update size until allocation succeeds.
10664 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10665 EMACS_INT, where ptrdiff_t will do.
10666 (Fsubstitute_command_keys): Check for string overflow.
10667
10668 * editfns.c (set_time_zone_rule): Don't assume environment length
10669 fits in int.
10670 (message_length): Now ptrdiff_t, not int.
10671 (Fmessage_box): Don't update size until allocation succeeds.
10672 Don't assume message length fits in int.
10673 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10674
0065d054
PE
10675 * emacs.c (main): Do not reallocate argv, since there is a null at
10676 the end that can be overwritten, and this way there's no need to
10677 worry about size-calculation overflow.
10678 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
10679
10680 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10681 alloc succeeds.
10682 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10683
10684 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10685 (x_set_scroll_bar_width, x_figure_window_size):
10686 Check for integer overflow.
10687 (x_set_alpha): Do not assume XINT fits in int.
10688
10689 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10690 This is for the members text_lines, text_cols, total_lines, total_cols,
10691 where the system imposes an 'int' limit.
10692
10693 * fringe.c (Fdefine_fringe_bitmap):
10694 Don't update size until alloc works.
10695
10696 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10697 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10698
10699 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10700 Check for size-calculation overflow.
10701 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10702 do, as we prefer signed integers.
10703 (id_to_widget.max_size, id_to_widget.used)
10704 (xg_store_widget_in_map, xg_remove_widget_from_map)
10705 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10706 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10707 Use and return ptrdiff_t, not int.
10708 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10709 * gtkutil.h: Change prototypes to match the above.
10710
10711 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10712 are duplicate now that they've been promoted to lisp.h.
10713 (x_allocate_bitmap_record, x_alloc_image_color)
10714 (make_image_cache, cache_image, xpm_load):
10715 Don't update size until alloc is done.
10716 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10717 (x_detect_edges):
3256efce 10718 Check for size calculation overflow.
726e0ab1
PE
10719 (ct_colors_allocated_max): New constant.
10720 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10721 overflow.
3256efce 10722
726e0ab1
PE
10723 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10724 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10725 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10726 Use ptrdiff_t, not int, to count maps.
10727 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
10728 calculations. Don't update size until allocation succeeds.
10729 Redo calculations to avoid overflow.
726e0ab1
PE
10730 * keyboard.h: Change prototypes to match the above.
10731
10732 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10733 to count maps.
10734 (current_minor_maps): Check for size calculation overflow.
10735 * keymap.h: Change prototypes to match the above.
10736
10737 * lread.c (read1, init_obarray): Don't update size until alloc done.
10738
10739 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10740 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10741
726e0ab1
PE
10742 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10743 Now ptrdiff_t, not int.
10744 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10745 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10746
10747 * process.c (Fnetwork_interface_list): Check for overflow
10748 in size calculation.
10749
10750 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10751
10752 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10753 overflow. Don't bother calling xmalloc when xrealloc will do.
10754
10755 * search.c (Freplace_match): Check for size calculation overflow.
10756 (Fset_match_data): Don't assume list lengths fit in 'int'.
10757
10758 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10759 for command line length. Do not attempt to address one before the
10760 beginning of an array, as that's not portable.
10761
10762 * term.c (max_frame_lines): Remove; unused.
10763 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10764 not int.
10765 (encode_terminal_code, calculate_costs): Check for size
10766 calculation overflow.
10767 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10768 table lengths and related sizes. Don't update size until alloc
10769 done. Redo calculations to avoid overflow.
10770 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10771
10772 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10773 subtracting pointers.
10774 (gobble_line): Check for overflow more carefully. Don't update size
10775 until alloc done.
10776
10777 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10778 Don't update size until alloc done.
10779 Redo size calculations to avoid overflow.
10780 Check for size calculation overflow.
0065d054 10781 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
10782
10783 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10784 Use ptrdiff_t, not int, for sizes.
10785 (store_mode_line_noprop_char): Don't update size until alloc done.
10786
0065d054
PE
10787 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10788 Use ptrdiff_t, not int, for sizes.
10789 (Finternal_make_lisp_face, cache_face):
10790 Check for size calculation overflow.
10791 (cache_face): Treat size calculation overflows as if they were
10792 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
10793
10794 * xfns.c (x_encode_text, x_set_name_internal)
10795 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10796 sizes, since they can exceed INT_MAX in size. Check for size
10797 calculation overflow.
10798
0065d054
PE
10799 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10800 (xg_select): Check for size calculation overflow.
726e0ab1
PE
10801 Don't update size until alloc done.
10802
0065d054 10803 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 10804 as sprintf is limited to int lengths.
1d526e2f 10805
252c5ee1
PE
10806 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10807 (X_LONG_MIN): New macros.
864d7ce7
PE
10808 Use them to make the following changes clearer.
10809 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10810 This change doesn't affect the value now, but it may help remind
10811 future maintainers not to raise the value too much later.
10812 (SELECTION_QUANTUM): Remove, replacing with ...
10813 (selection_quantum): ... new function, which avoids overflow.
10814 All uses changed.
10815 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10816 assumption that selection length fits in 'int'.
10817 (x_reply_selection_request, x_handle_selection_request)
10818 (x_get_window_property, receive_incremental_selection)
10819 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10820 (lisp_data_to_selection_data, clean_local_selection_data):
10821 Use ptrdiff_t, not int, to record length of selection.
10822 (x_reply_selection_request, x_get_window_property)
10823 (receive_incremental_selection, x_property_data_to_lisp):
10824 Redo calculations to avoid overflow.
10825 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 10826 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
10827 something.
10828 (x_get_window_property, receive_incremental_selection)
10829 (lisp_data_to_selection_data, x_property_data_to_lisp):
10830 Check for size-calculation overflow.
10831 (x_get_window_property, receive_incremental_selection)
10832 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10833 Don't store size until memory allocation succeeds.
10834 (x_get_window_property): Plug memory leak on memory exhaustion.
10835 Don't double-block input; malloc is safe here. Don't assume 2**34
10836 - 4 fits in unsigned long. Add an xassert to check
10837 XGetWindowProperty overflow. Be more careful about overflow
10838 calculations, and distinguish size from memory overflow better.
10839 (receive_incremental_selection): When tracing, don't assume
10840 unsigned int is less than INT_MAX.
10841 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10842 harmful) conversions of unsigned short to int.
10843 (lisp_data_to_selection_data): Don't assume that integers
10844 in the range -65535 through -1 fit in an X unsigned short.
10845 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10846 result parameters unless successful. Rely on cons_to_unsigned
10847 to report problems with elements; the old code wasn't right anyway.
10848 (x_check_property_data): Check for int overflow; we cannot use
10849 a wider type due to X limits.
10850 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10851
726e0ab1 10852 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 10853
0065d054
PE
10854 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10855 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
10856 (x_color_cells): Don't store size until memory allocation succeeds.
10857 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 10858 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
10859 (x_term_init): Don't assume length fits in int (sprintf is limited
10860 to int size).
bc18e09d 10861
ebfa62c0
PE
10862 Use ptrdiff_t for composition IDs.
10863 * character.c (lisp_string_width):
10864 * composite.c (composition_table_size, n_compositions)
10865 (get_composition_id, composition_gstring_from_id):
10866 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10867 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10868 * window.c (Frecenter):
10869 Use ptrdiff_t, not int, for composition IDs.
10870 * composite.c (get_composition_id): Check for integer overflow.
10871 * composite.h: Adjust prototypes to match the above changes.
10872
d3411f89
PE
10873 Use ptrdiff_t for hash table indexes.
10874 * category.c (hash_get_category_set):
10875 * ccl.c (ccl_driver):
10876 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10877 * coding.c (coding_system_charset_list, detect_coding_system):
10878 * coding.h (struct coding_system.id):
10879 * composite.c (get_composition_id, gstring_lookup_cache):
10880 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10881 * image.c (xpm_get_color_table_h):
10882 * lisp.h (hash_lookup, hash_put):
10883 * minibuf.c (Ftest_completion):
10884 Use ptrdiff_t for hash table indexes, not int (which is too
10885 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10886 32-bit --with-wide-int hosts).
10887
e097a6fa
PE
10888 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10889 Add a FIXME comment about memory leaks.
10890 (syms_of_charset): Don't assume xmalloc returns.
10891
5637687f
PE
10892 Don't assume that stated character widths fit in int.
10893 * character.c (Fchar_width, c_string_width, lisp_string_width):
10894 * character.h (CHAR_WIDTH):
10895 * indent.c (MULTIBYTE_BYTES_WIDTH):
10896 Use sanitize_char_width to avoid undefined and/or bad behavior
10897 with outlandish widths.
a66cfb1c 10898 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
10899 now that we have two such functions. All uses changed.
10900 (sanitize_char_width): New inline function.
10901
a2271ba2
PE
10902 Don't assume that tab-width fits in int.
10903 * character.h (sanitize_width): New inline function.
10904 (SANE_TAB_WIDTH): New macro.
10905 (ASCII_CHAR_WIDTH): Use it.
10906 * indent.c (sane_tab_width): Remove. All uses replaced by
10907 SANE_TAB_WIDTH (current_buffer).
10908 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10909
18c52557
PE
10910 * fileio.c: Integer overflow issues with file modes.
10911 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10912
caeeedc1
PE
10913 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10914 Remove unreachable code.
10915 (read_hex, load_charset_map_from_file): Check for integer overflow.
10916
6df6ae42 10917 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
10918 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10919 (x_send_scroll_bar_event): Likewise. Check that the size does not
10920 exceed limits imposed by XClientMessageEvent, as well as the usual
10921 ptrdiff_t and size_t limits.
10922
b13995db
PE
10923 * keyboard.c: Overflow, signedness and related fixes.
10924 (make_lispy_movement): Use same integer type in forward decl
10925 that is used in the definition.
10926 (read_key_sequence, keyremap_step):
10927 Change bufsize argument back to int, undoing my 2011-03-30 change.
10928 We prefer signed types, and int is wide enough here.
10929 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10930 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10931 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10932 length, not size_t. Use ptrdiff_t for index, not int.
10933 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10934 possibility of integer overflow.
10935
13464394
PE
10936 Overflow, signedness and related fixes for images.
10937
10938 * dispextern.h (struct it.stack[0].u.image.image_id)
10939 (struct_it.image_id, struct image.id, struct image_cache.size)
10940 (struct image_cache.used, struct image_cache.ref_count):
10941 * gtkutil.c (update_frame_tool_bar):
10942 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10943 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10944 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10945 * nsmenu.m (update_frame_tool_bar):
10946 * xdisp.c (calc_pixel_width_or_height):
10947 * xfns.c (image_cache_refcount):
10948 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10949 on typical 64-bit hosts.
10950
10951 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10952 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10953 Omit unnecessary casts to int.
10954 (parse_image_spec): Check that integers fall into 'int' range
10955 when the callers expect that.
10956 (image_ascent): Redo ascent calculation to avoid int overflow.
10957 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10958 (lookup_image): Remove unnecessary tests.
10959 (xbm_image_p): Locals are now of int, not EMACS_INT,
10960 since parse_image_check makes sure they fit into int.
10961 (png_load, gif_load, svg_load_image):
10962 Prefer int to unsigned where either will do.
10963 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
10964 old tiff_error_handler and tiff_warning_handler.
10965 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
10966 stack buffer overflows. It uses only the features of vsnprintf
10967 that are common to both POSIX and native Microsoft.
10968 (tiff_error_handler, tiff_warning_handler): Use it.
10969 (tiff_load, gif_load, imagemagick_load_image):
10970 Don't assume :index value fits in 'int'.
10971 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10972 (imagemagick_load_image): Check that crop parameters fit into
10973 the integer types that MagickCropImage accepts. Don't assume
10974 Vimagemagick_render_type has a nonnegative value. Don't assume
10975 size_t fits in 'long'.
10976 (gs_load): Use printmax_t to print the widest integers possible.
10977 Check for integer overflow when computing image height and width.
10978
c11821d4
EZ
109792011-08-26 Eli Zaretskii <eliz@gnu.org>
10980
10981 * xdisp.c (redisplay_window): Don't force window start if point
10982 will be invisible in the resulting window. (Bug#9324)
10983
0c95fcf7
EZ
109842011-08-25 Eli Zaretskii <eliz@gnu.org>
10985
10986 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10987 the display spec is of the form `(space ...)'.
10988 (handle_display_spec): Return the value returned by
10989 handle_single_display_spec, not just 1 or zero.
10990 (handle_single_display_spec): If the display spec is of the form
10991 `(space ...)', and specifies display in the text area, return 2
10992 rather than 1.
fee65a97 10993 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
10994 accurately, and prefer exact match for point under bidi.
10995 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
10996
10997 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10998 into disp_prop; all users changed.
10999
11000 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11001 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11002 for the text covered by the display property.
11003
e4ed06f1
CY
110042011-08-25 Chong Yidong <cyd@stupidchicken.com>
11005
11006 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11007 Change return value to nil.
11008 (Frecord_buffer): Delete unused function.
11009
f67cdd7f
EZ
110102011-08-24 Eli Zaretskii <eliz@gnu.org>
11011
5980d4c6
EZ
11012 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11013 buffers, return left-to-right.
8610fe8b
EZ
11014 (set_cursor_from_row): Consider candidate row a win if its glyph
11015 represents a newline and point is on that newline. Fixes cursor
11016 positioning on the newline at EOL of R2L text within L2R
11017 paragraph, and vice versa.
11018 (try_cursor_movement): Check continued rows, in addition to
11019 continuation rows. Fixes unwarranted scroll when point enters a
11020 continued line of R2L text within an L2R paragraph, or vice versa.
11021 (cursor_row_p): Consider the case of point being equal to
11022 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11023 from the end of a short line to the beginning of a continued line
11024 of R2L text within L2R paragraph.
11025 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11026 composed characters.
5980d4c6 11027
f67cdd7f
EZ
11028 * bidi.c (bidi_check_type): Use xassert.
11029 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11030 members.
11031
bca633fb
EZ
110322011-08-23 Eli Zaretskii <eliz@gnu.org>
11033
11034 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11035 a character.
11036
4a5885a7
CY
110372011-08-23 Chong Yidong <cyd@stupidchicken.com>
11038
11039 * nsfont.m (ns_otf_to_script): Fix typo.
11040
0902a04e
KH
110412011-08-22 Kenichi Handa <handa@m17n.org>
11042
11043 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11044 extra slot even if the purpose is char-code-property-table.
11045
1a2e6670
EZ
110462011-08-23 Eli Zaretskii <eliz@gnu.org>
11047
8ddde651
EZ
11048 * xdisp.c (redisplay_window): When computing centering_position,
11049 account for the height of the header line. (Bug#8874)
11050
425cc014
EZ
11051 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11052 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11053 candidate is selected by the mouse, and that candidate has a
11054 composed character under the mouse.
11055
1a2e6670
EZ
11056 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11057 coordinates reported by pos-visible-in-window-p for a composed
11058 character in column zero.
11059
8b76d6f8
SM
110602011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11061
11062 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11063
dac347dd
EZ
110642011-08-22 Eli Zaretskii <eliz@gnu.org>
11065
11066 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11067 consider it a hit if to_charpos is anywhere in the range of the
11068 composed buffer positions.
11069
e013fb34
CY
110702011-08-22 Chong Yidong <cyd@stupidchicken.com>
11071
11072 * image.c (gif_load): Don't assume that each subimage has the same
11073 dimensions as the base image. Handle disposal method that is
11074 "undefined" by the gif spec (Bug#9335).
11075
bd1ba3e8
CY
110762011-08-20 Chong Yidong <cyd@stupidchicken.com>
11077
11078 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11079 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11080
54a1215b
EZ
110812011-08-19 Eli Zaretskii <eliz@gnu.org>
11082
823564e5
EZ
11083 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11084 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11085 from an Org mode buffer to a Speedbar frame.
11086
54a1215b
EZ
11087 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11088 a composition, take its buffer position from IT->cmp_it.charpos.
11089 Fixes cursor positioning at the beginning of a line that begins
11090 with a composed character.
11091
9778ebcc
EZ
110922011-08-18 Eli Zaretskii <eliz@gnu.org>
11093
0be6ee06
EZ
11094 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11095 character bidirectional type, use STRONG_L instead. Fixes crashes
11096 in a buffer produced by `describe-categories'.
11097
9778ebcc
EZ
11098 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11099 members before the level stack, so they would be saved and
11100 restored when copying iterator state. Fixes incorrect reordering
11101 around TABs covered by display properties.
11102
156bffbe
AS
111032011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11104
6b02f655 11105 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11106
72ad093b
CY
111072011-08-17 Chong Yidong <cyd@stupidchicken.com>
11108
11109 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11110 (internal_condition_case_2, internal_condition_case_n):
11111 Remove unnecessary aborts (Bug#9081).
72ad093b 11112
35774242
EZ
111132011-08-17 Eli Zaretskii <eliz@gnu.org>
11114
11115 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11116 has no `load' handler, try opening the file locally. (Bug#9311)
11117
db76dd85
KB
111182011-08-16 Ken Brown <kbrown@cornell.edu>
11119
11120 * gmalloc.c: Expand comment.
11121
b215eee5
EZ
111222011-08-16 Eli Zaretskii <eliz@gnu.org>
11123
11124 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11125 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11126
a4579d33
KB
111272011-08-16 Ken Brown <kbrown@cornell.edu>
11128
11129 Fix memory allocation problems in Cygwin build (Bug#9273).
11130
11131 * unexcw.c ( __malloc_initialized): Declare external variable.
11132 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11133
8b76d6f8
SM
11134 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11135 New variables.
a4579d33
KB
11136 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11137 dumped emacs.
11138 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11139 in the static heap.
11140 [CYGWIN] (special_realloc): New function.
11141 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11142 requests to realloc storage in the static heap.
11143
3ebec551
PE
111442011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11145
11146 * bidi.c (bidi_initialize): Remove unused local.
11147
9fd8be00
EZ
111482011-08-15 Eli Zaretskii <eliz@gnu.org>
11149
6b02f655
SM
11150 * bidimirror.h:
11151 * biditype.h: Remove file.
11152 * makefile.w32-in ($(BLD)/bidi.$(O)):
11153 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11154
11155 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11156
11157 * chartab.c: Improve commentary for the uniprop_table API.
11158
32413314
EZ
11159 * bidi.c (bidi_paragraph_init): Support zero value of
11160 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11161 (bidi_initialize): Use uniprop_table instead of including
11162 biditype.h and bidimirror.h.
32413314 11163
9fd8be00
EZ
11164 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11165 coordinates of the iterator when restoring from ppos_it.
11166 (Bug#9296)
11167
5cf2b69b
KH
111682011-08-14 Kenichi Handa <handa@m17n.org>
11169
11170 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11171 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11172
daf17d00
EZ
111732011-08-14 Eli Zaretskii <eliz@gnu.org>
11174
11175 * xdisp.c (move_it_in_display_line_to): Don't invoke
11176 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11177 ppos_it. Fixes vertical cursor motion when line beginning is
11178 covered by an image. (Bug#9296)
11179
08e3161a
JD
111802011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11181
11182 * nsterm.h (ns_run_ascript): Declare.
11183 (NSAPP_DATA2_RUNASSCRIPT): Define.
11184
11185 * nsfns.m (as_script, as_result, as_status): New static variables.
11186 (ns_run_ascript): New function.
5e617bc2 11187 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11188 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11189 the event loop. Get status from as_status (Bug#7276).
11190
11191 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11192 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11193 the event loop (Bug#7276).
11194
a3720aa2
AS
111952011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11196
11197 * gnutls.c (QCgnutls_bootprop_priority)
11198 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11199 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11200 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11201 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11202 (QCgnutls_bootprop_verify_hostname_error)
11203 (QCgnutls_bootprop_callbacks_verify): Rename from
11204 Qgnutls_bootprop_..., all uses changed.
11205
11206 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11207 uses changed.
11208
0a0d27fb
PE
112092011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11210
19d5c50c
PE
11211 * xfaces.c (Qframe_set_background_mode): Now static.
11212 * dispextern.h (Qframe_set_background_mode): Remove decl.
11213
0a0d27fb
PE
11214 * process.c (Fnetwork_interface_info): Declare local only if needed.
11215
377538cb
JD
112162011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11217
11218 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11219 (Fnetwork_interface_list): Allocate in increments of bytes instead
11220 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11221 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11222 sockaddr.
11223 (struct ifflag_def): notrailers is smart on OSX.
11224 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11225 Get hardware address with getifaddrs if available.
11226
08fff70c
EZ
112272011-08-12 Eli Zaretskii <eliz@gnu.org>
11228
11229 * xdisp.c (iterate_out_of_display_property): xassert that
11230 IT->position is set to within IT->object's boundaries. Break from
11231 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11232 when IT->position is set up wrongly due to some bug.
11233 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11234 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11235 entry. Force push_it to save on the stack the current
11236 buffer/string position, to be restored by pop_it. Fix flags in
11237 the iterator structure wrt the object coming from a display
11238 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11239 properties. (Bug#9284)
11240
7be1c708 112412011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11242
7be1c708
CY
11243 * fontset.c (fontset_get_font_group): Add proper type checks.
11244 (Bug#9172)
aac0c6e3 11245
7be1c708 112462011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11247
7be1c708
CY
11248 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11249 and LC_VERSION_MIN_MACOSX.
11250 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11251 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11252
97bb72a6
EZ
112532011-08-08 Eli Zaretskii <eliz@gnu.org>
11254
11255 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11256 no-display-properties-and-no-overlays under bidi display.
11257 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11258 properties and overlays.
97bb72a6 11259
d5617611
CY
112602011-08-08 Chong Yidong <cyd@stupidchicken.com>
11261
37e11a63
CY
11262 * editfns.c (Fset_time_zone_rule): Document relationship with the
11263 setenv function.
11264
d5617611
CY
11265 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11266 the font entity extracted from the cache (Bug#8109).
11267
58872834
CY
112682011-08-07 Chong Yidong <cyd@stupidchicken.com>
11269
11270 * composite.c (autocmp_chars): Don't reset point. That is done by
11271 restore_point_unwind (Bug#5984).
11272
75bfc667
JL
112732011-08-07 Juri Linkov <juri@jurta.org>
11274
11275 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11276 to show the arg `TIME' instead of `TIMEVAL'.
11277
d1410150
EZ
112782011-08-06 Eli Zaretskii <eliz@gnu.org>
11279
11280 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11281 display property strides EOL and includes a newline, as in
11282 longlines-mode. (Bug#9254)
75b771e4
EZ
11283 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11284 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11285
11286 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11287 is non-zero, even if the data buffer is NULL. Fixes a crash in
11288 vertical-motion with longlines-mode. (Bug#9254)
11289
35928349
EZ
112902011-08-05 Eli Zaretskii <eliz@gnu.org>
11291
ec7cc85b
EZ
11292 * bidi.c <bidi_cache_total_alloc>: Now static.
11293 (bidi_initialize): Initialize bidi_cache_total_alloc.
11294
8b76d6f8 11295 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11296 cache. (Bug#9221)
11297
11298 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11299 amount allocated this far in `bidi_cache_total_alloc'.
11300 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11301 non-zero, only free the data buffer without restoring the cache
11302 contents. All callers changed.
11303
11304 * dispextern.h (bidi_unshelve_cache): Update prototype.
11305
11306 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11307 (move_it_in_display_line, move_it_to)
11308 (move_it_vertically_backward, move_it_by_lines): Replace the call
11309 to xfree to an equivalent call to bidi_unshelve_cache.
11310 (move_it_in_display_line_to): Fix logic of returning
412b6358 11311 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11312
e2e2423b
EZ
113132011-08-05 Eli Zaretskii <eliz@gnu.org>
11314
11315 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11316 came from a string character with a `cursor' property. (Bug#9229)
11317
ae9e757a
JD
113182011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11319
11320 * Makefile.in (LIB_PTHREAD): New variable.
11321 (LIBES): Add LIB_PTHREAD (Bug#9216).
11322
11323 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11324 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11325
213bd7f2
AS
113262011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11327
6b02f655 11328 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11329
99aaf75f
JD
113302011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11331
11332 * xterm.c (x_find_topmost_parent): New function.
11333 (x_set_frame_alpha): Find topmost parent window with
11334 x_find_topmost_parent and set the property there also (bug#9181).
11335 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11336
c74e9d86
PE
113372011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11338
11339 * callproc.c (Fcall_process): Avoid vfork clobbering
11340 the local vars buffer, coding_systems, current_dir.
11341
640c8776
SM
113422011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11343
11344 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11345
f26d0e4c
PE
113462011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11347
8a10d76c
PE
11348 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11349 so that it is not optimized away.
11350
f26d0e4c
PE
11351 * xdisp.c (compute_display_string_pos): Remove unused local.
11352
55439c61
EZ
113532011-08-02 Eli Zaretskii <eliz@gnu.org>
11354
11355 Fix slow cursor motion and scrolling in large buffers with
11356 selective display, like Org Mode buffers. (Bug#9218)
11357
11358 * dispextern.h (struct bidi_it): New member disp_prop_p.
11359
11360 * xdisp.c: Remove one-slot cache of display string positions.
11361 (compute_display_string_pos): Accept an additional argument
5e617bc2 11362 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11363 for a display string or property. If found, set DISP_PROP_P
11364 non-zero.
11365
11366 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11367 DISP_PROP_P, and pass it to compute_display_string_pos.
11368 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
11369 non-zero. All callers of bidi_fetch_char changed.
11370
fb33fa43
SM
113712011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11372
11373 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11374
b099e063
DM
113752010-12-03 Don March <don@ohspite.net>
11376
11377 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11378 last character M-[char] is translated to ESC [char] (bug#7541).
11379
5cc7f7af
KH
113802011-08-02 Kenichi Handa <handa@m17n.org>
11381
d0fffa3f 11382 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
11383
11384 * chartab.c (uniprop_table): Make it non-static.
11385
525d5e6e
EZ
113862011-08-01 Eli Zaretskii <eliz@gnu.org>
11387
11388 * xdisp.c (forward_to_next_line_start): Accept additional argument
11389 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11390 on the newline.
11391 (reseat_at_next_visible_line_start): Use the bidi iterator state
11392 returned by forward_to_next_line_start to restore the state of
11393 it->bidi_it after backing up to previous newline. (Bug#9212)
11394
31011111
AS
113952011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11396
11397 * regex.c (re_comp): Protoize.
11398 (re_exec): Fix return type.
11399 (regexec): Fix type of `ret'. (Bug#9203)
11400
476371c4
PE
114012011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11402
e5d76069
PE
11403 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11404 This is needed if max-image-size is a floating-point number.
11405
9a79b20c
AS
114062011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11407
11408 * print.c (print_object): Print empty symbol as ##.
11409
11410 * lread.c (read1): Read ## as empty symbol.
11411
d8c2fa78
AA
114122011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11413
11414 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11415 setting frame foreground color (Bug#9175).
11416 (x_set_background_color): Likewise.
11417
ffe57a7a
AA
11418 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11419 contents (Bug#9176).
11420 (EmacsTooltip -init): Remove bezels and add shadows to
11421 tooltip windows.
11422
bf3492a5
AA
11423 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11424 or scroll bar (Bug#8470).
11425
d55e9c53
AA
11426 * nsfont.m (nsfont_open): Remove assignment to voffset and
11427 unnecessary vars hshink, expand, hd, full_height, min_height.
11428 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11429
11430 * nsterm.h (nsfont_info): Remove voffset field.
11431
d8c2fa78 114322011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
11433
11434 Implement strike-through and overline on NextStep (Bug#8863).
11435
11436 * nsfont.m (nsfont_open): Use underline position provided by font,
11437 instead of hard-coded value of 2.
11438 (nsfont_draw): Call ns_draw_text_decoration instead.
11439
11440 * nsterm.h: Add declaration for ns_draw_text_decoration.
11441
11442 * nsterm.m (ns_draw_text_decoration): New function for drawing
11443 underline, overline, and strike-through.
11444 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11445 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 11446 accommodate underlining, etc.
4843aac3 11447
4cc60b9b
EZ
114482011-07-28 Eli Zaretskii <eliz@gnu.org>
11449
bc7ece87
EZ
11450 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11451 default.
4cc60b9b 11452
476371c4
PE
114532011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11454
66606eea
PE
11455 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11456 Without this fix, if a signal arrives just after memory fills up,
11457 'malloc' might be invoked reentrantly.
11458
476371c4
PE
11459 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11460 In other words, assume that every image size is allowed, on non-X
11461 hosts. This assumption is probably wrong, but it lets Emacs compile.
11462
f3fcc40d
AS
114632011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11464
11465 * regex.c (re_iswctype): Convert return values to boolean.
11466
350c992f
EZ
114672011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11468
11469 * xdisp.c (compute_display_string_pos): Don't use cached display
11470 string position if the buffer had its restriction changed.
11471 (Bug#9184)
11472
5266b4bb
PE
114732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11474
11475 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11476
2573a837 114772011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 11478
41f55ccd 11479 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 11480
39e378da
PE
11481 * bidi.c: Integer size and overflow fixes.
11482 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11483 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11484 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11485 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11486 (bidi_find_other_level_edge):
11487 Use ptrdiff_t instead of EMACS_INT where either will do.
11488 This works better on 32-bit hosts configured --with-wide-int.
11489 (bidi_cache_ensure_space): Check for size-calculation overflow.
11490 Use % rather than repeated addition, for better worst-case speed.
11491 Don't set bidi_cache_size until after xrealloc returns, because it
11492 might not return.
11493 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
11494 (bidi_cache_ensure_space): Also check that the bidi cache size
11495 does not exceed that of the largest Lisp string or buffer. See Eli
11496 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 11497
5e927815
PE
11498 * alloc.c (__malloc_size_t): Remove.
11499 All uses replaced by size_t. See Andreas Schwab's note
11500 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11501
ca4aa935
PE
11502 * image.c: Improve checking for integer overflow.
11503 (check_image_size): Assume that f is nonnull, since
11504 it is always nonnull in practice. This is one less thing to
11505 worry about when checking for integer overflow later.
11506 (x_check_image_size): New function, which checks for integer
11507 overflow issues inside X.
11508 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11509 This removes the need for a memory_full check.
11510 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11511 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11512 (xbm_read_bitmap_data): Change locals back to 'int', since
11513 their values must fit in 'int'.
11514 (xpm_load_image, png_load, tiff_load):
11515 Invoke x_create_x_image_and_pixmap earlier,
11516 to avoid much needless work if the image is too large.
11517 (tiff_load): Treat overly large images as if
11518 x_create_x_image_and_pixmap failed, not as malloc failures.
11519 (gs_load): Use x_check_image_size.
11520
5f8f9cc2
PE
11521 * gtkutil.c: Omit integer casts.
11522 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11523 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11524
5adf60bc
PE
11525 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11526
c8907a93
PE
11527 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11528 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11529 would wrongly return t on a 64-bit host.
11530
e3c25c68
PE
11531 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11532 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11533 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11534 and therefore cause GCC to emit a bogus diagnostic in some cases.
11535
3f791afe
PE
11536 * image.c: Integer signedness and overflow and related fixes.
11537 This is not an exhaustive set of fixes, but it's time to
11538 record what I've got.
11539 (lookup_pixel_color, check_image_size): Remove redundant decls.
11540 (check_image_size): Don't assume that arbitrary EMACS_INT values
11541 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11542 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11543 (tiff_load, imagemagick_load_image):
11544 Check for overflow in size calculations.
11545 (x_create_x_image_and_pixmap): Remove unnecessary test for
11546 xmalloc returning NULL; that can't happen.
11547 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11548 (xpm_color_bucket): Use better integer hashing function.
11549 (xpm_cache_color): Don't possibly over-allocate memory.
11550 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11551 (gif_memory_source):
11552 Use ptrdiff_t, not int or size_t, to record sizes.
11553 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11554 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11555 either works, as we prefer signed integers.
11556 (tiff_read_from_memory, tiff_write_from_memory):
11557 Return tsize_t, not size_t, since that's what the TIFF API wants.
11558 (tiff_read_from_memory): Don't fail simply because the read would
11559 go past EOF; instead, return a short read.
11560 (tiff_load): Omit no-longer-needed casts.
11561 (Fimagemagick_types): Don't assume size fits into 'int'.
11562
3cc5a532
PE
11563 Improve hashing quality when configured --with-wide-int.
11564 * fns.c (hash_string): New function, taken from sxhash_string.
11565 Do not discard information about ASCII character case; this
11566 discarding is no longer needed.
11567 (sxhash-string): Use it. Change sig to match it. Caller changed.
11568 * lisp.h: Declare it.
11569 * lread.c (hash_string): Remove, since we now use fns.c's version.
11570 The fns.c version returns a wider integer if --with-wide-int is
11571 specified, so this should help the quality of the hashing a bit.
11572
b312a492
PE
11573 * emacs.c: Integer overflow minor fix.
11574 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11575 Define only if GNU_LINUX.
11576 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11577
dfd153ae
PE
11578 * dispnew.c: Integer signedness and overflow fixes.
11579 Remove unnecessary forward decls, that were a maintenance hassle.
11580 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11581 All uses changed.
11582 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11583 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11584 (prepare_desired_row, line_draw_cost):
11585 Use int, not unsigned, where either works.
11586 (save_current_matrix, restore_current_matrix):
11587 Use ptrdiff_t, not size_t, where either works.
11588 (init_display): Check for overflow more accurately, and without
11589 relying on undefined behavior.
11590
a81d11a3
PE
11591 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11592 Remove, replacing with the new symbols in lisp.h. All uses changed.
11593 * fileio.c (make_temp_name):
11594 * filelock.c (lock_file_1, lock_file):
11595 * xdisp.c (message_dolog):
11596 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11597 Use pMd etc. instead.
11598 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11599 replacing the pWIDE etc. symbols removed from editfns.c.
11600
3300e6fd
PE
11601 * keyboard.h (num_input_events): Now uintmax_t.
11602 This is (very slightly) less likely to mess up due to wraparound.
11603 All uses changed.
11604
fd05c7e9
PE
11605 * buffer.c: Integer signedness fixes.
11606 (alloc_buffer_text, enlarge_buffer_text):
11607 Use ptrdiff_t rather than size_t when either will do, as we prefer
11608 signed integers.
11609
903fe15d
PE
11610 * alloc.c: Integer signedness and overflow fixes.
11611 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11612 (__malloc_size_t): Default to size_t, not to int.
11613 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11614 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11615 Prefer ptrdiff_t to size_t when either would do, as we prefer
11616 signed integers.
11617 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11618 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11619 Now const. Initialize with values that are in range even if char
11620 is signed.
11621 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11622 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11623 These functions do the right thing with sizes > 2**32.
11624 (check_depth): Now ptrdiff_t, not int.
11625 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11626 Adjust to new way of storing sizes. Check for size overflow bugs
11627 in rest of code.
11628 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11629 slightly wrong anyway, as it missed one instance of
11630 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11631 (refill_memory_reserve): Omit needless cast to size_t.
11632 (mark_object_loop_halt): Mark as externally visible.
11633
ac82cc6a
PE
11634 * xselect.c: Integer signedness and overflow fixes.
11635 (Fx_register_dnd_atom, x_handle_dnd_message):
11636 Use ptrdiff_t, not size_t, since we prefer signed.
11637 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11638 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11639 x_dnd_atoms_size and x_dnd_atoms_length.
11640
c2d1e36d
PE
11641 * doprnt.c: Prefer signed to unsigned when either works.
11642 * eval.c (verror):
11643 * doprnt.c (doprnt):
11644 * lisp.h (doprnt):
11645 * xdisp.c (vmessage):
11646 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11647 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11648 prefer signed arithmetic to avoid comparison confusion.
11649 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11650 but is a bit tricky.
11651
0e926e56
PE
11652 Assume freestanding C89 headers, string.h, stdlib.h.
11653 * data.c, doprnt.c, floatfns.c, print.c:
11654 Include float.h unconditionally.
11655 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11656 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11657 * regex.c: Likewise for stddef.h, string.h.
11658 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11659 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11660 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11661 (STDC_HEADERS): Remove obsolete defines.
11662 * sysdep.c: Include limits.h unconditionally.
11663
9cfdb3ec
PE
11664 Assume support for memcmp, memcpy, memmove, memset.
11665 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11666 * regex.c (memcmp, memcpy):
11667 Remove; we assume C89 now.
11668
11669 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11670 (__malloc_safe_bcopy): Remove; no longer needed.
11671
cf950e6b 11672 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
11673 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11674 well either way, and we prefer signed to unsigned.
11675
dbf38e02
LMI
116762011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11677
11678 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11679 closes the connection while we're reading (bug#9182).
11680
d6f0886c 116812011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 11682
d6f0886c
JD
11683 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11684 are specified (Bug#9168).
24e0f6b1 11685
2eb1f9e6
PE
116862011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11687
11688 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11689 Found by GCC static checking and --with-wide-int on a 32-bit host.
11690
22381272 116912011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
11692
11693 * xdisp.c (compute_display_string_pos): Fix logic of caching
11694 previous display string position. Initialize cached_prev_pos to
11695 -1. Fixes slow-down at the beginning of a buffer.
11696
f25e39b4
EZ
116972011-07-24 Eli Zaretskii <eliz@gnu.org>
11698
11699 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11700 for attrs[LFACE_FONTSET_INDEX].
11701
04c4b52e
PE
117022011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11703
11704 * xml.c (parse_region): Remove unused local
11705 that was recently introduced.
11706
c1734fbd
EZ
117072011-07-23 Eli Zaretskii <eliz@gnu.org>
11708
be18c5a5
EZ
11709 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11710 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11711
c1734fbd
EZ
11712 * xdisp.c (move_it_in_display_line_to): Record the best matching
11713 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
11714 exit if none of the characters scanned was an exact match.
11715 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
11716 when exact match is impossible due to invisible text, and the
11717 lines are truncated.
11718
a258d627
JD
117192011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11720
11721 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11722 for OSX >= 10.7.
11723
b6d5a689
EZ
117242011-07-22 Eli Zaretskii <eliz@gnu.org>
11725
0f74f785
EZ
11726 Fix a significant slow-down of cursor motion with C-n, C-p,
11727 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11728 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 11729 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
11730 (next_element_from_buffer): Call compute_stop_pos_backwards to
11731 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
11732 base_level_stop.
11733 (reseat): Don't look for prev_stop, as that could mean a very long
11734 run.
11735 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11736 <cached_disp_overlay_modiff>: Cache for last found display string
11737 position.
551918c1 11738 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
11739 about the same buffer in the same area of character positions, and
11740 the buffer wasn't changed since the time the display string
11741 position was cached.
551918c1 11742
b2d0c91a
EZ
117432011-07-22 Eli Zaretskii <eliz@gnu.org>
11744
11745 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11746 is an integer, which is important for empty lines. (Bug#9149)
11747
043604ee
CY
117482011-07-22 Chong Yidong <cyd@stupidchicken.com>
11749
11750 * frame.c (Fmodify_frame_parameters): In tty case, update the
11751 default face if necessary (Bug#4238).
11752
da4adb04
CY
117532011-07-21 Chong Yidong <cyd@stupidchicken.com>
11754
11755 * editfns.c (Fstring_to_char): No need to explain what a character
11756 is in the docstring (Bug#6576).
11757
9abd0532
LMI
117582011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11759
11760 * xml.c (parse_region): Make sure we always return a tree.
11761
36881d16
HK
117622011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11763
11764 * xml.c (parse_region): If a document contains only comments,
11765 return that, too.
11766
1e98674d
LMI
117672011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11768
11769 * xml.c (make_dom): Return comments, too.
11770
590bd467
PE
117712011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11772
11773 Port to OpenBSD.
11774 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11775 and the surrounding thread.
11776 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11777 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11778 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11779 timer goes off.
11780 * s/openbsd.h (BROKEN_SIGIO): Define.
11781 * unexelf.c (unexec) [__OpenBSD__]:
11782 Don't update the .mdebug section of the Alpha COFF symbol table.
11783
f41628b2
LMI
117842011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11785
11786 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11787 (bug#8460).
11788
b59b67c5
PE
117892011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11790
15e3a074
PE
11791 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11792 This fixes some race conditions on the permissions of any newly
11793 created file.
11794
41bed37d
PE
11795 * alloc.c (valid_pointer_p): Use pipe, not open.
11796 This fixes some permissions issues when debugging.
11797
b59b67c5
PE
11798 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11799 If fchown fails to set both uid and gid, try to set just gid,
11800 as that is sometimes allowed. Adjust the file's mode to eliminate
11801 setuid or setgid bits that are inappropriate if fchown fails.
11802
925a6be7
SM
118032011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11804
11805 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11806 to compare Lisp_Objects.
11807 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11808 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11809 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11810
52968808
AS
118112011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11812
0a6a104b
AS
11813 * lread.c (read_integer): Unread even EOF character.
11814 (read1): Likewise. Properly record start position of symbol.
11815
52968808
AS
11816 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11817 symbol character follows.
11818
9e381cdd
PE
118192011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11820
11821 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11822 This works around a problem with the previous change to Fcopy_file.
11823 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11824 and without this change, GCC might complain about discarding
11825 fchown's return value.
11826
b5641435
JB
118272011-07-16 Juanma Barranquero <lekktu@gmail.com>
11828
11829 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11830
a8031457
PE
118312011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11832
11833 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11834
dd889327
LMI
118352011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11836
750c33f7
LMI
11837 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11838 it's used from the C level.
11839
dd889327
LMI
11840 * process.c: Use the same condition for POLL_FOR_INPUT in both
11841 keyboard.c and process.c (bug#1858).
11842
87e86684
LM
118432011-07-09 Lawrence Mitchell <wence@gmx.li>
11844
11845 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11846 (Fgnutls_boot): Use it.
11847
64348f40
AS
118482011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11849
11850 * doc.c (Fsubstitute_command_keys): Revert last change.
11851
1d698799
LMI
118522011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11853
f863868c
LMI
11854 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11855 quotes the next character, and doesn't affect other longer
11856 sequences (bug#8935).
11857
1d698799
LMI
11858 * lread.c (syms_of_lread): Clarify that is isn't only
11859 `eval-buffer' and `eval-defun' that's affected by
11860 `lexical-binding' (bug#8460).
11861
aa4b6df6
EZ
118622011-07-15 Eli Zaretskii <eliz@gnu.org>
11863
11864 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 11865 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 11866
5d856da6
PE
118672011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11868
ad6042bb
PE
11869 Fix minor problems found by static checking.
11870 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11871 (elsz): Now a signed constant, not a size_t var. We prefer signed
11872 types to unsigned, to avoid integer comparison confusion. Without
11873 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11874 "cannot optimize loop, the loop counter may overflow", a symptom
11875 of the confusion.
f00bbb22 11876 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
11877 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11878
6468f31c
LMI
118792011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11880
49080b10
LMI
11881 * search.c (Fre_search_backward): Mention `case-fold-search' in
11882 all the re_search_* functions (bug#8138).
11883
6468f31c
LMI
11884 * keyboard.c (Fopen_dribble_file): Document when the file is
11885 closed (bug#8056).
11886
c965adc5
EZ
118872011-07-14 Eli Zaretskii <eliz@gnu.org>
11888
df9733bf
EZ
11889 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11890 bidi_cache_idx.
11891
0bb23927
EZ
11892 Support bidi reordering of display and overlay strings.
11893 * xdisp.c (compute_display_string_pos)
11894 (compute_display_string_end): Accept additional argument STRING.
11895 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11896 (reseat_to_string): Initialize bidi_it->string.s and
11897 bidi_it->string.schars.
11898 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
11899 NULL (avoids a crash in bidi_paragraph_init).
11900 Initialize itb.string.lstring.
0bb23927
EZ
11901 (init_iterator): Call bidi_init_it only of a valid
11902 buffer position was specified. Initialize paragraph_embedding to
11903 L2R.
11904 (reseat_to_string): Initialize the bidi iterator.
11905 (display_string): If we need to ignore text properties of
11906 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11907 original value of -1 will not work with bidi.)
11908 (compute_display_string_pos): First arg is now struct
11909 `text_pos *'; all callers changed. Support display properties on
11910 Lisp strings.
11911 (compute_display_string_end): Support display properties on Lisp
11912 strings.
11913 (init_iterator, reseat_1, reseat_to_string): Initialize the
11914 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11915 when iterating on a string not from display properties).
640c8776
SM
11916 (compute_display_string_pos, compute_display_string_end):
11917 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
11918 arrow keys.
11919 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
11920 base_level_stop; instead, set base_level_stop to BEGV.
11921 Fixes crashes in vertical-motion.
0bb23927
EZ
11922 (next_element_from_buffer): Improve commentary for when
11923 the iterator is before prev_stop.
11924 (init_iterator): Initialize bidi_p from the default value of
11925 bidi-display-reordering, not from buffer-local value. Use the
11926 buffer-local value only if initializing for buffer iteration.
11927 (handle_invisible_prop): Support invisible properties on strings
11928 that are being bidi-reordered.
11929 (set_iterator_to_next): Support bidi reordering of C strings and
11930 Lisp strings.
11931 (next_element_from_string): Support bidi reordering of Lisp
11932 strings.
11933 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
11934 (display_string): Support display of R2L glyph rows.
11935 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
11936 (init_iterator): Don't initialize it->bidi_p for strings
11937 here.
11938 (reseat_to_string): Initialize it->bidi_p for strings here.
11939 (next_element_from_string, next_element_from_c_string)
11940 (next_element_from_buffer): Add xassert's for correspondence
11941 between IT's object being iterated and it->bidi_it.string
11942 structure.
11943 (face_before_or_after_it_pos): Support bidi iteration.
11944 (next_element_from_c_string): Handle the case of the first string
11945 character that is not the first one in the visual order.
11946 (get_visually_first_element): New function, refactored from common
11947 parts of next_element_from_buffer, next_element_from_string, and
11948 next_element_from_c_string.
11949 (tool_bar_lines_needed, redisplay_tool_bar)
11950 (display_menu_bar): Force left-to-right direction. Add a FIXME
11951 comment for making that be controlled by a user option.
11952 (push_it, pop_it): Save and restore the state of the
11953 bidi iterator. Save and restore the bidi_p flag.
11954 (pop_it): Iterate out of display property for string iteration as
11955 well.
11956 (iterate_out_of_display_property): Support iteration over strings.
11957 (handle_single_display_spec): Set up it->bidi_it for iteration
11958 over a display string, and call bidi_init_it.
11959 (handle_single_display_spec, next_overlay_string)
11960 (get_overlay_strings_1, push_display_prop): Set up the bidi
11961 iterator for displaying display or overlay strings.
11962 (forward_to_next_line_start): Don't use the shortcut if
11963 bidi-iterating.
11964 (back_to_previous_visible_line_start): If handle_display_prop
11965 pushed the iterator stack, restore the internal state of the bidi
11966 iterator by calling bidi_pop_it same number of times.
11967 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11968 and we are bidi-iterating, don't decrement the iterator position;
11969 instead, set the first_elt flag in the bidi iterator, to produce
11970 the same effect.
11971 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11972 (push_display_prop): xassert that we are iterating a buffer.
11973 (push_it, pop_it): Save and restore paragraph_embedding member.
11974 (handle_single_display_spec, next_overlay_string)
11975 (get_overlay_strings_1, reseat_1, reseat_to_string)
11976 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11977 correctly. Don't assume unibyte strings are not bidi-reordered.
11978 (compute_display_string_pos)
11979 (compute_display_string_end): Fix handling the case of C string.
11980 (push_it, pop_it): Save and restore from_disp_prop_p.
11981 (handle_single_display_spec, push_display_prop): Set the
11982 from_disp_prop_p flag.
11983 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11984 (pop_it): Call iterate_out_of_display_property only if we are
11985 popping after iteration over a string that came from a display
11986 property. Fix a typo in popping stretch info. Add an assertion
11987 for verifying that the iterator position is in sync with the bidi
11988 iterator.
11989 (handle_single_display_spec, get_overlay_strings_1)
11990 (push_display_prop): Fix initialization of paragraph direction for
11991 string when that of the parent object is not yet determined.
11992 (reseat_1): Call bidi_init_it to resync the bidi
11993 iterator with IT's position. (Bug#7616)
11994 (find_row_edges): If ROW->start.pos gives position
11995 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11996 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11997 Reset the from_disp_prop_p flag.
11998 (SAVE_IT, RESTORE_IT): New macros.
11999 (pos_visible_p, face_before_or_after_it_pos)
12000 (back_to_previous_visible_line_start)
12001 (move_it_in_display_line_to, move_it_in_display_line)
12002 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12003 (try_scrolling, redisplay_window, display_line): Use them when
12004 saving a temporary copy of the iterator and restoring it back.
12005 (back_to_previous_visible_line_start, reseat_1)
12006 (init_iterator): Empty the bidi cache "stack".
12007 (move_it_in_display_line_to): If iterator ended up at
12008 EOL, but we never saw any buffer positions smaller than
12009 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12010 motion in bidi-reordered lines.
12011 (move_it_in_display_line_to): Record prev_method and prev_pos
12012 immediately before the call to set_iterator_to_next. Fixes cursor
12013 motion in bidi-reordered lines with stretch glyphs and strings
12014 displayed in margins. (Bug#8133) (Bug#8867)
12015 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12016 TO_CHARPOS.
640c8776
SM
12017 (pos_visible_p): Support positions in bidi-reordered lines.
12018 Save and restore bidi cache.
0bb23927
EZ
12019
12020 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12021 (bidi_paragraph_info): Delete unused struct.
12022 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12023 (bidi_cache_start): New variable.
12024 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12025 to zero.
12026 (bidi_cache_fetch_state, bidi_cache_search)
12027 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12028 (bidi_cache_find, bidi_peek_at_next_level)
12029 (bidi_level_of_next_char, bidi_find_other_level_edge)
12030 (bidi_move_to_visually_next): Compare cache index with
12031 bidi_cache_start rather than with zero.
12032 (bidi_fetch_char): Accept new argument STRING; all callers
12033 changed. Support iteration over a string. Support strings with
12034 display properties. Support unibyte strings. Fix the type of
12035 `len' according to what STRING_CHAR_AND_LENGTH expects.
12036 (bidi_paragraph_init, bidi_resolve_explicit_1)
12037 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12038 (bidi_level_of_next_char, bidi_move_to_visually_next):
12039 Support iteration over a string.
0bb23927
EZ
12040 (bidi_set_sor_type, bidi_resolve_explicit_1)
12041 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12042 can now be zero (for strings); special values 0 and -1 were
12043 changed to -1 and -2, respectively.
12044 (bidi_char_at_pos): New function.
12045 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12046 Call it instead of FETCH_MULTIBYTE_CHAR.
12047 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12048 initialized to valid values.
12049 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12050 values.
12051 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12052 the test for valid cached positions. Fix the logic for looking up
12053 the sentinel state in the cache. GCPRO the Lisp string we are
12054 iterating.
12055 (bidi_push_it, bidi_pop_it): New functions.
12056 (bidi_initialize): Initialize the bidi cache start stack pointer.
12057 (bidi_cache_ensure_space): New function, refactored from part of
12058 bidi_cache_iterator_state. Don't assume the required size is just
12059 one BIDI_CACHE_CHUNK away.
12060 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12061 (bidi_count_bytes, bidi_char_at_pos): New functions.
12062 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12063 always valid if bidi_cache_idx is valid.
12064 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12065 is valid if it's going to be used.
12066 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12067 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12068 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12069 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12070 (bidi_find_other_level_edge, bidi_cache_start_stack):
12071 All variables related to cache indices are now EMACS_INT.
c965adc5 12072
0bb23927
EZ
12073 * dispextern.h (struct bidi_string_data): New structure.
12074 (struct bidi_it): New member `string'. Make flag members be 1-bit
12075 fields, and put them last in the struct.
640c8776
SM
12076 (compute_display_string_pos, compute_display_string_end):
12077 Update prototypes.
0bb23927
EZ
12078 (bidi_push_it, bidi_pop_it): Add prototypes.
12079 (struct iterator_stack_entry): New members bidi_p,
12080 paragraph_embedding, and from_disp_prop_p.
12081 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12082 (bidi_shelve_cache, bidi_unshelve_cache):
12083 Declare prototypes.
0bb23927
EZ
12084
12085 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12086 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12087 and vector-like objects.
12088
12089 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12090 cache around display iteration.
12091
12092 * window.c (Fwindow_end, window_scroll_pixel_based)
12093 (displayed_window_lines, Frecenter): Save and restore the bidi
12094 cache around display iteration.
12095
3bbd2265
LMI
120962011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12097
12098 * editfns.c (Fdelete_region): Clarify the use of the named
12099 parameters (bug#6788).
12100
adc47434
MR
121012011-07-14 Martin Rudalics <rudalics@gmx.at>
12102
12103 * indent.c (Fvertical_motion): Set and restore w->pointm when
12104 saving and restoring the window's buffer (Bug#9006).
12105
837c31f8
LMI
121062011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12107
12108 * editfns.c (Fstring_to_char): Clarify just what is returned
12109 (bug#6576). Text by Eli Zaretskii.
12110
ac389d0c
JB
121112011-07-13 Juanma Barranquero <lekktu@gmail.com>
12112
12113 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12114
0be0ce47
EZ
121152011-07-13 Eli Zaretskii <eliz@gnu.org>
12116
12117 * buffer.c (mmap_find): Fix a typo.
12118
cd18e7e3
JB
121192011-07-13 Johan Bockgård <bojohan@gnu.org>
12120
12121 Fix execution of x selection hooks.
12122 * xselect.c (Qx_lost_selection_functions)
12123 (Qx_sent_selection_functions): New vars.
12124 (syms_of_xselect): DEFSYM them.
12125 (x_handle_selection_request): Pass Qx_sent_selection_functions
12126 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12127 (x_handle_selection_clear,x_clear_frame_selections):
12128 Pass Qx_lost_selection_functions rather than
12129 Vx_lost_selection_functions to Frun_hook_with_args.
12130
47ea7f44
PE
121312011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12132
ac389d0c 12133 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12134 The old code sometimes used this field without initializing it.
12135
47ea7f44
PE
12136 * alloc.c (gc_sweep): Don't read past end of array.
12137 In theory, the old code could also have corrupted Emacs internals,
12138 though it'd be very unlikely.
12139
bc985c87
AS
121402011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12141
12142 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12143 argument. (Bug#4026)
bc985c87 12144
0cf34688
LMI
121452011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12146
b3dadd76
LMI
12147 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12148 key" (bug#4257).
12149
0cf34688
LMI
12150 * window.c (Fset_window_start): Doc fix (bug#4199).
12151 (Fset_window_hscroll): Ditto.
12152
270768cd
PE
121532011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12154
077e3dda 12155 Fix minor new problems caught by GCC 4.6.1.
270768cd 12156 * term.c (init_tty): Remove unused local.
490011a6 12157 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12158 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12159 not used otherwise.
270768cd 12160
b1f58454
CY
121612011-07-12 Chong Yidong <cyd@stupidchicken.com>
12162
12163 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12164
22b9578d
LMI
121652011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12166
6e70ab07
LMI
12167 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12168 are the mini-buffer and the echo area (bug#3320).
12169
22b9578d
LMI
12170 * term.c (init_tty): Remove support for supdup, c10 and perq
12171 terminals, which are no longer supported (bug#1482).
12172
8974cc9f
JB
121732011-07-10 Johan Bockgård <bojohan@gnu.org>
12174
12175 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12176
a560d974
JD
121772011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12178
12179 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12180 for non-popups (Bug#3642).
12181
1dae0f0a
AS
121822011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12183
268c2c36 12184 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12185 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12186 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12187 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12188 * data.c (fmod): Likewise.
12189 * dispnew.c (swap_glyphs_in_rows): Likewise.
12190 * emacs.c (memory_warning_signal): Likewise.
12191 * floatfns.c (float_error): Likewise.
12192 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12193 (otf_open, font_otf_capability, generate_otf_features)
12194 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12195 Likewise.
12196 * image.c (pbm_read_file): Likewise.
12197 * indent.c (string_display_width): Likewise.
12198 * intervals.c (check_for_interval, search_for_interval)
12199 (inc_interval_count, count_intervals, root_interval)
12200 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12201 * lread.c (defalias): Likewise.
268c2c36 12202 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12203 * regex.c (set_image_of_range_1, set_image_of_range)
12204 (regex_grow_registers): Likewise.
12205 * sysdep.c (strerror): Likewise.
12206 * termcap.c (valid_filename_p, tprint, main): Likewise.
12207 * tparam.c (main): Likewise.
12208 * unexhp9k800.c (run_time_remap, save_data_space)
12209 (update_file_ptrs, read_header, write_header, calculate_checksum)
12210 (copy_file, copy_rest, display_header): Likewise.
12211 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12212 Likewise.
12213 * xdisp.c (check_it): Likewise.
12214 * xfaces.c (register_color, unregister_color, unregister_colors):
12215 Likewise.
12216 * xfns.c (print_fontset_result): Likewise.
12217 * xrdb.c (member, fatal, main): Likewise.
12218
99033785
PE
122192011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12220
12221 Fix minor problems found by static checking (Bug#9031).
12222 * chartab.c (char_table_set_range, map_sub_char_table):
12223 Remove unused locals.
12224 (uniprop_table): Now static.
12225 * composite.c (_work_char): Remove unused static var.
12226
9cb2ac56
JB
122272011-07-09 Juanma Barranquero <lekktu@gmail.com>
12228
12229 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12230
f25661f0
JD
122312011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12232
12233 * gtkutil.c (qttip_cb): Remove code without function.
12234
8278c4fe
EZ
122352011-07-09 Eli Zaretskii <eliz@gnu.org>
12236
12237 * w32.c (pthread_sigmask): New stub.
12238
1692ae2d 122392011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12240
8a6ebd58 12241 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12242 sigprocmask is portable only for single-threaded applications, and
12243 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12244 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12245 (LIBES): Use it.
12246 * callproc.c (Fcall_process):
12247 * process.c (create_process):
12248 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12249 Use pthread_sigmask, not sigprocmask.
123403e4 12250
1b854618
JD
122512011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12252
12253 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12254 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12255 wrong (Bug#8591).
12256
3fe4b549
JD
122572011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12258
0ce7e563
JD
12259 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12260 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12261 (xg_hide_tooltip): Fix comment.
12262
3fe4b549
JD
12263 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12264 in registerServicesMenuSendTypes.
12265 (validRequestorForSendType): Don't check ns_return_types.
12266
12267 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12268 ns_return_type.
12269
5df75e47
JR
122702011-07-08 Jason Rumney <jasonr@gnu.org>
12271
22610910
JR
12272 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12273 SH_SHOW for hidden windows (Bug#5482).
12274
5df75e47
JR
12275 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12276 frame struct members of non-existent frames (Bug#6284).
12277
699c10bd
JD
122782011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12279
4393663b
JD
12280 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12281 variable firstTime not needed on OSX >= 10.6.
12282 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12283 >= 10.5. Use setKnobProportion, setDoubleValue.
12284
12285 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12286 (MAC_OS_X_VERSION_10_5): Define if not defined.
12287 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12288 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12289 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12290
12291 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12292 cString and lossyCString on OSX >= 10.4.
4393663b 12293
58179cce 12294 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12295 sizeToFit on OSX >= 10.2.
12296
12297 * nsimage.m (allocInitFromFile): Don't use deprecated method
12298 bestRepresentationForDevice on OSX >= 10.6.
12299
12300 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12301 to avoid warning.
12302
12303 * emacs.c: Declare unexec_init_emacs_zone.
12304
a63e0781
JD
12305 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12306
699c10bd
JD
12307 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12308
12309 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12310 on svcsMenu (Bug#8842).
12311
12312 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12313 ns_return_types.
12314 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12315
12316 * nsterm.m (QUTF8_STRING): Declare.
12317 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12318 (validRequestorForSendType): Return type is (id).
12319 Change indexOfObjectIdenticalTo to indexOfObject.
12320 Check if we have local selection before returning self (Bug#8842).
12321 (writeSelectionToPasteboard): Put local selection into paste board
12322 if we have a local selection (Bug#8842).
12323 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12324
12325 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12326 (ns_get_local_selection): Declare.
12327
54e10184
LMI
123282011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12329
9888ff71
LMI
12330 * keymap.c (describe_map_tree): Don't insert a double newline at
12331 the end of the buffer (bug#1169) and return whether we inserted
12332 something.
12333
54e10184
LMI
12334 * callint.c (Fcall_interactively): Change "reading args" to
12335 "providing args" to try to clarify what it does (bug#1010).
12336
15fa4783
KH
123372011-07-07 Kenichi Handa <handa@m17n.org>
12338
12339 * composite.c (composition_compute_stop_pos): Ignore a static
12340 composition starting before CHARPOS (Bug#8915).
12341
12342 * xdisp.c (handle_composition_prop): Likewise.
12343
a8815b00
EZ
123442011-07-07 Eli Zaretskii <eliz@gnu.org>
12345
12346 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12347 (Bug#9015)
12348
ef7b981d 123492011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12350
12351 * character.h (unicode_category_t): New enum type.
12352
12353 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12354 (Qchar_code_property_table): New variable.
12355 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12356 (UNIPROP_COMPRESSED_FORM_P): New macros.
12357 (char_table_ascii): Uncompress the compressed values.
12358 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12359 Uncompress the compressed values.
ac389d0c 12360 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12361 (char_table_ref_and_range): Uncompress the compressed values.
12362 (sub_char_table_set): New arg is_uniprop. Callers changed.
12363 Uncompress the compressed values.
12364 (sub_char_table_set_range): Args changed. Callers changed.
12365 (char_table_set_range): Adjuted for the above change.
12366 (map_sub_char_table): Delete args default_val and parent. Add arg
12367 top. Give decoded values to a Lisp function.
640c8776 12368 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
12369 values to a Lisp function. Gcpro more variables.
12370 (uniprop_table_uncompress)
12371 (uniprop_decode_value_run_length): New functions.
12372 (uniprop_decoder, uniprop_decoder_count): New variables.
12373 (uniprop_get_decoder, uniprop_encode_value_character)
12374 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12375 New functions.
12376 (uniprop_encoder, uniprop_encoder_count): New variables.
12377 (uniprop_get_encoder, uniprop_table)
12378 (Funicode_property_table_internal, Fget_unicode_property_internal)
12379 (Fput_unicode_property_internal): New functions.
12380 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12381 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 12382 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
12383 char-code-property-alist.
12384
640c8776 12385 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
12386 Vunicode_category_table.
12387
640c8776 12388 * font.c (font_range): Adjust for the change of
c805dec0
KH
12389 Vunicode_category_table.
12390
76b397fb
DN
123912011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12392
12393 * m/iris4d.h: Remove file, move contents ...
12394 * s/irix6-5.h: ... here.
12395
22b4128e
PE
123962011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12397
12398 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
12399 * alloc.c (mark_buffer):
12400 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12401 (clone_per_buffer_values): Don't assume that
22b4128e
PE
12402 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12403 This isn't true in general, and it's particularly not true
12404 if Emacs is configured with --with-wide-int.
12405 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12406 New macros, used in the buffer.c change.
12407
869795d6
JD
124082011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12409
12410 * xsettings.c: Use both GConf and GSettings if both are available.
12411 (store_config_changed_event): Add comment.
12412 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12413 (store_tool_bar_style_changed): New functions.
5e617bc2 12414 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
12415 (struct xsettings): Move font inside HAVE_XFT.
12416 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 12417 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 12418 Move inside HAVE_XFT.
640c8776 12419 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
12420 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12421 also.
12422 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 12423 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 12424 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
12425 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12426 (parse_settings): Move check for font inside HAVE_XFT.
12427 (read_settings, apply_xft_settings): Add comment.
12428 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12429 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12430 call store_font_name_changed.
12431 (xft_settings_event): Add comment.
12432 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12433 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12434 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12435 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12436 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
12437 (xsettings_get_system_font, xsettings_get_system_normal_font):
12438 Add comment.
869795d6 12439
d8ed26bd
PE
124402011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12441
12442 Random fixes. E.g., (random) never returned negative values.
12443 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12444 subseconds part to the entropy, as that's a bit more random.
12445 Prefer signed to unsigned, since the signedness doesn't matter and
12446 in general we prefer signed. When given a limit, use a
12447 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12448 latter isn't right if USE_2_TAGS_FOR_INTS.
12449 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12450 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12451
cabf1cac
SM
124522011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12453
12454 * textprop.c (text_property_stickiness):
12455 Obey Vtext_property_default_nonsticky.
12456 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12457 * w32fns.c (syms_of_w32fns):
12458 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12459
6e9b2be9
PE
124602011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12461
12462 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12463 This is more efficient than Ffile_directory_p and avoids a minor race.
12464
90186c68
LMI
124652011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12466
7c301272
LMI
12467 * buffer.c (Foverlay_put): Say what the return value is
12468 (bug#7835).
12469
c4f2d8d4
LMI
12470 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12471 is a directory before asking whether to use the file name
12472 (bug#7564).
ad637907
LMI
12473 (barf_or_query_if_file_exists): Make the "File is a directory"
12474 error be more correct.
c4f2d8d4 12475
90186c68
LMI
12476 * fns.c (Frequire): Remove the mention of the .gz files, since
12477 that's installation-specific, but keep the mention of
12478 `get-load-suffixes'.
12479
da64016e
PE
124802011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12481
12482 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12483 Report string overflow if the output is too long.
12484
7d47b580
JB
124852011-07-04 Juanma Barranquero <lekktu@gmail.com>
12486
a555cb87
JB
12487 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12488 (syms_of_gnutls): Remove duplicate DEFSYM for
12489 Qgnutls_bootprop_verify_hostname_error, an error for
12490 Qgnutls_bootprop_verify_error (which is no longer used).
12491
7d47b580
JB
12492 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12493 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12494 Also (re)move comments that are misplaced or no longer relevant.
12495
1e49bfab
LMI
124962011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12497
12498 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12499
1485f4c0
CY
125002011-07-03 Chong Yidong <cyd@stupidchicken.com>
12501
12502 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12503 and background color parameters if they have been changed.
12504
a9ab721e
LMI
125052011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12506
12507 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12508
cf7cff57
PE
125092011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12510
2e13213d
PE
12511 * xsettings.c (SYSTEM_FONT): Define only when used.
12512 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12513
cf7cff57
PE
12514 * keymap.c (access_keymap_1): Now static.
12515
7a8e04f7
CY
125162011-07-02 Chong Yidong <cyd@stupidchicken.com>
12517
12518 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12519 leave any prefix arg for the up event (Bug#1586).
12520
61352f62
LMI
125212011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12522
69bb1ef7
LMI
12523 * lread.c (syms_of_lread): Mention single symbols defined by
12524 `defvar' or `defconst' (bug#7154).
12525
61352f62 12526 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 12527 (Frequire): Mention get-load-suffixes.
61352f62 12528
28545e04
MR
125292011-07-02 Martin Rudalics <rudalics@gmx.at>
12530
12531 * window.h (window): Remove clone_number slot.
12532 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12533 Remove.
12534 (make_parent_window, make_window, saved_window)
12535 (Fset_window_configuration, save_window_save): Don't deal with
12536 clone numbers.
12537 * buffer.c (Qclone_number): Remove declaration.
12538 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12539
3349e122
SM
125402011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12541
12542 Add multiple inheritance to keymaps.
12543 * keymap.c (Fmake_composed_keymap): New function.
12544 (Fset_keymap_parent): Simplify.
12545 (fix_submap_inheritance): Remove.
12546 (access_keymap_1): New function extracted from access_keymap to handle
12547 embedded parents and handle lists of maps.
12548 (access_keymap): Use it.
12549 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12550 (Fcopy_keymap): Handle embedded parents.
12551 (Fcommand_remapping, define_as_prefix): Simplify.
12552 (Fkey_binding): Simplify.
12553 (syms_of_keymap): Move minibuffer-local-completion-map,
12554 minibuffer-local-filename-completion-map,
12555 minibuffer-local-must-match-map, and
12556 minibuffer-local-filename-must-match-map to Elisp.
12557 (syms_of_keymap): Defsubr make-composed-keymap.
12558 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12559 (parse_menu_item): Trivial simplification.
12560
3279eb87
GM
125612011-07-01 Glenn Morris <rgm@gnu.org>
12562
12563 * Makefile.in (SETTINGS_LIBS): Fix typo.
12564
39cb9e56 125652011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
12566
12567 * coding.c (Fencode_coding_string): Record the last coding system
12568 used, as the function doc string says (bug#8738).
12569
0949d2b6
JD
125702011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12571
12572 * xsettings.c (store_monospaced_changed): Take new font as arg and
12573 check for change against current_mono_font.
12574 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12575 (emacs_settings_constructor, emacs_settings_get_property)
12576 (emacs_settings_set_property, emacs_settings_class_init)
12577 (emacs_settings_init, gsettings_obj): Remove.
12578 (something_changedCB): New function for HAVE_GSETTINGS.
12579 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12580 with value as argument.
12581 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12582 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 12583 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
12584 "changed".
12585
12586 * xgselect.c: Add defined (HAVE_GSETTINGS).
12587 (xgselect_initialize): Ditto.
12588
12589 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12590 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12591 xg_select.
12592
bbc6b304
PE
125932011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12594
12595 * eval.c (struct backtrace): Simplify and port the data structure.
12596 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12597 signed bit field, as this assumption is not portable and it makes
12598 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12599 "char debug_on_exit : 1" as this is not portable either; instead,
12600 use the portable "unsigned int debug_on_exit : 1". Remove unused
12601 member evalargs. Remove obsolete comments about cc bombing out.
12602
9851bfc5
JD
126032011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12604
51bb811f 12605 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
12606 Let HAVE_GSETTINGS override HAVE_GCONF.
12607 (store_monospaced_changed): New function.
12608 (EMACS_SETTINGS): A new type derived from GObject to handle
12609 GSettings notifications.
12610 (emacs_settings_constructor, emacs_settings_get_property)
12611 (emacs_settings_set_property, emacs_settings_class_init):
12612 New functions.
12613 (gsettings_client, gsettings_obj): New variables.
12614 (GSETTINGS_SCHEMA): New define.
12615 (something_changedCB): Call store_monospaced_changed.
12616 (init_gsettings): New function.
12617 (xsettings_initialize): Call init_gsettings.
12618 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12619 to NULL.
12620
640c8776 12621 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
12622 GCONF_CFLAGS/LIBS.
12623
5386012d
MR
126242011-06-29 Martin Rudalics <rudalics@gmx.at>
12625
12626 * window.c (resize_root_window, grow_mini_window)
12627 (shrink_mini_window): Rename Qresize_root_window to
12628 Qwindow_resize_root_window and Qresize_root_window_vertically to
12629 Qwindow_resize_root_window_vertically.
12630
f13e0b08
PE
126312011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12632
12633 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12634
94515237
JB
126352011-06-27 Juanma Barranquero <lekktu@gmail.com>
12636
12637 * makefile.w32-in: Redesign dependencies so they reflect more
12638 clearly which files are directly included by each source file,
12639 and not through other includes.
12640
e43b6e43
MR
126412011-06-27 Martin Rudalics <rudalics@gmx.at>
12642
12643 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12644 (sort_overlays, overlay_strings): When an overlay's clone number
12645 matches the window's clone number process the overlay even if
12646 the overlay's window property doesn't match the current window.
12647
d68443dc
MR
12648 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12649 (Fwindow_hchild): Rename to Fwindow_left_child.
12650 (Fwindow_next): Rename to Fwindow_next_sibling.
12651 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
12652 (resize_window_check): Rename to window_resize_check.
12653 (resize_window_apply): Rename to window_resize_apply.
12654 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12655 (Fdelete_other_windows_internal, resize_frame_windows)
12656 (Fsplit_window_internal, Fdelete_window_internal)
12657 (grow_mini_window, shrink_mini_window)
12658 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 12659
c7e73be5
JD
126602011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12661
12662 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12663 (emacs_fixed_set_min_size): Remove.
12664 (emacs_fixed_new): Take frame as argument.
12665
12666 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12667 (_EmacsFixedPrivate): Remove minwidth/height.
12668 Add struct frame *f.
12669 (emacs_fixed_init): Initialize priv->f.
12670 (get_parent_class, emacs_fixed_set_min_size): Remove.
12671 (emacs_fixed_new): Set priv->f to argument.
12672 (emacs_fixed_get_preferred_width)
12673 (emacs_fixed_get_preferred_height): Use min_width/height from
12674 frames size_hint to set minimum and natural (Bug#8919).
12675 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12676 and use min_width/height from frames size_hint to set
12677 min_width/height (Bug#8919).
12678
12679 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
12680 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12681 Fix indentation.
c7e73be5 12682
cf99dcf8
EZ
126832011-06-26 Eli Zaretskii <eliz@gnu.org>
12684
12685 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12686 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12687 called at ZV.
12688
029529ac
CY
126892011-06-26 Chong Yidong <cyd@stupidchicken.com>
12690
12691 * process.c (wait_reading_process_output): Bypass select if
12692 waiting for a cell while ignoring keyboard input, and input is
12693 pending. Suggested by Jan Djärv (Bug#8869).
12694
7a7ef429
PE
126952011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12696
12697 Use gnulib's dup2 module instead of rolling our own.
12698 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12699
11fdef7d 127002011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
12701
12702 * dispnew.c (scrolling_window): Before scrolling, turn off a
12703 mouse-highlight in the window being scrolled.
12704
cd3520a4
JB
127052011-06-24 Juanma Barranquero <lekktu@gmail.com>
12706
12707 Move DEFSYM to lisp.h and use everywhere.
12708
12709 * character.h (DEFSYM): Move declaration...
12710 * lisp.h (DEFSYM): ...here.
12711
12712 * gnutls.c:
12713 * minibuf.c:
12714 * w32menu.c:
12715 * w32proc.c:
12716 * w32select.c: Don't include character.h.
12717
12718 * alloc.c (syms_of_alloc):
12719 * buffer.c (syms_of_buffer):
12720 * bytecode.c (syms_of_bytecode):
12721 * callint.c (syms_of_callint):
12722 * casefiddle.c (syms_of_casefiddle):
12723 * casetab.c (init_casetab_once):
12724 * category.c (init_category_once, syms_of_category):
12725 * ccl.c (syms_of_ccl):
12726 * cmds.c (syms_of_cmds):
12727 * composite.c (syms_of_composite):
12728 * dbusbind.c (syms_of_dbusbind):
12729 * dired.c (syms_of_dired):
12730 * dispnew.c (syms_of_display):
12731 * doc.c (syms_of_doc):
12732 * editfns.c (syms_of_editfns):
12733 * emacs.c (syms_of_emacs):
12734 * eval.c (syms_of_eval):
12735 * fileio.c (syms_of_fileio):
12736 * fns.c (syms_of_fns):
12737 * frame.c (syms_of_frame):
12738 * fringe.c (syms_of_fringe):
12739 * insdel.c (syms_of_insdel):
12740 * keymap.c (syms_of_keymap):
12741 * lread.c (init_obarray, syms_of_lread):
12742 * macros.c (syms_of_macros):
12743 * msdos.c (syms_of_msdos):
12744 * print.c (syms_of_print):
12745 * process.c (syms_of_process):
12746 * search.c (syms_of_search):
12747 * sound.c (syms_of_sound):
12748 * syntax.c (init_syntax_once, syms_of_syntax):
12749 * terminal.c (syms_of_terminal):
12750 * textprop.c (syms_of_textprop):
12751 * undo.c (syms_of_undo):
12752 * w32.c (globals_of_w32):
12753 * window.c (syms_of_window):
12754 * xdisp.c (syms_of_xdisp):
12755 * xfaces.c (syms_of_xfaces):
12756 * xfns.c (syms_of_xfns):
12757 * xmenu.c (syms_of_xmenu):
12758 * xsettings.c (syms_of_xsettings):
12759 * xterm.c (syms_of_xterm): Use DEFSYM.
12760
4228cf16
TZ
127612011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12762
cd3520a4 12763 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 12764
7fcccf1e
PE
127652011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12766
7efb4e0e
PE
12767 Integer and buffer overflow fixes (Bug#8873).
12768
ff5844ad
PE
12769 * print.c (printchar, strout): Check for string overflow.
12770 (PRINTPREPARE, printchar, strout):
12771 Don't set size unless allocation succeeds.
12772
90532f02
PE
12773 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12774 for sizes. Check for string overflow more accurately.
12775 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12776
6d84508d
PE
12777 * macros.c: Integer and buffer overflow fixes.
12778 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12779 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12780 Use ptrdiff_t, not int, for sizes.
12781 Don't increment bufsize until after realloc succeeds.
12782 Check for size-calculation overflow.
12783 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12784
437b2cb4
PE
12785 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12786
8b9ac8b4
PE
12787 * lread.c: Integer overflow fixes.
12788 (read_integer): Radix is now EMACS_INT, not int,
12789 to improve quality of diagnostics for out-of-range radices.
12790 Calculate buffer size correctly for out-of-range radices.
12791 (read1): Check for integer overflow in radices, and in
12792 read-circle numbers.
82cb60d3
PE
12793 (read_escape): Avoid int overflow.
12794 (Fload, openp, read_buffer_size, read1)
12795 (substitute_object_recurse, read_vector, read_list, map_obarray):
12796 Use ptrdiff_t, not int, for sizes.
12797 (read1): Use EMACS_INT, not int, for sizes.
20270765 12798 Check for size overflow.
8b9ac8b4 12799
7fcccf1e
PE
12800 * image.c (cache_image): Check for size arithmetic overflow.
12801
bfbbd7e7
PE
12802 * lread.c: Integer overflow issues.
12803 (saved_doc_string_size, saved_doc_string_length)
12804 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12805 Now ptrdiff_t, not int.
12806 (read1): Don't assume doc string length fits in int. Check for
12807 out-of-range doc string lengths.
12808 (read_list): Don't assume file position fits in int.
39019e54 12809 (read_escape): Check for hex character overflow.
bfbbd7e7 12810
4e323265
LL
128112011-06-22 Leo Liu <sdl.web@gmail.com>
12812
12813 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12814 Move to minibuffer.el.
12815
85fece3e
PE
128162011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12817
20b84ce9 12818 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
12819 The following patches are for when GLYPH_DEBUG && !XASSERT.
12820 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12821 * dispnew.c (flush_stdout):
12822 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12823 Mark as externally visible.
12824 * dispnew.c (check_window_matrix_pointers): Now static.
12825 * dispnew.c (window_to_frame_vpos):
12826 * xfns.c (unwind_create_frame):
12827 * xterm.c (x_check_font): Remove unused local.
12828 * scroll.c (CHECK_BOUNDS):
12829 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12830 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12831 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12832 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12833 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12834 Now static.
12835 (debug_method_add): Use va_list and vsprintf rather than relying
12836 on undefined behavior with wrong number of arguments.
12837 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12838 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12839 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12840 since we're not interested in debugging glyphs with old libraries.
12841 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12842 GCC 4.6.0's static checking.
12843
0766b489
PE
128442011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12845
31fd4b32
PE
12846 Integer overflow and signedness fixes (Bug#8873).
12847 A few related buffer overrun fixes, too.
12848
b79e8648
PE
12849 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12850
0766b489
PE
12851 * dispextern.h (struct face.stipple):
12852 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12853 (x_bitmap_mask, x_allocate_bitmap_record)
12854 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12855 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12856 (x_create_bitmap_from_xpm_data):
12857 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12858 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12859 (.bitmaps_last):
12860 * xfaces.c (load_pixmap):
12861 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12862 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12863 (.bitmaps_last, struct x_output.icon_bitmap):
12864 Use ptrdiff_t, not int, for bitmap indexes.
12865 (x_allocate_bitmap_record): Check for size overflow.
12866 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12867
b081724f
PE
12868 Use ptrdiff_t, not int, for overlay counts.
12869 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12870 * editfns.c (overlays_around, get_pos_property):
12871 * textprop.c (get_char_property_and_overlay):
12872 * xdisp.c (next_overlay_change, note_mouse_highlight):
12873 * xfaces.c (face_at_buffer_position):
21514da7
PE
12874 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12875 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12876 (Fnext_overlay_change, Fprevious_overlay_change)
12877 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 12878 Use ptrdiff_t, not int, for sizes.
21514da7 12879 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 12880
3de73e5e
PE
12881 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12882
2606c57b
PE
12883 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12884 (x_session_initialize): Do not assume string length fits in int.
12885
aaafe47a
PE
12886 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12887 This is unlikely, but can occur if DPI is outlandish.
12888
2674ddc8 12889 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
12890 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12891
28154962
PE
12892 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12893 * xrdb.c (magic_file_p, search_magic_path):
12894 Omit last arg SUFFIX; it was always 0. All callers changed.
12895 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12896
7de51af5
PE
12897 * xfont.c (xfont_match): Avoid need for strlen.
12898
25ed6cc3
PE
12899 * xfns.c: Don't assume strlen fits in int.
12900 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12901
4eab31dd
PE
12902 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12903 not unsigned long, as we prefer signed integers. All callers changed.
12904 Detect integer overflow in repeat count.
12905 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 12906 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 12907
171e2a58
PE
12908 * termcap.c: Don't assume sizes fit in int and never overflow.
12909 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12910 (gobble_line): Check for size-calculation overflow.
12911
ad39faca 12912 * minibuf.c (Fread_buffer):
6e5bb2dc 12913 * lread.c (intern, intern_c_string):
74ca2eb3
PE
12914 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12915 Don't assume string length fits in int.
12916
52c61c22 12917 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
12918 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12919
b5b8c9e5
PE
12920 * font.c: Don't assume string length fits in int.
12921 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12922 Use ptrdiff_t, not int.
ccd6111c
PE
12923 (font_intern_prop): Don't assume string length fits in int.
12924 Don't assume integer property fits in fixnum.
12925 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 12926
882f0d81 12927 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 12928 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
12929 Reformulate so as not to need the command string.
12930 Invoke gzip -cd rather than gunzip, as it's more portable.
12931 (lock_info_type, lock_file_1, lock_file):
12932 Don't assume pid_t and time_t fit in unsigned long.
12933 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12934 (current_lock_owner): Prefer signed type for sizes.
12935 Use memcpy, not strncpy, where memcpy is what is really wanted.
12936 Don't assume (via atoi) that time_t and pid_t fit in int.
12937 Check for time_t and/or pid_t out of range, e.g., via a network share.
12938 Don't alloca where an auto var works fine.
12939
93f4cf88
PE
12940 * fileio.c: Fix some integer overflow issues.
12941 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12942 Don't assume string length fits in int.
12943 (directory_file_name): Don't assume string length fits in long.
12944 (make_temp_name): Don't assume pid fits in int, or that its print
12945 length is less than 20.
12946
f3e92b69
PE
12947 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12948
1bfdaf10
PE
12949 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12950
35016e9a
PE
12951 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12952
3d1e65a1
PE
12953 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12954 We prefer signed integers, even for size calculations.
12955
0b963a93
PE
12956 * emacs.c: Don't assume string length fits in 'int'.
12957 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12958 (main): Don't invoke strlen when not needed.
12959
573f4b54
PE
12960 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12961 (XD_DEBUG_MESSAGE): Don't waste a byte.
12962
989f33ba
PE
12963 * callproc.c (getenv_internal_1, getenv_internal)
12964 (Fgetenv_internal):
965d34eb
PE
12965 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12966
e4d29b33
PE
12967 * lread.c (invalid_syntax): Omit length argument.
12968 All uses changed. This doesn't fix a bug, but it simplifies the
12969 code away from its former Hollerith-constant appearance, and it's
12970 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 12971 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 12972
eb49b136
PE
12973 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12974 This didn't break anything, but it didn't help either.
12975 It's confusing to put a bogus integer in a place where the actual
12976 value does not matter.
9f62aeb1 12977 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 12978 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 12979
15375a22
PE
12980 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12981 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12982 implementation.
b61cc01c
PE
12983 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12984 We prefer signed types, and the value cannot exceed the EMACS_INT
12985 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
12986 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12987 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12988 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 12989
53b2623d
PE
12990 * indent.c (sane_tab_width): New function.
12991 (current_column, scan_for_column, Findent_to, position_indentation)
12992 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 12993 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 12994
51cab52b 12995 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 12996
f2ed8a70
PE
12997 * lisp.h (lint_assume): New macro.
12998 * composite.c (composition_gstring_put_cache):
12999 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13000
abe80cc6
PE
13001 * editfns.c, insdel.c:
13002 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13003
b02c740e
PE
13004 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13005
ebc96716
PE
13006 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13007
b4e50fa0 13008 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13009 Use much-faster test for byte-length change.
311d5d7c 13010 Don't assume string byte-length fits in 'int'.
a4cf38e4 13011 Check that character arg fits in 'int'.
85461888 13012 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13013
c0c1ee9f
PE
13014 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13015
a498d7f4
PE
13016 * fns.c (concat): Catch string overflow earlier.
13017 Do not rely on integer wraparound.
13018
51cab52b
PE
13019 * dispextern.h (struct it.overlay_strings_charpos)
13020 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13021 * xdisp.c (forward_to_next_line_start)
13022 (back_to_previous_visible_line_start)
13023 (reseat_at_next_visible_line_start, next_element_from_buffer):
13024 Don't arbitrarily truncate the value of 'selective' to int.
13025
76031fad
PE
13026 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13027
5eb55db9
PE
13028 * composite.c: Don't truncate sizes to 'int'.
13029 (composition_gstring_p, composition_reseat_it)
13030 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13031 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13032 not EMACS_UINT, for indexes.
5eb55db9 13033
0703a717
PE
13034 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13035
d6202519
PE
13036 * buffer.c: Include <verify.h>.
13037 (struct sortvec.priority, struct sortstr.priority):
8961a454 13038 Now EMACS_INT, not int.
c20998a7 13039 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13040 (struct sortstr.size, record_overlay_string)
13041 (struct sortstrlist.size, struct sortlist.used):
13042 Don't truncate size to int.
13043 (record_overlay_string): Check for size-calculation overflow.
d6202519 13044 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13045
d5a19415
JM
130462011-06-22 Jim Meyering <meyering@redhat.com>
13047
029529ac 13048 Don't leak an XBM-image-sized buffer
d5a19415
JM
13049 * image.c (xbm_load): Free the image buffer after using it.
13050
a9041e6c
PE
130512011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13052
13053 Port to Sun C.
13054 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13055 that Sun C diagnosed.
13056 * fns.c (secure_hash): Fix pointer signedness issue.
13057 * intervals.c (static_offset_intervals): New function.
13058 (offset_intervals): Use it.
13059
7f3f739f
LL
130602011-06-21 Leo Liu <sdl.web@gmail.com>
13061
13062 * deps.mk (fns.o):
13063 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13064 sha512.h.
13065
13066 * fns.c (secure_hash): Rename from crypto_hash_function and change
13067 the first arg to accept symbols.
5b66d427 13068 (Fsecure_hash): New primitive.
7f3f739f
LL
13069 (syms_of_fns): New symbols.
13070
76147d94
DD
130712011-06-20 Deniz Dogan <deniz@dogan.se>
13072
13073 * process.c (Fset_process_buffer): Clarify return value in
13074 docstring.
13075
7d7d0045
CY
130762011-06-18 Chong Yidong <cyd@stupidchicken.com>
13077
13078 * dispnew.c (add_window_display_history): Use BVAR.
13079
13080 * xdisp.c (debug_method_add): Use BVAR.
13081 (check_window_end, dump_glyph_matrix, dump_glyph)
13082 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13083
13084 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13085 Likewise.
13086
13087 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13088 check till after the cache is created in init_frame_faces.
13089
ff2bc410
SM
130902011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13091
13092 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13093
28177add
PE
130942011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13095
dd3482fe
PE
13096 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13097 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13098 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13099
393d71f3 13100 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13101 * fileio.c (Finsert_file_contents):
13102 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13103 Remove the old (too-loose) buffer overflow checks.
13104 They weren't needed, since make_gap checks for buffer overflow.
13105 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13106 The old code merely checked for Emacs fixnum overflow, and relied
13107 on undefined (wraparound) behavior. The new code avoids undefined
13108 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13109
2e6813b0 13110 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13111 Tune. Don't use wider integers than needed. Don't use alloca.
13112 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13113
599a9e4f
PE
13114 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13115
99561444
PE
13116 * insdel.c, lisp.h (buffer_overflow): New function.
13117 (insert_from_buffer_1, replace_range, replace_range_2):
13118 * insdel.c (make_gap_larger):
13119 * editfns.c (Finsert_char):
13120 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13121
28177add
PE
13122 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13123
e69dafad
PE
131242011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13125
4baa020d 13126 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13127
b1c46f02
PE
13128 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13129 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13130
e69dafad
PE
13131 * fileio.c: Don't assume EMACS_INT fits in off_t.
13132 (emacs_lseek): New static function.
13133 (Finsert_file_contents, Fwrite_region): Use it.
13134 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13135
566684ea
PE
13136 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13137
e6966cd6
PE
13138 * fns.c: Don't overflow int when computing a list length.
13139 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13140 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13141 truncation on 64-bit hosts. Check for QUIT every
13142 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13143 faster and is responsive enough.
13144 (Flength): Report an error instead of overflowing an integer.
13145 (Fsafe_length): Return a float if the value is not representable
13146 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13147 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13148 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13149
dd0b0efb
PE
13150 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13151 (header_size, word_size): New constants.
13152 (allocate_vectorlike): Don't check size overflow here.
13153 (allocate_vector): Check it here instead, since this is the only
13154 caller of allocate_vectorlike that could cause overflow.
13155 Check that the new vector's length is representable as a fixnum.
13156
86fe5cfe
PE
13157 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13158 The previous code was bogus. For example, next_almost_prime (32)
13159 returned 39, which is undesirable as it is a multiple of 3; and
13160 next_almost_prime (24) returned 25, which is a multiple of 5 so
13161 why was the code bothering to check for multiples of 7?
13162
80e88859
PE
13163 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13164
4a2f0ad6
PE
13165 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13166
f66c7cf8
PE
13167 Variadic C functions now count arguments with ptrdiff_t.
13168 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13169 Back then I didn't know that the Emacs coding style prefers signed int.
13170 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13171 were being counted with int, which may truncate counts on 64-bit
13172 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13173 * lisp.h (struct Lisp_Subr.function.aMANY)
13174 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13175 Arg counts are now ptrdiff_t, not size_t.
13176 All variadic functions and their callers changed accordingly.
13177 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13178 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13179 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13180 * callint.c (Fcall_interactively): Check arg count for overflow,
13181 to avoid potential buffer overrun. Use signed char, not 'int',
13182 for 'varies' array, so that we needn't bother to check its size
13183 calculation for overflow.
13184 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13185 * eval.c (apply_lambda):
13186 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13187 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13188 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13189
a1759b76
PE
13190 * callint.c (Fcall_interactively): Don't use index var as event count.
13191
d96be9fc
PE
13192 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13193 * mem-limits.h (SIZE): Remove; no longer used.
13194
a690a978 13195 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13196
578c21e6
PE
13197 Remove unnecessary casts.
13198 * xterm.c (x_term_init):
13199 * xfns.c (x_set_border_pixel):
13200 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13201 These aren't needed now that we assume ANSI C.
13202
96f53c6c
PE
13203 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13204 It's more likely to cause problems (due to unsigned overflow)
13205 than to cure them.
13206
83c77d31
PE
13207 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13208
ee2079f1
PE
13209 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13210
6da65536
PE
13211 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13212
7147c4a4
PE
13213 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13214
193e32d9
PE
13215 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13216
e5533da6
PE
13217 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13218
9910e595
PE
13219 GLYPH_CODE_FACE returns EMACS_INT, not int.
13220 * dispextern.h (merge_faces):
13221 * xfaces.c (merge_faces):
01103c44
PE
13222 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13223 Don't assume EMACS_INT fits in int.
9910e595 13224
2638320e
PE
13225 * character.h (CHAR_VALID_P): Remove unused parameter.
13226 * fontset.c, lisp.h, xdisp.c: All uses changed.
13227
045eb8d9
PE
13228 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13229
c1f134b5
PE
13230 * fns.c (concat): Minor tuning based on overflow analysis.
13231 This doesn't fix any bugs. Use int to hold character, instead
13232 of constantly refetching from Emacs object. Use XFASTINT, not
13233 XINT, for value known to be a character. Don't bother comparing
13234 a single byte to 0400, as it's always less.
13235
395fcb93 13236 * floatfns.c (Fexpt):
327eeec8
PE
13237 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13238
abbd3d23
PE
13239 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13240 for characters.
13241
684a03ef
PE
13242 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13243
0fed43f3
PE
13244 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13245 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13246 incorrectly succeed when S was a string, because 4294967386 was
13247 truncated before it was used.
13248
8fd02eb7
PE
13249 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13250 Otherwise, an out-of-range integer could cause undefined behavior
13251 on a 64-bit host.
13252
f8c86b69
PE
13253 * composite.c: Use int, not EMACS_INT, for characters.
13254 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13255 EMACS_INT, for values that are known to be in character range.
13256 This doesn't fix any bugs but is the usual style inside Emacs and
13257 may generate better code on 32-bit machines.
13258
34206dd2
PE
13259 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13260 This is for reasons similar to the recent CHAR_STRING fix.
13261 * charset.c (Fencode_char): Check that character arg is actually
13262 a character. Pass an int to ENCODE_CHAR.
13263 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13264 wider than 'int', as a compile-time check to prevent future regressions
13265 in this area.
13266
c5958d4c 13267 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13268
13269 Make sure a 64-bit char is never passed to CHAR_STRING.
13270 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13271 by silently ignoring the top 32 bits, allowing some values
13272 that were far too large to be valid characters.
13273 * character.h: Include <verify.h>.
13274 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13275 arguments are no wider than unsigned, as a compile-time check
13276 to prevent future regressions in this area.
13277 * data.c (Faset):
01103c44 13278 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13279 (Fsubst_char_in_region):
13280 * fns.c (concat):
13281 * xdisp.c (decode_mode_spec_coding):
13282 Adjust to CHAR_STRING's new requirement.
13283 * editfns.c (Finsert_char, Fsubst_char_in_region):
13284 * fns.c (concat): Check that character args are actually
13285 characters. Without this test, these functions did the wrong
13286 thing with wildly out-of-range values on 64-bit hosts.
13287
d37ca623
PE
13288 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13289 These casts should not be needed on 32-bit hosts, either.
13290 * keyboard.c (read_char):
13291 * lread.c (Fload): Remove casts to unsigned.
13292
ea204efb
PE
13293 * lisp.h (UNSIGNED_CMP): New macro.
13294 This fixes comparison bugs on 64-bit hosts.
13295 (ASCII_CHAR_P): Use it.
13296 * casefiddle.c (casify_object):
01103c44 13297 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13298 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13299 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13300 * dispextern.h (FACE_FROM_ID):
13301 * keyboard.c (read_char): Use UNSIGNED_CMP.
13302
41cb286c
PE
13303 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13304 not to EMACS_INT, to avoid GCC warning.
13305
4a1b9832
PE
13306 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13307
55daad71
PE
13308 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13309 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13310 isn't needed on 32-bit machines.
8f95c75c 13311
01103c44
PE
13312 * buffer.c (Fgenerate_new_buffer_name):
13313 Use EMACS_INT for count, not int.
0ceccced 13314 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13315
13316 * data.c (Qcompiled_function): Now static.
13317
c6f072e7
PE
13318 * window.c (window_body_lines): Now static.
13319
20ce5912
PE
13320 * image.c (gif_load): Rename local to avoid shadowing.
13321
9c4c5f81
PE
13322 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13323 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13324 * alloc.c (make_save_value): Integer argument is now of type
13325 ptrdiff_t, not int.
13326 (mark_object): Use ptrdiff_t, not int.
13327 * lisp.h (pD): New macro.
13328 * print.c (print_object): Use it.
13329
c0c5c8ae
PE
13330 * alloc.c: Use EMACS_INT, not int, to count objects.
13331 (total_conses, total_markers, total_symbols, total_vector_size)
13332 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13333 (total_free_floats, total_floats, total_free_intervals)
13334 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13335 Now EMACS_INT, not int. All uses changed.
13336 (Fgarbage_collect): Compute overall total using a double, so that
13337 integer overflow is less likely to be a problem. Check for overflow
13338 when converting back to an integer.
5a25e253
PE
13339 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13340 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13341 These were 'int' variables that could overflow on 64-bit hosts;
13342 they were never used, so remove them instead of repairing them.
211a0b2a 13343 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13344 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13345 Previously, this ceilinged at INT_MAX, but that doesn't work on
13346 64-bit machines.
e46bb31a 13347 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13348
c78baabf 13349 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13350 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13351 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13352 when a (possibly-narrower) signed value would do just as well.
13353 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13354
c9d624c6
PE
13355 * alloc.c: Catch some string size overflows that we were missing.
13356 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13357 for convenience in STRING_BYTES_MAX.
13358 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13359 The definition here is exact; the one in lisp.h was approximate.
13360 (allocate_string_data): Check for string overflow. This catches
13361 some instances we weren't catching before. Also, it catches
13362 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13363 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13364 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13365
c9d624c6
PE
13366 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13367 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13368 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 13369
353032ce
PE
13370 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13371
2bccce07
PE
13372 * alloc.c (Fmake_string): Check for out-of-range init.
13373
0ac30604
SM
133742011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13375
13376 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13377
c195f2de
JD
133782011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13379
13380 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13381 xg_get_default_scrollbar_width.
13382
13383 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13384 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13385 (style_changed_cb): Call update_theme_scrollbar_width and call
13386 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13387 all frames (Bug#8505).
13388 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13389 Call gtk_window_set_resizable if HAVE_GTK3.
13390 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13391 and height if HAVE_GTK3 (Bug#8505).
13392 (scroll_bar_width_for_theme): New variable.
13393 (update_theme_scrollbar_width): New function.
13394 (xg_get_default_scrollbar_width): Move code to
13395 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13396 (xg_initialize): Call update_theme_scrollbar_width.
13397
13398 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13399
13400 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13401
e10ac9f1
MR
134022011-06-12 Martin Rudalics <rudalics@gmx.at>
13403
13404 * frame.c (make_frame): Call other_buffer_safely instead of
13405 other_buffer.
13406
13407 * window.c (temp_output_buffer_show): Call display_buffer with
13408 second argument Vtemp_buffer_show_specifiers and reset latter
13409 immediately after the call.
13410 (Vtemp_buffer_show_specifiers): New variable.
13411 (auto_window_vscroll_p, next_screen_context_lines)
13412 (Vscroll_preserve_screen_position): Remove leading asterisks from
13413 doc-strings.
13414
2d3c217e 134152011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 13416
7b7f97e8 13417 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
13418 * buffer.c (Qclone_number): Remove for now, as it's unused.
13419 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13420 (record_buffer): Remove unused local.
13421 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13422 (set_frame_buffer_list): Remove; unused.
13423 * frame.h (other_visible_frames): Remove decl.
13424 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13425 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13426 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13427 if HAVE_GPM.
13428 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13429 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13430 Define only if HAVE_GPM.
13431 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13432 (update_hints_inhibit): Remove; never set. All uses removed.
13433 * widgetprv.h (emacsFrameClassRec): Remove decl.
13434 * window.c (delete_deletable_window): Now returns void, since it
13435 wasn't returning anything.
13436 (compare_window_configurations): Remove unused locals.
13437 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13438 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
13439 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13440 the same widths as pointers. This follows up on the 2011-05-06 patch.
13441 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13442 * xterm.h: Likewise.
13443 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13444
1384b89e
JB
134452011-06-12 Juanma Barranquero <lekktu@gmail.com>
13446
13447 * makefile.w32-in: Update dependencies.
13448 (LISP_H): Add lib/intprops.h.
13449
1100a63c
CY
134502011-06-11 Chong Yidong <cyd@stupidchicken.com>
13451
13452 * image.c (gif_load): Add animation frame delay to the metadata.
13453 (syms_of_image): Use DEFSYM. New symbol `delay'.
13454
6198ccd0
MR
134552011-06-11 Martin Rudalics <rudalics@gmx.at>
13456
13457 * window.c (delete_deletable_window): Re-add.
13458 (Fset_window_configuration): Rewrite to handle dead buffers and
13459 consequently deletable windows.
13460 (window_tree, Fwindow_tree): Remove. Supply functionality in
13461 window.el.
13462 (compare_window_configurations): Simplify code.
13463
b6e3633c
AS
134642011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13465
1ab0dee5
AS
13466 * image.c (imagemagick_load_image): Fix type mismatch.
13467 (Fimagemagick_types): Likewise.
13468
b6e3633c
AS
13469 * window.h (replace_buffer_in_windows): Declare.
13470
9397e56f
MR
134712011-06-11 Martin Rudalics <rudalics@gmx.at>
13472
13473 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13474 Qclone_number. Remove external declaration of Qdelete_window.
13475 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13476 code.
640c8776
SM
13477 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13478 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
13479 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13480 buffer list implementation.
13481 (other_buffer_safely): New function.
13482 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13483 calls to replace_buffer_in_windows and
13484 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13485 if allowed.
13486 (record_buffer): Inhibit quitting and rewrite using quittable
13487 functions. Run Qbuffer_list_update_hook if allowed.
13488 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
13489 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13490 Move switch-to-buffer to window.el.
9397e56f
MR
13491 (bury-buffer): Move to window.el.
13492 (Vbuffer_list_update_hook): New variable.
13493
13494 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13495 section.
13496
13497 * window.h (resize_frame_windows): Move up in code.
13498 (Fwindow_frame): Remove EXFUN.
13499 (replace_buffer_in_all_windows): Remove prototype.
13500 (replace_buffer_in_windows_safely): Add prototype.
13501
13502 * window.c: Declare Qdelete_window static again. Move down
13503 declaration of select_count.
13504 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13505 (Fother_window): Move to window.el.
13506 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13507 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13508 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13509 window.el.
13510 (replace_buffer_in_windows): Implement by calling
13511 Qreplace_buffer_in_windows.
13512 (replace_buffer_in_all_windows): Remove with some functionality
13513 moved into replace_buffer_in_windows_safely.
13514 (replace_buffer_in_windows_safely): New function.
13515 (select_window_norecord, select_frame_norecord): Move in front
13516 of run_window_configuration_change_hook. Remove now obsolete
13517 declarations.
640c8776
SM
13518 (Fset_window_buffer): Rewrite doc-string.
13519 Call Qrecord_window_buffer.
9397e56f
MR
13520 (keys_of_window): Move binding for other-window to window.el.
13521
b50691aa
CY
135222011-06-11 Chong Yidong <cyd@stupidchicken.com>
13523
13524 * dispextern.h (struct image): Replace data member, whose int_val
13525 and ptr_val fields were not used by anything, with a single
13526 lisp_val object.
13527
13528 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13529 (gif_clear_image, gif_load, imagemagick_load_image)
13530 (gs_clear_image, gs_load): Callers changed.
13531
3f754b86
PE
135322011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13533
cca69397
PE
13534 * buffer.h: Include <time.h>, for time_t.
13535 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13536
109e28d0
PE
13537 Fix minor problems found by static checking.
13538
60737f02
PE
13539 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13540
4b66faf3
PE
13541 Make identifiers static if they are not used in other modules.
13542 * data.c (Qcompiled_function, Qframe, Qvector):
13543 * image.c (QimageMagick, Qsvg):
13544 * minibuf.c (Qmetadata):
13545 * window.c (resize_window_check, resize_root_window): Now static.
13546 * window.h (resize_window_check, resize_root_window): Remove decls.
13547
109e28d0
PE
13548 * window.c (window_deletion_count, delete_deletable_window):
13549 Remove; unused.
46a4ce9e
PE
13550 (window_body_lines): Now static.
13551 (Fdelete_other_windows_internal): Mark vars as initialized.
13552 Make sure 'resize_failed' is initialized.
13553 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13554 (resize_window_apply): Remove unused local.
13555 * window.h (delete_deletable_window): Remove decl.
13556
109e28d0 13557 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
13558 (imagemagick_load_image): Fix pointer signedness problem by changing
13559 last arg from unsigned char * to char *. All uses changed.
13560 Also, fix a local for similar reasons.
13561 Remove unused locals. Remove locals to avoid shadowing.
13562 (fn_rsvg_handle_free): Remove; unused.
13563 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 13564 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 13565
3f754b86
PE
13566 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13567
2547adb1
CY
135682011-06-10 Chong Yidong <cyd@stupidchicken.com>
13569
13570 * image.c (gif_load): Fix omitted cast error introduced by
13571 2011-06-06 change.
13572
2c8e37d4
MR
135732011-06-10 Martin Rudalics <rudalics@gmx.at>
13574
13575 * window.h (resize_proportionally, orig_total_lines)
13576 (orig_top_line): Remove from window structure.
13577 (set_window_height, set_window_width, change_window_heights)
13578 (Fdelete_window): Remove prototypes.
13579 (resize_frame_windows): Remove duplicate declaration.
13580
440a42e3
EZ
135812011-06-10 Eli Zaretskii <eliz@gnu.org>
13582
13583 * window.h (resize_frame_windows, resize_window_check)
13584 (delete_deletable_window, resize_root_window)
13585 (resize_frame_windows): Declare prototypes.
13586
13587 * window.c (resize_window_apply): Make definition be "static" to
13588 match the prototype.
13589
562dd5e9
MR
135902011-06-10 Martin Rudalics <rudalics@gmx.at>
13591
13592 * window.c: Remove declarations of Qwindow_size_fixed,
13593 window_min_size_1, window_min_size_2, window_min_size,
13594 size_window, window_fixed_size_p, enlarge_window, delete_window.
13595 Remove static from declaration of Qdelete_window, it's
13596 temporarily needed by Fbury_buffer.
13597 (replace_window): Don't assign orig_top_line and
13598 orig_total_lines.
13599 (Fdelete_window, delete_window): Remove. Window deletion is
13600 handled by window.el.
640c8776
SM
13601 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13602 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
13603 (Fdelete_other_windows): Remove. Deleting other windows is
13604 handled by window.el.
13605 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13606 handled in window.el.
13607 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13608 Window minimum sizes are handled in window.el.
13609 (shrink_windows, size_window, set_window_height)
13610 (set_window_width, change_window_heights, window_height)
13611 (window_width, CURBEG, CURSIZE, enlarge_window)
13612 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13613 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13614 handled in window.el.
13615 (make_dummy_parent): Rename to make_parent_window and give it a
13616 second argument horflag.
13617 (make_window): Don't set resize_proportionally any more.
13618 (Fsplit_window): Remove. Windows are split in window.el.
13619 (save_restore_action, save_restore_orig_size)
13620 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13621 Resize mini windows in window.el.
13622 (grow_mini_window, shrink_mini_window): Implement by calling
13623 Qresize_root_window_vertically, resize_window_check and
13624 resize_window_apply.
640c8776
SM
13625 (saved_window, Fset_window_configuration, save_window_save):
13626 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
13627 resize_proportionally.
13628 (window_min_height, window_min_width): Move to window.el.
13629 (keys_of_window): Move bindings for delete-other-windows,
13630 split-window, delete-window and enlarge-window to window.el.
13631
13632 * buffer.c: Temporarily extern Qdelete_window.
13633 (Fbury_buffer): Temporarily call Qdelete_window instead of
13634 Fdelete_window (Fbury_buffer will move to window.el soon).
13635
13636 * frame.c (set_menu_bar_lines_1): Remove code handling
13637 orig_top_line and orig_total_lines.
13638
13639 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13640 set_window_height but set heights directly.
13641 (change_frame_size_1): Use resize_frame_windows.
13642
13643 * xdisp.c (init_xdisp): Don't use set_window_height but set
13644 heights directly.
13645
640c8776
SM
13646 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13647 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
13648 run_window_configuration_change_hook.
13649
13650 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13651 instead of change_window_heights and run
13652 run_window_configuration_change_hook.
13653
1a13852e
MR
136542011-06-09 Martin Rudalics <rudalics@gmx.at>
13655
13656 * window.c (replace_window): Rename second argument REPLACEMENT to
13657 NEW. New third argument SETFLAG. Rewrite.
13658 (delete_window, make_dummy_parent): Call replace_window with
13659 third argument 1.
13660 (window_list_1): Move down in code.
13661 (run_window_configuration_change_hook): Move set_buffer part
13662 before select_frame_norecord part in order to unwind correctly.
13663 Rename count1 to count.
13664 (recombine_windows, delete_deletable_window, resize_root_window)
13665 (Fdelete_other_windows_internal)
13666 (Frun_window_configuration_change_hook, make_parent_window)
13667 (resize_window_check, resize_window_apply, Fresize_window_apply)
13668 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
13669 (Fdelete_window_internal, Fresize_mini_window_internal):
13670 New functions.
1a13852e
MR
13671 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13672
f3d1777e
MR
136732011-06-08 Martin Rudalics <rudalics@gmx.at>
13674
496e208e
MR
13675 * window.h (window): Add some new members to window structure -
13676 normal_lines, normal_cols, new_total, new_normal, clone_number,
13677 splits, nest, prev_buffers, next_buffers.
13678 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 13679 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 13680
f3d1777e
MR
13681 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13682 Remove.
496e208e
MR
13683 (make_dummy_parent): Set new members of windows structure.
13684 (make_window): Move down in code. Handle new members of window
13685 structure.
13686 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13687 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13688 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13689 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
13690 (Fset_window_next_buffers, Fset_window_clone_number):
13691 New functions.
496e208e
MR
13692 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13693 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13694 Doc-string fixes.
13695 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13696 Argument WINDOW can be now internal window too.
13697 (Fwindow_use_time): Move up in code.
13698 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13699 Rewrite doc-string.
13700 (Fset_window_configuration, saved_window)
13701 (Fcurrent_window_configuration, save_window_save): Handle new
13702 members of window structure.
b9e809c2
MR
13703 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13704 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13705 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13706 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13707 Qget_mru_window, Qresize_root_window,
13708 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13709 Qauto_buffer_name; staticpro them.
f3d1777e 13710
abde8f8c
MR
137112011-06-07 Martin Rudalics <rudalics@gmx.at>
13712
13713 * window.c (Fwindow_total_size, Fwindow_left_column)
13714 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13715 (Fwindow_list_1): New functions.
13716 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
13717 (Fwindow_width, Fscroll_left, Fscroll_right):
13718 Use window_body_cols instead of window_box_text_cols.
13719 (delete_window, Fset_window_configuration):
13720 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
13721 (delete_all_subwindows): Take a window as argument and not a
13722 structure. Rewrite.
190b47e6
MR
13723 (window_loop): Remove handling of GET_LRU_WINDOW and
13724 GET_LARGEST_WINDOW.
13725 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
13726
13727 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
13728 window_box_text_cols. delete_all_subwindows now takes a
13729 Lisp_Object as argument.
abde8f8c 13730
640c8776
SM
13731 * indent.c (compute_motion, Fcompute_motion):
13732 Use window_body_cols instead of window_box_text_cols.
abde8f8c 13733
fa8a67e6
MR
13734 * frame.c (delete_frame): Call delete_all_subwindows with root
13735 window as argument.
13736
a54e3482
DC
137372011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13738
13739 * fns.c (Fputhash): Document return value.
13740
60002bf5
CY
137412011-06-06 Chong Yidong <cyd@stupidchicken.com>
13742
13743 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13744
0c671da6 137452011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 13746
b862a52a 13747 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 13748
be44ca6c
PE
13749 Check for overflow when converting integer to cons and back.
13750 * charset.c (Fdefine_charset_internal, Fdecode_char):
13751 Use cons_to_unsigned to catch overflow.
13752 (Fencode_char): Use INTEGER_TO_CONS.
13753 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13754 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13755 * data.c (long_to_cons, cons_to_long): Remove.
13756 (cons_to_unsigned, cons_to_signed): New functions.
13757 These signal an error for invalid or out-of-range values.
13758 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13759 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13760 * font.c (Ffont_variation_glyphs):
13761 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13762 * lisp.h: Include <intprops.h>.
13763 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13764 (cons_to_signed, cons_to_unsigned): New decls.
13765 (long_to_cons, cons_to_long): Remove decls.
13766 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13767 (Fprimitive_undo): Use CONS_TO_INTEGER.
13768 * xfns.c (Fx_window_property): Likewise.
13769 * xselect.c: Include <limits.h>.
13770 (x_own_selection, selection_data_to_lisp_data):
13771 Use INTEGER_TO_CONS.
13772 (x_handle_selection_request, x_handle_selection_clear)
13773 (x_get_foreign_selection, Fx_disown_selection_internal)
13774 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13775 (lisp_data_to_selection_data): Use cons_to_unsigned.
13776 (x_fill_property_data): Use cons_to_signed.
13777 Report values out of range.
13778
d1f3d2af
PE
13779 Check for buffer and string overflow more precisely.
13780 * buffer.h (BUF_BYTES_MAX): New macro.
13781 * lisp.h (STRING_BYTES_MAX): New macro.
13782 * alloc.c (Fmake_string):
13783 * character.c (string_escape_byte8):
13784 * coding.c (coding_alloc_by_realloc):
13785 * doprnt.c (doprnt):
13786 * editfns.c (Fformat):
13787 * eval.c (verror):
13788 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13789 since they may not be the same number.
13790 * editfns.c (Finsert_char):
13791 * fileio.c (Finsert_file_contents):
13792 Likewise for BUF_BYTES_MAX.
13793
dd52fcea
PE
13794 * image.c: Use ptrdiff_t, not int, for sizes.
13795 (slurp_file): Switch from int to ptrdiff_t.
13796 All uses changed.
13797 (slurp_file): Check that file size fits in both size_t (for
13798 malloc) and ptrdiff_t (for sanity and safety).
13799
7f9bbdbb
PE
13800 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13801 if b->modtime has its maximal value.
13802
dfe18f82
PE
13803 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13804
84acfcf0
PE
13805 Don't assume time_t can fit into int.
13806 * buffer.h (struct buffer.modtime): Now time_t, not int.
13807 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13808 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13809
ccd9a01a
PE
13810 Minor fixes for signed vs unsigned integers.
13811 * character.h (MAYBE_UNIFY_CHAR):
13812 * charset.c (maybe_unify_char):
13813 * keyboard.c (read_char, reorder_modifiers):
13814 XINT -> XFASTINT, since the integer must be nonnegative.
13815 * ftfont.c (ftfont_spec_pattern):
13816 * keymap.c (access_keymap, silly_event_symbol_error):
13817 XUINT -> XFASTINT, since the integer must be nonnegative.
13818 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13819 since it makes no difference and we prefer signed.
13820 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13821 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13822 nonnegative.
13823
d6d100dd
SM
138242011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13825
13826 * window.h (Fwindow_frame): Declare.
13827
2b6148e4
PE
138282011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13829
13830 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13831 (SPARE_MEMORY): Always define.
13832 (LARGE_REQUEST): Remove.
13833 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13834
f230ecc9
MR
138352011-06-06 Martin Rudalics <rudalics@gmx.at>
13836
727e958e
MR
13837 * lisp.h: Move EXFUNS for Fframe_root_window,
13838 Fframe_first_window and Fset_frame_selected_window to window.h.
13839
13840 * window.h: Move EXFUNS for Fframe_root_window,
13841 Fframe_first_window and Fset_frame_selected_window here from
13842 lisp.h.
13843
13844 * frame.c (Fwindow_frame, Fframe_first_window)
13845 (Fframe_root_window, Fframe_selected_window)
13846 (Fset_frame_selected_window): Move to window.c.
13847 (Factive_minibuffer_window): Move to minibuf.c.
13848 (Fother_visible_frames_p): New function.
13849
13850 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13851
f230ecc9
MR
13852 * window.c (decode_window, decode_any_window): Move up in code.
13853 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13854 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
13855 (Fwindow_buffer): Move up and rewrite doc-string.
13856 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13857 (Fwindow_prev): New functions.
727e958e
MR
13858 (Fwindow_frame): Move here from frame.c. Accept any window as
13859 argument.
13860 (Fframe_root_window, Fframe_first_window)
13861 (Fframe_selected_window): Move here from frame.c. Accept frame
13862 or arbitrary window as argument. Update doc-strings.
13863 (Fminibuffer_window): Move up in code.
13864 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
13865 (Fset_frame_selected_window): Move here from frame.c.
13866 Marginal rewrite.
727e958e
MR
13867 (Fselected_window, select_window, Fselect_window): Move up in
13868 code. Minor doc-string fixes.
f230ecc9 13869
4d09bcf6
PE
138702011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13871
13872 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13873 Do not assume that spare memory exists; that assumption is valid
13874 only if SYSTEM_MALLOC.
13875 (LARGE_REQUEST): New macro, so that the issue of large requests
13876 is separated from the issue of spare memory.
13877
810928a2
AS
138782011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13879
172418ad
AS
13880 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13881 format. (Bug#8806)
13882
43f862f7
AS
13883 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13884
810928a2
AS
13885 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13886 before statements.
13887
a059fe24
JD
138882011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13889
13890 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13891
13892 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13893
13894 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13895 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13896
989bf368
JB
138972011-06-05 Juanma Barranquero <lekktu@gmail.com>
13898
13899 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13900
4b80f674
CY
139012011-06-04 Chong Yidong <cyd@stupidchicken.com>
13902
13903 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13904 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
13905 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13906 New error handlers.
4b80f674
CY
13907 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13908 Obey Vx_select_enable_clipboard_manager. Catch errors in
13909 x_clipboard_manager_save (Bug#8779).
13910 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 13911 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 13912
99a33b77 139132011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
13914
13915 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13916
99a33b77 139172011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
13918
13919 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13920 in the current matrix if keep_current_p is non-zero.
13921
8264569d
EZ
139222011-06-04 Eli Zaretskii <eliz@gnu.org>
13923
13924 * bidi.c (bidi_level_of_next_char): Fix last change.
13925
57f97249
EZ
139262011-06-03 Eli Zaretskii <eliz@gnu.org>
13927
fec2107c 13928 Support bidi reordering of text covered by display properties.
57f97249 13929
fec2107c
EZ
13930 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13931 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13932 (bidi_cache_search, bidi_cache_iterator_state)
13933 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
13934 (bidi_level_of_next_char, bidi_move_to_visually_next):
13935 Support character positions inside a run of characters covered by a
fec2107c
EZ
13936 display string.
13937 (bidi_paragraph_init, bidi_resolve_explicit_1)
13938 (bidi_level_of_next_char): Call bidi_fetch_char and
13939 bidi_fetch_char_advance instead of FETCH_CHAR and
13940 FETCH_CHAR_ADVANCE.
13941 (bidi_init_it): Initialize new members.
13942 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13943 definitions.
13944 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13945 instead of using explicit *_CHAR codes.
d6d100dd
SM
13946 (bidi_resolve_explicit, bidi_resolve_weak):
13947 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
13948 bidirectional text is supported only in multibyte buffers.
13949 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13950 it to initialize the frame_window_p member of struct bidi_it.
13951 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13952 (bidi_resolve_explicit, bidi_resolve_weak)
13953 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13954 bidi_it->nchars is non-positive.
13955 (bidi_level_of_next_char): Don't try to lookup the cache for the
13956 next/previous character if nothing is cached there yet, or if we
13957 were just reseat()'ed to a new position.
c40e2fb2 13958
0e14fe90
EZ
13959 * xdisp.c (set_cursor_from_row): Set start and stop points
13960 according to the row's direction when priming the loop that looks
13961 for the glyph on which to display cursor.
13962 (single_display_spec_intangible_p): Function deleted.
13963 (display_prop_intangible_p): Reimplement to call
13964 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
13965 Accept 3 additional arguments needed by handle_display_spec.
13966 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
13967 values: lists, `(when COND...)' forms, etc.
13968 (single_display_spec_string_p): Support property values that are
13969 lists with the argument STRING its top-level element.
13970 (display_prop_string_p): Fix the condition for processing a
13971 property that is a list to be consistent with handle_display_spec.
fec2107c 13972 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
13973 last portion of handle_display_prop.
13974 (compute_display_string_pos): Accept additional argument
13975 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13976 value of a `display' property is a "replacing spec".
13977 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13978 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13979 the display property, but just return a value indicating whether
13980 the display property will replace the characters it covers.
13981 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13982 frame_window_p members of struct bidi_it.
d6d100dd
SM
13983 (compute_display_string_pos, compute_display_string_end):
13984 New functions.
fec2107c
EZ
13985 (push_it): Accept second argument POSITION, where pop_it should
13986 jump to continue iteration.
13987 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 13988
fec2107c
EZ
13989 * keyboard.c (adjust_point_for_property): Adjust the call to
13990 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
13991
13992 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
13993 (bidi_init_it): Update prototypes.
13994 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
13995 (compute_display_string_pos, compute_display_string_end):
13996 Declare prototypes.
fec2107c
EZ
13997 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13998 EMACS_INT.
fc6f18ce 13999
40087514 140002011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14001
57f53182
PE
14002 Malloc failure behavior now depends on size of allocation.
14003 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14004 * lisp.h: Change signatures accordingly.
14005 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14006 All callers changed. (Bug#8762)
14007
14008 * gnutls.c: Use Emacs's memory allocators.
14009 Without this change, the gnutls library would invoke malloc etc.
14010 directly, which causes problems on non-SYNC_INPUT hosts, and which
14011 runs afoul of improving memory_full behavior. (Bug#8761)
14012 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14013 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14014 xfree instead of the default malloc, realloc, free.
14015 (Fgnutls_boot): No need to check for memory allocation failure,
14016 since xmalloc does that for us.
14017
ac32cd99 14018 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14019 * category.c (hash_get_category_set):
14020 * ccl.c (ccl_driver):
14021 * charset.c (Fdefine_charset_internal):
14022 * charset.h (struct charset.hash_index):
14023 * composite.c (get_composition_id, gstring_lookup_cache)
14024 (composition_gstring_put_cache):
14025 * composite.h (struct composition.hash_index):
14026 * dispextern.h (struct image.hash):
14027 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14028 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14029 (hashfn_equal, hashfn_user_defined, make_hash_table)
14030 (maybe_resize_hash_table, hash_lookup, hash_put)
14031 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14032 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14033 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14034 * image.c (make_image, search_image_cache, lookup_image)
14035 (xpm_put_color_table_h):
14036 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14037 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14038 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14039 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14040 * alloc.c (allocate_vectorlike):
14041 Check for overflow in vector size calculations.
14042 * ccl.c (ccl_driver):
14043 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14044 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14045 need to be updated by these changes.
40087514
PE
14046 * fns.c (make_hash_table, maybe_resize_hash_table):
14047 Check for integer overflow with large hash tables.
0de4bb68
PE
14048 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14049 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14050 (SXHASH_REDUCE): New macro.
14051 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14052 Use it instead of discarding useful hash info with large hash values.
14053 (sxhash_float): New function.
14054 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14055 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14056 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14057 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14058 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14059 Adjust signatures to match updated version of code.
14060 (consing_since_gc): Now EMACS_INT, since a single hash table can
14061 use more than INT_MAX bytes.
14062
698d32e2
DN
140632011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14064
14065 Make it possible to build with GCC-4.6+ -O2 -flto.
14066
14067 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14068
fd6fa53f
SM
140692011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14070
14071 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14072 Call minibuffer-inactive-mode.
14073
864db017
JB
140742011-05-31 Juanma Barranquero <lekktu@gmail.com>
14075
14076 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14077 Update dependencies.
14078
2ad0baf4
DN
140792011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14080
14081 * data.c (init_data): Remove code for UTS, this system is not
14082 supported anymore.
14083
4fcc2638
DN
140842011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14085
14086 Don't force ./temacs to start in terminal mode.
14087
14088 * frame.c (make_initial_frame): Initialize faces in all cases, not
14089 only when CANNOT_DUMP is defined.
14090 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14091
c56e0fd5
DN
140922011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14093
14094 * dispnew.c (add_window_display_history): Use const for the string
14095 pointer. Remove declaration, not needed.
14096
333d54da 140972011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14098
55d4c1b2 14099 Use 'inline', not 'INLINE'.
333d54da 14100 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14101 * alloc.c, fontset.c (INLINE): Remove.
14102 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14103 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14104 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14105 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14106 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14107
738db178
DN
141082011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14109
14110 Make it possible to run ./temacs.
14111
14112 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14113 syms_of_callproc does the same thing. Remove test for
14114 "initialized", do it in the caller.
14115 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14116
620c53a6
SM
141172011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14118
14119 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14120 (read_minibuf): Use get_minibuffer.
14121 (syms_of_minibuf): Use DEFSYM.
14122 (Qmetadata): New var.
14123 * data.c (Qbuffer): Don't make it static.
14124 (syms_of_data): Use DEFSYM.
14125
e003a292
PE
141262011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14127
14128 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14129 (CCL_CODE_MIN): New macro.
14130
ed008a6d
PE
141312011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14132
3687c2ef
PE
14133 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14134
ed008a6d
PE
14135 * eval.c (Qdebug): Now static.
14136 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14137 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14138 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14139
d66c4c7c
CY
141402011-05-29 Chong Yidong <cyd@stupidchicken.com>
14141
14142 * image.c: Various fixes to ImageMagick code comments.
14143 (Fimagemagick_types): Doc fix.
14144
5fbc2025
PE
141452011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14146
0196f88a
PE
14147 Minor fixes prompted by GCC 4.6.0 warnings.
14148
14149 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14150
5fbc2025
PE
14151 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14152 (x_clipboard_manager_save_all): Move extern decl to ...
14153 * xterm.h: ... here, so that it can be checked for consistency.
14154
1dd3c2d9
CY
141552011-05-29 Chong Yidong <cyd@stupidchicken.com>
14156
14157 * xselect.c (x_clipboard_manager_save_frame)
14158 (x_clipboard_manager_save_all): New functions.
14159 (Fx_clipboard_manager_save): Lisp function deleted.
14160
14161 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14162 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14163
14164 * xterm.h: Update prototype.
14165
5ba6571d
WX
141662011-05-28 William Xu <william.xwl@gmail.com>
14167
14168 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14169 exiting (Bug#8239).
14170
3eaff834
JM
141712011-05-28 Jim Meyering <meyering@redhat.com>
14172
e1900994 14173 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14174 * fns.c (to_uchar): Define.
14175 (crypto_hash_function): Use it to convert some newly-signed
14176 variables to unsigned, to avoid sign-extension bugs. For example,
14177 without this change, (md5 "truc") would evaluate to
14178 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14179 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14180 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14181
0f6990a7
PE
141822011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14183
14184 Integer overflow fixes.
c8a9ca5a 14185
08686060
PE
14186 * dbusbind.c: Serial number integer overflow fixes.
14187 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14188 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14189 to hold a serial number that is too large for a fixnum.
14190 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14191 Check for serial numbers out of range. Decode any serial number
59568bf0 14192 that was so large that it became a float. (Bug#8722)
08686060 14193
2d1fc3c7
PE
14194 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14195 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14196 Use XFASTINT rather than XUINT when numbers are nonnegative.
14197 (xd_append_arg, Fdbus_method_return_internal):
14198 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14199 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14200 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14201 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14202 (Bug#8722)
2d1fc3c7 14203
c8a9ca5a
PE
14204 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14205
519e1d69
PE
14206 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14207
6df6ae42 14208 ccl: Add integer overflow checks.
30569699
PE
14209 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14210 (IN_INT_RANGE): New macros.
14211 (ccl_driver): Use them to check for integer overflow when
14212 decoding a CCL program. Many of the new checks are whether XINT (x)
14213 fits in int; it doesn't always, on 64-bit hosts. The new version
14214 doesn't catch all possible integer overflows, but it's an
847044ea 14215 improvement. (Bug#8719)
30569699 14216
c11285dc
PE
14217 * alloc.c (make_event_array): Use XINT, not XUINT.
14218 There's no need for unsigned here.
14219
fdccd48e
PE
14220 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14221 This follows up to the 2011-05-06 change that substituted uintptr_t
14222 for EMACS_INT. This case wasn't caught back then.
14223
37910ab2
PE
14224 Rework Fformat to avoid integer overflow issues.
14225 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14226 now (part of C89). Include <verify.h>.
14227 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14228 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14229 (Fformat): Avoid the prepass trying to compute sizes; it was only
14230 approximate and thus did not catch overflow reliably. Instead, walk
14231 through the format just once, formatting and computing sizes as we go,
14232 checking for integer overflow at every step, and allocating a larger
14233 buffer as needed. Keep track separately whether the format is
14234 multibyte. Keep only the most-recently calculated precision, rather
14235 than them all. Record whether each argument has been converted to
14236 string. Use EMACS_INT, not int, for byte and char and arg counts.
14237 Support field widths and precisions larger than INT_MAX. Avoid
14238 sprintf's undefined behavior with conversion specifications such as %#d
14239 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14240 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14241 formatting out-of-range floating point numbers with int
9173deec 14242 formats. (Bug#8668)
37910ab2 14243
2e6578fb
PE
14244 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14245
0ae6bdee
PE
14246 * data.c: Avoid integer truncation in expressions involving floats.
14247 * data.c: Include <intprops.h>.
14248 (arith_driver): When there's an integer overflow in an expression
14249 involving floating point, convert the integers to floating point
14250 so that the resulting value does not suffer from catastrophic
14251 integer truncation. For example, on a 64-bit host (* 4
14252 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14253 Do not rely on undefined behavior after integer overflow.
14254
de883a70
PE
14255 merge count_size_as_multibyte, parse_str_to_multibyte
14256 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14257 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14258 Check for integer overflow.
14259 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14260 since it's now a duplicate of the other. This is more of
14261 a character than a buffer op, so better that it's in character.c.
14262 * fns.c, print.c: Adjust to above changes.
14263
2ff916cb
PE
142642011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14265
14266 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14267
f1b54466
PE
142682011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14269
fb1ac845
PE
14270 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14271 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14272 (x_clipboard_manager_save): Now static.
14273 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14274
f1b54466
PE
14275 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14276 (crypto_hash_function): Now static.
14277 Fix pointer signedness problems. Avoid unnecessary initializations.
14278
a9f737ee
CY
142792011-05-27 Chong Yidong <cyd@stupidchicken.com>
14280
14281 * termhooks.h (Vselection_alist): Make it terminal-local.
14282
14283 * terminal.c (create_terminal): Initialize it.
14284
14285 * xselect.c: Support for clipboard managers.
14286 (Vselection_alist): Move to termhooks.h as terminal-local var.
14287 (LOCAL_SELECTION): New macro.
14288 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14289 (symbol_to_x_atom): Remove gratuitous arg.
14290 (x_handle_selection_request, lisp_data_to_selection_data)
14291 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14292 (x_own_selection, x_get_local_selection, x_convert_selection):
14293 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14294 (some_frame_on_display): Delete unused function.
14295 (Fx_own_selection_internal, Fx_get_selection_internal)
14296 (Fx_disown_selection_internal, Fx_selection_owner_p)
14297 (Fx_selection_exists_p): New optional frame arg.
14298 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14299 (x_handle_selection_clear): Don't treat other terminals with the
14300 same keyboard specially. Use the terminal-local Vselection_alist.
14301 (x_clear_frame_selections): Use Frun_hook_with_args.
14302
14303 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14304
14305 * xterm.h: Add support for those atoms.
14306
e067f0c1
CY
143072011-05-26 Chong Yidong <cyd@stupidchicken.com>
14308
14309 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14310 (converted_selections, conversion_fail_tag): New global variables.
14311 (x_selection_request_lisp_error): Free the above.
14312 (x_get_local_selection): Remove unnecessary code.
14313 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14314 of converted selections stored in converted_selections.
14315 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14316 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14317 (x_convert_selection): New function.
14318 (x_handle_selection_event): Simplify.
14319 (x_get_foreign_selection): Don't ignore incoming requests while
14320 waiting for an answer; this will fail when we implement
14321 SAVE_TARGETS, and seems unnecessary anyway.
14322 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14323 (Vx_sent_selection_functions): Doc fix.
14324
0f4aebc0
LL
143252011-05-26 Leo Liu <sdl.web@gmail.com>
14326
14327 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14328
e61124cd
YM
143292011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14330
14331 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14332
14333 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14334 for fringe update if it has periodic bitmap.
ac389d0c 14335 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14336 and fringe_bitmap_periodic_p.
14337
14338 * fringe.c (get_fringe_bitmap_data): New function.
14339 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14340 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14341 row. Mark glyph row for fringe update if periodicity changed.
14342
14343 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14344 for fringe update unless it has periodic bitmap.
14345
f16d9837
KH
143462011-05-25 Kenichi Handa <handa@m17n.org>
14347
14348 * xdisp.c (get_next_display_element): Set correct it->face_id for
14349 a static composition.
14350
e1b90ef6
LL
143512011-05-24 Leo Liu <sdl.web@gmail.com>
14352
14353 * deps.mk (fns.o):
14354 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14355
14356 * fns.c (crypto_hash_function, Fsha1): New function.
14357 (Fmd5): Use crypto_hash_function.
14358 (syms_of_fns): Add Ssha1.
14359
7400048f
PE
143602011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14361
14362 * gnutls.c: Remove unused macros.
14363 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14364 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14365 Remove macros that are defined and never used.
14366 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14367
abb71cf4
CY
143682011-05-22 Chong Yidong <cyd@stupidchicken.com>
14369
14370 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14371 (Fx_get_selection_internal): Minor cleanup.
14372 (Fx_own_selection_internal): Rename arguments for consistency with
14373 select.el.
14374
6307db39
PE
143752011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14376
14377 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14378
f3d4e0a4
CY
143792011-05-22 Chong Yidong <cyd@stupidchicken.com>
14380
14381 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14382
4d8ade89
YM
143832011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14384
14385 * dispnew.c (scrolling_window): Don't exclude the case that the
14386 last enabled row in the desired matrix touches the bottom boundary.
14387
32078c8d
GM
143882011-05-21 Glenn Morris <rgm@gnu.org>
14389
14390 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
14391 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14392 and add some more files.
32078c8d 14393
7285dc67
EZ
143942011-05-20 Eli Zaretskii <eliz@gnu.org>
14395
14396 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14397 report_file_error introduced by the change from 2011-05-07.
14398
89d1bd22
PE
143992011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14400
14401 * systime.h (Time): Define only if emacs is defined.
14402 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14403 where the include path doesn't have X11/X.h by default. See
14404 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14405
cd394be1 144062011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
14407
14408 * composite.c (find_automatic_composition): Fix previous change.
14409
b9704ad9
GM
144102011-05-20 Glenn Morris <rgm@gnu.org>
14411
14412 * lisp.mk: New file, split from Makefile.in.
14413 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14414 (shortlisp): Remove.
14415 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14416
4a720484
GM
144172011-05-19 Glenn Morris <rgm@gnu.org>
14418
14419 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14420 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14421 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14422 (lisp): Set the order to that of loadup.el.
14423 (shortlisp): Make it a copy of $lisp.
14424 (SOME_MACHINE_LISP): Remove.
14425 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14426 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14427
a28d4396
KH
144282011-05-18 Kenichi Handa <handa@m17n.org>
14429
14430 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14431 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14432 (find_automatic_composition): Mostly rewrite for efficiency.
14433
a2b1fa8e
JB
144342011-05-18 Juanma Barranquero <lekktu@gmail.com>
14435
14436 * makefile.w32-in: Update dependencies.
14437
8e1f5610
CS
144382011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14439
14440 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 14441 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 14442
7025ee00 144432011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 14444
cdfa6eab
PE
14445 Fix some integer overflow issues, such as string length overflow.
14446
06d6db33
PE
14447 * insdel.c (count_size_as_multibyte): Check for string overflow.
14448
2b4560a8
PE
14449 * character.c (lisp_string_width): Check for string overflow.
14450 Use EMACS_INT, not int, for string indexes and lengths; in
14451 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14452 the resulting string length overflows an EMACS_INT; instead,
14453 report a string overflow if no precision given. When checking for
14454 precision exhaustion, use a check that cannot possibly have
14455 integer overflow. (Bug#8675)
14456 * character.h (lisp_string_width): Adjust to new signature.
14457
cb93f9be
PE
14458 * alloc.c (string_overflow): New function.
14459 (Fmake_string): Use it. This doesn't change behavior, but saves
14460 a few bytes and will simplify future changes.
14461 * character.c (string_escape_byte8): Likewise.
14462 * lisp.h (string_overflow): New decl.
14463
1a1f3366
PE
14464 Fixups, following up to the user-interface timestamp change.
14465 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14466 for UI timestamps, instead of unsigned long.
9fbd6841
PE
14467 * msdos.c (mouse_get_pos): Likewise.
14468 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
14469 * w32gui.h (Time): Define by including "systime.h" rather than by
14470 declaring it ourselves. (Bug#8664)
14471
d4e3e4d3
PE
14472 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14473 * image.c (clear_image_cache): Likewise.
14474
f6a24d19
PE
14475 * term.c (term_mouse_position): Don't assume time_t wraparound.
14476
08dc5ae6
PE
14477 Be more systematic about user-interface timestamps.
14478 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
14479 and sometimes 'EMACS_UINT', to represent these timestamps.
14480 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
14481 This makes the code easier to follow, and makes it easier to catch
14482 integer overflow bugs such as Bug#8664.
14483 * frame.c (Fmouse_position, Fmouse_pixel_position):
14484 Use Time, not unsigned long, for user-interface timestamps.
14485 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14486 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14487 * keyboard.h (last_event_timestamp): Likewise.
14488 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14489 * menu.h (xmenu_show): Likewise.
14490 * term.c (term_mouse_position): Likewise.
14491 * termhooks.h (struct input_event.timestamp): Likewise.
14492 (struct terminal.mouse_position_hook): Likewise.
14493 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14494 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14495 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14496 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14497 what it was before.
14498 * menu.h, termhooks.h: Include "systime.h", for Time.
14499
8e55734a
PE
14500 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14501 Don't assume that the difference between two unsigned long values
14502 can fit into an integer. At this point, we know button_down_time
14503 <= event->timestamp, so the difference must be nonnegative, so
14504 there's no need to cast the result if double-click-time is
14505 nonnegative, as it should be; check that it's nonnegative, just in
14506 case. This bug is triggered when events are more than 2**31 ms
86db42d2 14507 apart (about 25 days). (Bug#8664)
8e55734a 14508
841f1b75 14509 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 14510 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 14511
3e26f69c
PE
14512 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14513 that always fit in int. Use a sentinel instead of a counter, to
14514 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
14515 * frame.h (struct frame): Use int for menu_bar_items_used
14516 instead of EMACS_INT, since it always fits in int.
3e26f69c 14517
5cc152c0
PE
14518 * menu.c (grow_menu_items): Check for int overflow.
14519
d89eb65e
PE
14520 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14521
5235bd3e
PE
14522 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14523 Before, the code was not consistent. These values cannot exceed
14524 2**31 - 1 so there's no need to make them unsigned.
14525 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14526 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14527 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14528 as modifiers.
14529 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14530
bc827e23
PE
14531 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14532 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14533 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14534 presumably because the widths might not match.
14535
78eb494e
PE
14536 * window.c (size_window): Avoid needless test at loop start.
14537
04f2d78b
CB
145382011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14539
14540 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14541
d2fc7e3d 145422011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
14543
14544 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14545
d2fc7e3d 145462011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
14547
14548 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14549 `width' to `bar_area_x' and `bar_area_width', respectively.
14550 (x_scroll_run): Take account of fringe background extension.
14551
04f2d78b
CB
14552 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14553 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
14554 `bar_area_width', respectively.
14555 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14556 background extension.
14557
79b70037
GM
145582011-05-10 Jim Meyering <meyering@redhat.com>
14559
14560 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14561
2f142cc5
JB
145622011-05-10 Juanma Barranquero <lekktu@gmail.com>
14563
14564 * image.c (Finit_image_library): Return t for built-in image types,
14565 like pbm and xbm. (Bug#8640)
14566
57679c86
AS
145672011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14568
14569 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14570
888c9e86
EZ
145712011-05-07 Eli Zaretskii <eliz@gnu.org>
14572
b0512a1d
EZ
14573 * w32console.c (Fset_screen_color): Doc fix.
14574 (Fget_screen_color): New function.
14575 (syms_of_ntterm): Defsubr it.
14576
7285dc67
EZ
14577 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14578 unlink the temporary file if Fcall_process didn't create it in the
14579 first place.
14580 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14581 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
14582 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14583 cue to call_process_cleanup not to close that handle.
14584
4d3fcc8e
BK
145852011-05-07 Ben Key <bkey76@gmail.com>
14586
14587 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14588 one of two shell specific rules, either bootstrap-temacs-CMD or
14589 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14590 to the previous implementation of the bootstrap-temacs rule.
14591 The bootstrap-temacs-CMD rule is similar to the previous
14592 implementation of the bootstrap-temacs rule except that it
14593 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14594 variable.
14595
14596 These changes, along with some changes to nt/configure.bat,
14597 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14598 earlier fix to add support for --cflags and --ldflags options
14599 that include quotes so that it works whether make uses cmd or
14600 sh as the shell.
14601
b4289b64
MA
146022011-05-06 Michael Albinus <michael.albinus@gmx.de>
14603
14604 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14605 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14606 is a constant.
14607 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14608 a string. Handle both cases.
14609 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14610 (Fdbus_register_method): Use Qinvalid_function.
14611
af4c0e28
JB
146122011-05-06 Juanma Barranquero <lekktu@gmail.com>
14613
14614 * makefile.w32-in: Update dependencies.
14615 (LISP_H): Add inttypes.h and stdin.h.
14616 (PROCESS_H): Add unistd.h.
14617
c51453d9
EZ
146182011-05-06 Eli Zaretskii <eliz@gnu.org>
14619
14620 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14621 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14622
8ff0ac3c 146232011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 14624
4c4b566b
PE
14625 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14626
aab2b9b5
PE
14627 * term.c (vfatal): Remove stray call to va_end.
14628 It's not needed and the C Standard doesn't allow it here anyway.
14629
c378da0b
PE
14630 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14631 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14632
288b08c7
PE
14633 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14634 bytes.
14635
e3601888
PE
14636 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14637
db6c0e74
PE
14638 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14639
dd5963ea
PE
14640 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14641
88c9450f
PE
14642 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14643
2f9442b8
PE
14644 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14645
c032b5f8
PE
14646 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14647 * charset.c (Fdefine_charset_internal): Don't initialize
14648 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 14649 32-bit int (Bug#8600).
a108c10b
PE
14650
14651 * lread.c (read_integer): Be more consistent with string-to-number.
14652 Use string_to_number to do the actual conversion; this avoids
14653 rounding errors and fixes some other screwups. Without this fix,
14654 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14655 (digit_to_number): Move earlier, for benefit of read_integer.
14656 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 14657 not a digit in any supported base. (Bug#8602)
a108c10b 14658
ad5f9eea
PE
14659 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14660
aec1708a
PE
14661 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14662 to match comment at start of function. This also removes a
14663 GCC warning about overflow in a 32+64-bit port.
14664
47be4ab5
PE
14665 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14666
371cac43
PE
14667 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14668 Reported by Stefan Monnier in
14669 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
14670 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14671 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 14672
d01a7826
PE
14673 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14674 (EMACS_UINTPTR): Likewise, with uintptr_t.
14675
7fd47d5c
PE
14676 * lisp.h: Prefer 64-bit EMACS_INT if available.
14677 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14678 on 32-bit hosts that have 64-bit int, so that they can access
14679 large files.
122b0c86
PE
14680 However, temporarily disable this change unless the temporary
14681 symbol WIDE_EMACS_INT is defined.
7fd47d5c 14682
8727937b
PE
14683 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14684
8ac068ac
PE
14685 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14686 This removes an assumption that EMACS_INT and long are the same
14687 width as pointers. The assumption is true for Emacs porting targets
14688 now, but we want to make other targets possible.
14689 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14690 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14691 In the rest of the code, change types of integers that hold casted
14692 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14693 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14694 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14695 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14696 No need to cast type when ORing.
14697 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14698 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14699 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14700 assume EMACS_INT is the same width as char *.
14701 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14702 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14703 Remove no-longer-needed casts.
14704 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14705 (xg_tool_bar_help_callback, xg_make_tool_item):
14706 Use EMACS_INTPTR to hold an integer
14707 that will be cast to void *; this can avoid a GCC warning
14708 if EMACS_INT is not the same width as void *.
14709 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14710 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14711 (current_message_1, set_message_1):
14712 Use a local to convert to proper width without a cast.
14713 * xmenu.c (dialog_selection_callback): Likewise.
14714
ede49d71
PE
14715 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14716 Also, don't assume VALBITS / RAND_BITS is less than 5,
14717 and don't rely on undefined behavior when shifting a 1 left into
14718 the sign bit.
14719 * lisp.h (get_random): Change signature to match.
14720
2f30ecd0
PE
14721 * lread.c (hash_string): Use size_t, not int, for hash computation.
14722 Normally we prefer signed values; but hashing is special, because
14723 it's better to use unsigned division on hash table sizes so that
14724 the remainder is nonnegative. Also, size_t is the natural width
14725 for hashing into memory. The previous code used 'int', which doesn't
14726 retain enough info to hash well into very large tables.
14727 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14728
2a866e7b
PE
14729 * dbusbind.c: Don't possibly lose pointer info when converting.
14730 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14731 Use XPNTR rather than XHASH, so that the high-order bits of
14732 the pointer aren't lost when converting through void *.
14733
51639eac
PE
14734 * eval.c (Fautoload): Don't double-shift a pointer.
14735
92394119
PE
14736 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14737
dbdb9a7c
JB
147382011-05-06 Juanma Barranquero <lekktu@gmail.com>
14739
14740 * gnutls.c (DEF_GNUTLS_FN):
14741 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14742
db7a0b4f
AS
147432011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14744
14745 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14746 marker. (Bug#8610)
14747
cd394be1 147482011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
14749
14750 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14751 New version that can reserve upto 2GB of heap space.
14752
f7ff1b0f 147532011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
14754
14755 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14756
639c109b
TZ
147572011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14758
14759 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14760 `gnutls_certificate_set_x509_key_file'.
14761
d2127135
JB
147622011-05-05 Juanma Barranquero <lekktu@gmail.com>
14763
14764 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14765 Update dependencies.
14766
e968f4f3
JB
147672011-05-04 Juanma Barranquero <lekktu@gmail.com>
14768
14769 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14770 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14771 Remove unused parameter `fildes'.
14772 * process.c (read_process_output, send_process): Don't pass it.
14773
84d358f0
JB
147742011-05-04 Juanma Barranquero <lekktu@gmail.com>
14775
14776 Fix previous change: the library cache is defined in w32.c.
14777 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14778 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14779
0898ca10
JB
147802011-05-04 Juanma Barranquero <lekktu@gmail.com>
14781
14782 Implement dynamic loading of GnuTLS on Windows.
14783
14784 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14785 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14786 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14787 Declare.
14788
14789 * gnutls.c (Qgnutls_dll): Define.
14790 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14791 (gnutls_*): Declare function pointers.
14792 (init_gnutls_functions): New function to initialize function pointers.
14793 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14794 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14795 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14796 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14797 (emacs_gnutls_write, emacs_gnutls_read)
14798 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14799 (Fgnutls_available_p): New function.
14800 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14801 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14802 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14803
14804 * image.c: Include w32.h.
14805 (Vimage_type_cache): Delete.
14806 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14807 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14808 (w32_delayed_load): Move to w32.c.
14809
14810 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14811
14812 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14813 (w32_delayed_load): Move from image.c. When loading a library, record
14814 its filename in the :loaded-from property of the library id.
14815 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14816 Initialize and staticpro them.
14817 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14818
14819 * process.c: Include lisp.h before w32.h, not after.
14820 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14821 instead of gnutls_record_check_pending.
14822
14823 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14824
ff4de4aa
TZ
148252011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14826
14827 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14828 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14829 as passed in.
14830
abe95abb
JD
148312011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14832
14833 * xterm.c (x_set_frame_alpha): Do not set property on anything
14834 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14835
e16e55d4
JB
148362011-05-02 Juanma Barranquero <lekktu@gmail.com>
14837
14838 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14839
bafcf6a5
JB
148402011-05-02 Juanma Barranquero <lekktu@gmail.com>
14841
14842 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14843 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14844 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14845 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14846 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14847 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14848 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14849 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14850 (Qgnutls_bootprop_callbacks_verify): Make static.
14851
e7a6747f
AS
148522011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14853
19ed11ba
AS
14854 * callproc.c: Indentation fixup.
14855
e7a6747f 14856 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
14857 (wait_for_termination, interruptible_wait_for_termination):
14858 Move after wait_for_termination_1.
e7a6747f 14859
1ef14cb4
LMI
148602011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14861
14862 * sysdep.c (interruptible_wait_for_termination): New function
14863 which is like wait_for_termination, but allows keyboard
14864 interruptions.
14865
14866 * callproc.c (Fcall_process): Add (:file "file") as an option for
14867 the STDOUT buffer.
14868 (Fcall_process_region): Ditto.
14869
330d880c
EZ
148702011-04-30 Eli Zaretskii <eliz@gnu.org>
14871
8db90b73
EZ
14872 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14873 rather than `XVECTOR (FOO)->size'.
14874
330d880c
EZ
14875 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14876 inttypes.h, as a gnulib replacement is used if it not available in
14877 system headers.
14878
15cbd324
EZ
148792011-04-21 Eli Zaretskii <eliz@gnu.org>
14880
14881 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14882 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14883 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14884
14885 * coding.c (coding_alloc_by_realloc): Error out if destination
14886 will grow beyond MOST_POSITIVE_FIXNUM.
14887 (decode_coding_emacs_mule): Abort if there isn't enough place in
14888 charbuf for the composition carryover bytes. Reserve an extra
14889 space for up to 2 characters produced in a loop.
14890 (decode_coding_iso_2022): Abort if there isn't enough place in
14891 charbuf for the composition carryover bytes.
14892
148932011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 14894
ae940cca
EZ
14895 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14896 aborting when %lld or %lll format is passed.
14897 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14898 %llo or %llx format is passed. (Bug#8545)
14899
03ab8921
EZ
14900 * window.c (window_scroll_line_based): Use a marker instead of
14901 simple variables to record original value of point. (Bug#7952)
14902
afda1437
EZ
14903 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14904 produced by %s or %c overflows available buffer space. (Bug#8545)
14905
f76dee0c
PE
149062011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14907
14908 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 14909 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 14910
fdc5744d
JB
149112011-04-28 Juanma Barranquero <lekktu@gmail.com>
14912
14913 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14914
638f053a
JB
149152011-04-28 Juanma Barranquero <lekktu@gmail.com>
14916
14917 * keyboard.c (Qdelayed_warnings_hook): Define.
14918 (command_loop_1): Run `delayed-warnings-hook'
14919 if Vdelayed_warnings_list is non-nil.
14920 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14921 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14922
d178f871
EZ
149232011-04-28 Eli Zaretskii <eliz@gnu.org>
14924
14925 * doprnt.c (doprnt): Don't return value smaller than the buffer
14926 size if the message was truncated. (Bug#8545).
14927
b124fd93
JB
149282011-04-28 Juanma Barranquero <lekktu@gmail.com>
14929
14930 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14931 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14932
e810457d
PE
149332011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14934
14935 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14936
ea51cceb
JB
149372011-04-27 Juanma Barranquero <lekktu@gmail.com>
14938
14939 * makefile.w32-in: Update dependencies.
14940
94dcfacf
EZ
149412011-04-27 Eli Zaretskii <eliz@gnu.org>
14942
14943 Improve `doprnt' and its usage. (Bug#8545)
14944 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14945 `format_end'. Remove support for %l as a conversion specifier.
14946 Don't use xrealloc. Improve diagnostics when the %l size modifier
14947 is used. Update the commentary.
14948
14949 * eval.c (verror): Simplify calculation of size_t.
14950
14951 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14952 messages.
14953
f61f41d7
PE
149542011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14955
14956 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14957 change.
14958
96fb4434
PE
149592011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14960
14961 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14962 This makes this file independent of the recent pseudovector change.
14963
671875da 149642011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 14965
69e9b5a3
PE
14966 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14967
b5f869a7 14968 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 14969 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 14970 Remove unused local.
c8926152 14971 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 14972
841a1577 14973 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
14974 GCC 4.6.0 optimizes based on type-based alias analysis.
14975 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
14976 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14977 != &v->size, and therefore "v->size = 1; b->size = 2; return
14978 v->size;" must therefore return 1. This assumption is incorrect
14979 for Emacs, since it type-puns struct Lisp_Vector * with many other
14980 types. To fix this problem, this patch adds a new type struct
f904488f 14981 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
14982 and pseudovectors, and helps optimizing compilers not get fooled
14983 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14984 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
14985 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14986 the size member.
eab3844f
PE
14987 (XSETPVECTYPE): Rewrite in terms of new macro.
14988 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14989 This is a bit clearer, and further avoids the possibility of
14990 undesirable aliasing.
14991 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 14992 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
14993 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14994 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
14995 (ASIZE): Now uses header.size rather than size.
14996 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
14997 to avoid the hassle of writing XVECTOR (foo)->header.size.
14998 (struct vectorlike_header): New type.
eab3844f
PE
14999 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15000 object, to help avoid aliasing.
15001 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15002 (SUBRP): Likewise, since Lisp_Subr is a special case.
15003 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15004 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15005 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15006 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15007 changed to be "header.size" and "header.next".
15008 * buffer.h (struct buffer): Likewise.
15009 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15010 * frame.h (struct frame): Likewise.
15011 * process.h (struct Lisp_Process): Likewise.
15012 * termhooks.h (struct terminal): Likewise.
15013 * window.c (struct save_window_data, struct saved_window): Likewise.
15014 * window.h (struct window): Likewise.
15015 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15016 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15017 * buffer.c (init_buffer_once): Likewise.
15018 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15019 special case.
15020 * process.c (Fformat_network_address): Use local var for size,
15021 for brevity.
15022
0df1eac5
PE
15023 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15024
847ab9d1 15025 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15026 * data.c (atof): Remove decl; no longer used or needed.
15027 (digit_to_number): Move to lread.c.
15028 (Fstring_to_number): Use new string_to_number function, to be
15029 consistent with how the Lisp reader treats infinities and NaNs.
15030 Do not assume that floating-point numbers represent EMACS_INT
15031 without losing information; this is not true on most 64-bit hosts.
15032 Avoid double-rounding errors, by insisting on integers when
15033 parsing non-base-10 numbers, as the documentation specifies.
15034 * lisp.h (string_to_number): New decl, replacing ...
15035 (isfloat_string): Remove.
bc0a5c13 15036 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15037 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15038 appears to have been a coding error. Similarly, do not accept
15039 strings like +-1e0 as floating point numbers. Do not report
15040 overflow for integer overflows unless the base is not 10 which
15041 means we have no simple and reliable way to continue.
15042 Break out the floating-point parsing into a new
15043 function string_to_number, so that Fstring_to_number parses
15044 floating point numbers consistently with the Lisp reader.
04f2d78b 15045 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15046 (E_CHAR, EXP_INT): Remove, replacing with ...
15047 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15048 (string_to_number): New function, replacing isfloat_string.
15049 This function checks for valid syntax and produces the resulting
15050 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15051 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15052 so that overflow for non-base-10 numbers is reported only when
15053 there's no portable and simple way to convert to floating point.
452f4150 15054
67769ffc
PE
15055 * textprop.c (set_text_properties_1): Rewrite for clarity,
15056 and to avoid GCC warning about integer overflow.
15057
c20db43f
PE
15058 * intervals.h (struct interval): Use EMACS_INT for members
15059 where EMACS_UINT might cause problems. See
15060 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15061 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15062 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15063 All uses changed.
37aa2f85
PE
15064 (offset_intervals): Tell GCC not to worry about length overflow
15065 when negating a negative length.
c20db43f 15066
2538aa2f
PE
15067 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15068 (overrun_check_free): Likewise.
15069
f2d3008d
PE
15070 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15071 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15072 word size.
15073
ec8df744
PE
15074 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15075 (gnutls_make_error): Rename local to avoid shadowing.
15076 (gnutls_emacs_global_deinit): ifdef out; not used.
15077 (Fgnutls_boot): Use const for pointer to readonly storage.
15078 Comment out unused local. Fix pointer signedness problems.
15079
640ee02d
PE
15080 * lread.c (openp): Don't stuff size_t into an 'int'.
15081 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15082 about possible signed overflow.
15083
6048fb2a
PE
15084 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15085 (GDK_KEY_g): Don't define if already defined.
15086 (xg_prepare_tooltip): Avoid pointer signedness problem.
15087 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15088
fa3c87e1
PE
15089 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15090 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15091
2172544b
PE
15092 * xfns.c (Fx_window_property): Simplify a bit,
15093 to make a bit faster and to avoid GCC 4.6.0 warning.
15094 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15095
9b821a21
PE
15096 * fns.c (internal_equal): Don't assume size_t fits in int.
15097
3c616cfa
PE
15098 * alloc.c (compact_small_strings): Tighten assertion a little.
15099
c2982e87
PE
15100 Replace pEd with more-general pI, and fix some printf arg casts.
15101 * lisp.h (pI): New macro, generalizing old pEd macro to other
15102 conversion specifiers. For example, use "...%"pI"d..." rather
15103 than "...%"pEd"...".
15104 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15105 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15106 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15107 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15108 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15109 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15110 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15111 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15112 64-bit hosts.
15113 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15114 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15115 * print.c (safe_debug_print, print_object): Likewise.
15116 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15117 to int.
6f04d126
PE
15118 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15119 avoiding the 0 flag, which is not portable.
c2982e87
PE
15120 * process.c (Fmake_network_process): Use pI to avoid cast.
15121 * region-cache.c (pp_cache): Likewise.
15122 * xdisp.c (decode_mode_spec): Likewise.
15123 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15124 behavior on 64-bit hosts with printf arg.
6f04d126 15125 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15126 (x_stop_queuing_selection_requests): Likewise.
15127 (x_get_window_property): Don't truncate byte count to an 'int'
15128 when tracing.
0b432f21 15129
5e073ec7
PE
15130 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15131 here, since it parses constructs like leading '-' and spaces,
15132 which are not wanted; and it overflows with large numbers.
15133 Instead, simply match F[0-9]+, which is what is wanted anyway.
15134
36372bf9
PE
15135 * alloc.c: Remove unportable assumptions about struct layout.
15136 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15137 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15138 (allocate_vectorlike, make_pure_vector): Use the new macros,
15139 plus offsetof, to remove unportable assumptions about struct layout.
15140 These assumptions hold on all porting targets that I know of, but
15141 they are not guaranteed, they're easy to remove, and removing them
15142 makes further changes easier.
15143
0b432f21
PE
15144 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15145 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15146 (string_overrun_cookie): Now const. Use initializers that
15147 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15148 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15149 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15150 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15151 multiple of sizeof (EMACS_INT); it need not be, if
15152 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15153 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15154
895009e1
JB
151552011-04-26 Juanma Barranquero <lekktu@gmail.com>
15156
15157 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15158
6a7a1b0b
TZ
151592011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15160
15161 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15162 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15163 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15164
841a1577 151652011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15166
15167 * lisp.h (Qdebug): List symbol.
895009e1 15168 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15169 * keyboard.c (debug-on-event): New variable.
15170 (handle_user_signal): Break into debugger when debug-on-event
15171 matches the current signal symbol.
15172
f2d3ba6f
DN
151732011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15174
15175 * alloc.c (check_sblock, check_string_bytes)
15176 (check_string_free_list): Convert to standard C.
15177
42ce4c63
TZ
151782011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15179
15180 * w32.c (emacs_gnutls_push): Fix typo.
15181
825cd63c
EZ
151822011-04-25 Eli Zaretskii <eliz@gnu.org>
15183
fb11d64d
EZ
15184 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15185 "cast to pointer from integer of different size".
15186
825cd63c
EZ
15187 Improve doprnt and its use in verror. (Bug#8545)
15188 * doprnt.c (doprnt): Document the set of format control sequences
15189 supported by the function. Use SAFE_ALLOCA instead of always
15190 using `alloca'.
15191
15192 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15193 is one byte too soon. Don't use xrealloc; instead xfree and
15194 xmalloc anew.
15195
e061a11b
TZ
151962011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15197
15198 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15199 callbacks stage.
15200
15201 * gnutls.c: Renamed global_initialized to
15202 gnutls_global_initialized. Added internals for the
15203 :verify-hostname-error, :verify-error, and :verify-flags
15204 parameters of `gnutls-boot' and documented those parameters in the
15205 docstring. Start callback support.
9173deec
JB
15206 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15207 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15208 on error. Return error code.
e061a11b
TZ
15209 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15210 (emacs_gnutls_read): Likewise.
15211 (Fgnutls_boot): Return handshake error code.
15212 (emacs_gnutls_handle_error): New function.
15213 (wsaerror_to_errno): Likewise.
15214
15215 * w32.h (emacs_gnutls_pull): Add prototype.
15216 (emacs_gnutls_push): Likewise.
15217
15218 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15219 (emacs_gnutls_push): Likewise.
15220
152212011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15222
15223 * process.c (wait_reading_process_output): Check if GnuTLS
15224 buffered some data internally if no FDs are set for TLS
15225 connections.
15226
15227 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15228 (LIBS): Link to USER_LIBS.
15229 ($(BLD)/gnutls.$(0)): New target.
15230
fa6996bc
EZ
152312011-04-24 Eli Zaretskii <eliz@gnu.org>
15232
eb35682e
EZ
15233 * xdisp.c (handle_single_display_spec): Rename the
15234 display_replaced_before_p argument into display_replaced_p, to
15235 make it consistent with the commentary. Fix typos in the
15236 commentary.
15237
e2ad650c
EZ
15238 * textprop.c (syms_of_textprop): Remove dead code.
15239 (copy_text_properties): Delete obsolete commentary about an
15240 interface that was deleted long ago. Fix typos in the description
15241 of arguments.
15242
1b2de274
EZ
15243 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15244 to changes in oldXMenu/XMenu.h from 2011-04-16.
15245 <menu_help_message, prev_menu_help_message>: Constify.
15246 (IT_menu_make_room): menu->help_text is now `const char **';
15247 adjust.
15248
15249 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15250 to changes in oldXMenu/XMenu.h from 2011-04-16.
15251 (struct XMenu): Declare `help_text' `const char **'.
15252
15253 * xfaces.c <Qunspecified>: Make extern again.
15254
15255 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15256 required by POSIX.
1b2de274 15257
762b15be
EZ
15258 * doc.c (get_doc_string): Improve the format passed to `error'.
15259
15260 * doprnt.c (doprnt): Improve commentary.
15261
15262 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15263
15264 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15265 them with etags.
15266
f1052e5d
EZ
15267 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15268 changes in globals.h immediately force recompilation.
762b15be
EZ
15269 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15270 $(CURDIR)/s/ms-w32.h.
15271 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15272
fa6996bc
EZ
15273 * character.c (Fchar_direction): Function deleted.
15274 (syms_of_character): Don't defsubr it.
15275 <char-direction-table>: Deleted.
15276
e6c3da20
EZ
152772011-04-23 Eli Zaretskii <eliz@gnu.org>
15278
15279 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15280 * doprnt.c: Include limits.h.
15281 (SIZE_MAX): New macro.
04f2d78b
CB
15282 (doprnt): Return a size_t value. 2nd arg is now size_t.
15283 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15284 Improve overflow protection. Support `l' modifier for integer
15285 conversions. Support %l conversion. Don't assume an EMACS_INT
15286 argument for integer conversions and for %c.
15287
15288 * lisp.h (doprnt): Restore prototype.
15289
15290 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15291 $(SRC)/character.h.
15292
15293 * Makefile.in (base_obj): Add back doprnt.o.
15294
15295 * deps.mk (doprnt.o): Add back prerequisites.
15296 (callint.o): Depend on character.h.
15297
15298 * eval.c (internal_lisp_condition_case): Include the handler
15299 representation in the error message.
15300 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15301 when breaking from the loop.
15302
15303 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15304
15305 * callint.c (Fcall_interactively): When displaying error message
15306 about invalid control letter, pass the character's codepoint, not
15307 a pointer to its multibyte form. Improve display of the character
15308 in octal and display also its hex code.
15309
15310 * character.c (char_string): Use %x to display the (unsigned)
15311 codepoint of an invalid character, to avoid displaying a bogus
15312 negative value.
15313
15314 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15315 `error', not SYMBOL_NAME itself.
15316
15317 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15318 character arguments to `error'.
15319
15320 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15321 to `error' in error message about FINAL_CHAR argument. Make sure
15322 FINAL_CHAR is a character, and use %c when it is passed as
15323 argument to `error'.
15324
4ffd0d6b 153252011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15326
15327 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15328
15329 * w32.c: Include <time.h>.
15330 (sys_localtime): New function.
15331
4ffd0d6b 153322011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15333
15334 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15335
4ffd0d6b 15336 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15337
4ffd0d6b 153382011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15339
4ffd0d6b
GM
15340 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15341 zombies (Bug#8467).
aac0c6e3 15342
04c56954
EZ
153432011-04-19 Eli Zaretskii <eliz@gnu.org>
15344
15345 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15346 gl_state.e_property when gl_state.object is Qt.
15347
15348 * insdel.c (make_gap_larger): Remove limitation of buffer size
15349 to <= INT_MAX.
15350
16a43933
CY
153512011-04-18 Chong Yidong <cyd@stupidchicken.com>
15352
15353 * xdisp.c (lookup_glyphless_char_display)
15354 (produce_glyphless_glyph): Handle cons cell entry in
15355 glyphless-char-display.
15356 (Vglyphless_char_display): Document it.
15357
15358 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15359 glyphless-char-display.
15360
4581706e
CY
153612011-04-17 Chong Yidong <cyd@stupidchicken.com>
15362
15363 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15364
15365 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15366
15367 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15368 definition for no-X builds.
15369
4887c6e2 153702011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 15371
fd35b6f9
PE
15372 Static checks with GCC 4.6.0 and non-default toolkits.
15373
5c1ccb01
PE
15374 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15375
006c5daa
PE
15376 * process.c (keyboard_bit_set): Define only if SIGIO.
15377 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15378 (send_process): Repair possible setjmp clobbering.
15379
efc736d3
PE
15380 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15381
4e2fe2e6
PE
15382 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15383
f97334a2
PE
15384 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15385
4e75f29d
PE
15386 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15387 Define only if needed.
15388
90efadd1
PE
15389 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15390 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 15391 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 15392
3c647824
PE
15393 * dispextern.h (struct redisplay_interface): Rename param
15394 to avoid shadowing.
e264f262 15395 * termhooks.h (struct terminal): Likewise.
761383f4 15396 * xterm.c (xembed_send_message): Likewise.
3c647824 15397
b58c5c4a
PE
15398 * insdel.c (make_gap_smaller): Define only if
15399 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15400
cad59032
PE
15401 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15402 it.
15403
c339dc2e
PE
15404 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15405 so that we aren't warned about unused symbols.
15406
91a3e27b
PE
15407 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15408
399c71d3 15409 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 15410
8ffc96f5
PE
15411 * xfns.c (x_real_positions): Mark locals as initialized.
15412
eef9bc79
PE
15413 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15414
098db9dd
PE
15415 * xterm.c: Fix problems found by static analysis with other toolkits.
15416 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
15417 (x_dispatch_event): Declare static if USE_GTK, and
15418 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 15419 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 15420 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
15421 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15422 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 15423
eb18f6cc
PE
15424 * xmenu.c (menu_help_callback): Pointer type fixes.
15425 Use const pointers when pointing at readonly data. Avoid pointer
15426 signedness clashes.
15427 (FALSE): Remove unused macro.
15428 (update_frame_menubar): Remove unused decl.
15429
1fe72bf8
PE
15430 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15431
60d9e1db
PE
15432 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15433 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15434 (single_menu_item): Rename local to avoid shadowing.
15435
39261c26
PE
15436 * keyboard.c (make_lispy_event): Remove unused local var.
15437
018c5e19
PE
15438 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15439 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15440
63d2b86e
PE
15441 * bitmaps: Change bitmaps from unsigned char back to the X11
15442 compatible char. Avoid the old compiler warnings about
15443 out-of-range initializers by using, for example, '\xab' rather
15444 than 0xab.
15445
aefd87e1
PE
15446 * xgselect.c (xgselect_initialize): Check vs interface
15447 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15448
bf501fb9
PE
15449 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15450
e9829fdf
PE
15451 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15452 to read-only memory.
15453
1086c095
PE
15454 * fns.c (vector): Remove; this old hack is no longer needed.
15455
2baccd04 15456 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 15457 Remove unused var.
dde42981 15458 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 15459
72391843 15460 * xrdb.c (x_load_resources): Omit unused local.
3565b346 15461
436c16df 15462 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 15463 (x_window): Rename locals to avoid shadowing.
dc5ddd85 15464 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 15465
92bb796d 15466 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 15467 (x_term_init): Remove local to avoid shadowing.
92bb796d 15468
764430a3 15469 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
15470
15471 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15472 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15473
d1dfb56c
EZ
154742011-04-16 Eli Zaretskii <eliz@gnu.org>
15475
c4354cb4
EZ
15476 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15477
d1dfb56c
EZ
15478 Fix regex.c, syntax.c and friends for buffers > 2GB.
15479 * syntax.h (struct gl_state_s): Declare character position members
15480 EMACS_INT.
15481
15482 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15483
04f2d78b
CB
15484 * textprop.c (verify_interval_modification, interval_of):
15485 Declare arguments EMACS_INT.
d1dfb56c
EZ
15486
15487 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15488 EMACS_INT.
15489
15490 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15491
15492 * indent.c (Fvertical_motion): Local variable it_start is now
15493 EMACS_INT.
15494
15495 * regex.c (re_match, re_match_2, re_match_2_internal)
15496 (bcmp_translate, regcomp, regexec, print_double_string)
15497 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15498 (re_compile_pattern, re_exec): Declare arguments and local
15499 variables `size_t' and `ssize_t' and return values `regoff_t', as
15500 appropriate.
15501 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15502 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15503 <compile_stack_type>: `size' and `avail' are now `size_t'.
15504
15505 * regex.h <regoff_t>: Use ssize_t, not int.
15506 (re_search, re_search_2, re_match, re_match_2): Arguments that
15507 specify buffer/string position and length are now ssize_t and
15508 size_t. Return type is regoff_t.
15509
613052cd
BK
155102011-04-16 Ben Key <bkey76@gmail.com>
15511
15512 * nsfont.m: Fixed bugs in ns_get_family and
15513 ns_descriptor_to_entity that were caused by using free to
15514 deallocate memory blocks that were allocated by xmalloc (via
15515 xstrdup). This caused Emacs to crash when compiled with
15516 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15517 --enable-checking=xmallocoverrun). xfree is now used to
15518 deallocate these memory blocks.
15519
4170f62f 155202011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 15521
71b41406
PE
15522 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15523
9587a89d
PE
15524 emacs_write: Accept and return EMACS_INT for sizes.
15525 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15526 et seq.
15527 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15528 Accept and return EMACS_INT.
15529 (emacs_gnutls_write): Return the number of bytes written on
15530 partial writes.
15531 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
15532 (emacs_read, emacs_write): Remove check for negative size, as the
15533 Emacs source code has been audited now.
9587a89d
PE
15534 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15535 (emacs_read, emacs_write): Use it.
273a5f82
PE
15536 * process.c (send_process): Adjust to the new signatures of
15537 emacs_write and emacs_gnutls_write. Do not attempt to store
15538 a byte offset into an 'int'; it might overflow.
9587a89d 15539 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 15540
3e047f51
PE
15541 * sound.c: Don't assume sizes fit in 'int'.
15542 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 15543 Return EMACS_INT, not int.
3e047f51 15544 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
15545 Accept EMACS_INT, not int.
15546 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
15547 record read return values.
15548
cc39a9db
BK
155492011-04-15 Ben Key <bkey76@gmail.com>
15550
c9d0ec6d
JB
15551 * keyboard.c (Qundefined): Don't declare static since it is used
15552 in nsfns.m.
15553 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15554 static since they are used in nsfont.m.
cc39a9db 15555
6c60eb9f
SM
155562011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15557
15558 * process.c (Qprocessp): Don't declare static.
15559 * lisp.h (Qprocessp): Declare again.
15560
7990b61a
JB
155612011-04-15 Juanma Barranquero <lekktu@gmail.com>
15562
15563 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15564
5d4cb038
PE
155652011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15566
8bd7b830 15567 Improve C-level modularity by making more things 'static'.
cd64ea1d 15568
e3b27b31
PE
15569 Don't publish debugger-only interfaces to other modules.
15570 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15571 (verify_bytepos, count_markers): Move decls to the only modules
15572 that need them.
15573 * region-cache.h (pp_cache): Likewise.
15574 * window.h (check_all_windows): Likewise.
15575 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15576
5d4cb038
PE
15577 * sysdep.c (croak): Now static, if
15578 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15579 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
15580
15581 * alloc.c (refill_memory_reserve): Now static if
15582 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15583 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 15584
e87b6180
PE
15585 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15586 Define only if USE_LUCID.
15587
ac64929e
PE
15588 * xrdb.c (x_customization_string, x_rm_string): Now static.
15589
6f37259d
PE
15590 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15591 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15592
1683e3ab
PE
15593 * xdisp.c (draw_row_with_mouse_face): Now static.
15594 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15595
de9c2632
PE
15596 * window.h (check_all_windows): Mark externally visible.
15597
2b96acb7
PE
15598 * window.c (window_deletion_count): Now static.
15599
15600 * undo.c: Make symbols static if they're not exported.
15601 (last_undo_buffer, last_boundary_position, pending_boundary):
15602 Now static.
15603
50436f33
PE
15604 * textprop.c (interval_insert_behind_hooks): Now static.
15605 (interval_insert_in_front_hooks): Likewise.
15606
64520e5c
PE
15607 * term.c: Make symbols static if they're not exported.
15608 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15609 (max_frame_lines, tty_set_terminal_modes):
15610 (tty_reset_terminal_modes, tty_turn_off_highlight):
15611 (get_tty_terminal): Now static.
15612 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15613 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 15614 HAVE_WINDOW_SYSTEM.
64520e5c
PE
15615 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15616 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15617
1fa53021
PE
15618 * sysdep.c: Make symbols static if they're not exported.
15619 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15620 Now static.
15621 (sigprocmask_set, full_mask): Remove; unused.
15622 (wait_debugging): Mark as visible.
15623 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15624 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15625
d4b43b22
PE
15626 * syntax.c (syntax_temp): Define only if !__GNUC__.
15627
b7c513d0
PE
15628 * sound.c (current_sound_device, current_sound): Now static.
15629
989b29ad
PE
15630 * search.c (searchbufs, searchbuf_head): Now static.
15631
13a55a78
PE
15632 * scroll.c (scroll_cost): Remove; unused.
15633 * dispextern.h (scroll_cost): Remove decl.
15634
de68a1fc
PE
15635 * region-cache.h (pp_cache): Mark as externally visible.
15636
40ccffa6
PE
15637 * process.c: Make symbols static if they're not exported.
15638 (process_tick, update_tick, create_process, chan_process):
15639 (Vprocess_alist, proc_buffered_char, datagram_access):
15640 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15641 (deactivate_process): Mark defn as static, as well as decl.
15642 * lisp.h (create_process): Remove decl.
15643 * process.h (chan_process, Vprocess_alist): Remove decls.
15644
ad64fc97
PE
15645 * print.c: Make symbols static if they're not exported.
15646 (print_depth, new_backquote_output, being_printed, print_buffer):
15647 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15648 (print_interval, print_number_index, initial_stderr_stream):
15649 Now static.
15650 * lisp.h (Fprinc): Remove decl.
15651 (debug_output_compilation_hack): Mark as externally visible.
15652
adddb265
PE
15653 * sysdep.c (croak): Move decl from here to syssignal.h.
15654 * syssignal.h (croak): Put it here, so the API can be checked when
15655 'croak' is called from dissociate_if_controlling_tty.
15656
1717ede2
PE
15657 * minibuf.c: Make symbols static if they're not exported.
15658 (minibuf_save_list, choose_minibuf_frame): Now static.
15659 * lisp.h (choose_minibuf_frame): Remove decl.
15660
fa5fb2bc
PE
15661 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15662
1e3890d1
PE
15663 * lread.c: Make symbols static if they're not exported.
15664 (read_objects, initial_obarray, oblookup_last_bucket_number):
15665 Now static.
15666 (make_symbol): Remove; unused.
15667 * lisp.h (initial_obarray, make_symbol): Remove decls.
15668
8a1414fa
PE
15669 * keyboard.c: Make symbols static if they're not exported.
15670 (single_kboard, recent_keys_index, total_keys, recent_keys):
15671 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15672 (this_single_command_key_start, echoing, last_auto_save):
15673 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15674 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15675 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15676 (Vlispy_mouse_stem, double_click_count):
15677 Now static.
15678 (force_auto_save_soon): Define only if SIGDANGER.
15679 (ignore_mouse_drag_p): Now static if
15680 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15681 (print_help): Remove; unused.
15682 (stop_character, last_timer_event): Mark as externally visible.
15683 * keyboard.h (ignore_mouse_drag_p): Declare only if
15684 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15685 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15686 * lisp.h (echoing): Remove decl.
15687 (force_auto_save_soon): Declare only if SIGDANGER.
15688 * xdisp.c (redisplay_window): Simplify code, to make it more
15689 obvious that ignore_mouse_drag_p is not accessed if !defined
15690 USE_GTK && !defined HAVE_NS.
15691
93ea6e8f
PE
15692 * intervals.c: Make symbols static if they're not exported.
15693 (merge_properties_sticky, merge_interval_right, delete_interval):
15694 Now static.
15695 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15696
77382fcc
PE
15697 * insdel.c: Make symbols static if they're not exported.
15698 However, leave prepare_to_modify_buffer alone. It's never
15699 called from outside this function, but that appears to be a bug.
15700 (combine_after_change_list, combine_after_change_buffer):
4889fc82 15701 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
15702 (adjust_after_replace_noundo): Remove; unused.
15703 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 15704 (signal_before_change): Remove decls.
77382fcc 15705
9306c32e
PE
15706 * indent.c (val_compute_motion, val_vmotion): Now static.
15707
cd44d2eb
PE
15708 * image.c: Make symbols static if they're not exported.
15709 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15710 if USE_GTK.
15711 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15712 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15713
ad9a7a06
PE
15714 * fringe.c (standard_bitmaps): Now static.
15715 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15716
81626931
PE
15717 * frame.c: Make symbols static if they're not exported.
15718 (x_report_frame_params, make_terminal_frame): Now static.
15719 (get_frame_param): Now static, unless HAVE_NS.
15720 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15721 (x_get_resource_string): Remove; not used.
15722 * frame.h (make_terminal_frame, x_report_frame_params):
15723 (x_get_resource_string); Remove decls.
15724 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15725 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15726
239f9db9
PE
15727 * font.c, fontset.c: Make symbols static if they're not exported.
15728 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15729 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15730 * font.c (font_close_object): Now static.
15731 * font.h (font_close_object): Remove.
15732 * fontset.c (FONTSET_OBJLIST): Remove.
15733 (free_realized_fontset) #if-0 the body, which does nothing.
15734 (face_suitable_for_char_p): #if-0, as it's never called.
15735 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
15736 * xfaces.c (face_at_string_position):
15737 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
15738 since 0 is always ASCII.
15739
dfcf3579
PE
15740 * fns.c (weak_hash_tables): Now static.
15741
5045092b
PE
15742 * fileio.c: Make symbols static if they're not exported.
15743 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15744 (Vwrite_region_annotation_buffers): Now static.
15745
57a96f5c
PE
15746 * eval.c: Make symbols static if they're not exported.
15747 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15748 * lisp.h (backtrace_list): Remove decl.
15749
35f08c38
PE
15750 * emacs.c: Make symbols static if they're not exported.
15751 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15752 (fatal_error_code, fatal_error_signal_hook, standard_args):
15753 Now static.
15754 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15755 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15756 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15757 * lisp.h (fatal_error_signal_hook): Remove decl.
15758 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15759
f44bd759
PE
15760 * editfns.c: Move a (normally-unused) function to its only use.
15761 * editfns.c, lisp.h (get_operating_system_release): Remove.
15762 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15763 worth the hassle of breaking this out.
15764
b532497d
PE
15765 * xterm.c: Make symbols static if they're not exported.
15766 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15767 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15768 (x_destroy_window, x_delete_display):
15769 Now static.
15770 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15771 (x_mouse_leave): Remove; unused.
15772 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15773 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15774 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15775 Remove decls.
15776 (x_mouse_leave): Declare only if WINDOWSNT.
15777 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15778 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15779 USE_X_TOOLKIT.
15780
1675728f
PE
15781 * ftxfont.c: Make symbols static if they're not exported.
15782 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15783 HAVE_FREETYPE.
15784 * font.h (ftxfont_driver): Likewise.
15785
e4cebfca
PE
15786 * xfns.c: Make symbols static if they're not exported.
15787 (x_last_font_name, x_display_info_for_name):
15788 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15789 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15790 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15791 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15792 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15793 (last_show_tip_args): Now static.
15794 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15795 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15796 (x_screen_planes): Remove; unused.
15797 * dispextern.h (x_screen_planes): Remove decl.
15798
5bf46f05
PE
15799 * dispnew.c: Make symbols static if they're not exported.
15800 * dispextern.h (redraw_garbaged_frames, scrolling):
15801 (increment_row_positions): Remove.
15802 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15803 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15804 Now static.
15805 (redraw_garbaged_frames): Remove; unused.
15806
435f4c28
PE
15807 * xfaces.c: Make symbols static if they're not exported.
15808 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15809 Remove decls.
15810 * xterm.h (defined_color): Remove decls.
15811 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15812 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15813 (menu_face_changed_default, defined_color, free_realized_face):
15814 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15815 (ascii_face_of_lisp_face): Remove; unused.
15816
8524aef3
PE
15817 * xdisp.c: Make symbols static if they're not exported.
15818 * dispextern.h (scratch_glyph_row, window_box_edges):
15819 (glyph_to_pixel_coords, set_cursor_from_row):
15820 (get_next_display_element, set_iterator_to_next):
15821 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15822 (show_mouse_face): Remove decls
15823 * frame.h (message_buf_print): Likewise.
15824 * lisp.h (pop_message, set_message, check_point_in_composition):
15825 Likewise.
15826 * xterm.h (set_vertical_scroll_bar): Likewise.
15827 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15828 (message_buf_print, scratch_glyph_row, displayed_buffer):
15829 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15830 (get_next_display_element, show_mouse_face, window_box_edges):
15831 (frame_to_window_pixel_xy, check_point_in_composition):
15832 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15833 (glyph_to_pixel_coords): Remove; unused.
15834
16390cd2
PE
15835 * dired.c (file_name_completion): Now static.
15836
15837 * dbusbind.c (xd_in_read_queued_messages): Now static.
15838
a25f4dfa
PE
15839 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15840 * data.c (circular_list_error): Remove.
15841
14a9c8df
PE
15842 * commands.h (last_point_position, last_point_position_buffer):
15843 (last_point_position_window): Remove decls.
15844 * keyboard.c: Make these variables static.
15845
04f2d78b
CB
15846 * coding.h (coding, code_convert_region, encode_coding_gap):
15847 Remove decls.
74ab6df5
PE
15848 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15849 (iso_code_class, detect_coding, code_convert_region): Now static.
15850 (encode_coding_gap): Remove; unused.
15851
38dfbee1
PE
15852 * chartab.c (chartab_chars, chartab_bits): Now static.
15853
a2cb4e63
PE
15854 * charset.h (charset_iso_8859_1): Remove decl.
15855 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15856 Now static.
15857
127198fd
PE
15858 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15859 * ccl.c (Vccl_program_table): Now static.
15860 (check_ccl_update): Remove; unused.
15861
d85b608f
PE
15862 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15863 * category.h: ... from here.
15864 * category.c (check_category_table, set_category_set): Now static.
15865
31cd66f3
PE
15866 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15867 * lisp.h: Remove these decls.
15868
c358e587
PE
15869 * buffer.c (buffer_count): Remove unused var.
15870
e78aecca
PE
15871 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15872 so that it's not optimized away.
15873 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15874 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15875 exported only to the debugger.
15876
e192d7d3 15877 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 15878 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 15879
92470028
PE
15880 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15881 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15882 was inaccessible from Lisp.
15883 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15884 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15885
244ed907
PE
15886 alloc.c: Import and export fewer symbols, and remove unused items.
15887 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15888 is defined.
15889 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15890 it's not optimized away by whole-program optimization.
15891 (message_enable_multibyte, free_misc): Remove.
15892 (catchlist, handlerlist, mark_backtrace):
15893 Declare only if BYTE_MARK_STACK.
15894 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15895 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15896 (message_enable_multibyte): Remove decl.
15897 (free_misc, interval_free_list, float_block, float_block_index):
15898 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15899 (cons_free_list, last_marked_index):
15900 Now static.
15901 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15902 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15903 (mark_backtrace): Define only if BYTE_MARK_STACK.
15904 * xdisp.c (message_enable_multibyte): Now static.
15905
61c2b50e 15906 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
15907 This makes it easier for human readers (and static analyzers)
15908 to see whether these variables are used from other modules.
15909 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15910 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15911 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15912 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15913 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15914 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15915 * xmenu.c, xselect.c:
15916 Declare Q* vars static if they are not used in other modules.
15917 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15918 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15919 Remove decls of unexported vars.
15920 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15921
95c82688
PE
15922 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15923
16a97296
PE
15924 Make Emacs functions such as Fatom 'static' by default.
15925 This makes it easier for human readers (and static analyzers)
15926 to see whether these functions can be called from other modules.
15927 DEFUN now defines a static function. To make the function external
15928 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
15929 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15930 (Finit_image_library):
16a97296
PE
15931 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15932 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15933 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15934 Remove decls, since these functions are now static.
15935 (Funintern, Fget_internal_run_time): New decls, since these functions
15936 were already external.
95c82688 15937
16a97296
PE
15938 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15939 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15940 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15941 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15942 * keyboard.c, keymap.c, lread.c:
15943 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15944 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15945 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15946 Mark functions with DEFUE instead of DEFUN,
15947 if they are used in other modules.
15948 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15949 decls for now-static functions.
15950 * buffer.h (Fdelete_overlay): Remove decl.
15951 * callproc.c (Fgetenv_internal): Mark as internal.
15952 * composite.c (Fremove_list_of_text_properties): Remove decl.
15953 (Fcomposition_get_gstring): New forward static decl.
15954 * composite.h (Fcomposite_get_gstring): Remove decl.
15955 * dired.c (Ffile_attributes): New forward static decl.
15956 * doc.c (Fdocumntation_property): New forward static decl.
15957 * eval.c (Ffetch_bytecode): New forward static decl.
15958 (Funintern): Remove extern decl; now in .h file where it belongs.
15959 * fileio.c (Fmake_symbolic_link): New forward static decl.
15960 * image.c (Finit_image_library): New forward static decl.
15961 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15962 * intervals.h (Fprevious_property_change):
15963 (Fremove_list_of_text_properties): Remove decls.
15964 * keyboard.c (Fthis_command_keys): Remove decl.
15965 (Fcommand_execute): New forward static decl.
15966 * keymap.c (Flookup_key): New forward static decl.
15967 (Fcopy_keymap): Now static.
15968 * keymap.h (Flookup_key): Remove decl.
15969 * process.c (Fget_process): New forward static decl.
15970 (Fprocess_datagram_address): Mark as internal.
15971 * syntax.c (Fsyntax_table_p): New forward static decl.
15972 (skip_chars): Remove duplicate decl.
15973 * textprop.c (Fprevious_property_change): New forward static decl.
15974 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15975 Now internal.
15976 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15977 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15978
785bbd42
PE
15979 * editfns.c (Fformat): Remove unreachable code.
15980
8b913b57
AS
159812011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15982
15983 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15984 change. (Bug#8496)
15985
a6744a35
EZ
159862011-04-13 Eli Zaretskii <eliz@gnu.org>
15987
15988 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15989 when at ZV. (Bug#8487)
15990
e7974947
AS
159912011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15992
baad03f0
AS
15993 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15994 (Bug#8437)
15995 * keyboard.c (parse_tool_bar_item): Likewise.
15996 * sound.c (sound_cleanup, alsa_close): Likewise.
15997 * termcap.c (tgetent): Likewise.
15998 * xfns.c (x_default_font_parameter): Likewise.
15999 * xsettings.c (read_and_apply_settings): Likewise.
16000
e7974947
AS
16001 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16002 (overrun_check_free): Protoize.
16003
28272684
PE
160042011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16005
16006 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16007 since callers should never pass a negative size.
16008 Change the signature to match that of plain 'read' and 'write'; see
16009 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16010 * lisp.h: Update prototypes of emacs_write and emacs_read.
16011
11997c76
EZ
160122011-04-11 Eli Zaretskii <eliz@gnu.org>
16013
16014 * xdisp.c (redisplay_window): Don't try to determine the character
16015 position of the scroll margin if the window start point w->startp
e896f03c 16016 is outside the buffer's accessible region. (Bug#8468)
11997c76 16017
8a2cbd72
EZ
160182011-04-10 Eli Zaretskii <eliz@gnu.org>
16019
16020 Fix write-region and its subroutines for buffers > 2GB.
16021 * fileio.c (a_write, e_write): Modify declaration of arguments and
16022 local variables to support buffers larger than 2GB.
16023 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16024
16025 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16026 argument, local variables, and return value.
16027
16028 * lisp.h: Update prototypes of emacs_write and emacs_read.
16029
16030 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16031
4073e537 160322011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16033
1ebfdcb6
PE
16034 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16035
b2ded58d
PE
16036 Fix more problems found by GCC 4.6.0's static checks.
16037
7d66342c
PE
16038 * xdisp.c (vmessage): Use a better test for character truncation.
16039
bbf47d44
PE
16040 * charset.c (load_charset_map): <, not <=, for optimization,
16041 and to avoid potential problems with integer overflow.
9248994d 16042 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16043 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16044 * editfns.c (Fformat): Likewise.
1e69125e 16045 * syntax.c (skip_chars): Likewise.
3befa583 16046
e3019616
PE
16047 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16048 This also lets GCC 4.6.0 generate slightly better loop code.
16049
becfa255
PE
16050 * callint.c (Fcall_interactively): <, not <=, for optimization.
16051 (Fcall_interactively): Count the number of arguments produced,
16052 not the number of arguments given. This is simpler and lets GCC
16053 4.6.0 generate slightly better code.
16054
dae0cd48
PE
16055 * ftfont.c: Distingish more carefully between FcChar8 and char.
16056 The previous code passed unsigned char * to a functions like
16057 strlen and xstrcasecmp that expect char *, which does not
16058 conform to the C standard.
16059 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16060 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16061 char * when the C standard requires it.
16062
76032d70
PE
16063 * keyboard.c (read_char): Remove unused var.
16064
eb3f1cc8
PE
16065 * eval.c: Port to Windows vsnprintf (Bug#8435).
16066 Include <limits.h>.
16067 (SIZE_MAX): Define if the headers do not.
16068 (verror): Do not give up if vsnprintf returns a negative count.
16069 Instead, grow the buffer. This ports to Windows vsnprintf, which
16070 does not conform to C99. Problem reported by Eli Zaretskii.
16071 Also, simplify the allocation scheme, by avoiding the need for
16072 calling realloc, and removing the ALLOCATED variable.
16073
70476b54
PE
16074 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16075
12020a9e
PE
16076 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16077 But keep the doprint source code for now, as we might revamp it
16078 and use it again (Bug#8435).
ea6c7ae6
PE
16079 * lisp.h (doprnt): Remove.
16080 * Makefile.in (base_obj): Remove doprnt.o.
16081 * deps.mk (doprnt.o): Remove.
16082
5fdb398c
PE
16083 error: Print 32- and 64-bit integers portably (Bug#8435).
16084 Without this change, on typical 64-bit hosts error ("...%d...", N)
16085 was used to print both 32- and 64-bit integers N, which relied on
16086 undefined behavior.
61bdb816 16087 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16088 * lisp.h (error, verror): Mark as printf-like functions.
16089 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16090 Report overflow in size calculations when allocating printf buffer.
16091 Do not truncate output string at its first null byte.
16092 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16093 Truncate the output at a character boundary, since vsnprintf does not
16094 do that.
16095 * charset.c (check_iso_charset_parameter): Convert internal
16096 character to string before calling 'error', since %c now has the
16097 printf meaning.
16098 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16099 overflow when computing char to be passed to 'error'. Do not
16100 pass Lisp_Object to 'error'; pass the integer instead.
16101 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16102 formatted with plain %d.
16103
b189fa66
PE
16104 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16105
bff87ef0
PE
16106 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16107
7e2cac20
PE
16108 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16109
ce4d90b5
PE
16110 * xterm.c (x_catch_errors): Remove duplicate declaration.
16111
266c9547
PE
16112 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16113
79c49ad2
PE
16114 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16115
368f4090
JM
161162011-04-10 Jim Meyering <meyering@redhat.com>
16117
16118 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16119 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16120 return ssize_t not "int", and use size_t as the buffer length.
16121 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16122 * gnutls.h: Update declarations.
16123 * process.c (read_process_output): Use ssize_t, to match.
16124 (send_process): Likewise.
16125
a32d4040
CY
161262011-04-09 Chong Yidong <cyd@stupidchicken.com>
16127
16128 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16129
8546720e 161302011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16131
04f2d78b
CB
16132 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16133 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16134
8546720e
GM
16135 * xterm.c (handle_one_xevent):
16136 * xmenu.c (create_and_show_popup_menu):
16137 * xselect.c (x_decline_selection_request)
16138 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16139
0a2f5c1a 161402011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16141
16142 Fix some uses of `int' instead of EMACS_INT.
16143 * search.c (string_match_1, fast_string_match)
16144 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16145 (scan_buffer, find_next_newline_no_quit)
16146 (find_before_next_newline, search_command, Freplace_match)
16147 (Fmatch_data): Make some `int' variables be EMACS_INT.
16148
16149 * xdisp.c (display_count_lines): 3rd argument and return value now
16150 EMACS_INT. All callers changed.
16151 (pint2hrstr): Last argument is now EMACS_INT.
16152
16153 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16154 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16155 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16156 (decode_coding_utf_16, decode_coding_emacs_mule)
16157 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16158 (decode_coding_ccl, decode_coding_charset)
16159 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16160 (decode_coding_iso_2022, decode_coding_emacs_mule)
16161 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16162 <char_offset, last_offset>: Declare EMACS_INT.
16163 (encode_coding_utf_8, encode_coding_utf_16)
16164 (encode_coding_emacs_mule, encode_invocation_designation)
16165 (encode_designation_at_bol, encode_coding_iso_2022)
16166 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16167 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16168 Declare EMACS_INT.
16169 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16170 (encode_invocation_designation): Last argument P_NCHARS is now
16171 EMACS_INT.
16172 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16173 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16174
16175 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16176 All users changed.
16177
16178 * ccl.c (Fccl_execute_on_string): Declare some variables
16179 EMACS_INT.
16180
8546720e 161812011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16182
16183 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16184
4e19a977
CS
161852011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16186
16187 * process.c (Fformat_network_address): Doc fix.
16188
87302331
R
161892011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16190
ee7683eb 16191 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16192
cbb59342
CY
161932011-04-08 Chong Yidong <cyd@stupidchicken.com>
16194
16195 * keyboard.c (read_char): Call Lisp function help-form-show,
16196 instead of using internal_with_output_to_temp_buffer.
16197 (Qhelp_form_show): New var.
e0d38eeb 16198 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16199
16200 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16201
16202 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16203
e67a13ab
CY
162042011-04-06 Chong Yidong <cyd@stupidchicken.com>
16205
04f2d78b
CB
16206 * process.c (Flist_processes): Remove to Lisp.
16207 (list_processes_1): Delete.
e67a13ab 16208
973f782d
EZ
162092011-04-06 Eli Zaretskii <eliz@gnu.org>
16210
7c106b1e
EZ
16211 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16212
973f782d
EZ
16213 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16214
41cf7d1a 162152011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16216
ca23cc88
PE
16217 Fix more problems found by GCC 4.6.0's static checks.
16218
f390e2d5
PE
16219 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16220
42eea0d0
PE
16221 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16222
b69769da 16223 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16224
f9541e84
PE
16225 * xdisp.c (vmessage): Mark as a printf-like function.
16226
13841b55
PE
16227 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16228
c136c10f
PE
16229 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16230
5e2d4a30
PE
16231 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16232 printf-like functions.
16233 (tiff_load): Add casts to remove these marks before passing them
16234 to system-supplied API.
16235
583f48b9
PE
16236 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16237
b25d760e
PE
16238 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16239 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16240 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16241 directly, rather than having caller test rule sign. This avoids
16242 some unnecessary tests.
16243 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16244 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16245 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16246
bc7b6697 16247 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16248 (xfont_open): Avoid unnecessary tests.
bc7b6697 16249
27ccc379
PE
16250 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16251
dcd5c89a
PE
16252 * composite.h, composite.c (composition_gstring_put_cache):
16253 Use EMACS_INT, not int, for length.
16254
b13a45c6
PE
16255 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16256 breaking out part of COMPOSITION_DECODE_RULE.
16257 (COMPOSITION_DECODE_RULE): Use it.
16258 * composite.c (get_composition_id): Remove unused local vars,
16259 by using the new macro.
16260
1e792e4d
PE
16261 * textprop.c (set_text_properties_1): Change while to do-while,
16262 since the condition is always true at first.
16263
dc6c6455 16264 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16265 (interval_deletion_adjustment): Return unsigned value.
16266 All uses changed.
dc6c6455 16267
aba7731a
PE
16268 * process.c (list_processes_1, create_pty, read_process_output):
16269 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16270 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16271 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16272 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16273 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16274
fdfc4bf3
PE
16275 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16276
fca8fe46 16277 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16278 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16279
06a0259a 16280 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16281 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16282 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16283
e7b9e80f
PE
16284 * print.c (print_error_message): Avoid int overflow.
16285
56201685
PE
16286 * font.c (font_list_entities): Redo for clarity,
16287 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16288
78834453 16289 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16290 (font_score): Avoid potential overflow in diff calculation.
78834453 16291
0bc0b309 16292 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16293 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16294
e610eaca
PE
16295 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16296
b895abce
PE
16297 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16298 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16299 can always succeed if overflow has undefined behavior.
16300
1f1d9321 16301 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16302 (wordify): Omit three unnecessary tests.
1f1d9321 16303
c59478bc
PE
16304 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16305 All callers changed. This avoids the need for an unused var.
16306
79b73827
PE
16307 * casefiddle.c (casify_region): Remove var that is set but not used.
16308
a4db5dfe
PE
16309 * dired.c (file_name_completion): Remove var that is set but not used.
16310
43aae36e
PE
16311 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16312
2a47c44d 16313 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16314 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16315
a37c69bf
PE
16316 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16317 Check for integer overflow on size calculations.
16318
328ab8e7
PE
16319 * buffer.c (Fprevious_overlay_change): Remove var that is set
16320 but not used.
16321
e5a2a5cb
PE
16322 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16323 Remove vars that are set but not used.
8d84a6eb 16324 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16325 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16326
a60e5f68
PE
16327 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16328
f661cb61 16329 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16330 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16331
f0397f5a
PE
16332 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16333 that are set but not used.
16334
8664db06 16335 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16336 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16337
6abdaa4a
PE
16338 * xselect.c (x_get_local_selection, x_handle_property_notify):
16339 Remove vars that are set but not used.
16340
0ce7538d 16341 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16342 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16343
9ae848fc
PE
16344 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16345 Remove var that is set but not used.
0b918413
PE
16346 (scroll_bar_windows_size): Now size_t, not int.
16347 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16348 Check for overflow.
9ae848fc 16349
a5a62657
PE
16350 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16351 (map_tty_color) [!defined MSDOS]: Likewise.
16352
5c5cdd39
PE
16353 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16354
66ebf983
PE
16355 * coding.c: Remove vars that are set but not used.
16356 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16357 All callers changed.
16358 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16359 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16360 (decode_coding_charset): Remove vars that are set but not used.
16361
1be4d761
PE
16362 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16363 that is set but not used.
16364
47553fa8
PE
16365 * print.c (print_object): Remove var that is set but not used.
16366
1f7196bf 16367 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16368 The gnulib version avoids calling malloc in the usual case,
16369 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16370 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16371 * filelock.c (current_lock_owner): Likewise.
16372 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16373 * sysdep.c: Include allocator.h, careadlinkat.h.
16374 (emacs_no_realloc_allocator): New static constant.
16375 (emacs_readlink): New function.
fdb61804
PE
16376 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16377 ../lib/careadlinkat.h.
d1fdcab7 16378
f84c17c7
SM
163792011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16380
16381 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16382 first non-nil return value).
16383
ef3862ad
JD
163842011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16385
16386 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16387 if not defined (Bug#8403).
16388
376a7006
JB
163892011-04-02 Juanma Barranquero <lekktu@gmail.com>
16390
16391 * xdisp.c (display_count_lines): Remove parameter `start',
16392 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16393 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16394 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16395 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16396 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16397 and thereabouts. All callers changed.
16398 (get_per_char_metric): Remove parameter `f', unused since
16399 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16400
6ca3801d
JM
164012011-04-02 Jim Meyering <meyering@redhat.com>
16402
16403 do not dereference NULL upon failed strdup
16404 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16405 (ns_get_family): Likewise.
16406
d8e2b5ba
JB
164072011-04-02 Juanma Barranquero <lekktu@gmail.com>
16408
16409 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16410
8c74fcbd
JD
164112011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16412
16413 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16414 later (Bug#8403).
16415
7200d79c
SM
164162011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16417
03408648 16418 Add lexical binding.
7200d79c 16419
03408648
SM
16420 * window.c (Ftemp_output_buffer_show): New fun.
16421 (Fsave_window_excursion):
16422 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16423
16424 * lread.c (lisp_file_lexically_bound_p): New function.
16425 (Fload): Bind Qlexical_binding.
16426 (readevalloop): Remove `evalfun' arg.
16427 Bind Qinternal_interpreter_environment.
16428 (Feval_buffer): Bind Qlexical_binding.
16429 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16430 Mark as dynamic.
16431 (syms_of_lread): Declare `lexical-binding'.
16432
16433 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16434
16435 * keyboard.c (eval_dyn): New fun.
16436 (menu_item_eval_property): Use it.
ca105506
SM
16437
16438 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 16439
03408648
SM
16440 * fns.c (concat, mapcar1): Accept byte-code-functions.
16441
16442 * eval.c (Fsetq): Handle lexical vars.
16443 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16444 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16445 (FletX, Flet): Obey lexical binding.
16446 (Fcommandp): Handle closures.
16447 (Feval): New `lexical' arg.
16448 (eval_sub): New function extracted from Feval. Use it almost
16449 everywhere where Feval was used. Look up vars in lexical env.
16450 Handle closures.
16451 (Ffunctionp): Move from subr.el.
16452 (Ffuncall): Handle closures.
16453 (apply_lambda): Remove `eval_flags'.
16454 (funcall_lambda): Handle closures and new byte-code-functions.
16455 (Fspecial_variable_p): New function.
16456 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16457 but without exporting it to Lisp.
23aba0ea 16458
23aba0ea 16459 * doc.c (Fdocumentation, store_function_docstring):
03408648 16460 * data.c (Finteractive_form): Handle closures.
23aba0ea 16461
03408648
SM
16462 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16463 interactive spec.
ba83908c 16464
04f2d78b
CB
16465 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16466 New byte-codes.
03408648
SM
16467 (exec_byte_code): New function extracted from Fbyte_code to handle new
16468 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 16469
03408648 16470 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 16471
03408648 16472 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 16473
e2abce01
JB
164742011-03-31 Juanma Barranquero <lekktu@gmail.com>
16475
16476 * xdisp.c (redisplay_internal): Fix prototype.
16477
63696a73 164782011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 16479
63696a73 16480 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
16481 (try_scrolling): Use it when setting scroll_limit.
16482 Limit scrolling to 100 screen lines.
63696a73
EZ
16483 (redisplay_window): Even when falling back on "recentering",
16484 position point in the window according to scroll-conservatively,
16485 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16486
16487 (try_scrolling): When point is above the window, allow searching
16488 as far as scroll_max, or one screenful, to compute vertical
16489 distance from PT to the scroll margin position. This prevents
16490 try_scrolling from unnecessarily failing when
16491 scroll-conservatively is set to a value slightly larger than the
16492 window height. Clean up the case of PT below the margin at bottom
16493 of window: scroll_max can no longer be INT_MAX. When aggressive
16494 scrolling is in use, don't let point enter the opposite scroll
16495 margin as result of the scroll.
16496 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
16497 threshold of 100 lines for never-recentering scrolling.
16498
e4cc2dfc
JB
164992011-03-31 Juanma Barranquero <lekktu@gmail.com>
16500
16501 * dispextern.h (move_it_by_lines):
16502 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16503 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16504 (message_log_check_duplicate): Remove parameters `prev_bol' and
16505 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16506 (redisplay_internal): Remove parameter `preserve_echo_area',
16507 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16508
16509 * indent.c (Fvertical_motion):
16510 * window.c (window_scroll_pixel_based, Frecenter):
16511 Don't pass `need_y_p' to `move_it_by_lines'.
16512
1c470562
SM
165132011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16514
44f230aa
SM
16515 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16516 steal a few bits to be more compact.
16517 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16518 Remove unneeded casts.
16519
1c470562
SM
16520 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16521
888adce9
ZK
165222011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16523
16524 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16525 binding" message (bug#7967).
16526
f838ed7b
PE
165272011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16528
77861b95
PE
16529 Fix more problems found by GCC 4.6.0's static checks.
16530
de6dbc14
PE
16531 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16532 Remove unused local var.
16533
f838ed7b
PE
16534 * editfns.c (Fmessage_box): Remove unused local var.
16535
792c7b2b
PE
16536 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16537 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16538 Omit unused local vars.
c499e557 16539 * window.c (shrink_windows): Omit unused local var.
b01a1c29 16540 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
16541 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16542 Omit unused local var.
16543
ba0165e1
PE
16544 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16545 Don't assume string length fits in int.
32ad8845 16546 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 16547 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 16548
3c59b4c9
PE
16549 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16550 instead of alloca (Bug#8344).
16551
a3eed478 16552 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 16553 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 16554
eb4d412d
PE
16555 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16556
1658b401
PE
16557 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16558 concerns.
16559
16560 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16561
16562 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 16563
9a2c6e05
PE
16564 * keyboard.c (syms_of_keyboard): Use the same style as later
16565 in this function when indexing through an array. This also
16566 works around GCC bug 48267.
16567
03d0a109
PE
16568 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16569
44f730c8
PE
16570 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16571
fe75f926
PE
16572 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16573 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16574
ffa8c828
PE
16575 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16576 This avoids undefined behavior on integer overflow, and is a bit
16577 more convenient anyway since it is compared to a size_t variable.
16578
c5101a77
PE
16579 Variadic C functions now count arguments with size_t, not int.
16580 This avoids an unnecessary limitation on 64-bit machines, which
16581 caused (substring ...) to crash on large vectors (Bug#8344).
16582 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16583 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 16584 All variadic functions and their callers changed accordingly.
c5101a77
PE
16585 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16586 * data.c (arith_driver, float_arith_driver): Likewise.
16587 * editfns.c (general_insert_function): Likewise.
16588 * eval.c (struct backtrace.nargs, interactive_p)
16589 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16590 (funcall_lambda, mark_backtrace): Likewise.
16591 * fns.c (concat): Likewise.
16592 * frame.c (x_set_frame_parameters): Likewise.
16593 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16594 0 if not found, not -1. All callers changed.
16595
dd3f25f7
PE
16596 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16597 (stack_copy_size): Now size_t, not int.
16598 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16599
461c2ab9
JB
166002011-03-28 Juanma Barranquero <lekktu@gmail.com>
16601
16602 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16603 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16604 All callers changed.
16605
16606 * lisp.h (multibyte_char_to_unibyte):
16607 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16608 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16609 * character.h (CHAR_TO_BYTE8):
16610 * cmds.c (internal_self_insert):
16611 * editfns.c (general_insert_function):
16612 * keymap.c (push_key_description):
16613 * search.c (Freplace_match):
16614 * xdisp.c (message_dolog, set_message_1): All callers changed.
16615
f6d62986
SM
166162011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16617
16618 * keyboard.c (safe_run_hook_funcall): New function.
16619 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16620 don't set the hook to nil, but remove the offending function instead.
16621 (Qcommand_hook_internal): Remove, unused.
16622 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16623 Vcommand_hook_internal.
16624
16625 * eval.c (enum run_hooks_condition): Remove.
16626 (funcall_nil, funcall_not): New functions.
16627 (run_hook_with_args): Call each function through a `funcall' argument.
16628 Remove `cond' argument, now redundant.
16629 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16630 (Frun_hook_with_args_until_failure): Adjust accordingly.
16631 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16632
1db5b1ad
JB
166332011-03-28 Juanma Barranquero <lekktu@gmail.com>
16634
16635 * dispextern.h (string_buffer_position): Remove declaration.
16636
16637 * print.c (strout): Remove parameter `multibyte', unused since
16638 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16639
16640 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16641 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16642 All callers changed.
16643
16644 * w32.c (_wsa_errlist): Use braces for struct initializers.
16645
16646 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16647 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16648 All callers changed.
16649 (string_buffer_position): Likewise. Also, make static (it's never
16650 used outside xdisp.c).
16651 (cursor_row_p): Remove parameter `w', unused since
16652 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16653 (decode_mode_spec): Remove parameter `precision', introduced during
16654 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16655 All callers changed.
16656
5ffb62aa
JD
166572011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16658
16659 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16660
461c2ab9 166612011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
16662
16663 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16664 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16665 (ns_update_auto_hide_menu_bar): New functions.
16666 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16667 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16668 ns_constrain_all_frames.
16669 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16670 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16671
5c380ffb
JD
166722011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16673
16674 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16675
9af30bdf
GM
166762011-03-27 Glenn Morris <rgm@gnu.org>
16677
16678 * syssignal.h: Replace RETSIGTYPE with void.
16679 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16680 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16681 Replace SIGTYPE with void everywhere.
16682 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16683 * s/template.h (SIGTYPE): Remove commented out definition.
16684
e2abce01
JB
166852011-03-26 Eli Zaretskii <eliz@gnu.org>
16686
16687 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16688 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16689
f868cd8a
JB
166902011-03-26 Juanma Barranquero <lekktu@gmail.com>
16691
59eb0929
JB
16692 * w32.c (read_unc_volume): Use parameter `henum', instead of
16693 global variable `wget_enum_handle'.
16694
16695 * keymap.c (describe_vector): Remove parameters `indices' and
16696 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16697 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16698
f868cd8a
JB
16699 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16700
16701 * keyboard.c (timer_check): Remove parameter `do_it_now',
16702 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16703 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16704 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16705
16706 * keyboard.c (read_char):
16707 * w32menu.c (w32_menu_display_help):
16708 * xmenu.c (show_help_event, menu_help_callback):
16709 Adjust calls to `show_help_echo'.
16710
16711 * gtkutil.c (xg_maybe_add_timer):
16712 * keyboard.c (readable_events):
16713 * process.c (wait_reading_process_output):
16714 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16715
16716 * insdel.c (adjust_markers_gap_motion):
16717 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16718 (gap_left, gap_right): Don't call it.
16719
2ecf6fdb
CY
167202011-03-25 Chong Yidong <cyd@stupidchicken.com>
16721
16722 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16723 incurred during fontification.
16724
6b1f9ba4
JB
167252011-03-25 Juanma Barranquero <lekktu@gmail.com>
16726
16727 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16728 (DEFVAR_PER_BUFFER): Don't pass it.
16729
16730 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16731 (scrolling_window): Don't pass it.
16732
0f4a96b5
JB
167332011-03-25 Juanma Barranquero <lekktu@gmail.com>
16734
16735 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16736
16737 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16738 and `suffix'.
16739 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16740 of variables specific to SELinux and computation of `encoded_absname'.
16741
16742 * image.c (XPutPixel): Remove unused variable `height'.
16743
16744 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16745
16746 * unexw32.c (get_section_info): Remove unused variable `section'.
16747
16748 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16749 (system_process_attributes): Remove unused variable `sess'.
16750 (sys_read): Remove unused variable `err'.
16751
16752 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16753 (w32_wnd_proc): Remove unused variable `isdead'.
16754 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16755 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16756 (x_create_tip_frame): Remove unused variable `tem'.
16757
16758 * w32inevt.c (w32_console_read_socket):
16759 Remove unused variable `no_events'.
16760
16761 * w32term.c (x_draw_composite_glyph_string_foreground):
16762 Remove unused variable `width'.
16763
1149507c
JB
167642011-03-24 Juanma Barranquero <lekktu@gmail.com>
16765
16766 * w32term.c (x_set_glyph_string_clipping):
16767 Don't pass uninitialized region to CombineRgn.
16768
9c88f339
JB
167692011-03-23 Juanma Barranquero <lekktu@gmail.com>
16770
16771 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16772 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16773 (Fx_close_connection): Remove unused variable `i'.
16774
16775 * w32font.c (w32font_draw): Return number of glyphs.
16776 (w32font_open_internal): Remove unused variable `i'.
16777 (w32font_driver): Add missing initializer.
16778
16779 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16780 (fill_in_menu): Remove unused variable `items_added'.
16781
16782 * w32term.c (last_mouse_press_frame): Remove static global variable.
16783 (w32_clip_to_row): Remove unused variable `f'.
16784 (x_delete_terminal): Remove unused variable `i'.
16785
16786 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16787 (NOTHING): Remove unused static global variable.
16788 (uniscribe_check_otf): Remove unused variable `table'.
16789 (uniscribe_font_driver): Add missing initializers.
16790
dee091a3
JD
167912011-03-23 Julien Danjou <julien@danjou.info>
16792
16793 * term.c (Fsuspend_tty, Fresume_tty):
16794 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16795 * window.c (temp_output_buffer_show):
16796 * insdel.c (signal_before_change):
16797 * frame.c (Fhandle_switch_frame):
16798 * fileio.c (Fdo_auto_save):
16799 * emacs.c (Fkill_emacs):
16800 * editfns.c (save_excursion_restore):
16801 * cmds.c (internal_self_insert):
16802 * callint.c (Fcall_interactively):
16803 * buffer.c (Fkill_all_local_variables):
16804 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16805 Use Frun_hooks.
0f4a96b5 16806 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 16807 unconditionally since it does the check itself.
dee091a3 16808
2c520ab5 168092011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 16810
c9c49752
PE
16811 Fix more problems found by GCC 4.5.2's static checks.
16812
8abc3f12
PE
16813 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16814 the first time through the loop, since we know p0 < p1 then.
16815 This also avoids a gcc -Wstrict-overflow warning.
16816
a2d26660
PE
16817 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16818 leading to a memory leak, possible in functions like
16819 load_charset_map_from_file that can allocate an unbounded number
b12ef411 16820 of objects (Bug#8318).
a2d26660 16821
916c72e9
PE
16822 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16823 that could (at least in theory) be that large.
16824
19ab8a18
PE
16825 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16826 This is less likely to overflow, and avoids undefined behavior if
16827 overflow does occur. All callers changed. Use strtoul to scan
16828 for the unsigned long integer.
b7cbbd6f
PE
16829 (pint2hrstr): Simplify and tune code slightly.
16830 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 16831
f0641eff
PE
16832 * scroll.c (do_scrolling): Work around GCC bug 48228.
16833 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16834
7f650bb9
PE
16835 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16836 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
16837 (validate_x_resource_name): Simplify count usage.
16838 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 16839
37dd57d1
PE
16840 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16841 fail (Bug#8306).
81e56e61 16842
699979fc 16843 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 16844
401bf9b4
PE
16845 * process.c (Fmake_network_process): Use socklen_t, not int,
16846 where POSIX says socklen_t is required in portable programs.
16847 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 16848 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
16849 (Fmake_network_process, server_accept_connection):
16850 (wait_reading_process_output, read_process_output):
16851 Likewise.
16852
b93aacde
PE
16853 * process.c: Rename or move locals to avoid shadowing.
16854 (list_processes_1, Fmake_network_process):
16855 (read_process_output_error_handler, exec_sentinel_error_handler):
16856 Rename or move locals.
4dc343ee 16857 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 16858 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 16859 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 16860 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 16861 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 16862
af8a867c 16863 Make tparam.h and terminfo.c consistent.
44f230aa
SM
16864 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16865 Include tparam.h instead, since it declares them.
af8a867c
PE
16866 * cm.h (PC): Remove extern decl; tparam.h now does this.
16867 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16868 * terminfo.c: Include tparam.h, to check interfaces.
16869 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16870 (tparam): Adjust signature to match interface in tparam.h;
16871 this removes some undefined behavior. Check that outstring and len
16872 are zero, which they always are with Emacs.
16873 * tparam.h (PC, BC, UP): New extern decls.
16874
0248044d 16875 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 16876 (xftfont_open): Rename locals to avoid shadowing.
0248044d 16877
8ff096c1 16878 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
16879 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16880 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 16881 (ftfont_list): Remove unused local.
49eaafba
PE
16882 (get_adstyle_property, ftfont_pattern_entity):
16883 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16884 Rename locals to avoid shadowing.
8ff096c1 16885
e2be39f6
PE
16886 * xfont.c (xfont_list_family): Mark var as initialized.
16887
c9735e30
PE
16888 * xml.c (make_dom): Now static.
16889
8f5201ae
PE
16890 * composite.c (composition_compute_stop_pos): Rename local to
16891 avoid shadowing.
b246f932
PE
16892 (composition_reseat_it): Remove unused locals.
16893 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 16894 (composition_update_it): Mark var as initialized.
11b61122
PE
16895 (find_automatic_composition): Mark vars as initialized,
16896 with a FIXME (Bug#8290).
8f5201ae 16897
760fbc2c
PE
16898 character.h: Rename locals to avoid shadowing.
16899 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16900 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16901 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16902 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16903 to avoid shadowing.
16904
ff08eb85
PE
16905 * textprop.c (property_change_between_p): Remove; unused.
16906
fc7bf025
PE
16907 * intervals.c (interval_start_pos): Now static.
16908
235d7abc
PE
16909 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16910
44f230aa
SM
16911 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16912 Rename locals to avoid shadowing.
3e7d6594 16913
50060332
PE
16914 * sound.c (wav_play, au_play, Fplay_sound_internal):
16915 Fix pointer signedness.
d01f234b 16916 (alsa_choose_format): Remove unused local var.
c83b8872
PE
16917 (wav_play): Initialize a variable to 0, to prevent undefined
16918 behavior (Bug#8278).
50060332 16919
c4fc4e30
PE
16920 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16921
918436ed
PE
16922 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16923
c939f91b
PE
16924 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16925 clobbering (Bug#8298).
b9c7f648
PE
16926 * sysdep.c (sys_subshell): Likewise.
16927 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 16928
6bd8c144
PE
16929 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16930 This should get cleaned up, so that child_setup has the
16931 same signature on all platforms.
16932
7710357c 16933 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 16934 (relocate_fd): Rename locals to avoid shadowing.
7710357c 16935
c59da222
CY
169362011-03-22 Chong Yidong <cyd@stupidchicken.com>
16937
16938 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16939 not to be necessary, and produces flickering.
16940
66b87493
GM
169412011-03-20 Glenn Morris <rgm@gnu.org>
16942
16943 * config.in: Remove file.
16944
45b6f6d5
JB
169452011-03-20 Juanma Barranquero <lekktu@gmail.com>
16946
16947 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16948 are now in src/globals.h.
16949 (syms_of_minibuf): Remove spurious & from previous change.
16950
cd394be1 169512011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
16952
16953 * minibuf.c (completing-read-function): New variable.
16954 (completing-read-default): Rename from completing-read.
16955 (completing-read): Call completing-read-function.
16956
b14e3e21
CY
169572011-03-19 Juanma Barranquero <lekktu@gmail.com>
16958
16959 * xfaces.c (Fx_load_color_file):
16960 Read color file from absolute filename (bug#8250).
16961
f2b726e6
JB
169622011-03-19 Juanma Barranquero <lekktu@gmail.com>
16963
16964 * makefile.w32-in: Update dependencies.
16965
09f6ff02
EZ
169662011-03-17 Eli Zaretskii <eliz@gnu.org>
16967
16968 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16969
29a6015a
PE
169702011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16971
a3a6c54e
PE
16972 Fix more problems found by GCC 4.5.2's static checks.
16973
b766f867
PE
16974 * process.c (make_serial_process_unwind, send_process_trap):
16975 (sigchld_handler): Now static.
16976
be02381c
PE
16977 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16978 That way, the code declares only the vars that it needs.
16979 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16980 * s/cygwin.h (PTY_ITERATION): Likewise.
16981 * s/darwin.h (PTY_ITERATION): Likewise.
16982 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16983
57048744
PE
16984 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16985 * process.c (allocate_pty): Don't declare stb unless it's needed.
16986
7914961c 16987 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
16988 (CONSTANTLIM): Remove; unused.
16989 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16990 Define only if needed.
7914961c 16991
b3967b18
PE
16992 * unexelf.c (unexec): Name an expression,
16993 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
16994 Use a different way to cause a compilation error if anyone uses
16995 n rather than nn, a way that does not involve shadowing.
73366a00 16996 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 16997
29a6015a
PE
16998 * deps.mk (unexalpha.o): Remove; unused.
16999
43cfc33e 17000 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17001 * unexec.h: New file.
ce701a33
PE
17002 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17003 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17004 Depend on unexec.h.
17005 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17006 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17007 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17008 Change as necessary to match prototype in unexec.h.
ce701a33 17009
01f44d5a
PE
17010 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17011 shadowing.
4f63c6bb 17012 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17013
a6670b0b
PE
17014 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17015 Rename locals to avoid shadowing.
17016
cef2010d 17017 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17018 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17019
d4d7173a
PE
17020 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17021
f08b802a
PE
17022 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17023 warning when compiling print.c.
17024
3ddb0639
PE
17025 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17026 instead of using an uninitialized var.
5ad03b97 17027 (font_sort_entities): Mark var as initialized.
3ddb0639 17028
170a2692
PE
17029 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17030
e663c700
PE
17031 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17032 pointers to constants.
89bc529a 17033 (font_parse_fcname): Remove unused vars.
7b81e2d0 17034 (font_delete_unmatched): Now static.
ea838e10 17035 (font_get_spec): Remove; unused.
13a547c6
PE
17036 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17037 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17038 Rename or move locals to avoid shadowing.
e663c700 17039
2a80c887 17040 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17041 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17042
1384fa33 17043 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17044 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17045
8b2c52e9
PE
17046 * alloc.c (mark_backtrace): Move decl from here ...
17047 * lisp.h: ... to here, so that it can be checked.
17048
475545b5 17049 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17050 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17051 (lisp_indirect_variable): Name an expression,
17052 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17053 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17054
b1349114 17055 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17056 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17057 Use const pointer when appropriate.
b1349114 17058
a2928364
PE
17059 * lisp.h (get_system_name, get_operating_system_release):
17060 Move decls here, to check interfaces.
17061 * process.c (get_operating_system_release): Move decl to lisp.h.
17062 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17063 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17064 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17065 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17066 (Fformat_time_string, Fencode_time, Finsert_char):
17067 (Ftranslate_region_internal, Fformat):
17068 Rename or remove local vars to avoid shadowing.
9710023e 17069 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17070
a415e694
PE
17071 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17072 avoid shadowing.
17073
8ef4622d
PE
17074 * lisp.h (eassert): Check that the argument compiles, even if
17075 ENABLE_CHECKING is not defined.
17076
946f9a5b
PE
17077 * data.c (Findirect_variable): Name an expression, to avoid
17078 gcc -Wbad-function-cast warning.
112396d6 17079 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17080 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17081 (Fmake_variable_buffer_local, Fmake_local_variable):
17082 Mark variables as initialized.
52746918 17083 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17084
e5aab7e7 17085 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17086 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17087 Rename locals to avoid shadowing.
dff45157
PE
17088 (mark_stack): Move local variables into the #ifdef region where
17089 they're used.
7bc26fdb
PE
17090 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17091 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17092 needed otherwise.
17093 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17094 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17095 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17096
e5aab7e7
PE
17097 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17098 avoids undefined behavior in theory.
17099
4da60324
PE
17100 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17101
88043301
PE
17102 Use functions, not macros, for up- and down-casing (Bug#8254).
17103 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17104 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17105 to use the following functions instead of these macros.
17106 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17107 EMACS_INT, since callers assume the returned value fits in int.
17108 (upcase1): Likewise, for UPCASE_TABLE.
17109 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17110 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17111 the race-condition problem in the old DOWNCASE.
88043301 17112
19ed5445
PE
17113 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17114 Rename locals to avoid shadowing.
17115 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17116 (regex_compile, re_search_2, re_match_2_internal):
17117 Remove unused local vars.
952db0d7
PE
17118 (FREE_VAR): Rewrite so as not to use empty "else",
17119 which gcc can warn about.
da053e48 17120 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17121 (RETALLOC_IF): Define only if needed.
17122 (WORDCHAR_P): Likewise. This one is never needed, but is used
17123 only in a comment talking about a compiler bug, so put inside
17124 the #if 0 of that comment.
17125 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17126 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17127 Remove; unused.
19ed5445 17128
1f3561e4 17129 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17130 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17131 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17132
ded6f8f7
PE
17133 * search.c (simple_search): Remove unused var.
17134
dbd37a95
PE
17135 * dired.c (compile_pattern): Move decl from here ...
17136 * lisp.h: ... to here, so that it can be checked.
17137 (struct re_registers): New forward decl.
17138
7e47afad
PE
17139 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17140
85f24f61
PE
17141 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17142 All uses changed.
17143 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17144 Rename locals to avoid shadowing.
5671df8f 17145 (Fvertical_motion): Mark locals as initialized.
85f24f61 17146
181aa2be 17147 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17148 (casify_region): Mark local as initialized.
181aa2be 17149
930d429c
PE
17150 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17151
7082eac6
PE
17152 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17153 New macros, so that the caller can use some names other than
17154 gcpro1, gcpro2, etc.
17155 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17156 of the new macros.
17157 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17158 argument, for consistency with GCPRO2_VAR, etc: it is now the
17159 prefix of the variable, not the variable itself. All uses
17160 changed.
38b2c076
PE
17161 * dired.c (directory_files_internal, file_name_completion):
17162 Rename locals to avoid shadowing.
17163
15206ed9
PE
17164 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17165 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17166 dired.c's scmp function, had undefined behavior.
17167 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17168 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17169 * buffer.h: ... to here, because these macros use current_buffer,
17170 and the new implementation with inline functions needs to have
17171 current_buffer in scope now, rather than later when the macros
17172 are used.
17173 (downcase, upcase1): New static inline functions.
17174 (DOWNCASE, UPCASE1): Reimplement using these functions.
17175 This avoids undefined behavior in expressions like
17176 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17177 from race conditions in accessing the global variables
17178 case_temp1 and case_temp2.
17179 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17180 * lisp.h (case_temp1, case_temp2): Remove their decls.
17181 * character.h (ASCII_CHAR_P): Move from here ...
17182 * lisp.h: ... to here, so that the inline functions mentioned
17183 above can use them.
17184
4a6bea26
PE
17185 * dired.c (directory_files_internal_unwind): Now static.
17186
f14b7e14
PE
17187 * fileio.c (file_name_as_directory, directory_file_name):
17188 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17189 Now static.
2893f146
PE
17190 (file_name_as_directory): Use const pointers when appropriate.
17191 (Fexpand_file_name): Likewise. In particular, newdir might
17192 point at constant storage, so make it a const pointer.
fd4ead52 17193 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17194 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17195 signedness issues.
f839df0c
PE
17196 (Fset_file_times, Finsert_file_contents, auto_save_error):
17197 Rename locals to avoid shadowing.
f14b7e14 17198
5716756e 17199 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17200 (Ftry_completion, Fall_completions): Rename or remove locals
17201 to avoid shadowing.
5716756e 17202
b4c3046a
PE
17203 * marker.c (bytepos_to_charpos): Remove; unused.
17204
b45db522
PE
17205 * lisp.h (verify_bytepos, count_markers): New decls,
17206 so that gcc does not warn that these functions aren't declared.
17207
85876d07
PE
17208 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17209 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17210 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17211 (copy_text): Remove unused local var.
85876d07 17212
03d78a21 17213 * filelock.c (within_one_second): Now static.
b3dd38ab 17214 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17215
5df8f01b
PE
17216 * buffer.c (fix_overlays_before): Mark locals as initialized.
17217 (fix_start_end_in_overlays): Likewise. This function should be
17218 simplified by using pointers-to-pointers, but that's a different
17219 matter.
b1d876f1 17220 (switch_to_buffer_1): Now static.
8f54f30a
PE
17221 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17222 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17223
a70072c9 17224 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17225 Fix pointer signedness issue.
edced198
PE
17226 (sys_subshell): Mark local as volatile if checking for lint,
17227 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17228 (MAXPATHLEN): Define only if needed.
a70072c9 17229
a0977c44
PE
17230 * process.c (serial_open, serial_configure): Move decls from here ...
17231 * systty.h: ... to here, so that they can be checked.
17232
a884fdcc
PE
17233 * fns.c (get_random, seed_random): Move extern decls from here ...
17234 * lisp.h: ... to here, so that they can be checked.
17235
604efe86 17236 * sysdep.c (reset_io): Now static.
b8950c94 17237 (wait_for_termination_signal): Remove; unused.
604efe86 17238
38fc62d9
PE
17239 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17240 (copy_keymap_item, append_key, push_text_char_description):
17241 Now static.
1004a21a 17242 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17243 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17244 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17245 (describe_map_tree):
17246 Rename locals to avoid shadowing.
38fc62d9 17247
2f2650da
PE
17248 * keyboard.c: Declare functions static if they are not used elsewhere.
17249 (echo_char, echo_dash, cmd_error, top_level_2):
17250 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17251 (read_char, kbd_buffer_get_event, make_lispy_position):
17252 (make_lispy_event, make_lispy_movement, apply_modifiers):
17253 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17254 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17255 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17256 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17257 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17258
a053e86c 17259 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17260 (mark_kboards): Move decl here ...
17261 * alloc.c (mark_kboards): ... from here.
a053e86c 17262
4752793e
PE
17263 * lisp.h (force_auto_save_soon): New decl.
17264
74f10ca7 17265 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17266 (DEFINE_DUMMY_FUNCTION): New macro.
17267 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17268 Use it.
c03cd23f
PE
17269 (main): Add casts to avoid warnings
17270 if GCC considers string literals to be constants.
74f10ca7 17271
022e70d4
PE
17272 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17273
59d6fe83
PE
17274 * dbusbind.c: Pointer signedness fixes.
17275 (xd_signature, xd_append_arg, xd_initialize):
17276 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17277 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17278 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17279 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17280
78320123
PE
17281 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17282 if GCC considers string literals to be constants.
49cebcca 17283 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17284
35ac2a97
SM
172852011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17286
fb103ca9
SM
17287 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17288 (print_preprocess, print_object): New macro to fix last change.
17289
35ac2a97
SM
17290 * print.c (print_preprocess): Don't forget font objects.
17291
62973b41
JB
172922011-03-16 Juanma Barranquero <lekktu@gmail.com>
17293
17294 * emacs.c (USAGE3): Doc fixes.
17295
0e48bb22
AS
172962011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17297
17298 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17299 structure.
17300
7684e57b
JB
173012011-03-14 Juanma Barranquero <lekktu@gmail.com>
17302
17303 * lisp.h (VWindow_system, Qfile_name_history):
17304 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17305 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17306 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17307
17308 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17309 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17310
17311 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17312 * w32console.c (detect_input_pending, read_input_pending)
17313 (encode_terminal_code):
17314 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17315 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17316 (w32_system_caret_y, Qfile_name_history):
17317 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17318 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17319 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17320 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17321 * w32proc.c (Qlocal, report_file_error):
17322 * w32term.c (Vwindow_system, updating_frame):
17323 * w32uniscribe.c (initialized, uniscribe_font_driver):
17324 Remove unneeded extern declarations.
17325
2aa46d6c
CY
173262011-03-14 Chong Yidong <cyd@stupidchicken.com>
17327
c96bbc66 17328 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17329
cffc6f3b
CY
173302011-03-13 Chong Yidong <cyd@stupidchicken.com>
17331
17332 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17333 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17334 These macros can no longer be used for assignment.
17335
44f230aa
SM
17336 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17337 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17338 (record_buffer_markers, fetch_buffer_markers): New functions for
17339 recording and fetching special buffer markers.
17340 (set_buffer_internal_1, set_buffer_temp): Use them.
17341
17342 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17343
17344 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17345
17346 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17347 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17348
17349 * xdisp.c (hscroll_window_tree):
17350 (reconsider_clip_changes): Use PT instead of BUF_PT.
17351
d251f04b
EZ
173522011-03-13 Eli Zaretskii <eliz@gnu.org>
17353
17354 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17355 $(EMACS_ROOT)/lib/intprops.h.
17356
f0c77cd1
PE
173572011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17358
3eca4629
PE
17359 Fix more problems found by GCC 4.5.2's static checks.
17360
7c86ee98
PE
17361 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17362 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17363 (xg_free_frame_widgets): Make it clear that a local variable is
17364 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17365 (gdk_window_get_screen): Make it clear that this macro is needed
17366 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17367 (int_gtk_range_get_value): New function, which avoids a diagnostic
17368 from gcc -Wbad-function-cast.
17369 (xg_set_toolkit_scroll_bar_thumb): Use it.
17370 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17371 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
17372 (get_utf8_string, xg_get_file_with_chooser):
17373 Rename locals to avoid shadowing.
17374 (create_dialog): Move locals to avoid shadowing.
7c86ee98 17375
41729b81
PE
17376 * xgselect.c (xg_select): Remove unused var.
17377
f0c77cd1
PE
17378 * image.c (four_corners_best): Mark locals as initialized.
17379 (gif_load): Initialize transparent_p to zero (Bug#8238).
17380 Mark another local as initialized.
ec6cf4c6 17381 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 17382
ce0ad53d 17383 * image.c (clear_image_cache): Now static.
d5d5a617 17384 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 17385 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
17386 (x_edge_detection): Remove unnecessary cast that
17387 gcc -Wbad-function-cast diagnoses.
2037898d 17388 (gif_load): Fix pointer signedness.
6ae141d6
PE
17389 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17390 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 17391
33383987 173922011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 17393
d32df629
PE
17394 Improve quality of tests for time stamp overflow.
17395 For example, without this patch (encode-time 0 0 0 1 1
17396 1152921504606846976) returns the obviously-bogus value (-948597
17397 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17398 reports time overflow. See
17399 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
17400 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17401 * editfns.c: Include limits.h and intprops.h.
17402 (TIME_T_MIN, TIME_T_MAX): New macros.
17403 (time_overflow): Move earlier, to before first use.
17404 (hi_time, lo_time): New functions, for an accurate test for
17405 out-of-range times.
17406 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17407 (Fget_internal_run_time): Don't assume time_t fits in int.
17408 (make_time): Use list2 instead of Fcons twice.
17409 (Fdecode_time): More accurate test for out-of-range times.
17410 (check_tm_member): New function.
17411 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
17412 (lisp_time_argument): Don't rely on undefined left-shift and
17413 right-shift behavior when checking for time stamp overflow.
8be6f318 17414
fe31d94c
PE
17415 * editfns.c (time_overflow): New function, refactoring common code.
17416 (Fformat_time_string, Fdecode_time, Fencode_time):
17417 (Fcurrent_time_string): Use it.
17418
8be6f318
PE
17419 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17420 * dired.c (make_time): Move to ...
17421 * editfns.c (make_time): ... here.
17422 * systime.h: Note the move.
17423
09d9db2c 174242011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 17425
126bc0dc
YM
17426 * fringe.c (update_window_fringes): Remove unused variables.
17427
c47cbdfd
YM
17428 * unexmacosx.c (copy_data_segment): Also copy __got section.
17429 (Bug#8223)
17430
7ac80be9
EZ
174312011-03-12 Eli Zaretskii <eliz@gnu.org>
17432
c96bbc66 17433 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
17434 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17435 Constify `char *' arguments and their references according to
17436 prototypes in tparam.h.
17437
ecb0f94d 17438 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 17439
7ac80be9
EZ
17440 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17441 Adapt all references accordingly.
17442
17443 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17444
ef1fd07e
TT
174452011-03-11 Tom Tromey <tromey@redhat.com>
17446
17447 * buffer.c (syms_of_buffer): Remove obsolete comment.
17448
7ef4b50c
EZ
174492011-03-11 Eli Zaretskii <eliz@gnu.org>
17450
17451 * termhooks.h (encode_terminal_code): Declare prototype.
17452
17453 * msdos.c (encode_terminal_code): Don't declare prototype.
17454
17455 * term.c (encode_terminal_code): Now external again, used by
17456 w32console.c and msdos.c.
17457
44f230aa
SM
17458 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17459 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 17460
4b1ec863 174612011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 17462
1714f52b 17463 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 17464
4b1ec863
PE
17465 * fringe.c (update_window_fringes): Mark locals as initialized
17466 (Bug#8227).
17467 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 17468
524c7aa6
PE
17469 * alloc.c (mark_fringe_data): Move decl from here ...
17470 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17471 to check its interface.
17472 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17473
a5c0af81 17474 * fontset.c (free_realized_fontset): Now static.
7519b8cd 17475 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 17476 (fontset_font): Mark local as initialized.
a9a06e0b 17477 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 17478
b4716021
PE
17479 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17480
811e9bac 17481 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 17482 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
17483 (x_own_selection, Fx_disown_selection_internal): Rename locals
17484 to avoid shadowing.
17485 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 17486
7e3ab302
PE
17487 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17488 so that the caller can use some name other than gcpro1.
17489 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
17490 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17491 (Fx_backspace_delete_keys_p):
17492 Use them to avoid shadowing, and rename vars to avoid shadowing.
17493 (x_decode_color, x_set_name, x_window): Now static.
6b437900 17494 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 17495 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
17496 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17497 Remove unused locals.
7e3ab302
PE
17498 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17499 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17500 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17501 macros.
f78faa98 17502
e2b13473
PE
17503 * xterm.h (x_mouse_leave): New decl.
17504
77f23912
PE
17505 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17506 Remove unused functions.
cdf4ba58
PE
17507 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17508 (x_calc_absolute_position): Now static.
7411c686 17509 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 17510 Don't declare local "event" unless it's used.
ed7bf3a5
PE
17511 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17512 unless they are used.
38d0b34a
PE
17513 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17514 (x_fatal_error_signal): Remove; not used.
a6067996
PE
17515 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17516 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17517 (x_error_catcher, x_connection_closed, x_error_handler):
17518 (x_error_quitter, xembed_send_message, x_iconify_frame):
17519 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 17520 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 17521 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 17522
44f230aa
SM
17523 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17524 Rename or move locals to avoid shadowing.
6b463e58 17525 (tty_defined_color, merge_face_heights): Now static.
5967d051 17526 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
17527 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17528 does not deduce is never used uninitialized.
73719eba
PE
17529 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17530 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 17531
426994c3 17532 * terminal.c (store_terminal_param): Now static.
5489860b 17533
032f1620 17534 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 17535 (set_frame_menubar): Remove unused local.
d4323972 17536 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
17537 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17538 since they might point to immutable storage.
281585b0
PE
17539 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17540 since it's unused otherwise.
032f1620 17541
367c19e5 17542 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 17543 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
17544 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17545 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 17546 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
17547 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17548 does not deduce are never used uninitialized.
70739cbe 17549
07b48fa9
PE
17550 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17551
8868a238 17552 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
17553 * window.c (window_loop, size_window):
17554 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 17555
7e5cf297 17556 * window.c (display_buffer): Now static.
d6550a9f
PE
17557 (size_window): Mark variables that gcc -Wuninitialized
17558 does not deduce are never used uninitialized.
a586633d
PE
17559 * window.h (check_all_windows): New decl, to forestall
17560 gcc -Wmissing-prototypes diagnostic.
5b555da1 17561 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 17562
f6095868
PE
17563 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17564 shadowing.
17565 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
17566 Include <limits.h>.
17567 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17568 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
17569 (load_charset_map): Mark variables that gcc -Wuninitialized
17570 does not deduce are never used uninitialized.
53df7c11 17571 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 17572
f38b440c
PE
17573 * coding.c (coding_set_source, coding_set_destination):
17574 Use "else { /* comment */ }" rather than "else /* comment */;"
17575 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
17576 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17577 a block, when the outer 'i' will do.
17578 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17579 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17580 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17581 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17582 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17583 Rename locals to avoid shadowing.
17584 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
17585 * coding.c (emacs_mule_char, encode_invocation_designation):
17586 Now static, since they're not used elsewhere.
413bb2db 17587 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 17588 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
17589 (decode_coding_emacs_mule): Mark variables that gcc
17590 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
17591 (detect_coding_iso_2022): Initialize a local variable that might
17592 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 17593 this initialization is needed. (Bug#8211)
5f58e762
PE
17594 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17595 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17596 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17597 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17598 Remove unused macros.
f38b440c 17599
232b38b9 17600 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 17601 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 17602 * character.c (string_count_byte8): Likewise.
232b38b9 17603
fb90da1b
PE
17604 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17605 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17606
fb93dbc2
PE
17607 * chartab.c (copy_sub_char_table): Now static, since it's not used
17608 elsewhere.
5c156ace
PE
17609 (sub_char_table_ref_and_range, char_table_ref_and_range):
17610 Rename locals to avoid shadowing.
bbcd0949 17611 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 17612
7d3b3862 17613 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 17614 (BIDI_BOB): Remove unused macro.
7d3b3862 17615
6be7d3da
PE
17616 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17617 deduce are never used uninitialized.
c2ed9c8b 17618 * term.c (encode_terminal_code): Likewise.
6be7d3da 17619
75f8807f 17620 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 17621
50938595
PE
17622 * tparam.h: New file.
17623 * term.c, tparam.h: Include it.
17624 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17625 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17626 Move these decls to tparam.h, and make them agree with what
17627 is actually in tparam.c. The previous trick of using incompatible
17628 decls in different modules does not conform to the C standard.
17629 All callers of tparam changed to use tparam's actual API.
17630 * tparam.c (tparam1, tparam, tgoto):
17631 Use const pointers where appropriate.
17632
fbceeba2
PE
17633 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17634 * cm.h (struct cm): Likewise.
17635 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17636 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17637 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17638 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17639 (turn_on_face, init_tty): Likewise.
17640 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 17641
7f3f1250
PE
17642 * term.c (term_mouse_position): Rename local to avoid shadowing.
17643
e6ca6543
PE
17644 * alloc.c (mark_ttys): Move decl from here ...
17645 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17646
c40f8d15
AS
176472011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17648
17649 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17650
cfe0661d
JB
176512011-03-09 Juanma Barranquero <lekktu@gmail.com>
17652
17653 * search.c (compile_pattern_1): Remove argument regp, unused since
17654 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17655 (compile_pattern): Don't pass it.
17656
0afb4571
J
176572011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17658
17659 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17660 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17661 for ! HAVE_GTK3.
17662 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17663
17664 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17665
17666 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17667 gdk_window_get_screen, gdk_window_get_geometry,
17668 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17669 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17670 (xg_get_pixbuf_from_pixmap): New function.
17671 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17672 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17673 Call xg_get_pixbuf_from_pixmap instead of
17674 gdk_pixbuf_get_from_drawable.
17675 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17676 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17677 (xg_check_special_colors): Use GtkStyleContext and its functions
17678 for HAVE_GTK3.
17679 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17680 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17681 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
17682 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17683 Call gtk_widget_get_preferred_size.
0afb4571
J
17684 (xg_frame_resized): gdk_window_get_geometry only takes 5
17685 parameters.
44f230aa
SM
17686 (xg_win_to_widget, xg_event_is_for_menubar):
17687 Call gdk_x11_window_lookup_for_display.
0afb4571
J
17688 (xg_set_widget_bg): New function.
17689 (delete_cb): New function.
895009e1 17690 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 17691 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
17692 (xg_set_background_color): Call xg_set_widget_bg.
17693 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17694 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17695 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17696 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17697 if ! HAVE_GTK3.
17698 (update_frame_tool_bar): Call gtk_widget_hide.
17699 (xg_initialize): Use GDK_KEY_g.
17700
17701 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17702 if ! HAVE_GTK3
17703 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17704
17705 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17706 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17707 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17708
1c2cc4ef
JB
177092011-03-08 Juanma Barranquero <lekktu@gmail.com>
17710
17711 * w32xfns.c (select_palette): Check success of RealizePalette against
17712 GDI_ERROR, not zero.
17713
33383987 17714See ChangeLog.11 for earlier changes.
aac0c6e3
MR
17715
17716;; Local Variables:
17717;; coding: utf-8
aac0c6e3
MR
17718;; End:
17719
2f097256 17720 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
17721
17722 This file is part of GNU Emacs.
17723
17724 GNU Emacs is free software: you can redistribute it and/or modify
17725 it under the terms of the GNU General Public License as published by
17726 the Free Software Foundation, either version 3 of the License, or
17727 (at your option) any later version.
17728
17729 GNU Emacs is distributed in the hope that it will be useful,
17730 but WITHOUT ANY WARRANTY; without even the implied warranty of
17731 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17732 GNU General Public License for more details.
17733
17734 You should have received a copy of the GNU General Public License
17735 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.