* Makefile.in (bootstrap): Simplify build procedure.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
01108e3f
PE
12012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2
3 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
4 or that fprintf is async-signal-safe. POSIX doesn't require
5 either assumption.
6
82f8cd94
CY
72012-09-22 Chong Yidong <cyd@gnu.org>
8
9 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
10 (Bug#8207).
11
3cccbd87
KH
122012-09-22 Kenichi Handa <handa@gnu.org>
13
14 * composite.c (composition_reseat_it): Handle the case that a
15 grapheme cluster is not covered by a single font (Bug#12352).
16
09c01941
CY
172012-09-21 Chong Yidong <cyd@gnu.org>
18
19 * image.c (define_image_type): Avoid adding duplicate types to
20 image_types (Bug#12463). Suggested by Jörg Walter.
21
acfa068f 222012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
23
24 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
25 (print_load_command_name): Add case LC_DATA_IN_CODE.
26 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
27
acfa068f 282012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
29
30 * eval.c (Frun_hook_with_args_until_success)
31 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
32
acfa068f 332012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
34
35 * fileio.c (Ffile_selinux_context): Only call freecon when
36 lgetfilecon succeeded.
37 (Fset_file_selinux_context): Likewise. (Bug#12444)
38
acfa068f 392012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
40
41 * xdisp.c (try_window_reusing_current_matrix): Under bidi
42 reordering, locate the cursor by calling set_cursor_from_row; if
43 that fails, clear the desired glyph matrix before returning a
44 failure indication to the caller. Fixes leaving garbled display
45 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
46 (compute_stop_pos_backwards): Fix a typo that caused crashes while
47 scrolling through multibyte text.
aa36e4d2 48
e99f70c8
SM
492012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
50
51 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
52 calling mark_vectorlike since that's the one that marks the window.
53 (mark_discard_killed_buffers): Mark the final cdr.
54 * window.h (struct window): Move prev/next_buffers to the
55 non-standard fields.
56 * window.c (make_window): Initialize prev/next_buffers manually.
57
f75beb47
PE
582012-09-20 Paul Eggert <eggert@cs.ucla.edu>
59
60 Omit unused arg EXPECTED from socket hooks.
61 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
62 * nsterm.m (ns_term_init):
63 * termhooks.h (struct terminal.read_socket_hook):
64 * w32inevt.c (w32_console_read_socket):
65 * w32term.c (w32_read_socket):
66 * xterm.c (XTread_socket):
67 Omit unused arg EXPECTED. All callers changed.
68 (store_user_signal_events): Return void, not int, since callers no
69 longer care about the return value. All uses changed.
70
b019b76a
JB
712012-09-20 Juanma Barranquero <lekktu@gmail.com>
72
73 * w32gui.h (XParseGeometry): Do not declare.
74
05642592
PE
752012-09-19 Paul Eggert <eggert@cs.ucla.edu>
76
e4bce92a
PE
77 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
78 Ignore 'expected'. See Eli Zaretskii in
79 <http://bugs.gnu.org/12471#8> (last line).
80
05642592
PE
81 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
82 (XParseGeometry): Now static. Substitute extremal values for
83 values that are out of range.
84
e543ae91
JD
852012-09-19 Jan Djärv <jan.h.d@swipnet.se>
86
87 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
88
89 * nsfns.m (XParseGeometry): Remove.
90 (Fx_create_frame): Call x_set_offset to correctly interpret
91 top_pos in geometry.
92
93 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
94 (Fx_parse_geometry): If there is a space in string, call
95 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
96
45ba16c7
EZ
972012-09-17 Eli Zaretskii <eliz@gnu.org>
98
c8b9f1bc
EZ
99 * search.c (scan_buffer): Use character positions in calls to
100 region_cache_forward and region_cache_backward, not byte
101 positions. (Bug#12196)
102
b4c932a2
EZ
103 * w32term.c (w32_read_socket): Set pending_signals to 1, like
104 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
105
45ba16c7
EZ
106 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
107 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
108 emacs_blocked_malloc, now deleted.
109
eeceac93
PE
1102012-09-17 Paul Eggert <eggert@cs.ucla.edu>
111
112 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
113 The workaround was for improving performance on Solaris 2.4, but
114 is getting in the way now. Emacs will still work if someone is
115 still running Solaris 2.4 in a museum somewhere; Sun dropped
116 support for Solaris 2.4 in 2003.
117 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
118 * process.c (create_process) [HAVE_WORKING_VFORK]:
119 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
120 since Emacs no longer uses vfork on that platform.
121
78f83752
GM
1222012-09-17 Glenn Morris <rgm@gnu.org>
123
124 * emacs.c: Use COPYRIGHT.
125
634b8cac
PE
1262012-09-16 Paul Eggert <eggert@cs.ucla.edu>
127
0caaedb1
PE
128 Remove configure's --without-sync-input option (Bug#12450).
129 When auditing signal-handling in preparation for cleaning it up,
130 I found that SYNC_INPUT has race conditions and would be a real
131 pain to fix. Since it's an undocumented and deprecated
132 configure-time option, now seems like a good time to remove it.
133 Also see <http://bugs.gnu.org/11080#16>.
134 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
135 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
136 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
137 (malloc_hysteresis):
138 (check_depth) [XMALLOC_OVERRUN_CHECK]:
139 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
140 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
141 (dont_register_blocks, bytes_used_when_reconsidered)
142 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
143 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
144 [!SYSTEM_MALLOC && !SYNC_INPUT]:
145 Remove. All uses removed.
146 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
147 implementation, one that depends on whether the new macro
148 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
149 is defined.
150 * atimer.c (run_timers, handle_alarm_signal):
151 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
152 (handle_async_input, process_pending_signals)
153 (handle_input_available_signal, init_keyboard):
154 * nsterm.m (ns_read_socket):
155 * process.c (wait_reading_process_output):
156 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
157 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
158 (emacs_write):
159 * xterm.c (XTread_socket):
160 Assume SYNC_INPUT.
161 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
162 * eval.c (handling_signal): Remove. All uses removed.
163 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
164 All uses replaced with the SYNC_INPUT version.
165 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
166 Remove decls.
167 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
168 Now static.
169
634b8cac
PE
170 * font.c (Ffont_shape_gstring): Remove unused local.
171
83da1b55
GM
1722012-09-16 Glenn Morris <rgm@gnu.org>
173
518650a5
GM
174 * Makefile.in (clean): No longer run nextstep's clean.
175
83da1b55
GM
176 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
177 (ns_frag): Remove.
178 (ns-app): Move here from ns.mk, and simplify.
179 (clean): Simplify nextstep entry.
180 * ns.mk: Remove file.
181
85a43e2e
KH
1822012-09-17 Kenichi Handa <handa@gnu.org>
183
184 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
185 not covert the last few charactes.
186
ba13e616 1872012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
188
189 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
190 here, but just check the validity of glyphs in the glyph-string.
191
a8c729af
MR
1922012-09-16 Martin Rudalics <rudalics@gmx.at>
193
194 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
195 any window as argument (Bug#12452).
196
c077c059
JD
1972012-09-16 Jan Djärv <jan.h.d@swipnet.se>
198
199 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
200 to ns_term_init to avoid memory leak.
201
202 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
203 explicit retain/release.
204 (ns_term_init): Only allow one display. Initialize outerpool and
205 ns_*_types.
206
39a57ad0
PE
2072012-09-15 Paul Eggert <eggert@cs.ucla.edu>
208
209 Port _setjmp fix to POSIXish hosts as well as Microsoft.
210 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
211 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
212 the Microsoft problem in a different way, by altering ../nt/config.nt.
213
7105c8cb
EZ
2142012-09-15 Eli Zaretskii <eliz@gnu.org>
215
216 * w32xfns.c:
217 * w32uniscribe.c:
218 * w32term.c:
219 * w32select.c:
220 * w32reg.c:
221 * w32proc.c:
222 * w32menu.c:
223 * w32inevt.c:
224 * w32heap.c:
225 * w32font.c:
226 * w32fns.c:
227 * w32console.c:
228 * w32.c:
229 * w16select.c: Remove inclusion of setjmp.h, as it is now included
230 by lisp.h. This completes removal of setjmp.h inclusion
231 erroneously announced in the previous commit. (Bug#12446)
232
233 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
234 more accurate.
235
236 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
237 not defined as a macro. The latter happens on MS-Windows.
238 (Bug#12446)
239
0328b6de
PE
2402012-09-15 Paul Eggert <eggert@cs.ucla.edu>
241
242 Port better to POSIX hosts lacking _setjmp (Bug#12446).
243 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 244 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
245 only reason for the instance was because "lisp.h" was included.
246 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
247 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
248 and _longjmp with the new symbols. Emacs already uses _setjmp if
249 available, so this change affects only POSIXish hosts that have
250 sigsetjmp but not _setjmp, such as some versions of Solaris and
251 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
252 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
253 (png_load_body) [HAVE_PNG]:
254 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
255 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
256 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
257 since PNG requires jmp_buf. This is the only exception to the
258 general rule that we now use sys_setjmp and sys_longjmp.
259 This exception is OK since this code does not change the signal
260 mask or longjmp out of a signal handler.
261
2af03429
PE
2622012-09-14 Paul Eggert <eggert@cs.ucla.edu>
263
264 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
265 Include "syssignal.h", for 'main_thread'.
266
2f294edf
DA
2672012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
268
269 Avoid out-of-range marker position (Bug#12426).
270 * insdel.c (replace_range, replace_range_2): Adjust
271 markers before overlays, as suggested by comments.
272 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
273 Remove redundant check before calling offset_intervals.
274
6b533e9c
MR
2752012-09-14 Martin Rudalics <rudalics@gmx.at>
276
277 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
278 current buffer (Bug#12387).
279
2a7931e3
JB
2802012-09-14 Juanma Barranquero <lekktu@gmail.com>
281
282 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
283
c18e885b
PE
2842012-09-13 Paul Eggert <eggert@cs.ucla.edu>
285
286 Use a more backwards-compatible timer format (Bug#12430).
287 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
288 vector element, not from the 4th, since PSECS is now at the end.
289 (Fcurrent_idle_time): Doc fix.
290
d59a1afb
DA
2912012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
292
293 Function to mark objects and remove killed buffers at once.
294 * alloc.c (discard_killed_buffers): Rename to ...
295 (mark_discard_killed buffers) ... new name. Add marking
296 of remaining objects. Fix comment. Adjust users.
297 (mark_object): Do not touch frame buffer lists here.
298 * frame.c (delete_frame): Reset frame buffer lists here.
299
5f0cb45a
PE
3002012-09-13 Paul Eggert <eggert@cs.ucla.edu>
301
8ea47e3a
PE
302 Better workaround for GNOME bug when --enable-gcc-warnings.
303 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
304 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
305 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
306
4a4bbad2
PE
307 Simplify SIGIO usage (Bug#12408).
308 The code that dealt with SIGIO was crufty and confusing, e.g., it
309 played tricks like "#undef SIGIO" but these tricks were not used
310 consistently. Simplify mostly by not #undeffing standard symbols,
311 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
312 or not as we please) rather than "defined SIGIO" (standard symbol
313 that we probably shouldn't #undef).
314 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
315 Modules that need it can include it.
316 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
317 * dispextern.h (ignore_sigio): New decl.
318 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
319 unconditionally, since it's now a no-op if !USABLE_SIGIO.
320 * emacs.c (shut_down_emacs):
321 * keyboard.c (kbd_buffer_store_event_hold):
322 Use ignore_sigio rather than invoking 'signal' directly.
323 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
324 for FIONREAD.
325 (FIONREAD, SIGIO): Do not #undef.
326 (tty_read_avail_input): Use #error rather than a syntax error.
327 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
328 for I_PIPE, used by SETUP_SLAVE_PTY.
329 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
330 * sysdep.c (croak): Remove; no longer needed. This bit of
331 temporary code, with Fred N. Fish's comment that it's temporary,
332 has been in Emacs since at least 1992!
333 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
334 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
335 * syssignal.h (croak): Remove decl.
336 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
337 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
338 now that we're termios-only.
339 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
340 * term.c (dissociate_if_controlling_tty): Use #error rather than
341 a run-time error.
342
5f0cb45a
PE
343 Work around GCC and GNOME bugs when --enable-gcc-warnings.
344 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
345 to work around GNOME bug 683906.
346 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
347 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
348 This works around GCC bug 54561.
349
40bce90b
PE
3502012-09-12 Paul Eggert <eggert@cs.ucla.edu>
351
352 More fixes for 'volatile' and setjmp/longjmp.
353 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
354 * image.c (struct png_load_context) [HAVE_PNG]: New type.
355 (png_load_body) [HAVE_PNG]:
356 (jpeg_load_body) [HAVE_JPEG]:
357 New function, with most of the old parent function's body.
358 (png_load) [HAVE_PNG]:
359 (jpeg_load) [HAVE_JPEG]:
360 Invoke the new function, to avoid longjmp munging our locals.
361 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
362 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
363 longjmp is passed 2, as the C standard doesn't guarantee this.
364 Instead, store the failure code into mgr->failure_code.
365
bfeae2cf
SM
3662012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
367
368 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
369 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
370 (syms_of_keyboard): Remove support for unread-command-char.
371
8099e36b
EZ
3722012-09-12 Eli Zaretskii <eliz@gnu.org>
373
374 * w32proc.c (sys_kill): If PID is our process ID and the signal is
375 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
376 violation. (Bug#12426)
377
92547ff9
PE
3782012-09-12 Paul Eggert <eggert@cs.ucla.edu>
379
380 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
381
45b82ad0
SM
3822012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
383
384 * eval.c: Add `inhibit-debugger'.
385 (Qinhibit_debugger): New symbol.
386 (call_debugger): Bind it instead of Qdebug_on_error.
387 (maybe_call_debugger): Test Vinhibit_debugger.
388 (syms_of_eval): Define inhibit-debugger.
389 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
390 (syms_of_xdisp): Remove inhibit-debug-on-message.
391
5779a1dc
PE
3922012-09-11 Paul Eggert <eggert@cs.ucla.edu>
393
50f2e553
PE
394 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
395 If a nonvolatile local variable is written before a _longjmp to
396 the frame containing the variable, and is read after the _longjmp,
397 the value read is indeterminate. Some local variables of type
398 'struct handler' and 'struct catchtag' are used in this way, so
399 mark each of their slots as volatile if the slot can be set before
400 _longjmp and read afterwards.
401 * lisp.h (struct handler): var and chosen_clause are now volatile.
402 (struct catchtag): val, next, and pdlcount are now volatile.
403
ae1d87e2
PE
404 * bidi.c (bidi_push_it, bidi_pop_it):
405 * fns.c (copy_hash_table):
406 * image.c (define_image_type):
407 * keyboard.c (kbd_buffer_store_event_hold):
408 * process.c (Fprocess_send_eof):
409 * xfaces.c (x_create_gc) [HAVE_NS]:
410 * xgselect.c (xg_select):
411 Prefer assignment to memcpy when either will do.
412
5779a1dc
PE
413 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
414 Use pointer-to-a-pointer to simplify and avoid a NILP check each
415 time an item is removed. No need to mark this function 'inline';
416 the compiler knows better than we do.
417
c4c9756b
JD
4182012-09-11 Jan Djärv <jan.h.d@swipnet.se>
419
420 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
421 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
422 to change_frame_size (Bug#12388).
423 (windowDidResize:): Pass YES to updateFrameSize.
424
425 * nsterm.h: Add delay parameter to updateFrameSize.
426
d73e321c
DA
4272012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
428
429 Discard killed buffers from deleted window and frame objects.
430 This reduces an amount of references to killed buffers and
431 helps GC to reclaim them faster.
432 * alloc.c (discard_killed_buffers): New function.
433 (mark_object): Use it for deleted windows and frames.
434 (mark_object): If symbol's value is set up for a killed buffer
435 or deleted frame, restore it's global binding.
436 * data.c (swap_in_global_binding): Add GC notice.
437 (swap_in_symval_forwarding): Use convenient set_blv_where.
438 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
439 * window.h: ... to here.
440
e578f381
DA
4412012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
442
443 Convenient macro to check whether the buffer is live.
444 * buffer.h (BUFFER_LIVE_P): New macro.
445 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
446 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
447
3057e615
YM
4482012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
449
450 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
451 composition cases (Bug#12364).
452
453 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
454 overhang of succeeding glyphs overlapping box cursor.
455
456 * w32term.c (x_draw_glyph_string): Likewise.
457
6fda35f2
PE
4582012-09-11 Paul Eggert <eggert@cs.ucla.edu>
459
c990426a
PE
460 Simplify, document, and port floating-point (Bug#12381).
461 The porting part of this patch fixes bugs on non-IEEE platforms
462 with frexp, ldexp, logb.
463 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
464 Now static.
465 * floatfns.c: Simplify discussion of functions that Emacs doesn't
466 support, by removing commented-out code and briefly listing the
467 C89 functions excluded. The commented-out stuff was confusing
468 maintenance, e.g., we thought we needed cbrt but it was commented out.
469 (logb): Remove decl; no longer needed.
470 (isfinite): New macro, if not already supplied.
471 (isnan): Don't replace any existing macro.
472 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
473 are present on all C89 platforms.
474 (Ffrexp): Do not special-case zero, as frexp does the right thing
475 for that case.
476 (Flogb): Do not use logb, as it doesn't have the desired meaning
477 on hosts that use non-base-2 floating point. Instead, stick with
478 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
479 frexp, to avoid getting an unspecified result.
480
6fda35f2
PE
481 * xdisp.c (Qinhibit_debug_on_message): Now static.
482
16130a58
JD
4832012-09-10 Jan Djärv <jan.h.d@swipnet.se>
484
485 * nsterm.m (ns_update_begin): Set clip path to whole view by using
486 NSBezierPath (Bug#12131).
487
d105a573
CY
4882012-09-10 Chong Yidong <cyd@gnu.org>
489
490 * fns.c (Fdelq, Fdelete): Doc fix.
491
ff55dfe8
PE
4922012-09-10 Paul Eggert <eggert@cs.ucla.edu>
493
494 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
495 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
496
e7032e7c
SM
4972012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
498
499 * lisp.h (make_lisp_ptr): New macro to replace XSET.
500 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
501 Use it.
502
e9957956
EZ
5032012-09-09 Eli Zaretskii <eliz@gnu.org>
504
aba05ce9
EZ
505 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
506 left fringe if the window has a left margin. This avoids leaving
507 traces of the cursor because its leftmost pixel is not drawn over.
508
e9957956
EZ
509 * dispnew.c (update_window_line): When the left margin area of a
510 screen line is updated, set the redraw_fringe_bitmaps_p flag of
511 that screen line. (Bug#12277)
512
f6196b87
PE
5132012-09-09 Paul Eggert <eggert@cs.ucla.edu>
514
515 Assume C89 or later for math functions (Bug#12381).
516 This simplifies the code, and makes it a bit smaller and faster,
517 and (most important) makes it easier to clean up signal handling
518 since we can stop worring about floating-point exceptions in
519 library code. That was a problem before C89, but the problem
520 went away many years ago on all practical Emacs targets.
521 * data.c, image.c, lread.c, print.c:
522 Don't include <math.h>; no longer needed.
523 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
524 might be autoconfigured, as that never happens.
525 * data.c (fmod):
526 * doprnt.c (DBL_MAX_10_EXP):
527 * print.c (DBL_DIG):
528 Remove. C89 or later always defines these.
529 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
530 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
531 (arith_error, domain_error, domain_error2):
532 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
533 no longer needed -- we simply return what C returns. All uses removed.
534 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
535 the wrapped code.
536 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
537 Remove. All uses expanded, as these macros are no longer used
538 more than once and are now more trouble than they're worth.
539 (Ftan): Use tan, not sin / cos.
540 (Flogb): Assume C89 frexp.
541 (fmod_float): Assume C89 fmod.
542 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
543 (init_floatfns): Remove. All uses removed.
544
9d7f1863
JD
5452012-09-08 Jan Djärv <jan.h.d@swipnet.se>
546
547 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
548 compositeToPoint for OSX < 10.6 (Bug#12390).
549
eabf0404
PE
5502012-09-08 Paul Eggert <eggert@cs.ucla.edu>
551
552 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
553 This produces more-accurate results.
554
0b3b1d23
JD
5552012-09-08 Jan Djärv <jan.h.d@swipnet.se>
556
557 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
558 changes (Bug#12088).
559
6dcef6ec
CY
5602012-09-08 Chong Yidong <cyd@gnu.org>
561
562 * syntax.c (Fstring_to_syntax): Doc fix.
563
aa7d57c5
JD
5642012-09-08 Jan Djärv <jan.h.d@swipnet.se>
565
566 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
567 in the internal border.
568 (x_set_window_size): Remove static variables and their usage.
569 (ns_redraw_scroll_bars): Fix NSTRACE arg.
570 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
571 fringe/internal border adjustment (Bug#11052).
572 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
573 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
574 (ns_fix_rect_ibw): Remove.
575 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
576 (ns_dumpglyphs_box_or_relief): Ditto.
577 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
578 adjustment.
579 (ns_dumpglyphs_image): Ditto.
fc0c31f8 580 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
581 border adjustment.
582 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
583 their usage. Add fringe_extended_p and its use as in other terms.
584 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
585 scroll bar was removed.
586 (updateFrameSize): New function.
587 (windowDidResize): Move code to updateFrameSize and call it.
588
589 * nsterm.h (EmacsView): Add updateFrameSize.
590
1a5432bc
CY
5912012-09-07 Chong Yidong <cyd@gnu.org>
592
b4f5313e
CY
593 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
594
1a5432bc
CY
595 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
596
1a4f1e9b
PE
5972012-09-07 Paul Eggert <eggert@cs.ucla.edu>
598
599 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
600 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
601 Problem introduced when merging patches. Noted by Eli Zaretskii in
602 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
603 * floatfns.c: Comment fix.
604 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
605 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
606 and anyway the declaration is harmless even if SIGDANGER is not defined.
607 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
608 defined BROKEN_FIONREAD). systty.h formerly did this, but other
609 source files not surprisingly expected syssignal.h to define, or
610 not define, SIGIO, and it's cleaner to do it that way, for consistency.
611 Include <sys/ioctl.h>, for FIONREAD.
612 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
613 This eliminates a problem whereby other files mysteriously had
614 to include "syssignal.h" before including "systty.h" if they
615 wanted to use "#ifdef SIGIO".
616
bc8000ff
EZ
6172012-09-07 Eli Zaretskii <eliz@gnu.org>
618
3e6d6928
EZ
619 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
620
621 * w32.c (sigemptyset): Empty the set.
622 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
623
bc8000ff
EZ
624 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
625
b4fa72f2
DA
6262012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
627
628 * alloc.c (mark_buffer): Revert unsafe marking optimization.
629 (mark_object): Likewise for frame objects.
630
30730c93
PE
6312012-09-07 Paul Eggert <eggert@cs.ucla.edu>
632
633 * syssignal.h (handle_on_main_thread): Always declare,
634 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
635 This ports to platforms without HAVE_PTHREAD.
636
2fe28299
PE
6372012-09-06 Paul Eggert <eggert@cs.ucla.edu>
638
639 Signal-handler cleanup (Bug#12327).
640 Emacs's signal handlers were written in the old 4.2BSD style with
641 sigblock and sigmask and so forth, and this led to some
642 inefficiencies and confusion. Rewrite these to use
643 pthread_sigmask etc. without copying signal sets around. Also,
644 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
645 'signal', and instead use functions that do not attempt to take
646 over the system name space. This patch causes Emacs's text
647 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
648 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
649 Do not include <signal.h> or "syssignal.h", as these
650 modules do not use signals.
651 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
652 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
653 Do not include <signal.h>, as "syssignal.h" does that for us now.
654 * atimer.c (sigmask_atimers): New function.
655 (block_atimers, unblock_atimers): New functions,
656 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
657 All uses replaced.
658 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
659 no longer needed here.
660 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 661 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
662 * sysdep.c (struct save_signal): New member 'action', replacing
663 old member 'handler'.
664 (save_signal_handlers, restore_signal_handlers):
665 Use sigaction instead of 'signal' to save and restore.
666 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
667 New function. All users of 'signal' modified to use set_sighandler
668 if they're writeonly, and to use sys_signal if they're read+write.
669 (emacs_sigaction_init, forwarded_signal): New functions.
670 (sys_signal): Remove. All uses replaced by calls to sigaction
671 and emacs_sigaction_init, or by direct calls to 'signal'.
672 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
673 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
674 all uses replaced by pthread_sigmask etc. calls.
675 * syssignal.h: Include <signal.h>.
676 (emacs_sigaction_init, forwarded_signal): New decls.
677 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
678 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
679 (sigmask, sys_sigmask): Remove; no longer needed.
680 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
681 (sigblock, sigunblock, sigfree):
682 (sigsetmask) [!defined sigsetmask]:
683 Remove. All uses replaced by pthread_sigmask.
684 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
685 no longer need to be replaced, and its typical old uses
686 are now done via emacs_sigaction_init and sigaction.
687 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
688 (sys_sigdel): Remove; unused.
689 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
690
0216c128
EZ
6912012-09-06 Eli Zaretskii <eliz@gnu.org>
692
693 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
694 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
695
c752cfa9
DA
6962012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
697
698 Explicitly mark buffer_defaults and buffer_local_symbols.
699 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
700 mark_local_symbols here.
701 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
702 since special buffers aren't marked here any more.
703 (allocate_buffer): Chain new buffer with all_buffers here...
704 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
705 not here.
706 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
707 (syms_of_buffer): Remove staticpro of the above.
708 (init_buffer_once): Set names for buffer_defaults and
709 buffer_local_symbols.
710
a864ef14
PE
7112012-09-06 Paul Eggert <eggert@cs.ucla.edu>
712
713 Use bool for booleans in font-related modules.
714 * font.c (font_intern_prop, font_style_to_value)
715 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
716 (generate_otf_features, font_check_otf_features, font_check_otf)
717 (font_match_p, font_list_entities, font_at):
718 * fontset.c (fontset_id_valid_p, reorder_font_vector
719 (fontset_find_font, Fset_fontset_font)
720 (face_suitable_for_char_p) [0]:
721 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
722 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
723 (m17n_flt_initialized, ftfont_shape_by_flt):
724 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
725 * nsfont.m (nsfont_draw):
726 * w32font.c (w32font_draw):
727 * w32term.c (x_draw_glyphless_glyph_string_foreground):
728 Use bool for booleans.
729 * font.h: Adjust to above API changes.
730 (struct font, struct font_driver, struct font_driver_list):
731 Use bool for booleans.
732 (struct font): Remove useless member encoding_type.
733 All users removed.
734 * fontset.c, xftfont.c: Omit unnecessary static decls.
735
0699fc18
DA
7362012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
737
738 * alloc.c (mark_object): Revert window marking code
739 since it's unsafe for the Fset_window_configuration.
740
20ef56db
PE
7412012-09-05 Paul Eggert <eggert@cs.ucla.edu>
742
2fe28299 743 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
744 Be more systematic about preserving errno whenever a signal
745 handler returns, even if it's not in the main thread. Do this by
746 renaming signal handlers to distinguish between signal delivery
747 and signal handling. All uses changed.
748 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
749 * data.c (deliver_arith_signal): Rename from arith_error.
750 * dispnew.c (deliver_window_change_signal): Rename from
751 window_change_signal.
752 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
753 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
754 * keyboard.c (deliver_input_available_signal): Rename from
755 input_available_signal.
756 (deliver_user_signal): Rename from handle_user_signal.
757 (deliver_interrupt_signal): Rename from interrupt_signal.
758 * process.c (deliver_pipe_signal): Rename from send_process_trap.
759 (deliver_child_signal): Rename from sigchld_handler.
760 * atimer.c (handle_alarm_signal):
761 * data.c (handle_arith_signal):
762 * dispnew.c (handle_window_change_signal):
763 * emacs.c (handle_fatal_signal, handle_danger_signal):
764 * keyboard.c (handle_input_available_signal):
765 * keyboard.c (handle_user_signal, handle_interrupt_signal):
766 * process.c (handle_pipe_signal, handle_child_signal):
767 New functions, with the actual signal-handling code taken from the
768 original respective signal handlers, sans the sporadic attempts to
769 preserve errno, since that's now done by handle_on_main_thread.
770 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
771 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
772 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
773 Move to sysdep.c.
774 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
775 Move initialization of main_thread to sysdep.c's init_signals.
776 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
777 our usage, and simplifies the mainline code.
778 (record_child_status_change): New static function, as a helper
779 for handle_child_signal, and with most of the old child handler's
780 contents.
781 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
782 (handle_child_signal): Use the above.
783 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
784 Moved here from emacs.c.
785 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
786 code moved here from emacs.c's main function.
787 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
788 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
789 lets callers save and restore errno properly.
790
e3ccf108
DA
7912012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
792
793 Remove redundant or unused things here and there.
794 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
795 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
796 * editfns.c (Fcompare_buffer_substrings): Likewise.
797 * frame.h (struct terminal, struct font_driver_list):
798 Remove redundant declarations.
799 * window.h (Qleft, Qright): Likewise.
800
697e1e39
DA
8012012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
802
803 Do not mark objects from deleted buffers, windows and frames.
804 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
805 (mark_object): Likewise for windows and frames.
806
c1ca42ca
DA
8072012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
808
809 * alloc.c (valid_lisp_object_p): Treat killed buffers,
810 buffer_defaults and buffer_local_symbols as valid objects.
811 Return special value to denote them.
812
014d93be
PE
8132012-09-05 Paul Eggert <eggert@cs.ucla.edu>
814
f75d7a91
PE
815 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
816 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
817 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
818 (file_name_absolute_p, Fsubstitute_in_file_name):
819 (check_executable, check_writable, Ffile_accessible_directory_p)
820 (Fset_file_selinux_context, Fdefault_file_modes)
821 (Finsert_file_contents, choose_write_coding_system)
822 (Fwrite_region, build_annotations, a_write, e_write)
823 (Fdo_auto_save):
824 * filelock.c (boot_time_initialized, get_boot_time)
825 (get_boot_time_1, lock_file_1, within_one_second):
826 * floatfns.c (in_float):
827 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
828 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
829 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
830 * lisp.h (struct Lisp_Hash_Table.cmpfn):
831 * window.c (compare_window_configurations):
832 Use bool for booleans.
833 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
834 (Fdefault_file_modes): Now mode_t, not int, for modes.
835 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
836 (internal_delete_file): Now returns void, not a (boolean) int,
837 since nobody was looking at the return value.
838 * lisp.h, window.h: Adjust to above API changes.
839
014d93be
PE
840 * xdisp.c (set_message): Simplify and reindent last change.
841
776f29e1
JB
8422012-09-05 Juanma Barranquero <lekktu@gmail.com>
843
844 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
845
7f7e0167
LI
8462012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
847
848 * eval.c (call_debugger): Make the function non-static so that we
849 can call it from set_message.
850
851 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
852 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
853
cf29dd84
PE
8542012-09-04 Paul Eggert <eggert@cs.ucla.edu>
855
856 Give more-useful info on a fatal error (Bug#12328).
857 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
858 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
859 of doing the work ourselves.
860 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
861 do most of the work.
862 (fatal_error_backtrace): New function, taken from the guts
863 of the old fatal_error_signal, but with a new option to output
864 a backtrace.
865 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
866 info about the signal than just its number.
867 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
868 * sysdep.c: Include <execinfo.h>
869 (emacs_backtrace): New function, taken partly from the previous
870 code of the 'die' function.
871 (emacs_abort): Call fatal_error_backtrace rather than abort.
872
972debf2
SM
8732012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
874
875 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
876 eager (load-time) macro-expansion.
877 * lisp.mk (lisp): Add macroexp.
878
1088b922
PE
8792012-09-04 Paul Eggert <eggert@cs.ucla.edu>
880
881 Simplify redefinition of 'abort' (Bug#12316).
882 Do not try to redefine the 'abort' function. Instead, redo
883 the code so that it calls 'emacs_abort' rather than 'abort'.
884 This removes the need for the NO_ABORT configure-time macro
885 and makes it easier to change the abort code to do a backtrace.
886 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
887 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
888 Remove; sysdep.c's emacs_abort now takes its place.
889 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
890 'abort' changed to use 'emacs_abort'.
891 * msdos.c (dos_abort) [defined abort]: Remove; not used.
892 (abort) [!defined abort]: Rename to ...
893 (emacs_abort): ... new name.
894 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
895 the place of the old 'abort' in emacs.c.
896 * w32.c, w32fns.c (abort): Do not #undef.
897 * w32.c (emacs_abort): Rename from w32_abort.
898
30934d33
EZ
8992012-09-04 Eli Zaretskii <eliz@gnu.org>
900
901 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
902 offsets[j].dv, since the y axis of the screen coordinates points
903 down, while the y axis of the font definition coordinates points
904 up. This fixes display of Arabic diacritics such as KASRA and
905 KASRATAN. (Bug#11860)
906
af26b72c
PE
9072012-09-04 Paul Eggert <eggert@cs.ucla.edu>
908
909 Be more systematic about _setjmp vs setjmp.
910 * alloc.c (test_setjmp, mark_stack):
911 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
912 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
913 (png_load, my_error_exit, jpeg_load):
914 * process.c (send_process_trap, send_process):
915 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
916 The underscored versions are up to 30x faster on some hosts.
917 Formerly, the code used setjmp+longjmp sometimes and
918 _setjmp+_longjmp at other times, with no particular reason to
919 prefer setjmp+longjmp.
920
26d4541d
PE
9212012-09-03 Paul Eggert <eggert@cs.ucla.edu>
922
d42f4f0f 923 Fix minor problem found by static checking.
26d4541d 924 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 925
c5e28e39
MR
9262012-09-03 Martin Rudalics <rudalics@gmx.at>
927
928 * buffer.c (Fdelete_all_overlays): New function.
929
3eab3ca9
CY
9302012-09-03 Chong Yidong <cyd@gnu.org>
931
932 * gtkutil.c: Add extern decl for Qxft.
933
c04889f8
PE
9342012-09-02 Paul Eggert <eggert@cs.ucla.edu>
935
1882aa38
PE
936 * emacs.c, eval.c: Use bool for boolean.
937 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
938 (malloc_using_checking) [DOUG_LEA_MALLOC]:
939 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
940 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
941 (main, decode_env_path, Fdaemon_initialized):
942 * eval.c (call_debugger, Finteractive_p, interactive_p):
943 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
944 (maybe_call_debugger, Fbacktrace):
945 * process.c (read_process_output, exec_sentinel):
946 Use bool for booleans.
947 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
948 All callers changed.
949 * eval.c (interactive_p): Omit always-true boolean argument
950 EXCLUDE_SUBRS_P. All callers changed.
951 * dispextern.h, lisp.h: Reflect above API changes.
952 * firstfile.c (dummy): Use the address of 'main', whose signature
953 won't change, instead of the address of 'initialize', whose
954 signature just changed from int to bool.
955 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
956 * msdos.c (fatal_error_in_progress): ... from here.
957 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
958 of incrementing it.
959 (redisplay_internal, unwind_redisplay): Simply clear
960 REDISPLAYING_P when unwinding, instead of saving its previous,
961 always-false value and then restoring it.
962
a411ac43
PE
963 Clean up some extern decls.
964 Mostly, this hoists extern decls out of .c files and into .h files.
965 That way, we're more likely to catch errors if the interfaces change.
966 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
967 declare xg_mark_data.
968 * dispextern.h (x_frame_parm_handlers):
969 * font.h (Qxft):
970 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
971 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
972 (Qultra_bold, Qoblique, Qitalic):
973 Move extern decl here from .c file.
974 * alloc.c (xg_mark_data) [USE_GTK]:
975 * doc.c (Qclosure):
976 * eval.c (Qlexical_binding):
977 * fns.c (time) [!HAVE_UNISTD_H]:
978 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
979 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
980 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
981 * lread.c (Qinternal_interpreter_environment):
982 * minibuf.c (Qbuffer):
983 * process.c (QCfamily, QCfilter):
984 * widget.c (free_frame_faces):
985 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
986 * xfont.c (x_clear_errors):
987 * xterm.c (x_frame_parm_handlers):
988 Remove now-redundant extern decls.
989 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
990 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
991 Now static.
992 * xfaces.c: Remove unnecessary static decls.
993 * xterm.c (updating_frame): Remove decl of nonexistent object.
994
c04889f8
PE
995 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
996 when building globals.h, as the objects that are not built on
997 this host are not needed to compile C files on this host.
998
8b339673
JD
9992012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1000
1001 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1002
1003 * frame.h: Add missing prototype for x_wm_set_size_hint.
1004
a08d4ba7
PE
10052012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1006
1007 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1008 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1009 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1010 (Fsubstitute_command_keys):
1011 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1012 (save_excursion_save, save_excursion_restore)
1013 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1014 (format_time_string, general_insert_function)
1015 (make_buffer_string, make_buffer_string_both)
1016 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1017 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1018 (copy_text, insert_1, insert_1_both, insert_from_string)
1019 (insert_from_string_before_markers, insert_from_string_1)
1020 (insert_from_buffer, insert_from_buffer_1, replace_range)
1021 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1022 (del_range_2, modify_region):
1023 * intervals.c (intervals_equal, balance_possible_root_interval)
1024 (adjust_intervals_for_insertion, merge_properties_sticky)
1025 (graft_intervals_into_buffer, lookup_char_property)
1026 (adjust_for_invis_intang, set_point_both)
1027 (get_property_and_range, compare_string_intervals)
1028 (set_intervals_multibyte_1, set_intervals_multibyte):
1029 * keyboard.c (decode_timer):
1030 Use bool for boolean.
1031 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1032 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1033
48c948de
CY
10342012-09-02 Chong Yidong <cyd@gnu.org>
1035
1036 * keymap.c (push_key_description): Print M-TAB as C-M-i
1037 (Bug#11758).
1038
6c49a40b
JB
10392012-09-02 Juanma Barranquero <lekktu@gmail.com>
1040
1041 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1042 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1043 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1044 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1045 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1046 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1047 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1048
4dfbd238
EZ
10492012-09-01 Eli Zaretskii <eliz@gnu.org>
1050
7e510e28
EZ
1051 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1052 more than one grapheme cluster passed to the shaper: compute the
1053 offset adjustment values separately for each cluster. (Bug#11860)
1054
4dfbd238
EZ
1055 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1056 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1057 about implicit conversions from integer to pointer.
1058
86571ae0
DC
10592012-09-01 Daniel Colascione <dancol@dancol.org>
1060
1061 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1062 system used too early.
1063
0e23ef9d
PE
10642012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1065
1066 Better seed support for (random).
1067 * emacs.c (main): Call init_random.
1068 * fns.c (Frandom): Set the seed from a string argument, if given.
1069 Remove long-obsolete Gentzel cruft.
1070 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1071 (init_random): New function.
1072
17a2cbbd
DC
10732012-09-01 Daniel Colascione <dancol@dancol.org>
1074
1075 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1076 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1077 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1078 x_wm_set_size_hint, x_query_colors, x_real_positions,
1079 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1080 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1081 all of which have been moved to common code.
1082
1083 * xfaces.c: Include TERM_HEADER instead of listing all possible
1084 window-system headers.
1085
1086 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1087 to match header.
1088
1089 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1090 directly accessing frame internals.
1091
f18cbb28 1092 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1093 globals_of_w32font.
1094
1095 * process.c: Include TERM_HEADER instead of listing all possible
1096 window-system headers.
1097
1098 * nsterm.h: Remove declarations now in frame.h. Define
1099 FRAME_X_SCREEN, FRAME_X_VISUAL.
1100
1101 * menu.c: Include TERM_HEADER instead of listing all possible
1102 window-system headers.
1103
1104 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1105 window system.
1106
1107 * keyboard.c: Include TERM_HEADER instead of listing all possible
1108 window-system headers.
1109
1110 * image.c: Include TERM_HEADER instead of listing all possible
1111 window-system headers. Declare Vlibrary_cache when compiling for
1112 Windows.
1113
1114 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1115 window system declarations.
1116
1117 * frame.h: Move common functions here: set_frame_menubar,
1118 x_set_window_size, x_sync, x_get_focus_frame,
1119 x_set_mouse_position, x_set_mouse_pixel_position,
1120 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1121 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1122 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1123 x_activate_menubar, x_real_positions, x_bitmap_icon,
1124 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1125 and x_query_colors.
1126
1127 * frame.c: Include TERM_HEADER instead of listing all possible
1128 window-system headers.
1129
1130 * font.c: Include TERM_HEADER instead of listing all possible
1131 window-system headers.
1132
1133 * emacs.c: Include TERM_HEADER.
1134
f18cbb28
EZ
1135 * dispnew.c: Include TERM_HEADER instead of listing all possible
1136 window-system headers.
17a2cbbd 1137
f18cbb28 1138 * ccl.h: Include character.h.
17a2cbbd
DC
1139
1140 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1141 the current window system; include in list of objects to link into
1142 Emacs.
1143
c650a5de
DA
11442012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1145
1146 Remove mark_ttys function and fix tty_display_info initialization.
1147 * lisp.h (mark_ttys): Remove prototype.
1148 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1149 to mark_ttys because all possible values of 'top_frame' slot are
1150 the frames which are reachable from Vframe_list.
1151 * term.c (mark_ttys): Remove.
1152 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1153
4e0f6479
DA
11542012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1155
1156 Change struct frame bitfields from unsigned char to unsigned.
1157 * frame.h (struct frame): Change type of 'display_preempted',
1158 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1159 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1160 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1161 bitfields from unsigned char to unsigned.
1162
8b96a52c
DA
11632012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1164
1165 Remove unused member of struct x_output and struct w32_output.
1166 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1167 * w32term.h (struct w32_output): Likewise.
1168
b4444c8a
JD
11692012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1170
1171 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1172 does not become zero (Bug#12234).
1173
b98521db
PE
11742012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1175
1176 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1177 for GCC 4.7.1 x86-64.
1178
31d02438
GM
11792012-08-30 Glenn Morris <rgm@gnu.org>
1180
1181 * lread.c (init_lread): For out-of-tree builds, only add the
1182 source directory's site-lisp dir to the load-path if it exists,
1183 consistent with in-tree builds. (Bug#12302)
1184
7f8941d8
JD
11852012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1186
1187 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 1188 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
1189 (windowShouldClose:): Set window_closed.
1190 (dealloc): New member, free button_values.
fc0c31f8
JB
1191 (process_dialog:): Make member function. Remove window argument,
1192 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
1193 in button_values.
1194 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 1195 with tag. Remove return self, declare return value as void.
7f8941d8
JD
1196 (addString:row:): Remove return self, declare return value as void.
1197 (addSplit): Remove return self, declare return value as void.
1198 (clicked:): Remove return self, declare return value as void.
fc0c31f8 1199 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
1200 (initFromContents:isQuestion:): Adjust call to process_dialog.
1201 Code formatting change.
1202 (timeout_handler:): Set timer_fired to YES.
1203 (runDialogAt:): Set timer_fired to NO.
1204 Handle click on close button as quit.
1205
1206 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1207 Add window_closed and button_values. Add void as return value for
1208 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1209 Add process_dialog as new member.
1210
eada0861 12112012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 1212
eada0861
GM
1213 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1214 is not one of the heaps we manage. (Bug#12242)
1215
12162012-08-28 Glenn Morris <rgm@gnu.org>
1217
1218 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1219
457294dd
MR
12202012-08-28 Martin Rudalics <rudalics@gmx.at>
1221
1222 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
1223 auto-buffer-name window parameter. Install revision of reverted
1224 fix.
457294dd 1225
4f2daf31
DA
12262012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1227
1228 Do not allow to set major mode for a dead buffer.
1229 * buffer.c (Fset_buffer_major_mode): Signal an error
1230 if the buffer is dead.
1231 (Fother_buffer, other_buffer_safely): Remove redundant
1232 nested declaration.
1233
66322887
DA
12342012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1235
1236 Always use set_buffer_if_live to restore original buffer at unwind.
1237 * buffer.h (record_unwind_current_buffer): New function.
1238 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1239 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1240 * undo.c, window.c: Adjust users.
1241 * buffer.c (set_buffer_if_live): Fix comment.
1242
a3d794a1
DA
12432012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1244
1245 Fix usage of set_buffer_internal.
1246 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1247 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1248 * coding.c (decode_coding): Omit redundant test.
1249 * fileio.c (decide_coding_unwind): Likewise.
1250 * fns.c (secure_hash): Likewise.
1251 * insdel.c (modify_region): Likewise.
1252 * keyboard.c (command_loop_1): Likewise.
1253 * print.c (PRINTFINISH): Likewise.
1254 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1255
59ea14cd
PE
12562012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1257
1258 * dispnew.c: Use bool for boolean.
1259 (frame_garbaged, display_completed, delayed_size_change)
1260 (fonts_changed_p, add_window_display_history)
1261 (add_frame_display_history, verify_row_hash)
1262 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1263 (row_equal_p, realloc_glyph_pool)
1264 (allocate_matrices_for_frame_redisplay)
1265 (showing_window_margins_p)
1266 (adjust_frame_glyphs_for_frame_redisplay)
1267 (build_frame_matrix_from_leaf_window, make_current)
1268 (mirrored_line_dance, mirror_line_dance, update_frame)
1269 (update_window_tree, update_single_window)
1270 (check_current_matrix_flags, update_window, update_text_area)
1271 (update_window_line, set_window_update_flags, scrolling_window)
1272 (update_frame_1, scrolling, buffer_posn_from_coords)
1273 (do_pending_window_change, change_frame_size)
1274 (change_frame_size_1, sit_for):
1275 Use bool for boolean.
1276 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1277 and remove last int (actually boolean) argument, which was always 0.
1278 All callers changed.
1279 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1280 * dispextern.h (struct composition_it): Use bool for boolean.
1281 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1282 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1283 * dired.c (file_name_completion):
1284 Use bool for boolean. (This was missed in an earlier change.)
1285
95072a94
MR
12862012-08-27 Martin Rudalics <rudalics@gmx.at>
1287
1288 * window.c (Fset_window_configuration): Revert first part of
1289 last change.
1290
0f19feff
JD
12912012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1292
1293 * nsterm.h (NSPanel): New class variable dialog_return.
1294
1295 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1296 dialog_return.
1297 (windowShouldClose:): Use stop instead of stopModalWithCode.
1298 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1299 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1300 event.
1301 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1302 modal loop returns.
1303
f10fe38f
PE
13042012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1305
de1339b0
PE
1306 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1307 * composite.c (find_composition, composition_gstring_p)
1308 (composition_reseat_it, find_automatic_composition):
1309 * data.c (let_shadows_buffer_binding_p)
1310 (let_shadows_global_binding_p, set_internal, make_blv)
1311 (Fmake_variable_buffer_local, Fmake_local_variable)
1312 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1313 (cons_to_signed, arith_driver):
1314 * dbusbind.c (xd_in_read_queued_messages):
1315 * dired.c (directory_files_internal, file_name_completion):
1316 Use bool for booleans.
1317 * dired.c (file_name_completion):
1318 * process.h (fd_callback):
1319 Omit int (actually boolean) argument. It wasn't being used.
1320 All uses changed.
1321 * composite.h, lisp.h: Reflect above API changes.
1322
f10fe38f
PE
1323 * cmds.c, coding.c: Use bool for booleans.
1324 * cmds.c (move_point, Fself_insert_command):
1325 * coding.h (struct composition status, struct coding_system):
1326 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1327 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1328 (emacs_mule_char, decode_coding_emacs_mule)
1329 (encode_coding_emacs_mule, detect_coding_iso_2022)
1330 (decode_coding_iso_2022, encode_invocation_designation)
1331 (encode_designation_at_bol, encode_coding_iso_2022)
1332 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1333 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1334 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1335 (encode_coding_raw_text, detect_coding_charset)
1336 (decode_coding_charset, encode_coding_charset, detect_eol)
1337 (detect_coding, get_translation_table, produce_chars)
1338 (consume_chars, reused_workbuf_in_use)
1339 (make_conversion_work_buffer, code_conversion_save)
1340 (decode_coding_object, encode_coding_object)
1341 (detect_coding_system, char_encodable_p)
1342 (Funencodable_char_position, code_convert_region)
1343 (code_convert_string, code_convert_string_norecord)
1344 (Fset_coding_system_priority):
1345 * fileio.c (Finsert_file_contents):
1346 Use bool for booleans.
1347 * coding.h, lisp.h: Reflect above API changes.
1348 * coding.c: Remove unnecessary static function decls.
1349 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1350 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1351 not a boolean 'int', since callers never look at the return value.
1352 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1353 * coding.h (decoding_buffer_size, encoding_buffer_size)
1354 (emacs_mule_string_char): Remove unused extern decls.
1355 (struct iso_2022_spec, struct coding_system):
1356 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1357 (struct emacs_mule_spec): Remove unused field 'full_support'.
1358 All initializations removed.
1359 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1360
5474c384
DA
13612012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1362
f10fe38f 1363 Fix spare memory change (Bug#12286).
5474c384
DA
1364 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1365 (valid_lisp_object_p): Likewise.
1366
c4b6914d
MR
13672012-08-27 Martin Rudalics <rudalics@gmx.at>
1368
1369 * window.c (Fset_window_configuration): Record any window's old
1370 buffer if it's replaced (see Bug#8789). If the new current
1371 buffer doesn't appear in the selected window, go to its old
1372 point (Bug#12208).
1373
35aaa1ea
DA
13742012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1375
1376 Special MEM_TYPE_SPARE to denote reserved memory.
1377 * alloc.c (enum mem_type): New memory type.
1378 (refill_memory_reserve): Use new type for spare memory.
1379 This prevents live_cons_p and live_string_p from incorrect
1380 detection of uninitialized objects from spare memory as live.
1381
6af64513
PE
13822012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1383
8b2e00a3
PE
1384 Spelling fixes.
1385 * Makefile.in (.PHONY): versioclean -> versionclean.
1386
b52d6985
PE
1387 Remove unused external symbols.
1388 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1389 * window.c (Qwindow_valid_p, decode_valid_window):
1390 Now static, not extern.
1391 * data.c (Qinterval): Remove; unused.
1392 (syms_of_data): Do not define 'interval'.
1393 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1394 * window.h (decode_valid_window):
1395 Remove decls.
1396
d5172d4f
PE
1397 * character.c, charset.c, chartab.c: Use bool for booleans.
1398 * character.c (lisp_string_width, string_count_byte8)
1399 (string_escape_byte8):
1400 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1401 (load_charset_map_from_file, map_charset_chars)
1402 (Fdefine_charset_internal, define_charset_internal)
1403 (Fdeclare_equiv_charset, find_charsets_in_text)
1404 (Ffind_charset_region, char_charset, Fiso_charset):
1405 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1406 (sub_char_table_set, sub_char_table_set_range)
1407 (char_table_set_range, optimize_sub_char_table)
1408 (map_sub_char_table):
1409 Use bool for boolean.
1410 * character.c (str_to_unibyte): Omit last boolean argument; it was
1411 always 0. All callers changed.
1412 * character.h, charset.h: Adjust to match previous changes.
1413 * character.h (char_printable_p): Remove decl of nonexistent function.
1414 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1415 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1416 are all boolean, so make them single-bit bitfields.
1417
6af64513
PE
1418 * lisp.h (ASET): Remove attempt to detect side effects.
1419 It was meant to be temporary and it often doesn't work,
1420 because when IDX has side effects the behavior of IDX==IDX
1421 is undefined. See Stefan Monnier in
1422 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1423
e1f29348
BR
14242012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1425
1426 * lisp.h (functionp): New function (extracted from Ffunctionp).
1427 (FUNCTIONP): Use it.
1428 * eval.c (Ffunctionp): Use it.
1429
17c05d74
PE
14302012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1431
0f46bc75
PE
1432 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1433 as that's faster and simpler than static storage. Don't bother
1434 with the g_main_context_query overhead if g_main_context_pending
1435 says no events are pending.
1436 (gfds, gfds_size): Remove these static vars.
1437 (xgselect_initialize): Remove; no longer needed.
1438 All uses and decls removed.
1439
ee4c0f69
PE
1440 * emacs.c (fatal_error_signal_hook): Remove.
1441 All uses removed. This leftover from old code was always 0.
1442
17c05d74
PE
1443 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1444 * casefiddle.c (casify_object, casify_region):
1445 * casetab.c (set_case_table):
1446 * category.c, category.h (word_boundary_p):
1447 * category.h (CHAR_HAS_CATEGORY):
1448 Use bool for booleans, instead of int.
1449
391ceac5
EZ
14502012-08-25 Eli Zaretskii <eliz@gnu.org>
1451
1452 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1453
2f221583
PE
14542012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1455
f4a681b0
PE
1456 On assertion failure, print backtrace if available.
1457 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1458 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1459 * Makefile.in (LIB_EXECINFO): New macro.
1460 (LIBES): Use it.
1461
2f221583
PE
1462 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1463 * bytecode.c (exec_byte_code):
1464 * callint.c (check_mark, Fcall_interactively):
1465 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1466 (getenv_internal, sync_process_alive, call_process_exited):
1467 * lisp.h (USE_SAFE_ALLOCA):
1468 Use bool for booleans, instead of int.
1469 * lisp.h, process.h: Adjust prototypes to match above changes.
1470 * callint.c (Fcall_interactively): Don't assume the mark's
1471 offset fits in 'int'.
1472
37ef52bb
PE
14732012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1474
1475 * buffer.c, buffer.h: Use bool for boolean.
1476 * buffer.c (reset_buffer_local_variables)
1477 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1478 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1479 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1480 (overlay_touches_p, overlay_strings, Foverlay_put)
1481 (report_overlay_modification, call_overlay_mod_hooks):
1482 (mmap_enlarge, mmap_set_vars):
1483 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1484 Use bool for booleans, instead of int.
1485 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1486 since the 1-or-0 return value is always ignored anyway.
1487 (mmap_initialized_p):
1488 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1489 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1490
2cc21167
PE
14912012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1492
1493 * bidi.c: Use bool for boolean.
1494 This is a bit more readable, and makes the text segment of bidi.o
1495 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1496 Presumably it's faster too.
1497 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1498 Now bool.
1499 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1500 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1501 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1502 (bidi_explicit_dir_char, bidi_level_of_next_char)
1503 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1504 Use bool for booleans, instead of int.
1505 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1506 (bidi_unshelve_cache): Adjust decls to match code.
1507
7db4ddf4
MR
15082012-08-23 Martin Rudalics <rudalics@gmx.at>
1509
1510 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1511 argument.
1512
b1bb8011
PE
15132012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1514
1515 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1516 * atimer.h: Include <stdbool.h>.
1517
ff687885
DN
15182012-08-22 Dan Nicolaescu <dann@gnu.org>
1519
1520 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1521 compile time tests instead of run time tests on systems that do
1522 not use them.
1523 (FRAME_MAC_P): Remove leftover from deleted code.
1524 * frame.c (syms_of_frame): Remove leftover from deleted code.
1525
4ce7a138
JD
15262012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1527
1528 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1529
d733ec6d
PE
15302012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1531
1532 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1533 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 1534 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
1535 (fontset_add): Return void, for FONTSET_ADD.
1536
d0d2d26f
PE
15372012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1538
fce31d69
PE
1539 * alloc.c: Use bool for booleans.
1540 (gc_in_progress, abort_on_gc)
1541 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1542 (dont_register_blocks) [GC_MALLOC_CHECK]:
1543 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1544 (check_string_bytes, make_specified_string, memory_full)
1545 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1546 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1547 (mark_stack, valid_pointer_p, make_pure_string)
1548 (Fgarbage_collect, survives_gc_p, gc_sweep):
1549 Use bool for booleans, instead of int.
1550 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1551 Remove unused local.
1552 * alloc.c (PURE_POINTER_P):
1553 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1554 * editfns.c (Fformat):
1555 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1556 (Fdo_auto_save):
1557 * fns.c (sweep_weak_table):
1558 * lisp.h (suppress_checking, push_message, survives_gc_p)
1559 (make_pure_string, gc_in_progress, abort_on_gc):
1560 * lread.c (readchar, read1):
1561 * print.c (Fprin1_to_string):
1562 * xdisp.c (push_message):
1563 Use bool for booleans affected directly or indirectly by
1564 alloc.c's changes.
1565
d0d2d26f
PE
1566 Make recently-introduced setters macros.
1567 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1568 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1569 (set_fontset_default, set_fontset_fallback): Rename from their
1570 upper-case counterparts, and make them functions rather than macros.
1571 This is more consistent with the other recently-introduced setters.
1572 These don't need to be inline, since they're local.
1573
d18e2bb6
JD
15742012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1575
1576 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1577 the loop (Bug#12247).
1578
1b9d9d16
PE
15792012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1580
1581 * lisp.h (vcopy): Use memcpy rather than our own loop.
1582 This fixes a performance regression introduced by the recent
1583 addition of vcopy. This means 'vcopy' will need to be modified
1584 for a copying collector, but that's OK. Also, tighten the
1585 checking in the assertion.
1586
b2f09701
EZ
15872012-08-21 Eli Zaretskii <eliz@gnu.org>
1588
1589 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1590 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1591 non-base glyph for the width of the base character, according to
e1f29348
BR
1592 what x_draw_composite_glyph_string_foreground expects.
1593 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
1594 expectations, to produce correct width of the composed character.
1595 Reverse the sign of the DU offset produced by ScriptPlace.
1596
9b994fed
PE
15972012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1598
1599 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1600
086ca913
DA
16012012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1602
1603 Avoid direct writes to contents member of struct Lisp_Vector.
1604 * lisp.h (vcopy): New function to copy data into vector.
1605 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1606 * fns.c (Ffillarray): Use ASET.
1607 * keyboard.c (timer_check_2): Use AREF and ASET.
1608 (append_tool_bar_item, Frecent_keys): Use vcopy.
1609 * lread.c (read_vector): Use ASET.
1610 * msdos.c (Frecent_doskeys): Use vcopy.
1611 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1612 (Finternal_merge_in_global_face): Use ASET and vcopy.
1613 * xfont.c (xfont_list_pattern): Likewise.
1614
5481664a
MR
16152012-08-21 Martin Rudalics <rudalics@gmx.at>
1616
1617 * window.c (Fwindow_point): For the selected window always return
1618 the position of its buffer's point.
1619 (Fset_window_point): For the selected window always go in its
1620 buffer to the specified position.
1621
6d470bdd
DA
16222012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1623
1624 Setter macros for fontsets.
1625 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1626 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1627 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1628 Adjust users.
1629
24564fe1
GM
16302012-08-20 Glenn Morris <rgm@gnu.org>
1631
1632 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1633 Don't assume that `ln -f' works.
1634
0a05a035
EZ
16352012-08-20 Eli Zaretskii <eliz@gnu.org>
1636
1637 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1638 and later about non-assignments with no effect. See discussion at
1639 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1640 details.
1641
e46f2325
DA
16422012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1643
1644 Inline setter functions for Lisp_Objects slots of struct specbinding.
1645 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1646 Adjust users.
1647
734fbd86
MR
16482012-08-20 Martin Rudalics <rudalics@gmx.at>
1649
1650 * window.c (select_window): Always make selected window's buffer
1651 current.
1652
f1a95992
DA
16532012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1654
1655 Use AREF and ASET for docstrings of category tables.
1656 * category.h (CATEGORY_DOCSTRING): Use AREF.
1657 (SET_CATEGORY_DOCSTRING): Use ASET.
1658 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1659
e83064be
DA
16602012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1661
1662 Inline setter functions for hash table members.
1663 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1664 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1665 (set_hash_key_and_value, set_hash_index, set_hash_next)
1666 (set_hash_hash): New functions.
1667 * charset.c, fns.c: Adjust users.
1668
4ce60d2e
DA
16692012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1670
1671 Inline getter and setter functions for per-buffer values.
1672 * buffer.h (per_buffer_default, set_per_buffer_default)
1673 (per_buffer_value, set_per_buffer_value): New functions.
1674 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1675 * buffer.c, data.c: Adjust users.
1676
c06c9690
JB
16772012-08-20 Juanma Barranquero <lekktu@gmail.com>
1678
1679 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1680
32bd4250
PE
16812012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1682
bad03192 1683 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
1684 as gnulib does this if the system doesn't.
1685 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
1686 Remove declaration. MS-Windows declares it on stdlib.h which is
1687 included by conf_post.h.
b69a6d22
PE
1688 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1689 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1690 * vm-limit.c: Include <unistd.h>, for 'environ'.
1691
22d7feb2
PE
1692 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1693 (start_of_data): Remove decl; mem-limits.h provides it.
1694
32bd4250
PE
1695 * xdisp.c (handle_invisible_prop): Make it a bit faster
1696 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1697
450809af
CY
16982012-08-19 Chong Yidong <cyd@gnu.org>
1699
1700 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1701 ends (Bug#3874).
1702
9e677988
AS
17032012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1704
6b1319ce
AS
1705 * .gdbinit: Use call instead of set when calling a function in the
1706 inferior.
1707
9e677988
AS
1708 * data.c (set_internal): Don't use set_blv_found.
1709 (Fkill_local_variable): Likewise.
1710
d7191076
AA
17112012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1712
1713 * nsfont.m (ns_ascii_average_width): Ensure the string
1714 ascii_printable is initialized with a null-terminated character
1715 array. Otherwise, it can contain undesired extra characters.
1716
e757f1c6
PE
17172012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1718
1719 port new setting code to Sun C 5.8 2005/10/13
1720 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1721 Return void, not Lisp_Object. Otherwise, the compiler
1722 complains about (A?B:C) where B is void and C is Lisp_Object
1723 when compiling CHAR_TABLE_SET, due to the recent change to
1724 the API of sub_char_table_set_contents.
1725
a999ce26
CY
17262012-08-18 Chong Yidong <cyd@gnu.org>
1727
1728 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1729 for the string case (Bug#3874).
1730
3f22b86f
PE
17312012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1732
39eb03f1
PE
1733 * buffer.h (BSET): Remove (Bug#12215).
1734 Replace all uses with calls to new setter functions.
1735 (bset_bidi_paragraph_direction, bset_case_canon_table)
1736 (bset_case_eqv_table, bset_directory, bset_display_count)
1737 (bset_display_time, bset_downcase_table)
1738 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1739 (bset_last_selected_window, bset_local_var_alist)
1740 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1741 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1742 (bset_width_table):
1743 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1744 (bset_auto_fill_function, bset_auto_save_file_format)
1745 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1746 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1747 (bset_cache_long_line_scans, bset_case_fold_search)
1748 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1749 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1750 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1751 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1752 (bset_header_line_format, bset_indicate_buffer_boundaries)
1753 (bset_indicate_empty_lines, bset_invisibility_spec)
1754 (bset_left_fringe_width, bset_major_mode, bset_mark)
1755 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1756 (bset_name, bset_overwrite_mode, bset_pt_marker)
1757 (bset_right_fringe_width, bset_save_length)
1758 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1759 (bset_scroll_up_aggressively, bset_selective_display)
1760 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1761 (bset_word_wrap, bset_zv_marker):
1762 * category.c (bset_category_table):
1763 * syntax.c (bset_syntax_table):
1764 New setter functions.
1765
6a09a33b
PE
1766 * process.h (PSET): Remove (Bug#12215).
1767 Replace all uses with calls to new setter functions.
1768 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1769 (PROCESS_INLINE): New macro.
1770 (pset_childp): New setter function.
1771 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1772 * process.c (PROCESS_INLINE):
1773 Define to EXTERN_INLINE, so that the corresponding functions
1774 are compiled into code.
1775 (pset_buffer, pset_command, pset_decode_coding_system)
1776 (pset_decoding_buf, pset_encode_coding_system)
1777 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1778 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1779 (pset_type, pset_write_queue): New setter functions.
1780
e8c17b81
PE
1781 * window.h (WSET): Remove (Bug#12215).
1782 Replace all uses with calls to new setter functions.
1783 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1784 (WINDOW_INLINE): New macro.
1785 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1786 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1787 (wset_total_lines, wset_vertical_scroll_bar)
1788 (wset_window_end_pos, wset_window_end_valid)
1789 (wset_window_end_vpos): New setter functions.
1790 * window.c (WINDOW_INLINE):
1791 Define to EXTERN_INLINE, so that the corresponding functions
1792 are compiled into code.
1793 (wset_combination_limit, wset_dedicated, wset_display_table)
1794 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1795 (wset_new_normal, wset_new_total, wset_next_buffers)
1796 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1797 (wset_prev_buffers, wset_right_fringe_width)
1798 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1799 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1800 (wset_window_parameters):
1801 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1802 (wset_column_number_displayed, wset_region_showing):
1803 New setter functions.
1804
3f22b86f
PE
1805 * termhooks.h (TSET): Remove (Bug#12215).
1806 Replace all uses with calls to new setter functions.
1807 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1808 (TERMHOOKS_INLINE): New macro.
1809 (tset_charset_list, tset_selection_alist): New setter functions.
1810 * terminal.c (TERMHOOKS_INLINE):
1811 Define to EXTERN_INLINE, so that the corresponding functions
1812 are compiled into code.
1813 (tset_param_alist): New setter function.
1814
742af32f
PE
18152012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1816
15dbb4d6
PE
1817 * keyboard.h (KSET): Remove (Bug#12215).
1818 Replace all uses with calls to new setter functions.
1819 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1820 (KEYBOARD_INLINE): New macro.
1821 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1822 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1823 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1824 New setter functions.
1825 * keyboard.c (KEYBOARD_INLINE):
1826 Define to EXTERN_INLINE, so that the corresponding functions
1827 are compiled into code.
1828 (kset_echo_string, kset_kbd_queue)
1829 (kset_keyboard_translate_table, kset_last_prefix_arg)
1830 (kset_last_repeatable_command, kset_local_function_key_map)
1831 (kset_overriding_terminal_local_map, kset_real_last_command)
1832 (kset_system_key_syms): New setter functions.
1833
f00af5b1
PE
1834 * frame.h (FSET): Remove (Bug#12215).
1835 Replace all uses with calls to new setter functions.
1836 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1837 (FRAME_INLINE): New macro.
1838 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1839 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1840 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1841 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1842 (fset_param_alist, fset_root_window, fset_scroll_bars)
1843 (fset_selected_window, fset_title, fset_tool_bar_items)
1844 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1845 * frame.c (FRAME_INLINE):
1846 Define to EXTERN_INLINE, so that the corresponding functions
1847 are compiled into code.
1848 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1849
0c94c8d6
PE
1850 A few more naming-convention fixes for getters and setters.
1851 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1852 and rename from buffer_overlays_set_before.
1853 (set_buffer_overlays_after): Move here from buffer.h, and rename
1854 from buffer_overlays_set_after.
1855 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1856 All uses changed.
1857 (set_buffer_intervals): Rename from buffer_set_intervals.
1858 * intervals.c (set_interval_object): Move here from intervals.h,
1859 and rename from interval_set_object.
1860 (set_interval_left): Move here from intervals.h, and rename from
1861 interval_set_left.
1862 (set_interval_right): Move here from intervals.h, and rename from
1863 interval_set_right.
1864 (copy_interval_parent): Move here from intervals.h, and rename from
1865 interval_copy_parent.
1866 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1867 (set_interval_plist): Rename from interval_set_plist.
1868 Return void, not Lisp_Object, since no caller uses the result.
1869 * lisp.h (string_intervals): Rename from string_get_intervals.
1870 (set_string_intervals): Rename from string_set_intervals.
1871
34dabdb7
PE
1872 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1873 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 1874 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
1875 All uses changed. See the end of
1876 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1877
742af32f
PE
1878 * lisp.h (CSET): Remove (Bug#12215).
1879 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1880 (set_char_table_purpose): New functions,
1881 replacing CSET. All uses changed. For example, replace
1882 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 1883 "set_char_table_parent (char_table, parent);".
742af32f
PE
1884 The old version was confusing because it used the same name
1885 'parent' for two different things.
1886
a04e2c62
DA
18872012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1888
1889 Functions to get and set Lisp_Object fields of buffer-local variables.
1890 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1891 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1892 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1893 * data.c, eval.c, frame.c: Adjust users.
1894
383dcbf9
CY
18952012-08-17 Chong Yidong <cyd@gnu.org>
1896
1897 * xfaces.c (merge_face_vectors): If the target font specfies a
1898 font spec, make the font's attributes take precedence over
1899 directly-specified attributes.
1900 (merge_face_ref): Recognize :font.
1901
44386687
DA
19022012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1903
1904 Do not use memcpy for copying intervals.
1905 * intervals.c (reproduce_interval): New function.
1906 (reproduce_tree, reproduce_tree_obj): Use it.
1907 (reproduce_tree_obj): Remove prototype.
1908
927c7216
PE
19092012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1910
1911 * lisp.h (duration_to_sec_usec): Remove unused decl.
1912
93044f7b
AA
19132012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1914
1915 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1916 to an allocated instance of NSString, not to the class itself.
1917
9851e4a5
JB
19182012-08-17 Juanma Barranquero <lekktu@gmail.com>
1919
1920 * makefile.w32-in (C_CTYPE_H): New macro.
1921 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1922 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1923 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1924
620f13b0
PE
19252012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1926
1927 Use ASCII tests for character types.
1928 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1929 * xfns.c, xterm.c:
1930 Don't include <ctype.h>; was not needed.
1931 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1932 * sysdep.c, xfaces.c:
1933 Include <c-ctype.h> instead of <ctype.h>.
1934 * nsterm.m: Include <c-ctype.h>.
1935 * charset.c (read_hex):
1936 * doc.c (Fsnarf_documentation):
1937 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1938 (DRIVE_LETTER) [DOS_NT]:
1939 (Ffile_name_directory, Fexpand_file_name)
1940 (Fsubstitute_in_file_name):
1941 * font.c (font_parse_xlfd, font_parse_fcname):
1942 * frame.c (x_set_font_backend):
1943 * gtkutil.c (xg_get_font):
1944 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1945 * nsimage.m (hexchar):
1946 * nsterm.m (ns_xlfd_to_fontname):
1947 * sysdep.c (system_process_attributes):
1948 * xfaces.c (hash_string_case_insensitive):
1949 Use C-locale tests instead of locale-specific tests for character
1950 types, since we want the ASCII interpretation here, not the
1951 interpretation suitable for whatever happens to be the current locale.
1952
52162052
MR
19532012-08-16 Martin Rudalics <rudalics@gmx.at>
1954
1955 Consistently check windows for validity/liveness
1956 (Bug#11984, Bug#12025, Bug#12026).
1957 * lisp.h (CHECK_VALID_WINDOW): New macro.
1958 * window.c (decode_window): Rename to decode_live_window.
1959 (decode_valid_window, Fwindow_valid_p): New functions.
1960 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1961 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1962 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1963 (Fwindow_prev_sibling, Fwindow_combination_limit)
1964 (Fset_window_combination_limit, Fwindow_use_time)
1965 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1966 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1967 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1968 (Fwindow_hscroll, Fset_window_hscroll)
1969 (Fwindow_redisplay_end_trigger)
1970 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1971 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1972 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1973 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1974 (Fwindow_end, Fset_window_point, Fset_window_start)
1975 (Fpos_visible_in_window_p, Fwindow_line_height)
1976 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1977 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1978 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1979 (Fset_window_parameter, Fwindow_display_table)
1980 (Fset_window_display_table, Fdelete_other_windows_internal)
1981 (Fset_window_buffer, Fset_window_new_total)
1982 (Fset_window_new_normal, Fdelete_window_internal)
1983 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1984 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1985 (Fwindow_scroll_bars): Check whether argument window is a valid or
1986 live window. Update doc-strings.
1987 (syms_of_window): New symbol Qwindow_valid_p.
1988 * keyboard.c (Fposn_at_x_y): Check whether argument
1989 frame_or_window denotes a valid window.
1990
2751c80f
DA
19912012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1992
1993 Fix previous char table change.
1994 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1995 * chartab.c (optimize_sub_char_table): Likewise.
1996
032a42c8
CY
19972012-08-16 Chong Yidong <cyd@gnu.org>
1998
a2d19368
CY
1999 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2000
032a42c8
CY
2001 * xfont.c (xfont_open):
2002 * xftfont.c (xftfont_open): Set the font's max_width field.
2003
2004 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2005 min_width to space_width and average_width to the average over
2006 printable ASCII characters.
2007 (ns_char_width): Code cleanup.
2008 (ns_ascii_average_width): New utility function.
2009
2010 * font.h (struct font): Update comments.
2011
a098c930
DA
20122012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2013
032a42c8 2014 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2015 * lisp.h (CSET): New macro.
2016 (char_table_set_extras, char_table_set_contents)
2017 (sub_char_table_set_contents): New function.
2018 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2019 * syntax.c: Adjust users.
2020
8be3a09c
SM
20212012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2022
2023 * eval.c (eval_sub): Bind lexical-binding.
2024 * lread.c (Qlexical_binding): Make non-static.
2025
ac4845a6
JD
20262012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2027
ddee6515
JD
2028 * nsmenu.m (popupSession): Remove.
2029 (pop_down_menu): Remove endModalSession.
2030 (timeout_handler:): New method.
2031 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2032 Call runModalForWindow. Check timer_fired when it returns.
2033 If not set, cancel timer and break out of loop.
2034 Otherwise loop again, with a new timeout.
2035
2036 * nsterm.m: Include fcntl.h if present.
2037 (fd_entry, t_readfds, inNsSelect): Remove.
2038 (select_writefds, select_valid, select_timeout, selfds)
2039 (select_mutex, apploopnr): Add.
2040 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2041 Otherwise call kbd_buffer_store_event.
2042 (ns_send_appdefined): Remove release of fd_entry.
2043 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2044 Increment and decrement apploopnr.
2045 (ns_select): If no file descriptors, just do a NSTimer.
2046 Otherwise copy read/write masks and start select thread (fd_handler).
2047 Start main loop and wait for application defined event.
2048 Inform select thread to stop selecting after main loop is exited.
2049 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2050 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2051 (fd_handler:): Loop forever, wait for info from the main thread
2052 to either start or stop selecting. When select returns, send
2053 and appdefined event.
2054 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2055 If not call kbd_buffer_store_event.
2056
2057 * nsterm.h (EmacsApp): fd_handler takes id argument.
2058 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2059
ac4845a6
JD
2060 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2061
eb424fe3
EZ
20622012-08-15 Eli Zaretskii <eliz@gnu.org>
2063
2064 * region-cache.c (move_cache_gap): Update gap_len using the actual
2065 growth of the boundaries array. Do not change cache_len.
2066 (Bug#12196)
2067
4e6a86c6
DA
20682012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2069
2070 Generalize and cleanup font subsystem checks.
2071 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2072 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2073 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2074
5bf192ca
DA
20752012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2076
2077 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2078
f2045622
CY
20792012-08-15 Chong Yidong <cyd@gnu.org>
2080
8be3a09c
SM
2081 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2082 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2083 extract the font descriptor instead of just the font name.
2084 In that case, return a font spec instead of a string.
f2045622
CY
2085 (x_last_font_name): Move to this file from xfns.c.
2086
2087 * xfns.c (Fx_select_font): The return value can also be a font
2088 spec. Move x_last_font_name management to gtkutil.c.
2089
2090 * xfaces.c: Make font weight and style symbols non-static.
2091
7f6feb56
SM
20922012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2093
2094 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2095 (bug#12117).
2096
fecbd8ff
SM
20972012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2098
2099 * alloc.c (Fgarbage_collect): Use plural form consistently.
2100
9b8d5165
EZ
21012012-08-14 Eli Zaretskii <eliz@gnu.org>
2102
2103 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2104 iteration through the command loop. Fixes a problem whereby mouse
2105 movements are ignored until the first mouse click.
2106
f5d9e83a
PE
21072012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2108
2109 Use bool, not int, for Lisp booleans.
2110 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2111 makes Emacs a bit smaller and presumably a bit faster.
2112 * lisp.h: Include <stdbool.h>.
2113 (struct Lisp_Boolfwd, defvar_bool):
2114 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2115 * regex.c [!emacs]: Include <stdbool.h>.
2116 (false, true): Remove; <stdbool.h> does this for us now.
2117
55802e4a
CY
21182012-08-14 Chong Yidong <cyd@gnu.org>
2119
4abcdac8
CY
2120 * character.c (Fcharacterp): Doc fix (Bug#12076).
2121
2122 * data.c (Findirect_variable): Doc fix (Bug#11040).
2123
55802e4a
CY
2124 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2125
2126 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2127 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2128
8e99d072
BR
21292012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2130
2131 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2132 (bug#12022).
2133
08908aca
MR
21342012-08-14 Martin Rudalics <rudalics@gmx.at>
2135
2136 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2137 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2138 * minibuf.c (choose_minibuf_frame, read_minibuf):
2139 * w32fns.c (x_create_tip_frame):
2140 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2141 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2142
56120d6f
PE
21432012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2144
2145 * intervals.c (offset_intervals): Remove obsolete comment.
2146
67b77c0b
AS
21472012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2148
2149 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2150
f48b82fd
GR
21512012-08-14 Gergely Risko <gergely@risko.hu>
2152
2153 * coding.c (decode_coding): Record buffer modification before
2154 disabling undo_list (Bug#11773).
2155
fd318b54
DA
21562012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2157
2158 Revert and cleanup some recent overlay changes.
2159 * buffer.h (enum overlay_type): Remove.
2160 (buffer_get_overlays, buffer_set_overlays): Likewise.
2161 (buffer_set_overlays_before, buffer_set_overlays_after):
2162 New function. Adjust users.
2163 (unchain_both): Add eassert.
2164
41a62dd9
DA
21652012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2166
2167 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2168
5884c324
PE
21692012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2170
2171 * gtkutil.c (xg_mark_data): Don't assume C99.
2172
ca06f160
JD
21732012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2174
2175 * gtkutil.c (xg_frame_tb_info): New struct.
2176 (TB_INFO_KEY): New define.
2177 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2178 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2179 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2180 if not present.
2181 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 2182 is up to date. Otherwise store new data.
ca06f160
JD
2183 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2184
7864a3f7
DA
21852012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2186
2187 Use KSET for write access to Lisp_Object members of struct kboard.
2188 * keyboard.h (KSET): New macro.
2189 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2190 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2191 * xterm.c: Adjust users.
2192
4c31be61
DA
21932012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2194
2195 Use BSET for write access to Lisp_Object members of struct buffer.
2196 * buffer.h (BSET): New macro.
2197 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2198 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2199 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2200 * window.c, xdisp.c, xfns.c: Adjust users.
2201
14ae4239
BT
22022012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2203
2204 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2205
32bcadb4
JD
22062012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2207
3d29b2ce 2208 * nsterm.m (not_in_argv): New function.
fc0c31f8 2209 (application:openFile, application:openTempFile:):
3d29b2ce
JD
2210 (application:openFileWithoutUI:, application:openFiles:): Open file
2211 if not_in_argv returns non-zero (bug#12171).
2212
32bcadb4 2213 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
2214 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2215 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
2216 (xg_get_font_name): Use those functions/macros here.
2217 Reported by Frans Oilinki <moilinki@gmail.com>.
2218
9ff9402d 22192012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
2220
2221 * unexmacosx.c (copy_data_segment): Copy initialized data in
2222 statically linked libraries from input file rather than memory.
2223
db74a5fc
YM
2224 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2225 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2226 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2227
25e65510
GM
22282012-08-10 Glenn Morris <rgm@gnu.org>
2229
2230 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2231 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2232
7961135c
DA
22332012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2234
2235 Fix last change to allow compilation with low optimization levels.
2236 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2237 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2238
42b3a444
DA
22392012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2240
2241 Use common inline syntax in intervals.h.
2242 * intervals.h (INTERVALS_INLINE): New macro.
2243 Change all users from LISP_INLINE.
2244
9fb0c957
DA
22452012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2246
2247 Define Qnone once for all platforms.
2248 * frame.c (Qnone): Define here.
2249 (syms_of_frame): DEFSYM it.
2250 * lisp.h (Qnone): New declaration.
2251 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2252 * xfns.c: Remove duplication. Adjust users.
2253
65e8ee52
DA
22542012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2255
2256 Remove unused macros from intervals.h.
2257 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2258 * intervals.c: Adjust comment.
2259
9b855fd6
EZ
22602012-08-10 Eli Zaretskii <eliz@gnu.org>
2261
2262 * w32fns.c <w32_unicode_gui>: New static variable.
2263 (globals_of_w32fns): Initialize it according to os_subtype.
2264 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2265 testing os_subtype.
2266
39cb9e56 22672012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
2268 Eli Zaretskii <eliz@gnu.org>
2269
2270 Fix bug #10299 with Unicode characters sent by customized
2271 keyboards created by MSKLC.
2272 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2273 (w32_init_class): Use it to initialize the Emacs class with either
2274 ANSI or Unicode API calls.
2275 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2276 later.
2277 (w32_wnd_proc): If the character code sent by WM_CHAR or
2278 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2279 original message. Call DefWindowProcW on NT and later.
2280
9374581a
GM
22812012-08-10 Glenn Morris <rgm@gnu.org>
2282
4b94e8cf
GM
2283 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2284
9374581a
GM
2285 * lisp.h (DIRECTORY_SEP): Let configure set it.
2286
a2752828
DA
22872012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2288
2289 Use TSET for write access to Lisp_Object slots of struct terminal.
2290 * termhooks.h (TSET): New macro.
2291 * coding.c, terminal.c, xselect.c: Adjust users.
2292
cc92c454
SM
22932012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2294
2295 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2296 the failing expression, include them in the error message.
2297 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2298 * lisp.h (internal_condition_case_n): Update declaration.
2299
4cb3e6b3
DA
23002012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2301
2302 Inline functions to examine and change buffer overlays.
2303 * buffer.c (unchain_both): New function.
2304 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2305 (buffer_has_overlays): New function.
2306 (enum overlay_type): New enum.
2307 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2308 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2309
8707c1e5
DA
23102012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2311
2312 Inline functions to examine and change buffer intervals.
2313 * alloc.c (mark_interval_tree): Remove.
2314 (MARK_INTERVAL_TREE): Simplify.
2315 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2316 * intervals.c (buffer_balance_intervals): New function.
2317 (graft_intervals_into_buffer): Adjust indentation.
2318 (set_intervals_multibyte): Simplify.
2319 * buffer.h (BUF_INTERVALS): Remove.
2320 (buffer_get_intervals, buffer_set_intervals): New function.
2321 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2322 * intervals.c, textprop.c: Adjust users.
2323
ad8c997f
DA
23242012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2325
2326 Inline functions to examine and change string intervals.
2327 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2328 (string_get_intervals, string_set_intervals): New function.
2329 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2330 * lread.c, print.c, textprop.c: Adjust users.
2331
32ac3a6b
GM
23322012-08-08 Glenn Morris <rgm@gnu.org>
2333
2334 * lisp.mk (lisp): Remove language/persian.elc.
2335
77c7bcb1
DA
23362012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2337
2338 Cleanup intervals.
2339 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2340 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
2341 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2342 Adjust comment. Move under #if 0.
77c7bcb1
DA
2343 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2344 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2345
9c08a8d4
DA
23462012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2347
2348 Check total length of intervals with eassert.
2349 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2350 * intervals.c: Change all users to eassert.
2351
26d16b35
EZ
23522012-08-07 Eli Zaretskii <eliz@gnu.org>
2353
14ae4239
BT
2354 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2355 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
2356 INTERNAL_FIELD in Lisp_Cons.
2357
c644523b
DA
23582012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2359
2360 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2361 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2362 name since all xname users are fixed long time ago. Do not
2363 use INTERNAL_FIELD.
2364 (set_symbol_name, set_symbol_function, set_symbol_plist):
2365 (set_symbol_next, set_overlay_plist): New function.
2366 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2367 (struct Lisp_Overlay): Likewise.
2368 (CVAR, MVAR, SVAR): Remove.
2369 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2370 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2371 * xterm.c: Adjust users.
2372 * .gdbinit: Change to use name field of struct Lisp_Symbol
2373 where appropriate.
2374
6a3d20cc
DA
23752012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2376
2377 Basic functions to set Lisp_Object and pointer slots of intervals.
2378 * intervals.h (interval_set_parent, interval_set_object):
2379 (interval_set_left, interval_set_right, interval_set_plist):
2380 (interval_copy_parent): New function.
2381 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
2382 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2383 Adjust indentation.
6a3d20cc
DA
2384 (INTERVAL_SIZE): Remove. Adjust users.
2385 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2386
4d2b044c
DA
23872012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2388
2389 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2390 * process.h (PGET): Remove.
2391 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2392 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2393
d3d50620
DA
23942012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2395
2396 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2397 * window.h (WGET): Remove.
2398 (struct window): Do not use INTERNAL_FIELD.
2399 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2400 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2401 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2402 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2403 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2404 Adjust users.
2405
d10a51dc
CY
24062012-08-07 Chong Yidong <cyd@gnu.org>
2407
2408 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2409 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2410 (Fdelete_window_internal): Signal an error if the window is not on
2411 a live frame (Bug#12025).
2412
e69b0960
DA
24132012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2414
2415 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2416 * frame.h (FGET): Remove.
2417 (struct frame): Do not use INTERNAL_FIELD.
2418 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2419 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2420 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2421 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2422
25a20a3a
JB
24232012-08-06 Juanma Barranquero <lekktu@gmail.com>
2424
2425 * w32.c: Silence compiler warnings.
2426 (map_w32_filename): Remove unused variable `is_fat'.
2427 (chase_symlinks): Add parentheses around expression.
2428
1c6f11f4
GM
24292012-08-06 Glenn Morris <rgm@gnu.org>
2430
1db4583a
GM
2431 * sysdep.c: Respect BROKEN_GETWD.
2432
1c6f11f4
GM
2433 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2434 Let configure handle it.
2435 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2436
2b90362b
DA
24372012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2438
2439 Use GCALIGNMENT where appropriate.
2440 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2441 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2442 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2443
5f50daf2
EZ
24442012-08-06 Eli Zaretskii <eliz@gnu.org>
2445
14ae4239
BT
2446 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2447 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 2448
cbcc7007
SM
24492012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2450
2451 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2452 that should be sufficient for everyone.
2453
4d365fa4
JD
24542012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2455
2456 * keyboard.c (timer_check_2): Add break so timer_check returns next
2457 timeout.
2458
dd86bd82
DA
24592012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2460
2461 Fix Windows build errors introduced after converting to WGET and WSET.
2462 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2463 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2464
054e1668
JD
24652012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2466
2467 * nsterm.m (ns_frame_rehighlight): Use FSET.
2468
2469 * nsmenu.m (ns_update_menubar): Use FSET.
2470
21238f11
DA
24712012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2472
2473 Separate read and write access to Lisp_Object slots of Lisp_Process.
2474 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2475 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2476
077288cf
DA
24772012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2478
2479 Separate read and write access to Lisp_Object slots of struct window.
2480 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2481 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2482 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2483 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2484 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2485 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2486 Adjust users.
2487
71688bd7
DA
24882012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2489
2490 Fix Windows build errors introduced after converting to FGET and FSET.
2491 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2492 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2493 (w32_judge_scroll_bars): Change to use FSET.
2494 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2495
f99bac93
DA
24962012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2497
2498 Fix replacement typo.
2499 * window.c (replace_window): Set root_window instead of
2500 selected_window. This fixes a total window subsystem
2501 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2502
8c2a0f2d
GM
25032012-08-06 Glenn Morris <rgm@gnu.org>
2504
2505 * lisp.mk (lisp): Add language/persian.elc.
2506
edd74c35
DA
25072012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2508
2509 Separate read and write access to Lisp_Object slots of struct frame.
2510 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2511 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2512 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2513 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2514 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2515
8671676c
AS
25162012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2517
2518 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2519
663e2b3f
DA
25202012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2521
2522 Generalize common compile-time constants.
2523 * lisp.h (header_size, bool_header_size, word_size): Now here.
2524 (struct Lisp_Vector): Add comment.
2525 (struct Lisp_Bool_Vector): Move up to define handy constants.
2526 (VECSIZE, PSEUDOVECSIZE): Simplify.
2527 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2528 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2529 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2530 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2531 * xfont.c, xmenu.c: Use word_size where appropriate.
2532
d32e47af
LM
25332012-08-05 Lawrence Mitchell <wence@gmx.li>
2534
2535 * search.c (Freplace_match): Treat \? in the replacement text
2536 literally (Bug#8161).
2537
e5d9c0d1
CY
25382012-08-05 Chong Yidong <cyd@gnu.org>
2539
2540 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2541 * frame.c (Vdelete_frame_functions):
2542 * emacs.c (Vkill_emacs_hook): Doc fix.
2543
8da0576b
EZ
25442012-08-04 Eli Zaretskii <eliz@gnu.org>
2545
2546 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2547 --with-x-toolkit=no builds.
2548 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2549
02676e5d
CY
25502012-08-04 Chong Yidong <cyd@gnu.org>
2551
2552 * syntax.c (Fmodify_syntax_entry): Doc fix.
2553
97147da9
EZ
25542012-08-04 Eli Zaretskii <eliz@gnu.org>
2555
76151e2c
EZ
2556 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2557 * w32.c (init_environment): Change the default values of many
2558 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
2559 them into environment when they were not already defined.
2560 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 2561 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
2562 (check_windows_init_file): Now external, not static.
2563 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
2564 called when Vload_path is already set up.
2565
2566 * w32.h (check_windows_init_file): Add prototype.
2567
2568 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2569 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2570 compatibility with Posix platforms.
2571 (main): Move the call to check_windows_init_file to here from
2572 w32.c.
2573 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2574 any, in the DEFALT argument into the root of the Emacs build or
2575 installation tree, as appropriate.
2576
2577 * callproc.c (init_callproc_1): Call decode_env_path instead of
2578 doing its equivalent by hand.
2579 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2580 the code that sets Vexec_path run on MS-Windows.
2581
2582 * lread.c (init_lread): Add comments to #ifdef's.
2583
97147da9
EZ
2584 * msdos.c (dos_set_window_size, IT_update_begin)
2585 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2586 instead of direct references.
2587
185ee146
PE
25882012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2589
2590 Export DEFAULT_REHASH_* to GDB.
2591 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2592 Now constants, not macros.
2593
8834c57a
PE
25942012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2595
98c6f1e3
PE
2596 Remove unnecessary casts involving pointers.
2597 These casts are no longer needed now that we assume C89 or later,
2598 since they involve casting to or from void *.
2599 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2600 (make_pure_float, make_pure_vector):
2601 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2602 * macros.c (Fstart_kbd_macro):
2603 * menu.c (find_and_return_menu_selection):
2604 * minibuf.c (read_minibuf_noninteractive):
2605 * sysdep.c (closedir):
2606 * xdisp.c (x_produce_glyphs):
2607 * xfaces.c (compare_fonts_by_sort_order):
2608 * xfns.c (x_real_positions, select_visual):
2609 * xselect.c (x_stop_queuing_selection_requests)
2610 (x_get_window_property, x_get_window_property_as_lisp_data):
2611 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2612 Remove unnecessary pointer casts.
2613 * alloc.c (record_xmalloc): New function.
2614 * lisp.h (record_xmalloc): New decl.
2615 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2616 more like a function. This is because the pointer cast is not
2617 needed. All uses changed.
2618 * print.c (print_string, print_error_message): Avoid length recalc.
2619
8834c57a
PE
2620 Improve fix for macroexp crash with debugging (Bug#12118).
2621 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2622 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2623 not supposed to be invoked from the garbage collector.
2624 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2625 (gc_aset): New function, which is like ASET but can be
2626 used in the garbage collector.
2627 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2628 (set_hash_index): Use it instead of ASET.
2629
6dad7178
EZ
26302012-08-03 Eli Zaretskii <eliz@gnu.org>
2631
2632 Support symlinks on latest versions of MS-Windows.
2633 * w32.c: Include winioctl.h and aclapi.h.
2634 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2635 (revert_to_self): Forward declarations of static functions.
2636 <static BOOL g_b_init_get_security_info>:
2637 <g_b_init_create_symbolic_link>: New static flags.
2638 (globals_of_w32): Initialize them to zero.
2639 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2640 (map_w32_filename): Improve commentary. Simplify switch.
2641 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2642 headers (most versions of MinGW w32api don't).
2643 (get_security_info, create_symbolic_link)
2644 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2645 New functions.
2646 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2647 in the argument file name.
2648 (sys_access): Call unc_volume_file_attributes only if
2649 GetFileAttributes fails with network-related error codes.
2650 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2651 have the required privileges.
14ae4239 2652 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
2653 get_file_security_desc.
2654 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
2655 with addition of handling of symlinks and support for 'lstat'.
2656 If possible, get file's attributes and security information by
6dad7178
EZ
2657 handle, not by name. Produce S_IFLNK bit for symlinks, when
2658 called from 'lstat'.
2659 (stat, lstat): New functions, call 'stat_worker'.
2660 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2661 symlinks when the underlying filesystem supports them.
2662
f162bcc3
PE
26632012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2664
79ea6c20
PE
2665 Fix macroexp crash on Windows with debugging (Bug#12118).
2666 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2667 checking subscripts; problem introduced with the recent
2668 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2669 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2670 since it's used in non-static inline functions now.
2671
c0ce93fd
PE
2672 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2673 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 2674
f162bcc3
PE
2675 Use C99-style 'extern inline' if available.
2676 * buffer.h (BUFFER_INLINE):
2677 * category.h (CATEGORY_INLINE):
2678 * character.h (CHARACTER_INLINE):
2679 * charset.h (CHARSET_INLINE):
2680 * composite.h (COMPOSITE_INLINE):
2681 * dispextern.h (DISPEXTERN_INLINE):
2682 * lisp.h (LISP_INLINE):
2683 * systime.h (SYSTIME_INLINE):
2684 New macro, replacing 'static inline' in this header.
2685 * buffer.h, category.h, character.h, charset.h, composite.h:
2686 * dispextern.h, lisp.h, systime.h:
2687 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2688 * alloc.c (LISP_INLINE):
2689 * buffer.c (BUFFER_INLINE):
2690 * category.c (CATEGORY_INLINE):
2691 * character.c (CHARACTER_INLINE):
2692 * charset.c (CHARSET_INLINE):
2693 * composite.c (COMPOSITE_INLINE):
2694 * dispnew.c (DISPEXTERN_INLINE):
2695 * sysdep.c (SYSTIME_INLINE):
2696 Define to EXTERN_INLINE, so that the corresponding functions
2697 are compiled into code.
2698 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2699 (INLINE_HEADER_END): New macros.
2700 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2701 since it's used in non-static inline functions now.
a8333d03 2702 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 2703
837b365b
GM
27042012-08-02 Glenn Morris <rgm@gnu.org>
2705
d66b744d
GM
2706 * s/: Remove empty directory.
2707
837b365b
GM
2708 * s/ms-w32.h: Move to ../nt/inc.
2709 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2710 Update for new ms-w32.h location.
2711
13294f95
PE
27122012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2713
2714 Port to Solaris 8.
2715 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2716
90df0db3
GM
27172012-08-02 Glenn Morris <rgm@gnu.org>
2718
2719 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2720 hard-coding the path separator.
2721
4939150c
PE
27222012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2723
2724 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2725 This how ASET and AREF are supposed to work, and makes
2726 it easier to think about future improvements. See
2727 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2728 * charset.h (set_charset_attr): New function.
2729 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2730 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2731 (aref_addr): New function. All uses of &AREF(...) changed.
2732 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2733 (set_hash_index): New functions. All lvalue-style uses of
2734 HASH_KEY etc. changed.
2735 * keyboard.c (set_prop): New function. All lvalue-style uses
2736 of PROP changed.
2737
947b2afd
AA
27382012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2739
2740 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2741 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2742 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2743 * nsfns.m (ns_set_name_as_filename): Likewise.
2744 * nsmenu.m (ns_update_menubar): Likewise.
2745 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2746
4f5d0325
EZ
27472012-08-01 Eli Zaretskii <eliz@gnu.org>
2748
2008beae
EZ
2749 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2750 Adapt to latest changes in field names of the corresponding Lisp
288479f6 2751 objects.
2008beae 2752
4f5d0325
EZ
2753 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2754
fe3cc771
GM
27552012-08-01 Glenn Morris <rgm@gnu.org>
2756
2757 * s/msdos.h: Remove file.
2758 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2759 * Makefile.in (S_FILE): Remove.
2760 (config_h): Remove S_FILE.
2761
c90acc54
JB
27622012-08-01 Juanma Barranquero <lekktu@gmail.com>
2763
2764 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2765 Remove; moved to nt/config.nt.
2766
d8a05828
DA
27672012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2768
2769 Use INTERNAL_FIELD for conses and overlays.
2770 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2771 Remove obsolete comment.
2772 (MVAR): New macro.
2773 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2774 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2775
8271d590
DA
27762012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2777
2778 Use INTERNAL_FIELD for symbols.
2779 * lisp.h (SVAR): New macro. Adjust users.
2780 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2781 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2782
3193acd2
DA
27832012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2784
2785 Use INTERNAL_FIELD for processes.
2786 * process.h (PVAR): New macro. Adjust style.
2787 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2788 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2789
3a45383a
DA
27902012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2791
2792 Use INTERNAL_FIELD for windows.
2793 * window.h (WVAR): New macro.
2794 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2795 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2796 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2797 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2798 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2799 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2800
c1dbc63c
PE
28012012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2802
2803 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2804
5c0c0e8a
GM
28052012-08-01 Glenn Morris <rgm@gnu.org>
2806
2807 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2808 Move to configure.ac.
2809
552a99b4
JB
28102012-08-01 Juanma Barranquero <lekktu@gmail.com>
2811
2812 * makefile.w32-in (CONFIG_H): Update dependencies.
2813 (CONF_POST_H): New macro.
2814
2815 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2816
8d8e2dfe
GM
28172012-07-31 Glenn Morris <rgm@gnu.org>
2818
bc96620a
GM
2819 * Makefile.in (S_FILE): No longer set by configure.
2820
476b1b2d
GM
2821 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2822 is available.
2823 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2824
b2c7a106
GM
2825 * process.h (NULL_DEVICE):
2826 * emacs.c (SEPCHAR):
2827 * editfns.c (USER_FULL_NAME): Let configure set them.
2828
d53d062a
GM
2829 * s/README, s/template.h: Remove files.
2830
4515017f
GM
2831 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2832
8d8e2dfe
GM
2833 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2834 Move to configure.ac.
2835
5b20b3cc
EZ
28362012-07-31 Eli Zaretskii <eliz@gnu.org>
2837
1e0afd9a
EZ
2838 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2839 resulting renaming of 'struct frame' members.
2840
5b20b3cc
EZ
2841 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2842
2843 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2844 after introduction of FVAR.
2845
f1310128
JD
28462012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2847
79e721e0
JD
2848 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2849
2850 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2851 instead of compositeToPoint.
2852 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2853
8d7c7eed 2854 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 2855
e34f7f79
DA
28562012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2857
2858 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2859 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 2860 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
2861 (BVAR): Change to use INTERNAL_FIELD.
2862 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2863 (KVAR): Change to use INTERNAL_FIELD.
2864 * frame.h (FVAR): New macro.
2865 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
2866 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2867 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2868 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
2869 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2870
c09bfb2f
DA
28712012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2872
2873 Miscellaneous fixes for non-default X toolkits.
2874 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2875 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2876 Move under #ifdef USE_LUCID.
2877 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2878 definition and usage to avoid warnings.
2879
14c114ae
JD
28802012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2881
2882 * nsterm.m (openFiles): Fix previous checkin.
2883
3bd21e82
PE
28842012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2885
2886 * indent.c (compute_motion): Remove unused local.
2887
c1529ded
GM
28882012-07-31 Glenn Morris <rgm@gnu.org>
2889
400d5621
GM
2890 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2891
268e2432
GM
2892 * conf_post.h [USG5_4]:
2893 Move remaining contents of s/usg5-4-common.h here.
2894 * s/usg5-4-common.h: Remove file.
2895
7552f3ee
GM
2896 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2897 * s/irix6-5.h: Remove file.
2898
6a381852
GM
2899 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2900 * s/darwin.h: Remove file.
2901
c1529ded
GM
2902 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2903 * s/hpux10-20.h: Remove file, which is now empty.
2904
b429a4ee
GM
29052012-07-30 Glenn Morris <rgm@gnu.org>
2906
2907 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2908 * Makefile.in (config_h): Add conf_post.h.
2909 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2910
adff3182
JD
29112012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2912
2913 * nsterm.m (ns_do_open_file): New variable.
b9031d69 2914 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
2915 (openFile, openTempFile, openFileWithoutUI, openFiles):
2916 Open files only if ns_do_open_file.
adff3182 2917
c32af1e4
PE
29182012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2919
7393bcbb
PE
2920 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2921 This no-op macro hasn't been needed for many years.
2922 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2923
c32af1e4
PE
2924 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2925 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2926 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2927 gdb_make_enums_visible.
2928 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2929 (DIRECTORY_SEP): Now a constant, not a macro.
2930
302fc036
EZ
29312012-07-30 Eli Zaretskii <eliz@gnu.org>
2932
2933 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2934 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2935
2936 * w32term.c <w32_keyboard_codepage>: Renamed from
2937 keyboard_codepage and now external. All users changed.
2938
2939 * w32term.h: Add declaration of w32_keyboard_codepage.
2940
2941 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2942 the codepage to translate keys to Unicode. If this argument is
2943 -1, use the value returned by GetConsoleCP. All callers changed.
2944
88fb40b4
PE
29452012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2946
0aee6912
PE
2947 Update .PHONY listings in makefiles.
2948 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2949 bootstrap-clean, distclean, maintainer-clean, versioclean,
2950 extraclean, frc.
2951
88fb40b4
PE
2952 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2953 This is a bit clearer. Fix some commentary typos.
2954
0a763bd1
GM
29552012-07-30 Glenn Morris <rgm@gnu.org>
2956
32bac6d6
GM
2957 * s/netbsd.h: Let configure include signal.h if needed.
2958 Remove file, which is now empty.
2959
b65e7c46
GM
2960 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2961 Let configure set them.
2962 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2963 No more need to undefine.
0a763bd1 2964
169304bd
AS
29652012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2966
2967 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2968 non-single-byte char when adding meta modifier. (Bug#12090)
2969
6cd7a139
DA
29702012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2971
2972 Convert safe_call to use variable number of arguments.
2973 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2974 (safe_call2): Fix comment.
2975 * lisp.h (safe_call): Adjust prototype.
2976 * coding.c (encode_coding_object): Change to use safe_call2.
2977 * xfaces.c (merge_face_heights): Change to use safe_call1.
2978
d34d6ffc
GM
29792012-07-30 Glenn Morris <rgm@gnu.org>
2980
7b8a48e4 2981 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 2982 does that unconditionally. Remove file, which is now empty.
7b8a48e4 2983
d34d6ffc
GM
2984 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2985 Remove empty files.
2986
03a660a6
PE
29872012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2988
2989 Export to GDB most of lisp.h's remaining object-like macros.
2990 * lisp.h (min, max): Move earlier, because they're used earlier now.
2991 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2992 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2993 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2994 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2995 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2996 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2997 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2998 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2999 Now constants, for GDB. They need not be macros.
3000 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3001 Now constants, for GDB, as well as macros, for static initializers.
3002 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3003 Move to after the definition of struct Lisp_Char_Table,
3004 since the former now needs that type defined.
3005 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3006 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3007 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3008 New enums, for gdb_make_enums_visible.
3009 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3010 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3011 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3012 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3013 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3014 enum maxargs, enum MAX_ALLOCA.
3015 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3016 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3017 no longer needed, now that they are done in lisp.h.
3018
e499d0ee
DA
30192012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3020
3021 Cleanup string bytes checking.
3022 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3023 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3024 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3025 (check_sblock, compact_small_strings): Simplify.
3026
d5040d2d
PE
30272012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3028
3029 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3030 These macros are confusing and no longer need to be defined, as
3031 the enum values now suffice. All uses replaced with definiens.
3032 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3033
7f259ae6
JB
30342012-07-29 Juanma Barranquero <lekktu@gmail.com>
3035
3036 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3037 ($(BLD)/w32console.$(O)): Update dependencies.
3038
7e63e0c3
DA
30392012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3040
3041 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3042 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3043 time. Adjust users.
3044 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3045
ffd817eb
JD
30462012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3047
3048 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3049 setting sitelisp (Bug#12010).
3050
417a7a0e
EZ
30512012-07-29 Eli Zaretskii <eliz@gnu.org>
3052
14ae4239 3053 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3054
3055 * w32heap.c (cache_system_info):
3056 * w32.c (sys_rename):
3057 * w32proc.c (find_child_console, sys_kill): All users changed.
3058
387d4d92
PE
30592012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3060
3061 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3062
55a6cca6
EZ
30632012-07-29 Eli Zaretskii <eliz@gnu.org>
3064
3065 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3066
dbcf001c
DA
30672012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3068
3069 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3070 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3071 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3072
e2688e4a
DA
30732012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3074
3075 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3076 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3077 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3078 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3079 (replace_range, replace_range_2, del_range_2): Change to eassert.
3080 * marker.c (byte_char_debug_check): Adjust style.
3081
b46a6a83
PE
30822012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3083
3084 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3085 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3086 long-ago-commented-out code that talks about "WIN32".
3087 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3088 All uses changed.
3089
e32a5799
PE
30902012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3091
3092 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3093 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3094 Simplify by using alignof.
3095 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3096 * lisp.h: Include <stdalign.h>.
3097 (GCALIGNMENT): New macro and constant.
3098 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3099 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3100 (stdalign): New macro, if not already defined.
3101
df81cd29
EZ
31022012-07-28 Eli Zaretskii <eliz@gnu.org>
3103
01bd1b0d
EZ
3104 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3105 * w32inevt.c: Include w32inevt.h.
3106 (w32_read_console_input): New inline function, calls either
3107 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3108 w32_console_unicode_input.
3109 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3110 (w32_kbd_patch_key, key_event): Use the codepage returned by
3111 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3112 (key_event): use uChar.UnicodeChar only if
3113 w32_console_unicode_input is non-zero.
3114
3115 * w32console.c: Include w32heap.h.
3116 <w32_console_unicode_input>: New global variable.
3117 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3118 family of Windows, zero otherwise.
3119
3120 * w32inevt.h: Declare w32_console_unicode_input.
3121
df81cd29
EZ
3122 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3123 --without-x. (Bug#11742)
3124
c20fdd9e
PE
31252012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3126
3127 Adjust GDB to reflect pvec_type changes (Bug#12036).
3128 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3129 2012-07-04 changes to pseudovector representation.
3130 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3131
32770973 31322012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3133
3134 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3135 bus address.
3136 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3137
3438fe21
EZ
31382012-07-27 Eli Zaretskii <eliz@gnu.org>
3139
bcfbc9de
EZ
3140 * alloc.c (listn): Fix the order the arguments are consed onto the
3141 list.
3142
3438fe21
EZ
3143 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3144 enumeration constants, as PURE and HEAP are too general, and clash
3145 with other headers and sources, such as gmalloc.c and the
3146 MS-Windows system headers. All users changed.
3147
eeaea515
DA
31482012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3149
3150 Revert last save_excursion_save and save_excursion_restore changes.
3151 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3152 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3153
073c88c2
DA
31542012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3155
3156 Fix recently-introduced typos in Windows port.
3157 Reported by Martin Rudalics <rudalics@gmx.at>.
3158 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 3159 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 3160
4706125e
PE
31612012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3162
3163 Improve GDB symbol export (Bug#12036).
3164 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3165 arms of an 'if', not using conditional expressions; otherwise GDB
3166 complains about the types in the unevaluated arm when the argument
3167 is an integer literal.
3168 (xgetint): Simplify expression.
3169 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3170 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3171 Zaretskii in <http://bugs.gnu.org/12036#13>.
3172 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3173 needed now that we have gdb_make_enums_visible.
3174 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3175 (enum enum_USE_LSB_TAG):
3176 New enum types, packaging up enums that need to be exported to GDB.
3177
694b6c97
DA
31782012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3179
3180 Utility function to make a list from specified amount of objects.
3181 * lisp.h (enum constype): New datatype.
3182 (listn): New prototype.
3183 * alloc.c (listn): New function.
3184 (Fmemory_use_count, syms_of_alloc): Use it.
3185 * buffer.c (syms_of_buffer): Likewise.
3186 * callint.c (syms_of_callint): Likewise.
3187 * charset.c (define_charset_internal): Likewise.
3188 * coding.c (syms_of_coding): Likewise.
3189 * keymap.c (syms_of_keymap): Likewise.
3190 * search.c (syms_of_search): Likewise.
3191 * syntax.c (syms_of_syntax): Likewise.
3192 * w32.c (init_environment): Likewise.
3193 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3194 * xdisp.c (syms_of_xdisp): Likewise.
3195 * xfns.c (syms_of_xfns): Likewise.
3196
6195f384
DA
31972012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3198
3199 Fast save_excursion_save and save_excursion_restore.
3200 * lisp.h (struct Lisp_Excursion): New data type.
3201 (PVEC_EXCURSION): New pseudovector type.
3202 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3203 to deal with it. Adjust comments.
3204 (init_marker, attach_marker): New prototype.
3205 (unchain_marker): Adjust prototype.
3206 * marker.c (attach_marker): Change to global.
3207 (init_marker): New function.
3208 * alloc.c (Fmake_marker, build_marker): Use it.
3209 (build_marker): More easserts.
3210 (mark_object): Handle struct Lisp_Excursion.
3211 * editfns.c (save_excursion_save, save_excursion_restore):
3212 Reimplement to use struct Lisp_Excursion. Add comments.
3213
5eceb8fb
PE
32142012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3215
3216 Fix export of symbols to GDB (Bug#12036).
3217 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3218 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3219 emacs.c, as this is a more-suitable home. Had this been done earlier
3220 the fix for 12036 would have avoided some of the problems noted in
3221 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3222 would have been more obvious.
562157c8
PE
3223 * emacs.c: Do not include <verify.h>; no longer needed.
3224 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
3225 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3226 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3227 Remove; now done in lisp.h.
3228 * lisp.h (PUBLISH_TO_GDB): New macro.
3229 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3230 (DATA_SEG_BITS): Use it.
3231 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3232 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3233 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3234 not be usable in #if. This simplifies things.
3235
d6749401
JB
32362012-07-26 Juanma Barranquero <lekktu@gmail.com>
3237
3238 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3239
1781b9e9
PE
32402012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3241
d89518db 3242 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
3243 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3244 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3245 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3246 Adjust to changes in lisp.h and emacs.c, by using
3247 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3248 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3249 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3250 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3251 instead of gdb_valbits.
3252 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3253 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3254 instead of gdb_array_mark_flag.
3255 (xboolvector): Get size from $->size, not $->header.size.
3256 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3257 (xreload, hook-run, hookpost-run): Remove.
3258 * emacs.c: Include <verify.h>.
3259 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3260 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3261 Remove.
3262 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3263 (gdb_USE_LSB_TAG): New enum constants.
3264 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3265 Also define these as enum constants, so they're visible to GDB.
3266 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3267 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3268 as constants, so they're visible to GDB.
3269 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3270 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3271 Now enum constants, not macros, so they're visible to GDB.
3272 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3273 more convenient now. All uses changed.
3274 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3275 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3276
3628596a
DA
32772012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3278
3279 Explicitly free restriction data that are not needed anymore.
3280 * editfns.c (save_restriction_restore): Free restriction data.
3281
7abaf5cc
SM
32822012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3283
3284 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3285 add argument, tune behavior, and adjust all callers.
3286
71f88e00
PE
32872012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3288
3289 Use typedef for EMACS_INT, EMACS_UINT.
3290 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3291 than macros. This simplifies debugging in the usual case, since
3292 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3293 and it allows expressions involving EMACS_INT casts.
3294 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3295
57ec3034
JD
32962012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3297
3298 * nsterm.m (ns_read_socket): Return early if there is a modal
3299 window (Bug#12043).
3300
8137e7b3
MR
33012012-07-25 Martin Rudalics <rudalics@gmx.at>
3302
3303 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3304 that FOCUS-FRAME can be omitted.
3305
04e9897c
DA
33062012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3307
3308 Adjust buffer text indirection counters at the end of Fkill_buffer.
3309 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3310 buffer is definitely dead. This should really fix an issue reported
3311 by Christoph Scholtes again. (Bug#12007).
3312 (init_buffer_once): Initialize indirection counters of
3313 buffer_defaults and buffer_local_symbols (for sanity and safety).
3314
8a0484e1
EZ
33152012-07-24 Eli Zaretskii <eliz@gnu.org>
3316
3317 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3318 and continuation glyphs on tooltip frames, leave them at zero.
3319 Avoids continued lines in tooltips. (Bug#11832)
3320
fa691a83
DA
33212012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3322
3323 Simplify copy_overlay.
04e9897c 3324 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
3325 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3326
436bc8e0
EZ
33272012-07-23 Eli Zaretskii <eliz@gnu.org>
3328
3329 * print.c (print_object): Don't crash when a frame's name is nil
3330 or invalid. (Bug#12025)
3331
3332 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3333 it signals an error when a tooltip frame is being created.
3334
d7a7fda3
DA
33352012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3336
3337 Cleanup miscellaneous objects allocation and initialization.
3338 * alloc.c (allocate_misc): Change to static. Add argument to
3339 specify the subtype. Adjust comment and users.
3340 (build_overlay): New function.
3341 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3342 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3343 (allocate_misc): Remove prototype.
3344 (build_overlay): Add prototype.
3345
33462012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
3347
3348 Swap buffer text indirection counters in Fbuffer_swap_text.
3349 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3350 This avoids crash reported by Christoph Scholtes at
3351 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3352
9d7fa573
JD
33532012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3354
3355 * nsmenu.m (Popdown_data): New struct.
3356 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3357 free Popdown_data.
3358 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3359 (initWithContentRect): Make imgView and contentView non-static
3360 and autorelease them. Also autorelease img and matrix (Bug#12005).
3361 (dealloc): Remove (Bug#12005).
3362
0dd6d66d
DA
33632012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3364
3365 Adjust consing_since_gc when objects are explicitly freed.
3366 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3367 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3368 (free_cons, free_misc): Subtract object size from consing_since_gc.
3369
d36d71df
DA
33702012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3371
3372 Simplify and cleanup markers positioning code.
3373 * marker.c (attach_marker): More useful eassert.
3374 (live_buffer, set_marker_internal): New function.
3375 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3376 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3377
fb9ea40f
PE
33782012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3379
3380 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3381 as it's limited by the amount of memory, not by INT_MAX.
3382
2d5c5f7d
EZ
33832012-07-21 Eli Zaretskii <eliz@gnu.org>
3384
07fb592e
EZ
3385 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3386 in special-event-map. See the discussion at
3387 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3388 for the reasons.
3389
37a9eac8 3390 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
3391 info.dwItemData. Fixes crashes on 64-bit Windows.
3392 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 3393
c4328746
JD
33942012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3395
fc0c31f8 3396 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 3397 (conversationIdentifier): Return value is NSInteger.
784051c4 3398 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 3399
6e5d1c12
CY
34002012-07-21 Chong Yidong <cyd@gnu.org>
3401
3402 * window.c (decode_any_window): Signal an error if the window is
3403 on a dead frame (Bug#11984).
3404
9928463d
DA
34052012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3406
3407 Add indirection counting to speed up Fkill_buffer.
3408 * buffer.h (struct buffer): New member.
3409 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3410 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3411 base buffer indirection counter.
3412 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3413 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3414 through buffer list if indirection counter is 0.
3415
f8643a6b
DA
34162012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3417
3418 Extend the value returned by Fgarbage_collect with heap statistics.
3419 * alloc.c (Qheap): New symbol.
3420 (syms_of_alloc): DEFSYM it.
3421 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3422 (Fmemory_free): Remove.
3423 (syms_of_alloc): Don't defsubr it.
3424 * buffer.c (Fcompact_buffer): Remove.
3425 (syms_of_buffer): Don't defsubr it.
3426
dac616ff
DA
34272012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3428
3429 Make maybe_gc inline.
3430 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3431 * lisp.h (consing_since_gc, gc_relative_threshold)
3432 (memory_full_cons_threshold): Revert declaration.
3433 (maybe_gc): Remove prototype, define as inline.
3434 * alloc.c: Remove old commented-out code.
3435 (consing_since_gc, gc_relative_threshold)
3436 (memory_full_cons_threshold): Revert to global.
3437 (maybe_gc): Remove.
3438
d7ea76b4
DA
34392012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3440
3441 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3442 * lisp.h (build_unibyte_string): New function.
3443 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3444 * sysdep.c, w32fns.c, xfns.c: Use it.
3445 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3446 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3447 Adjust users accordingly.
3448 * font.h (font_open_by_name): Adjust prototype.
3449
765e61e3
DA
34502012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3451
3452 Cleanup calls to Fgarbage_collect.
3453 * lisp.h (maybe_gc): New prototype.
3454 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3455 Remove declarations.
3456 * alloc.c (maybe_gc): New function.
3457 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3458 Make them static.
3459 * bytecode.c (MAYBE_GC): Use maybe_gc.
3460 * eval.c (eval_sub, Ffuncall): Likewise.
3461 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3462 to avoid dependency from auto-save feature.
3463
52b852c7
PE
34642012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3465
3466 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3467 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3468 'for_each_per_buffer_object_at'.
3469 All uses changed. It's better to use upper-case for macros that
3470 cannot be implemented as functions, to give the reader a clue
3471 that they're special.
3472
5db81e33
SM
34732012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3474
3475 * alloc.c (Fgarbage_collect): Tweak docstring.
3476
5b835e1d
DA
34772012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3478
3479 Tweak the value returned from Fgarbage_collect again.
3480 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3481 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3482 Adjust documentation.
3483 (total_vector_bytes): Rename to total_vector_slots, adjust
3484 accounting.
3485 (total_free_vector_bytes): Rename to total_free_vector_slots,
3486 adjust accounting.
3487 (Qstring_bytes, Qvector_slots): New symbols.
3488 (syms_of_alloc): DEFSYM them.
3489
9cd47b72
DA
34902012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3491
3492 Buffer compaction primitive which may be used from Lisp.
3493 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3494 (syms_of_buffer): Register Fcompact_buffer.
3495 * alloc.c (Fgarbage_collect): Use compact_buffer.
3496 * buffer.h (compact_buffer): New prototype.
3497 (struct buffer_text): New member.
3498
d17337e5
DA
34992012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3500
3501 New macro to iterate over all buffers, miscellaneous cleanups.
3502 * lisp.h (all_buffers): Remove declaration.
3503 * buffer.h (all_buffers): Add declaration, with comment.
3504 (for_each_buffer): New macro.
3505 * alloc.c (Fgarbage_collect, mark_object): Use it.
3506 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3507 (init_buffer): Likewise.
3508 * data.c (Fset_default): Likewise.
3509 * coding.c (code_conversion_restore): Remove redundant check
3510 for dead buffer.
3511 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3512
60cfd278
AS
35132012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3514
3515 Fix bug that created negative-length intervals.
3516 * intervals.c (merge_interval_right, merge_interval_left):
3517 Do not zero out this interval if it is absorbed by its children,
3518 as this interval's total length doesn't change in that case. See
3519 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3520
d06714cb
PE
35212012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3522
83713154
PE
3523 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3524 when invoking (make-bool-vector N t) and N is a positive
3525 multiple of 8 -- the last 8 bits were mistakenly cleared.
3526
d06714cb
PE
3527 Remove some struct layout assumptions in bool vectors.
3528 * alloc.c (bool_header_size): New constant.
3529 (header_size, word_size): Move earlier, as they're now used earlier.
3530 Use 'word_size' in a few more places, where it's appropriate.
3531 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3532 padding before the data member of a bool vector.
3533 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3534 than doing the check by hand with an abort ().
3535
464d5a5e
SM
35362012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3537
5fbc0409
SM
3538 * eval.c (Fdefvar): Don't check constants since we only set the var if
3539 it's not yet defined anyway (bug#11904).
3540
464d5a5e
SM
3541 * lisp.h (last_undo_boundary): Declare new var.
3542 * keyboard.c (command_loop_1): Set it.
3543 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3544 were auto-added by the command loop (bug#11774).
3545
8dc2e44a
AS
35462012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3547
3548 * w32font.c (Qsymbol): Remove local definition.
3549 (syms_of_w32font): Don't DEFSYM it.
3550
169925ec
DA
35512012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3552
3553 Fix sweep_vectors to handle large bool vectors correctly.
3554 * alloc.c (sweep_vectors): Account total_vector_bytes for
3555 bool vectors larger than VBLOCK_BYTES_MAX.
3556
5fbfb018
CY
35572012-07-18 Chong Yidong <cyd@gnu.org>
3558
3559 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3560 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3561
3ab6e069
DA
35622012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3563
3564 Return more descriptive data from Fgarbage_collect.
3565 Suggested by Stefan Monnier in
3566 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3567 * alloc.c (bounded_number): New function.
3568 (total_buffers, total_vectors): New variable.
3569 (total_string_size): Rename to total_string_bytes, adjust users.
3570 (total_vector_size): Rename to total_vector_bytes, adjust users.
3571 (sweep_vectors): Account total_vectors and total_vector_bytes.
3572 (Fgarbage_collect): New return value. Adjust documentation.
3573 (gc_sweep): Account total_buffers.
3574 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3575 (VECTOR_SIZE): Remove.
3576 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3577 (Qinterval, Qmisc): New symbols.
3578 (syms_of_data): Initialize them.
3579 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3580 (Qcons, Qbuffer): New declarations.
3581
6d02fe5b
PE
35822012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3583
3584 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3585 Round up, not down. Improve doc.
3586
b7ffe040
DA
35872012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3588
3589 Restore old code in allocate_string_data to avoid Faset breakage.
3590 Reported by Julien Danjou <julien@danjou.info> in
3591 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3592 * alloc.c (allocate_string_data): Restore old code with minor
3593 adjustments, fix comment to explain this subtle issue.
3594
4dc7c8d5
SM
35952012-07-17 Eli Zaretskii <eliz@gnu.org>
3596
3597 Remove FILE_SYSTEM_CASE.
3598 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3599
3600 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3601 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3602 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3603 call-process-region passes it through expand-file-name.
3604
3605 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3606
36072012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3608
3609 Fix crash when creating indirect buffer (Bug#11917)
3610 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3611 Don't handle unbound variables specially if non-zero.
3612 (Fbuffer_local_variables): Pass zero.
3613 (clone_per_buffer_values): Pass non-zero.
3614
36152012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3616
3617 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3618 to make the loop interruptible.
3619
36202012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3621
3622 * gnutls.c (emacs_gnutls_handshake): Only retry if
3623 GNUTLS_E_INTERRUPTED.
3624
cce7fefc
DA
36252012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3626
3627 Cleanup and convert miscellaneous checks to eassert.
3628 * alloc.c (mark_interval): Fix comment, partially rephrase
3629 old comment from intervals.h (see below).
3630 * intervals.c (find_interval, adjust_intervals_for_insertion)
3631 (delete_interval, adjust_intervals_for_deletion)
3632 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3633 Convert to eassert.
3634 (adjust_intervals_for_insertion, make_new_interval):
3635 Remove obsolete and unused code.
3636 * intervals.h (struct interval): Remove obsolete comment.
3637 * textprotp.c (erase_properties): Remove unused code.
3638 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3639 (Fremove_list_of_text_properties): Convert to eassert.
3640
9ea10cc3
CY
36412012-07-17 Chong Yidong <cyd@gnu.org>
3642
3643 * editfns.c (Finsert_char): Doc fix.
3644
3900d5de
DA
36452012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3646
3647 Fix previous change to make Fmemory_free always accurate.
3648 * alloc.c (make_interval): Update total_free_intervals.
3649 (make_float): Likewise for total_free_floats.
3650 (free_cons, Fcons): Likewise for total_free_conses.
3651 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3652 Likewise for total_free_vector_bytes.
3653 (Fmake_symbol): Likewise for total_free_symbols.
3654 (bytes_free): Remove.
3655
7098646f
DA
36562012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3657
3658 Simple free memory accounting feature.
3659 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3660 (sweep_vectors): Accumulate size of free vectors.
3661 (Fgarbage_collect): Setup bytes_free.
3662 (Fmemory_free): New function.
3663 (syms_of_alloc): Register it.
3664
22657b40
DA
36652012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3666
3667 Cleanup overlays checking.
3668 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3669 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3670 eassert and OVERLAYP.
3671 (sort_overlays): Change to use OVERLAYP.
3672
ddfc8813
RK
36732012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3674
3675 * editfns.c (Finsert_char): Make it interactive, and make the
3676 second arg optional. Copy interactive spec and docstring from
3677 ucs-insert.
3678
7c26cf3c
PE
36792012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3680
3681 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3682 Unlike the other wrapped functions, fabs has an unspecified
3683 effect on errno.
3684
5d127af9
JD
36852012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3686
3687 * nsterm.m (keyDown): Interpret flags without left/right bits
3688 as the left key (Bug#11670).
3689
6a0dd1d7
DA
36902012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3691
3692 Remove empty and useless init functions.
3693 * lisp.h (init_character_once, init_fns, init_image)
3694 (init_filelock, init_sound): Remove prototype.
3695 * character.c (init_character_once): Remove.
3696 * filelock.c (init_filelock): Likewise.
3697 * fns.c (init_fns): Likewise.
3698 * image.c (init_image): Likewise.
3699 * sound.c (init_sound): Likewise.
3700 * emacs.c (main): Adjust accordingly.
3701
7a6136fd
DA
37022012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3703
3704 * gtkutil.h: Tiny cleanups.
3705 (use_old_gtk_file_dialog): Remove useless declaration.
3706 (xg_uses_old_file_dialog): Add suggested const attribute.
3707
ce811ad9
EZ
37082012-07-15 Eli Zaretskii <eliz@gnu.org>
3709
3710 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3711 (bidi_paragraph_init): Use it to limit search forward for a strong
3712 directional character in abnormally large paragraphs full of
3713 neutral or weak characters. (Bug#11943)
3714
c9adfeaa
SF
37152012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3716
3717 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3718 the toolbar (Bug#9451).
3719 (xg_make_tool_item): Give the widget event box a transparent
3720 background.
3721
fff62aa9
DA
37222012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3723
3724 Cleanup basic allocation variables and functions.
3725 * alloc.c (ignore_warnings, init_intervals, init_float)
3726 (init_cons, init_symbol, init_marker): Remove.
3727 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3728 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3729 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3730 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3731 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3732 (staticidx, init_alloc_once, init_strings, free_ablock):
3733 Remove redundant initialization.
3734 * fns.c (init_weak_hash_tables): Remove.
3735 * lisp.h (init_weak_hash_tables): Remove prototype.
3736
9730daca
DA
37372012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3738
3739 Use zero_vector where appropriate.
3740 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3741 accordingly.
3742 * lisp.h (zero_vector): New declaration.
3743 * font.c (null_vector): Remove.
3744 (syms_of_font): Remove initialization and staticpro.
3745 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3746 * keymap.c (Faccessible_keymaps): Likewise.
3747
2e2d2a13
LL
37482012-07-15 Leo Liu <sdl.web@gmail.com>
3749
3750 * fringe.c: Fix typo in comments.
3751
cd276f6e
LL
37522012-07-14 Leo Liu <sdl.web@gmail.com>
3753
3754 * fringe.c: Add a new bitmap exclamation-mark.
3755
5a1131d9
EZ
37562012-07-14 Eli Zaretskii <eliz@gnu.org>
3757
3758 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3759
3760 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3761 (HAVE_MENUS): Don't define, defined by editing config.in with
3762 msdos/sed2v2.inp.
3763 (GMALLOC_INHIBIT_VALLOC): Don't define.
3764 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3765
22e983b7
JB
37662012-07-14 Juanma Barranquero <lekktu@gmail.com>
3767
3768 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3769
5b3f250f
GM
37702012-07-14 Glenn Morris <rgm@gnu.org>
3771
3772 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3773 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3774 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3775
33d63ff4
GM
37762012-07-13 Glenn Morris <rgm@gnu.org>
3777
5b633342
GM
3778 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3779
33d63ff4
GM
3780 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3781 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3782
b55b9f85
JD
37832012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3784
0dc8cf50
JD
3785 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3786 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3787 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3788 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3789 where appropriate.
3790 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3791 as boolean expression.
3792 (x_set_window_size): Remove unused variable toolbar.
3793 (ns_get_color_default, ns_mod_to_lisp): Remove.
3794 (ns_mouse_position): Remove unused variables xchar and ychar.
3795 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3796 (ns_set_vertical_scroll_bar): Remove unused variable count.
3797 (ns_delete_terminal): Remove unused variable i.
3798 (ns_term_init): Remove unused variables r, g and b.
3799 (mouseDown): Remove unused variable window.
3800 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3801 (initFrameFromEmacs): Remove unused variable vbextra.
3802 (mouseEntered): Remove unused variables p and dpyinfo.
3803 (mouseExited): Remove unused variables p and r.
3804 (ns_define_frame_cursor, ns_clear_frame_area)
3805 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3806 (menuDown): Assign [sender tag] to variable and cast the variable.
3807
3808 * nsterm.h (menuDown): Add id as type to argument sender.
3809 (ns_display_info_for_name): Add Lisp_Object argument.
3810 (ns_term_init): Add Lisp_Object argument.
3811 (ns_map_event_to_object): Add void argument.
3812 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3813 prototype with arguments and only declare if __OBJC__.
3814 (nxatoms_of_nsselect): Add void argument.
3815 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3816 (ns_alloc_autorelease_pool): Add void argument.
3817 (ns_release_autorelease_pool): Add void* argument.
3818 (ns_get_defaults_value): Add const char* argument.
3819
3820 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3821 (initFromContents): Use SSDATA where appropriate.
3822 (ns_update_menubar): Add braces to ambigous if-else.
3823 (initWithTitle): Put () around assignment in if statement.
3824 (ns_menu_show): Remove unused variables window and keymap.
3825 (update_frame_tool_bar): Remove unused variable selected_p.
3826 (initWithContentRect): Remove unused variable this_cmd_name.
3827
3828 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3829 appropriate.
3830 (setXBMColor): Remove unused variable len.
3831 (setPixmapData): Put () around assignment in loop statement.
3832
3833 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3834 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3835 where appropriate.
3836 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3837 around assignment in loop statement.
3838 (nsfont_open): Remove unused variable i.
3839 (nsfont_open): Remove unused variable len.
3840 (nsfont_draw): Remove unused variable cs.
3841
3842 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3843 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3844 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3845 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3846 (Fns_font_name, Fns_perform_service)
3847 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3848 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3849 (ns_set_name): Remove unused variable view.
3850 (x_set_menu_bar_lines): Remove unused variable olines.
3851 (x_set_tool_bar_lines): Remove unused variable root_window.
3852 (Fns_list_colors): Put () around assignment in while statement.
3853 (Fns_perform_service): Remove unused variable len.
3854 (Fns_display_usable_bounds): Remove unused variable top.
3855 (syms_of_nsfns): Remove unused variable i.
3856
b55b9f85
JD
3857 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3858 memcpy (Bug#11907).
3859
ed9265fc 38602012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
3861
3862 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3863 and free it with DestroyExceptionInfo (Bug#11558).
3864
ef099b57
JB
38652012-07-13 Juanma Barranquero <lekktu@gmail.com>
3866
3867 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3868 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3869 Set here, not in nt/config.nt.
3870
ea814a5d
EZ
38712012-07-13 Eli Zaretskii <eliz@gnu.org>
3872
3873 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3874 cursor overflow into the last glyph on display line when the right
3875 fringe is off. (Bug#11832)
3876
1a952767
PE
38772012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3878
3879 * xdisp.c (produce_special_glyphs): Now static.
3880 * dispextern.h (produce_special_glyphs): Remove decl.
3881
983188fd
GM
38822012-07-13 Glenn Morris <rgm@gnu.org>
3883
8d7c7eed 3884 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
3885 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3886
983188fd
GM
3887 * s/usg5-4-common.h (USG, USG5):
3888 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3889 * s/sol2-6.h (SOLARIS2):
3890 * s/irix6-5.h (IRIX6_5):
3891 * s/hpux10-20.h (USG, USG5, HPUX):
3892 * s/gnu-linux.h (USG, GNU_LINUX):
3893 * s/freebsd.h (BSD_SYSTEM):
3894 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3895 * s/cygwin.h (CYGWIN):
3896 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3897 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3898
d1e68667 38992012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
3900
3901 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 3902
6de0e799
GM
39032012-07-13 Glenn Morris <rgm@gnu.org>
3904
739ae010
GM
3905 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3906
dbee5793
GM
3907 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3908
6de0e799
GM
3909 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3910 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3911
b82da769
GM
39122012-07-12 Glenn Morris <rgm@gnu.org>
3913
4fae5a7a 3914 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
3915
3916 * process.c (init_process_emacs): Rename from init_process.
3917 The old name is also the name of a Mach system call.
3918 * lisp.h, emacs.c: Update for this name change.
3919 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3920 longer needed.
3921
5a979817
EZ
39222012-07-12 Eli Zaretskii <eliz@gnu.org>
3923
3924 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3925 memmove call that removes glyphs covered by the left truncation
3926 glyph. Improve commentary.
3927 (display_line): Fix display of continuation glyphs on GUI frames
3928 when the right fringe is turned off and variable-size fonts are
3929 used in the window. Move the code that appends a stretch glyph to
3930 produce_special_glyphs, so that it could be used for truncation
3931 and continuation glyphs alike.
3932 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3933 glyph of a suitably computed width, to align the special glyphs at
3934 the window margin. Code moved from display_line. (Bug#11832)
3935
3e91a053
GM
39362012-07-12 Glenn Morris <rgm@gnu.org>
3937
ba9e4b84
GM
3938 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3939
3940 * s/gnu-linux.h, s/hpux10-20.h:
3941 Do not unconditionally define HAVE_XRMSETDATABASE.
3942
3e91a053
GM
3943 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3944
b300b1f4
PE
39452012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3946
3947 Fix typos that broke OS X build.
3948 Reported by Randal L. Schwartz in
3949 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3950 * nsterm.m (ns_timeout): Add missing local decl.
3951 (ns_get_color): snprintf -> sprintf, to fix typo.
3952
6e777848
GM
39532012-07-12 Glenn Morris <rgm@gnu.org>
3954
3f922c37
GM
3955 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3956 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3957 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3958 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3959
0ab7b23a
GM
3960 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3961 Move PTY_OPEN to configure.
3962
6e777848
GM
3963 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3964 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3965 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3966
4a7edc24
DA
39672012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3968
3969 Use empty_unibyte_string where applicable.
3970 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3971 * lread.c (read1): Likewise.
3972 * xsettings.c (syms_of_xsettings): Likewise.
3973
308aab79
GM
39742012-07-12 Glenn Morris <rgm@gnu.org>
3975
42bd1719
GM
3976 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3977 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
3978 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3979 * s/hpux10-20.h (RUN_TIME_REMAP):
3980 * s/bsd-common.h (TABDLY): Move to configure.
3981
3982 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3983
3984 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3985
ea0bbd17 3986 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 3987 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
3988
3989 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 3990
308aab79
GM
3991 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3992 * s/template.h: Move NARROWPROTO to configure.
3993
ee1cf5cf
GM
39942012-07-11 Glenn Morris <rgm@gnu.org>
3995
30fe9bf4
GM
3996 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3997 unused since 2011-01-17 change to systty.h.
3998
ee1cf5cf
GM
3999 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4000 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4001 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4002
63e47e07
PE
40032012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4004
4005 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4006
c43fb4c3
GM
40072012-07-11 Glenn Morris <rgm@gnu.org>
4008
4009 * s/darwin.h, s/gnu-linux.h, s/template.h:
4010 Move INTERRUPT_INPUT to configure.
4011
e8df9267
DA
40122012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4013
4014 Minor adjustments to interning code.
4015 * lisp.h (intern, intern_c_string): Redefine as static inline
4016 wrappers for intern_1 and intern_c_string_1, respectively.
4017 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4018 * lread.c (intern_1, intern_c_string_1, oblookup):
4019 Simplify Vobarray checking.
e8df9267
DA
4020 * font.c (font_intern_prop): Likewise. Adjust comment.
4021 * w32font.c (intern_font_name): Likewise.
4022
34348bd4
AS
40232012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4024
d96a1e0c
AS
4025 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4026
34348bd4
AS
4027 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4028 of Fcar/Fcdr if possible.
4029 * font.c (check_otf_features): Likewise.
4030 * fontset.c (Fnew_fontset): Likewise.
4031 * gnutls.c (Fgnutls_boot): Likewise.
4032 * minibuf.c (read_minibuf): Likewise.
4033 * msdos.c (IT_set_frame_parameters): Likewise.
4034 * xmenu.c (Fx_popup_dialog): Likewise.
4035 * w32menu.c (Fx_popup_dialog): Likewise.
4036
c8add24e
GM
40372012-07-11 Glenn Morris <rgm@gnu.org>
4038
4b575b3c
GM
4039 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4040 since nothing has defined it on these platforms.
4041
09f4e3b0
GM
4042 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4043 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4044
172bedef
GM
4045 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4046 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4047 Move CLASH_DETECTION to configure.
4048
249685df
GM
4049 * s/gnu.h: Remove file, which is now empty.
4050
c8add24e
GM
4051 * s/gnu.h, s/gnu-linux.h:
4052 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4053
b41253a3
JW
40542012-07-11 John Wiegley <johnw@newartisans.com>
4055
4056 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4057 function attribute, so we only use it if it exists in the
4058 compiler.
4059
d923b542
DA
40602012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4061
4062 Avoid call to strlen in fast_c_string_match_ignore_case.
4063 * search.c (fast_c_string_match_ignore_case): Change to use
4064 length argument. Adjust users accordingly.
4065 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4066
5ebbef1d
PE
40672012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4068
bb352260
PE
4069 Assume mkdir, rmdir.
4070 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4071 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4072
57054ddd
PE
4073 Assume rename.
4074 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4075
b747d3f7
PE
4076 Assume perror.
4077 * s/hpux10-20.h (HAVE_PERROR): Remove.
4078 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4079 Remove dummy definition, as this problem was obsolete long ago.
4080
5ebbef1d
PE
4081 Assume strerror.
4082 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4083
984e7f30
DA
40842012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4085
4086 Avoid calls to strlen in font processing functions.
4087 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4088 (font_open_by_name): Change to use length argument.
4089 Adjust users accordingly.
d923b542
DA
4090 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4091 Adjust prototypes.
4092 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4093 Change to return ptrdiff_t.
984e7f30
DA
4094 (xfont_list_pattern, xfont_match): Use length returned by
4095 xfont_decode_coding_xlfd.
4096 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4097
20e94fdd
GM
40982012-07-11 Glenn Morris <rgm@gnu.org>
4099
9d596af3
GM
4100 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4101 Move DONT_REOPEN_PTY to configure.
4102
20e94fdd
GM
4103 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4104 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4105
e99a530f
PE
41062012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4107
22ffb973
PE
4108 Remove "#define unix" that is no longer needed (Bug#11905).
4109 * s/aix4-2.h (unix): Remove; no longer needed.
4110
e9a9ae03
PE
4111 EMACS_TIME simplification (Bug#11875).
4112 This replaces macros (which typically do not work in GDB)
4113 with functions, typedefs and enums, making the code easier to debug.
4114 The functional style also makes code easier to read and maintain.
4115 * systime.h: Include <sys/time.h> on all hosts, not just if
4116 WINDOWSNT, since 'struct timeval' is needed in general.
4117 (EMACS_TIME): Now a typedef, not a macro.
4118 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4119 not macros.
4120 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4121 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4122 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4123 (EMACS_TIME_LE): Now functions, not macros.
4124 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4125 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4126 which are not functions. All uses rewritten to use:
4127 (make_emacs_time): New function.
4128 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4129 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4130 not functions. All uses rewritten to use the following, respectively:
4131 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4132 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4133 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4134 * fileio.c (Fcopy_file):
4135 * xterm.c (XTflash): Get the current time closer to when it's used.
4136 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4137
ffacb126
PE
4138 * bytecode.c (targets): Suppress -Woverride-init warnings.
4139
e99a530f
PE
4140 Simplify by avoiding confusing use of strncpy etc.
4141 * doc.c (Fsnarf_documentation):
4142 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4143 * frame.c (Fmake_terminal_frame):
4144 * gtkutil.c (get_utf8_string):
4145 * lread.c (openp):
4146 * nsmenu.m (ns_update_menubar):
4147 * regex.c (regerror):
4148 Prefer memcpy to strncpy and strncat when either will do.
4149 * fileio.c (Fsubstitute_in_file_name):
4150 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4151 (menu_separator_name_p):
4152 * nsmenu.m (ns_update_menubar):
4153 Prefer memcmp to strncmp when either will do.
4154 * nsterm.m: Include <ftoastr.h>.
4155 (ns_get_color):
4156 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4157 Prefer snprintf to strncpy.
4158 * nsterm.m (ns_term_init):
4159 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4160 * nsterm.m (ns_term_init):
4161 Avoid the need for strncpy, by using build_string or
4162 make_unibyte_string directly. Use dtoastr, not snprintf.
4163 * process.c (Fmake_network_process): Diagnose service names that
4164 are too long, rather than silently truncating them or creating
4165 non-null-terminated names.
4166 (Fnetwork_interface_info): Likewise, for interface names.
4167 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4168 Prefer sprintf to strncat.
4169 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4170 Prefer vsnprintf to vsprintf + strncpy.
4171
c59592b3
GM
41722012-07-10 Glenn Morris <rgm@gnu.org>
4173
4174 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4175 Clarify fallback case.
4176
7d7bbefd
DA
41772012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4178
4179 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4180 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4181 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 4182 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
4183 where argument type is known to be a Lisp_Cons.
4184
3a4c8000
TT
41852012-07-10 Tom Tromey <tromey@redhat.com>
4186
4187 * bytecode.c (BYTE_CODE_THREADED): New macro.
4188 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4189 (enum byte_code_op): New type.
4190 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4191 (exec_byte_code): Use them. Use token threading when applicable.
4192
2a0213a6
DA
41932012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4194
4195 Optimize pure C strings initialization.
4196 * lisp.h (make_pure_string): Fix prototype.
4197 (build_pure_c_string): New function, defined as static inline. This
4198 provides a better opportunity to optimize away calls to strlen when
4199 the function is called with compile-time constant argument.
4200 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4201 argument, adjust users accordingly. Use build_pure_c_string where
4202 appropriate.
4203 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4204 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4205 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4206
cb1caeaf
DA
42072012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4208
4209 Avoid calls to strlen in miscellaneous functions.
4210 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4211 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4212 * lread.c (openp): Likewise.
4213
c293e30c
DA
42142012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4215
4216 Avoid calls to strlen in path processing functions.
4217 * fileio.c (file_name_as_directory): Add comment. Change to add
4218 srclen argument and return the length of result. Adjust users
4219 accordingly.
4220 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
4221 swap 1st and 2nd arguments to obey the common convention.
4222 Adjust users accordingly.
c293e30c
DA
4223 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4224
9e059e3f
GM
42252012-07-10 Glenn Morris <rgm@gnu.org>
4226
d02eb359
GM
4227 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4228 Move PENDING_OUTPUT_COUNT definition to configure.
4229
882cf227
GM
4230 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4231 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4232 * s/gnu.h (DATA_START): Move definitions to configure.
4233
af6e839f
GM
4234 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4235 We include usg5-4-common.h, which defines them both.
4236
40289a12
GM
4237 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4238 O_RDONLY already includes it).
4239
9e059e3f
GM
4240 Stop ns builds setting the EMACSLOADPATH environment variable.
4241 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4242 Now it does not set EMACSLOADPATH, just returns the load-path string.
4243 * nsterm.h: Update accordingly.
4244 * lread.c [HAVE_NS]: Include nsterm.h.
4245 (init_lread) [HAVE_NS]: Use ns_load_path.
4246 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4247
7c4e8ec0
GM
42482012-07-09 Glenn Morris <rgm@gnu.org>
4249
d4f600ff
GM
4250 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4251 since the included bsd-common.h does so.
4252
cbb31951
GM
4253 Stop ns builds setting the EMACSPATH environment variable.
4254 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4255 (ns_init_paths): Do not set EMACSPATH.
4256 * nsterm.h (ns_exec_path): Add it.
4257 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4258 Use ns_exec_path.
4259
7c4e8ec0
GM
4260 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4261
26bccfae
PE
42622012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4263
a0bee46f
PE
4264 * process.c (wait_reading_process_output): 'waitchannels' was unset
4265 when read_kbd || !NILP (wait_for_cell); fix this.
4266
5994c183
PE
4267 Add GCC-style 'const' attribute to functions that can use it.
4268 * character.h (char_resolve_modifier_mask):
4269 * keyboard.h (make_ctrl_char):
4270 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4271 (init_character_once, next_almost_prime, init_fns, init_image)
4272 (flush_pending_output, init_sound):
4273 * mem-limits.h (start_of_data):
4274 * menu.h (finish_menu_items):
4275 Add ATTRIBUTE_CONST.
4276 * emacs.c (DEFINE_DUMMY_FUNCTION):
4277 Declare the dummy function with ATTRIBUTE_CONST.
4278 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4279 Add decls with ATTRIBUTE_CONST.
4280
26bccfae
PE
4281 Minor improvements to make_formatted_string.
4282 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4283 where int is good enough, as vsprintf returns an int.
4284 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4285
a8290ec3
DA
42862012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4287
4288 Use make_formatted_string to avoid double length calculation.
4289 * lisp.h (make_formatted_string): New prototype.
4290 * alloc.c (make_formatted_string): New function.
4291 * buffer.c (Fgenerate_new_buffer_name): Use it.
4292 * dbus.c (syms_of_dbusbind): Likewise.
4293 * editfns.c (Fcurrent_time_zone): Likewise.
4294 * filelock.c (get_boot_time): Likewise.
4295 * frame.c (make_terminal_frame, set_term_frame_name)
4296 (x_report_frame_params): Likewise.
4297 * image.c (gs_load): Likewise.
4298 * minibuf.c (get_minibuffer): Likewise.
4299 * msdos.c (dos_set_window_size): Likewise.
4300 * process.c (make_process): Likewise.
4301 * xdisp.c (ensure_echo_area_buffers): Likewise.
4302 * xsettings.c (apply_xft_settings): Likewise.
4303
d01ba2f1
GM
43042012-07-09 Glenn Morris <rgm@gnu.org>
4305
4306 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4307 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4308 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4309 * nsterm.h (ns_etc_directory): Add it.
4310 * callproc.c [HAVE_NS]: Include nsterm.h.
4311 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4312
f1f924b6
DA
43132012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4314
4315 Move marker debugging code under MARKER_DEBUG.
4316 * marker.c (MARKER_DEBUG): Move marker debugging code under
4317 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4318 for bootstrap with --enable-checking (~3x slowdown reported
4319 by Juanma Barranquero <lekktu@gmail.com>).
4320 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4321
ab531b66
PE
43222012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4323
4324 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4325 See <http://bugs.gnu.org/11825#29>.
4326
c4b3bc8a
EZ
43272012-07-08 Eli Zaretskii <eliz@gnu.org>
4328
4329 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4330 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
4331 (display_line): Add commentary about displaying truncation glyphs
4332 on GUI frames.
4333 (produce_special_glyphs): Move here from term.c.
4334
4335 * term.c (produce_special_glyphs): Move to xdisp.c.
4336
4337 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4338 section.
c4b3bc8a 4339
b676b881
AS
43402012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4341
f17c5273
AS
4342 * xdisp.c (display_line): Avoid warning about implicit declaration
4343 of FRAME_FONT.
4344
298819b9
AS
4345 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4346
b676b881
AS
4347 * lisp.h: Remove empty conditional.
4348
6045c4fd
PE
43492012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4350
b3350bf9
PE
4351 * lread.c (load_path_check): Now static.
4352
6045c4fd
PE
4353 Fix some minor --with-ns problems found by static checking.
4354 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4355 (x_set_font) [!HAVE_X_WINDOWS]:
4356 * image.c (xpm_load_image) [HAVE_NS]:
4357 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4358 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4359 Remove unused local.
4360 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4361 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4362 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4363 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4364 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4365 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4366 Fix pointer signedness problem.
4367 * xfaces.c (FRAME_X_FONT_TABLE):
4368 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4369
929e7845
GM
43702012-07-07 Glenn Morris <rgm@gnu.org>
4371
4372 * lread.c (load_path_check): New function, split from init_lread.
4373 (init_lread): Reorganize. Motivation:
4374 If EMACSLOADPATH is set, check/warn about that rather than the
4375 defaults, which we are not going to use. Hence we can remove
4376 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4377 Don't warn if site-lisp directories are missing.
4378 If not installed, start from a blank load-path, since
4379 PATH_LOADSEARCH refers to the eventual installation directories.
4380
58dd0aa4
EZ
43812012-07-07 Eli Zaretskii <eliz@gnu.org>
4382
4383 Support truncation and continuation glyphs on GUI frames, when
4384 fringes are disabled. (Bug#11832)
4385 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
4386 continuation glyphs even if on GUI frames.
4387 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
4388 or both, are absent.
4389 (start_display, move_it_in_display_line_to): Handle the case of a
4390 GUI frame without a fringe to display continuation or truncation
4391 glyphs.
4392 (insert_left_trunc_glyphs): Support GUI frames: make sure
4393 truncation glyphs overwrite enough glyphs from the current line to
4394 have sufficient space in pixels.
4395 (display_line): Support truncation and continuation glyphs on GUI
4396 frames. If some spare pixels are left on the line after inserting
4397 the truncation glyphs, fill that space with a stretch glyph of a
4398 suitably computed width.
4399
4400 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4401 produce_glyphs, to support GUI sessions.
4402
31571fd7
PE
44032012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4404
5a16b9bc
PE
4405 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4406
f3047c75
PE
4407 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4408
31571fd7
PE
4409 Do not require float-time's arg to fit in time_t (Bug#11825).
4410 This works better on hosts where time_t is unsigned, and where
4411 float-time is applied to the (negative) difference between two times.
4412 * editfns.c (decode_time_components): Last arg is now double *,
4413 not int *, and means to store all the result as a double, without
4414 worrying about whether the seconds part fits in time_t.
4415 All callers changed.
4416 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4417 All callers changed.
4418 (Ffloat_time): Do not fail merely because the specified time falls
4419 outside of time_t range.
4420
4516fbef
GM
44212012-07-07 Glenn Morris <rgm@gnu.org>
4422
4423 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4424 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4425 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4426
07adc2c6
JB
44272012-07-07 Juanma Barranquero <lekktu@gmail.com>
4428
4429 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4430 Update dependencies.
4431
4432 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4433
fd573f31
PE
44342012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4435
fee5959d
PE
4436 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4437 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4438 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4439 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4440 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4441 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4442
fd573f31
PE
4443 * xfont.c (compare_font_names): Redo to omit the need for casts.
4444
ddadbc0e
AS
44452012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4446
fca8d6b6
AS
4447 * xfns.c (Fx_change_window_property): Doc fix.
4448 * w32fns.c (Fx_change_window_property): Doc fix.
4449
ddadbc0e
AS
4450 * w32fns.c (Fx_window_property): Accept the same arguments as the
4451 X Windows version. Doc fix.
4452 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4453
ed9265fc 44542012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
4455 Eli Zaretskii <eliz@gnu.org>
4456
4457 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4458 Windows-specific code from nt/config.nt moved here.
4459 Obsolete settings removed.
4460
216ee680
PE
44612012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4462
4463 * process.c: Avoid unnecessary calls to gettime.
4464 (wait_reading_process_output): Don't get the time of day
4465 when gobbling data immediately and not waiting, as there's no need
4466 for it in that case. This removes a FIXME.
4467
bdd091e4
JD
44682012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4469
4470 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4471 is defined (Bug#11768).
4472
9d44f8ce
DA
44732012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4474
4475 Fix marker debugging code.
4476 * marker.c (byte_char_debug_check): Do not perform the check
4477 if buffer is not multibyte.
090bd7cb
JB
4478 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4479 Call byte_char_debug_check with correct arguments.
9d44f8ce 4480
90fc4786
DA
44812012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4482
4483 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
4484 * marker.c (byte_char_debug_check, count_markers):
4485 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
4486 (byte_debug_flag): Remove.
4487 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4488 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4489
7b7ae965
DA
44902012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4491
4e57b342
DA
4492 Avoid code repetition in marker-related functions.
4493 * marker.c (attach_marker): New function.
4494 (Fset_marker, set_marker_restricted, set_marker_both)
4495 (set_marker_restricted_both): Use it.
4496 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4497 Consistently rename charno to charpos.
4498 (marker_position): Add eassert.
4499 (marker_byte_position): Convert to eassert.
4500
45012012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4502
4503 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 4504 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 4505 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 4506
657924ff
DA
45072012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4508
4509 Introduce fast path for the widely used marker operation.
4510 * alloc.c (build_marker): New function.
4511 * lisp.h (build_marker): New prototype.
4512 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4513 * composite.c (autocmp_chars): Likewise.
4514 * editfns.c (buildmark): Remove.
4515 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4516 (save_restriction_save): Use build_marker.
4517 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4518 * window.c (save_window_save): Likewise.
4519
041a49a6
DA
45202012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4521
4522 Do not use Fdelete_overlay in delete_all_overlays
4523 to avoid redundant calls to unchain_overlay.
4524 * buffer.c (drop_overlay): New function.
4525 (delete_all_overlays, Fdelete_overlay): Use it.
4526 * minibuf.c (get_minibuffer): Fix comment.
4527
7dca65a4
PE
45282012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4529
4530 Port to OpenBSD 5.1 amd64.
4531 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4532 This is needed for OpenBSD, and should be harmless on all BSD systems.
4533 Also, include <sys/sysctl.h>, as it should be available on all
4534 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4535 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4536 use p_pid member, not kp_proc.pid.
4537
8eb876e2
GM
45382012-07-06 Glenn Morris <rgm@gnu.org>
4539
4540 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4541
38182d90
PE
45422012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4543
4544 More xmalloc and related cleanup.
4545 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4546 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4547 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4548 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4549 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4550 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4551 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4552 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4553 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4554 * xterm.c:
4555 Omit needless casts involving void * pointers and allocation.
4556 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4557 as the former is more robust if P's type is changed.
4558 Prefer xzalloc to xmalloc + memset 0.
4559 Simplify malloc-or-realloc to realloc.
4560 Don't worry about xmalloc returning a null pointer.
4561 Prefer xstrdup to xmalloc + strcpy.
4562 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4563 growing it.
4564 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4565 alloca of a constant.
4566
6dd5a677
EZ
45672012-07-05 Eli Zaretskii <eliz@gnu.org>
4568
4569 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4570 hscroll is larger than the line width. Fixes long and futile
4571 looping inside extend_face_to_end_of_line (on a TTY) producing
4572 glyphs that are not needed and thrown away.
4573
6b312f0f
DA
45742012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4575
4576 * marker.c (set_marker_restricted_both): Simplify by using
4577 clip_to_bounds.
4578
f520ef9b
PE
45792012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4580
4581 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4582
383b7c95
JD
45832012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4584
4585 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4586 not defined (Bug#11768).
4587 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4588 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4589 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4590 followed by gtk_box_set_homogeneous (Bug#11768).
4591 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
4592 (update_theme_scrollbar_width, xg_create_scroll_bar):
4593 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
4594 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4595 (is_box_type): New function (Bug#11768).
4596 (xg_tool_item_stale_p): Call is_box_type.
5293d758 4597 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
4598 with default display (Bug#11768).
4599
d6e7bf45
EZ
46002012-07-05 Eli Zaretskii <eliz@gnu.org>
4601
4602 * xdisp.c (window_hscroll_limited): New function.
4603 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4604 coordinates when window's hscroll is set to insanely large
4605 values. (Bug#11857)
4606
431391ec
JB
46072012-07-05 Juanma Barranquero <lekktu@gmail.com>
4608
4609 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4610 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4611
23f86fce
DA
46122012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4613
4614 Cleanup xmalloc.
4615 * lisp.h (xzalloc): New prototype. Omit needless casts.
4616 * alloc.c (xzalloc): New function. Omit needless casts.
4617 * charset.c: Omit needless casts. Convert all calls to
4618 xmalloc with following memset to xzalloc.
4619 * dispnew.c: Likewise.
4620 * fringe.c: Likewise.
4621 * image.c: Likewise.
4622 * sound.c: Likewise.
4623 * term.c: Likewise.
4624 * w32fns.c: Likewise.
4625 * w32font.c: Likewise.
4626 * w32term.c: Likewise.
4627 * xfaces.c: Likewise.
4628 * xfns.c: Likewise.
4629 * xterm.c: Likewise.
4630 * atimer.c: Omit needless casts.
4631 * buffer.c: Likewise.
4632 * callproc.c: Likewise.
4633 * ccl.c: Likewise.
4634 * coding.c: Likewise.
4635 * composite.c: Likewise.
4636 * doc.c: Likewise.
4637 * doprnt.c: Likewise.
4638 * editfns.c: Likewise.
4639 * emacs.c: Likewise.
4640 * eval.c: Likewise.
4641 * filelock.c: Likewise.
4642 * fns.c: Likewise.
4643 * gtkutil.c: Likewise.
4644 * keyboard.c: Likewise.
4645 * lisp.h: Likewise.
4646 * lread.c: Likewise.
4647 * minibuf.c: Likewise.
4648 * msdos.c: Likewise.
4649 * print.c: Likewise.
4650 * process.c: Likewise.
4651 * region-cache.c: Likewise.
4652 * search.c: Likewise.
4653 * sysdep.c: Likewise.
4654 * termcap.c: Likewise.
4655 * terminal.c: Likewise.
4656 * tparam.c: Likewise.
4657 * w16select.c: Likewise.
4658 * w32.c: Likewise.
4659 * w32reg.c: Likewise.
4660 * w32select.c: Likewise.
4661 * w32uniscribe.c: Likewise.
4662 * widget.c: Likewise.
4663 * xdisp.c: Likewise.
4664 * xmenu.c: Likewise.
4665 * xrdb.c: Likewise.
4666 * xselect.c: Likewise.
4667
0497dc44
PE
46682012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4669
4670 * fileio.c (time_error_value): Check the right error number.
4671 Problem reported by Troels Nielsen in
4672 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4673
356e7178
PE
46742012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4675
4e71fd89
PE
4676 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4677 This should be fixed in a better way; see Eli Zaretskii in
4678 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4679 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4680
f0941253
PE
4681 * fileio.c (time_error_value): Rename from special_mtime.
4682 The old name's problems were noted by Eli Zaretskii in
4683 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4684
065c9eb4
PE
4685 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4686 This variable's comment says Emacs needs at least one GDB-visible
4687 symbol of type enum pvec_type, to work around GDB problems.
4688 The symbol's value doesn't matter.
4689
356e7178
PE
4690 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4691 that causes compilation to fail on pre-C99 compilers.
4692
ed9265fc 46932012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
4694
4695 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4696 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4697
3884d954
DA
46982012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4699
d209e2fb 4700 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
4701 headers for buffer_defaults and buffer_local_symbols.
4702 Reported by Juanma Barranquero <lekktu@gmail.com>.
4703
ee28be33
SM
47042012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4705
4706 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4707 * lisp.h (enum pvec_type): Use fewer bits.
4708 (PSEUDOVECTOR_SIZE_BITS): New constant.
4709 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4710 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4711 change in pvec_type.
4712 (PSEUDOVECTOR_TYPEP): New macro.
4713 (TYPED_PSEUDOVECTORP): Use it.
4714 * fns.c (internal_equal): Adapt code to extract pvectype.
4715 * emacs.c (gdb_pvec_type): Update type.
4716 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4717 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4718 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4719 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4720 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4721 abusing vector->header.next.nbytes.
4722 (live_vector_p): Use PVEC_TYPE.
4723 (mark_object): Adapt code to extract pvectype. Use switch.
4724
c7f2cd7f
PE
47252012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4726
4727 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4728 Tighten new eassert a bit.
4729
8ce70ed2
DA
47302012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4731
4732 Fix compilation with --enable-gcc-warnings and -O1
4733 optimization level.
4734 * doprnt.c (doprnt): Change type of tem to int, initialize
4735 to avoid compiler warning. Add eassert.
4736 * search.c (simple_search): Initialize match_byte to avoid
4737 compiler warning. Add eassert.
4738
dea7f1e5
PE
47392012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4740
24a212eb
PE
4741 Avoid weird behavior with large horizontal scrolls.
4742 Without this change, for example, large hscroll values would
4743 mess up Emacs's display on Fedora 15 x86, presumably due to
4744 overflows in int calculations in the display code.
4745 Also, if buffers had long lines, Emacs would freeze.
4746 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4747 (set_window_hscroll): New function, containing the old guts of
4748 Fset_window_hscroll. Return the clipped value.
4749 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4750 This avoids the need to check against PTRDIFF_MAX.
4751
dea7f1e5
PE
4752 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4753
76046526
DA
47542012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4755
4756 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4757
39adff0d
PE
47582012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4759
63807d47
PE
4760 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4761 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4762 since GCC 4.4.6 issues a bogus warning for them.
4763
39adff0d
PE
4764 Fix bugs in file timestamp newness comparisons.
4765 * fileio.c (Ffile_newer_than_file_p):
4766 * lread.c (Fload): Use full timestamp resolution of files,
4767 not just the 1-second resolution, so that files that are only
4768 slightly newer still count as newer.
4769 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4770 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4771
dbeed9a6
PE
47722012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4773
4774 * fileio.c: Improve handling of file time marker. (Bug#11852)
4775 (special_mtime): New function.
4776 (Finsert_file_contents, Fverify_visited_file_modtime):
4777 Use it to set special mtime values consistently.
4778
636334d6
AS
47792012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4780
4781 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4782 marker for non-existing file. (Bug#11852)
4783
e2017fe2
GM
47842012-07-03 Glenn Morris <rgm@gnu.org>
4785
4786 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4787 and did not make it into globals.h).
4788
404dbd37
TT
47892012-07-03 Tom Tromey <tromey@redhat.com>
4790
4791 * window.c (Fset_window_margins, Fset_window_fringes)
4792 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4793 * textprop.c (Fprevious_property_change): No longer static.
4794 * syntax.c (Fsyntax_table_p): No longer static.
4795 * process.c (Fget_process, Fprocess_datagram_address): No longer
4796 static.
4797 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4798 * keyboard.c (Fcommand_execute): No longer static.
4799 Remove EXFUN.
4800 * insdel.c (Fcombine_after_change_execute): No longer static.
4801 * image.c (Finit_image_library): No longer static.
4802 * fileio.c (Fmake_symbolic_link): No longer static.
4803 * eval.c (Ffetch_bytecode): No longer static.
4804 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
4805 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4806 No longer static.
404dbd37
TT
4807 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4808 static.
4809 * dired.c (Ffile_attributes): No longer static.
4810 * composite.c (Fcomposition_get_gstring): No longer static.
4811 * callproc.c (Fgetenv_internal): No longer static.
4812
4813 * ccl.h: Remove EXFUNs.
4814 * buffer.h: Remove EXFUNs.
4815 * dispextern.h: Remove EXFUNs.
4816 * intervals.h: Remove EXFUNs.
4817 * fontset.h: Remove EXFUN.
4818 * font.h: Remove EXFUNs.
4819 * dosfns.c (system_process_attributes): Remove EXFUN.
4820 * keymap.h: Remove EXFUNs.
4821 * lisp.h: Remove EXFUNs.
4822 * w32term.h: Remove EXFUNs.
4823 * window.h: Remove EXFUNs.
4824 * xsettings.h: Remove EXFUN.
4825 * xterm.h: Remove EXFUN.
4826
8e4fd1e1
GM
48272012-07-03 Glenn Morris <rgm@gnu.org>
4828
4829 * lisp.h (Frandom): Make it visible to C.
4830 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4831 buffer for invisible buffers. (Bug#1229)
4832
ca95b3eb
DA
48332012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4834
4835 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4836 values which aren't power of 2.
14ae4239
BT
4837 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4838 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
4839 accordingly.
4840
7555c33f
SM
48412012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4842
4843 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4844
4845 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4846
d12e8f5a
DA
48472012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4848
4849 * alloc.c (allocate_vector_block): Remove redundant
4850 calls to mallopt if DOUG_LEA_MALLOC is defined.
4851 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4852 avoid calls to mallopt if zero_vector is returned.
4853
296094c3
DA
48542012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4855
4856 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4857 is enabled, avoid dereferencing NULL current_sblock if
4858 running undumped.
4859
36429c89
DA
48602012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4861
4862 Cleanup basic buffer management.
4863 * buffer.h (struct buffer): Change layout to use generic vector
4864 marking code. Fix some comments. Change type of 'clip_changed'
4865 to bitfield. Remove unused #ifndef old.
4866 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4867 (GET_OVERLAYS_AT): Fix indentation.
4868 (for_each_per_buffer_object_at): New macro.
4869 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4870 (Fbuffer_local_variables): Use it.
4871 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4872 * alloc.c (allocate_buffer): Adjust to match new layout of
4873 struct buffer. Fix comment.
4874 (mark_overlay): New function.
4875 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4876 Lisp area of struct buffer.
4877 (mark_object): Use it. Adjust marking of misc objects
4878 and related comments.
4879
3b3e4cac
PE
48802012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4883 wrapper that is not needed because the wrapped code is a no-op (zero
4884 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4885 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4886
cf5c0175
DA
48872012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4888
4889 * alloc.c (mark_buffer): Simplify. Remove prototype.
4890 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 4891 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
4892 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4893 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 4894
ca26824c
GM
48952012-06-30 Glenn Morris <rgm@gnu.org>
4896
2e4c5312
GM
4897 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4898
ca26824c
GM
4899 * epaths.in (PATH_SITELOADSEARCH): New.
4900 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4901 This is rather than relying on --enable-locallisppath elements
4902 having "site-lisp" in their names. (Bug#10208#25, 11658)
4903
0d23c240
EZ
49042012-06-30 Eli Zaretskii <eliz@gnu.org>
4905
c9240d7a
EZ
4906 * w32proc.c (sys_select): Accept and ignore one more argument.
4907
4908 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4909
0d23c240 4910 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 4911 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
4912
4913 * sysdep.c: Don't include dos.h and dosfns.h.
4914
4915 * process.c (sys_select):
4916 * msdos.c (sys_select): Accept one more argument and ignore it.
4917
4918 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4919 adapt data types and code to that.
4920
4921 * dosfns.c:
4922 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4923 which clashes with the gnulib function of the same name.
4924
af5a5a98
AS
49252012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4926
c5e4379c
AS
4927 * font.c (font_style_to_value, font_style_symbolic)
4928 (font_prop_validate_style): Add type checks for values in
4929 font_style_table.
4930
af5a5a98
AS
4931 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4932 argument.
4933 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4934 uses.
4935
8d38f461
EZ
49362012-06-29 Eli Zaretskii <eliz@gnu.org>
4937
2e5a6631
EZ
4938 * xdisp.c (try_window_id): Undo last change.
4939
8d38f461
EZ
4940 * w32.c (getwd): Adjust commentary about startup_dir.
4941 (init_environment): Always call sys_access, even in non-MSVC
4942 builds. Don't chdir to the directory of the Emacs executable.
4943 This undoes code from 1997 which was justified by the need to
4944 "avoid conflicts when removing and renaming directories". But its
4945 downside was that every relative file name was being interpreted
4946 relative to the directory of the Emacs executable, which can never
4947 be TRT. In particular, it broke sys_access when called with
4948 relative file names.
4949 (sys_access): Map GetLastError to errno.
4950
2af3565e
DA
49512012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4952
4953 * window.h (struct window): Change type of 'fringes_outside_margins'
4954 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 4955 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
4956 Adjust comment.
4957 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4958 to ptrdiff_t.
4959
c8d3a25c 49602012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 4961
c8d3a25c
GM
4962 * gnutls.c (emacs_gnutls_handshake):
4963 Add QUIT to make the loop interruptible.
57570cd3 4964
c8d3a25c 49652012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 4966
c8d3a25c
GM
4967 * charset.c (init_charset): Make lack of etc/charsets fatal.
4968
3e984ee8
DA
49692012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4970
4971 * editfns.c (region_limit): Fix type mismatch.
4972
ef884f23
DA
49732012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4974
4975 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4976 undefined. Convert from xassert to eassert.
4977 * nsmenu.m: Convert from xassert to eassert.
4978 * nsterm.m: Likewise.
4979
7d7e0027
SM
49802012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4981
4982 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4983
aa754e6a
PE
49842012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4985
4986 Avoid integer overflow on scroll-left and scroll-right.
4987 * window.c (HSCROLL_MAX): New macro.
4988 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4989 overflow when requested scroll falls outside ptrdiff_t range.
4990
80b00b08
DA
49912012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4992
4993 * window.h (struct window): Change type of 'hscroll',
4994 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4995 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4996 Adjust users accordingly.
4997 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4998 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4999 from EMACS_INT to ptrdiff_t.
5000 (make_window): Omit redundant initialization.
5001
62b2bcf6
JB
50022012-06-28 Juanma Barranquero <lekktu@gmail.com>
5003
5004 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5005
45942c7d
DA
50062012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5007
5008 * window.h (struct window): Change type of 'use_time' and
5009 'sequence_number' from Lisp_Object to int.
5010 * frame.c (make_frame): Adjust users accordingly.
5011 * print.c (print_object): Likewise.
5012 * window.c (select_window, Fwindow_use_time, make_parent_window)
5013 (make_window): Likewise.
5014
e509cfa6
DA
50152012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5016
5017 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5018 enabled with --enable-checking=[all,glyphs] configure option.
5019 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5020 adjust comments accordingly.
5021 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5022 undefined, adjust comments accordingly.
5023 * image.c: Likewise.
5024 * scroll.c: Likewise.
5025 * w32fns.c: Likewise.
5026 * w32term.c: Likewise.
5027 * xdisp.c: Likewise.
5028 * xfaces.c: Likewise.
5029 * xfns.c: Likewise.
5030 * xterm.c: Likewise.
5031
a54e2c05
DA
50322012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5033
5034 Generalize run-time debugging checks.
5035 * dispextern.h (XASSERTS): Remove.
5036 * fontset.c (xassert): Remove.
5037 Convert from xassert to eassert.
5038 * alloc.c: Convert from xassert to eassert.
5039 * bidi.c: Likewise.
5040 * dispnew.c: Likewise.
5041 * fns.c: Likewise.
5042 * fringe.c: Likewise.
5043 * ftfont.c: Likewise.
5044 * gtkutil.c: Likewise.
5045 * image.c: Likewise.
5046 * keyboard.c: Likewise.
5047 * menu.c: Likewise.
5048 * process.c: Likewise.
5049 * scroll.c: Likewise.
5050 * sound.c: Likewise.
5051 * term.c: Likewise.
5052 * w32console.c: Likewise.
5053 * w32fns.c: Likewise.
5054 * w32term.c: Likewise.
5055 * window.c: Likewise.
5056 * xdisp.c: Likewise.
5057 * xfaces.c: Likewise.
5058 * xfns.c: Likewise.
5059 * xselect.c: Likewise.
5060 * xterm.c: Likewise.
5061
1ec4b7b2
SM
50622012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5063
5064 * fns.c (maybe_resize_hash_table): Output message when growing the
5065 purify-hashtable.
5066
2014308a
DA
50672012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5068
5069 * alloc.c (allocate_string_data): Remove dead code.
5070 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5071 avoid GCC warning about unused macro.
5072
246155eb
DA
50732012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5074
5075 * alloc.c (allocate_string): Omit intervals initialization.
5076 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5077 as in make_pure_string and make_pure_c_string.
5078
43184b7b
DA
50792012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5080
d209e2fb 5081 * alloc.c (allocate_string): Fix last change.
43184b7b 5082
3fe6dd74
DA
50832012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5084
d209e2fb 5085 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5086 to memset, add explicit initialization where appropriate.
5087
1ba6038a
GM
50882012-06-27 Glenn Morris <rgm@gnu.org>
5089
5090 * lisp.mk (lisp): Remove paths.elc.
5091
c89926a5
CY
50922012-06-27 Chong Yidong <cyd@gnu.org>
5093
5094 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5095
ed6b3510
JW
50962012-06-26 John Wiegley <johnw@newartisans.com>
5097
1ec4b7b2 5098 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5099 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5100
ed6b3510
JW
5101 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5102 when building with Clang.
5103
8edd4a2b
SM
51042012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5105
5106 * eval.c (Fapply): Allow calling it with a single argument.
5107
f6f62d1b
EZ
51082012-06-26 Eli Zaretskii <eliz@gnu.org>
5109
5110 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5111 _stricmp and _strnicmp.
5112 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5113
62efea5e
DA
51142012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5115
5116 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5117 allocated window.
5118 (allocate_process): Likewise for new process.
8edd4a2b 5119 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5120 (allocate_frame): Likewise.
5121 * frame.c (make_frame): Omit redundant initialization.
5122 * window.c (make_parent_window): Use memset.
5123 (make_window): Omit redundant initialization.
5124 * process.c (make_process): Omit redundant initialization.
5125 * terminal.c (create_terminal): Likewise.
5126
42997f4d
DA
51272012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5128
5129 * term.c (delete_tty): Remove redundant call to memset.
5130
1130ecfc
DA
51312012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5132
5133 * alloc.c: Remove build_string.
5134 * lisp.h: Define build_string as static inline. This provides
5135 a better opportunity to optimize away calls to strlen when the
5136 function is called with compile-time constant argument.
5137 * image.c (imagemagick_error): Convert to build_string.
5138 * w32proc.c (sys_spawnve): Likewise.
5139 * xterm.c (x_term_init): Likewise.
5140
cf38a720
PE
51412012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5142
99027bdd
PE
5143 Use sprintf return value instead of invoking strlen on result.
5144 In the old days this wasn't portable, since some sprintf
5145 implementations returned char *. But they died out years ago and
5146 Emacs already assumes sprintf returns int.
5147 Similarly for float_to_string.
5148 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5149 * ccl.c (ccl_driver):
5150 * character.c (string_escape_byte8):
5151 * data.c (Fnumber_to_string):
5152 * doprnt.c (doprnt):
5153 * print.c (print_object):
5154 * xdisp.c (message_dolog):
5155 * xfns.c (syms_of_xfns):
5156 Use sprintf or float_to_string result to avoid need to call strlen.
5157 * data.c (Fnumber_to_string):
5158 Use make_unibyte_string, since the string must be ASCII.
5159 * lisp.h, print.c (float_to_string): Now returns int length.
5160 * term.c (produce_glyphless_glyph):
5161 Use sprintf result rather than recomputing it.
5162
cf38a720
PE
5163 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5164 * Makefile.in (ALL_CFLAGS):
5165 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5166 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5167
3511c784
DA
51682012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5169
0a08eb21 5170 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
5171 strcasecmp if available.
5172 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5173
fb7da12e
AS
51742012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5175
5176 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5177 Avoid comma operator.
5178 * menu.c (push_submenu_start, push_submenu_end)
5179 (push_left_right_boundary, push_menu_pane): Likewise.
5180 * msdos.c (dos_rawgetc): Likewise.
5181
afa2ffd8
DA
51822012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5183
5184 * xfns.c (xic_create_fontsetname): Remove redundant calls
5185 to memset.
5186
b3b4476b
PE
51872012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5188
4495ff38
PE
5189 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5190 sprintf already null-terminates its output.
5191
b3b4476b
PE
5192 * xfns.c (x_window): Remove redundant cast.
5193
b00876c9
DA
51942012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5195
5196 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5197 `const char *' to `char *' to avoid compiler warning.
5198
d188e26b
PE
51992012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5200
885d1d74
PE
5201 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5202 instead of truncating it to 63 (admittedly a generous limit).
5203
d188e26b
PE
5204 * process.c: Fix spelling and caps in comments.
5205
e2f560b1
DN
52062012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5207
e86db54b 5208 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
5209 * sysdep.c (setpgrp): Remove definition, not used in this file.
5210
7583a3a1
JB
52112012-06-24 Juanma Barranquero <lekktu@gmail.com>
5212
5213 * makefile.w32-in: Update dependencies.
5214
696056c2
EZ
52152012-06-24 Eli Zaretskii <eliz@gnu.org>
5216
5217 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5218 (SYSTIME_H): Add nt/inc/sys/time.h.
5219
5220 * systime.h [WINDOWSNT]: Include sys/time.h.
5221
5222 * s/ms-w32.h (struct timespec): Definition moved from
5223 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5224
845ca893
PE
52252012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5226
5227 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5228 * buffer.h (buffer_slot_type_mismatch):
5229 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5230 * eval.c (unwind_to_catch):
5231 * image.c (my_png_error, my_error_exit):
5232 * keyboard.c (quit_throw_to_read_char, user_error)
5233 (Fexit_recursive_edit, Fabort_recursive_edit):
5234 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5235 (wrong_type_argument, buffer_overflow, __executable_start)
5236 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5237 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5238 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5239 (fatal):
5240 (child_setup) [!DOS_NT]:
5241 * lread.c (end_of_file_error, invalid_syntax):
5242 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5243 * puresize.h (pure_write_error):
5244 * search.c (matcher_overflow):
5245 * sound.c (sound_perror, alsa_sound_perror):
5246 * sysdep.c, syssignal.h (croak):
5247 * term.c (maybe_fatal, vfatal):
5248 * textprop.c (text_read_only):
5249 * undo.c (user_error):
5250 * unexmacosx.c (unexec_error):
5251 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5252 Use _Noreturn rather than NO_RETURN.
5253 No need for separate decl merely because of _Noreturn.
5254 * sound.c (sound_warning, parse_sound):
5255 Remove unnecessary forward decls.
5256
f1dd8073
PE
52572012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5258
5259 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5260 * lisp.h (WAIT_READING_MAX): New macro.
5261 * dispnew.c (Fsleep_for, sit_for):
5262 * keyboard.c (kbd_buffer_get_event):
5263 * process.c (Faccept_process_output):
5264 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5265 This improves on the previous patch, which introduced a bug
5266 when time_t is unsigned and as wide as intmax_t.
5267 See <http://bugs.gnu.org/9000#51>.
5268
b82c1755
EZ
52692012-06-23 Eli Zaretskii <eliz@gnu.org>
5270
5271 * dispnew.c (sit_for, Fsleep_for):
5272 * keyboard.c (kbd_buffer_get_event):
5273 * process.c (Faccept_process_output): Avoid compiler warnings when
5274 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5275
ca300656
JB
52762012-06-23 Juanma Barranquero <lekktu@gmail.com>
5277
049ec95b
JB
5278 * makefile.w32-in: Update dependencies.
5279
ca300656
JB
5280 * w32.c (ltime): Add return type and declare static.
5281 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5282
db7b8d06
PE
52832012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5284
5285 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5286 Privately reported by Herbert J. Skuhra.
5287 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5288 All uses changed.
5289 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5290 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5291
0bd8297f
EZ
52922012-06-23 Eli Zaretskii <eliz@gnu.org>
5293
96512555
EZ
5294 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5295 last argument of make_unibyte_string.
5296
0bd8297f
EZ
5297 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5298 language ID in the event parameters.
5299
5300 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5301 event.code, not the obscure "character set ID".
5302
63def6b6
CY
53032012-06-23 Chong Yidong <cyd@gnu.org>
5304
5305 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5306
e8a02204
EZ
53072012-06-23 Eli Zaretskii <eliz@gnu.org>
5308
388cdec0
EZ
5309 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5310 * w32.c (fdutimens): New function.
5311
5312 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5313
5314 * s/ms-w32.h (pselect): Redirect to sys_select.
5315
5316 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5317
e8a02204
EZ
5318 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5319 in the logic of incrementing and decrementing the value of
5320 use_relocatable_buffers.
5321
d054f3fb
PE
53222012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5323
5324 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5325 Privately reported by Herbert J. Skuhra.
5326 [__FreeBSD__]: Remove "*/" typo after "#include".
5327 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5328 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5329 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5330 Don't assume EMACS_TIME and struct timeval are the same type.
5331
d35af63c
PE
53322012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5333
5334 Support higher-resolution time stamps (Bug#9000).
5335 The time stamps are only nanosecond-resolution at the C level,
5336 since that's the best that any real-world system supports now.
5337 But they are picosecond-resolution at the Lisp level, as that's
5338 easy, and leaves room for future OS improvements.
5339
5340 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5341 (LIBES): Use it.
5342
5343 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5344 Don't get current time unless it's needed.
5345
5346 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5347 now provides it if it's absent.
5348 (start_atimer): Port to higher-res time stamps.
5349 Check for time stamp overflow. Don't get current time more
5350 often than is needed.
5351
5352 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5353 Include systime.h, not time.h.
5354 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5355
5356 * dired.c: Include stat-time.h.
5357 (Ffile-attributes): File times now have higher resolution.
5358
5359 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5360 (struct image): Timestamp now has higher resolution.
5361
5362 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5363 has at least microseconds now. All uses removed.
5364 (update_frame, update_single_window, update_window, update_frame_1)
5365 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 5366 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
5367
5368 * editfns.c (time_overflow): Now extern.
5369 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5370 (float-time, Fformat_time_string, Fcurrent_time_string)
5371 (Fcurrent_time_zone): Accept and generate higher-resolution
5372 time stamps.
5373 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5374 (decode_time_components, lisp_seconds_argument): New functions.
5375 (make_time): Now static.
5376 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5377 Report an error if the time is invalid, rather than having the caller
5378 do that.
5379
5380 * fileio.c: Include <stat-time.h>
5381 (Fcopy_file): Copy higher-resolution time stamps.
5382 Prefer to set the time stamp via a file descriptor if that works.
5383 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5384 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5385 (Fvisited_file_modtime, Fset_visited_file_modtime):
5386 Support higher-resolution time stamps.
5387
5388 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5389
5390 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5391
5392 * image.c (prepare_image_for_display, clear_image_cache)
5393 (lookup_image): Port to higer-resolution time stamps.
5394
5395 * keyboard.c (start_polling, bind_polling_period):
5396 Check for time stamp overflow.
5397 (read_char, kbd_buffer_get_event, timer_start_idle)
5398 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5399 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5400 Port to higher-resolution time stamps. Do not assume time_t is signed.
5401 (decode_timer): New function. Timers are now vectors of length 9,
5402 not 8, to accommodate the picosecond component.
5403 (timer_check_2): Use it.
5404
5405 * nsterm.m (select_timeout, timeval_subtract): Remove.
5406 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5407 as they're a bit more accurate and handle overflow better.
5408 (ns_select): Change prototype to be compatible with pselect.
5409 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5410 * nsterm.h (ns_select): Adjust prototype.
5411
5412 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5413 us-resolution time stamps.
5414 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5415
5416 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5417
5418 * lisp.h (time_overflow): New decl.
5419 (wait_reading_process_output): First arg is now intmax_t, not int,
5420 to accommodate larger waits.
5421
5422 * process.h (struct Lisp_Process.read_output_delay):
5423 Now counts nanoseconds, not microseconds.
5424 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5425 EMACS_HAS_USECS.
5426 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5427 (wait_reading_process_output):
5428 Port to ns-resolution time stamps.
5429 (Faccept_process_output, wait_reading_process_output):
5430 Check for time stamp overflow. Do not assume time_t is signed.
5431 (select_wrapper): Remove; we now use pselect.
5432 (Fprocess_attributes): Now generates ns-resolution time stamps.
5433
5434 * sysdep.c: Include utimens.h. Don't include utime.h
5435 or worry about struct utimbuf; gnulib does that for us now.
5436 (gettimeofday): Remove; gnulib provides a substitute.
5437 (make_timeval): New function.
5438 (set_file_times): Now sets ns-resolution time stamps.
5439 New arg FD; all uses changed.
5440 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5441 (system_process_attributes):
5442 Now returns ns-resolution time stamp. All uses changed.
5443 Check for time stamp overflow.
5444
5445 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5446 provides a substitute now.
5447
5448 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5449 since it guarantees struct timespec.
5450 (EMACS_TIME): Now struct timespec, so that we can support
5451 ns-resolution time stamps.
5452 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5453 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5454 (EMACS_USECS): Remove.
5455 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5456 so multiply the arg by 1000 before storing it.
5457 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5458 New macros.
5459 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5460 Port to ns-resolution time stamps.
5461 (EMACS_TIME_NEG_P): Remove; replaced by....
5462 (EMACS_TIME_SIGN): New macro.
5463 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5464 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5465 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5466 (make_timeval, make_lisp_time, decode_time_components): New decls.
5467 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5468 that it mishandled time_t overflow. You can't compare by subtracting!
5469 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5470 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5471
5472 * term.c: Include <sys/time.h>.
5473 (timeval_to_Time): New function, for proper overflow wraparound.
5474 (term_mouse_position, term_mouse_click): Use it.
5475
5476 * undo.c (record_first_change): Support higher-resolution time stamps
5477 in the undo buffer.
5478 (Fprimitive_undo): Use them when restoring time stamps.
5479
5480 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5481 (w32_get_internal_run_time):
5482 Port to higher-resolution Emacs time stamps.
5483 (ltime): Now accepts single 64-bit integer, as that's more convenient
5484 for callers.
5485
5486 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5487
5488 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5489 for compatibility with pselect. Support ns-resolution time stamps.
5490
5491 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5492
5493 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5494 Check for time stamp overflow, and support ns-resolution time stamps.
5495
5496 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5497 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5498 (timeval_subtract): Remove; no longer needed.
5499 (XTflash, XTring_bell, x_wait_for_event):
5500 Port to ns-resolution time stamps. Don't assume time_t is signed.
5501
b6a92dfe
CY
55022012-06-22 Chong Yidong <cyd@gnu.org>
5503
5504 * xdisp.c (x_consider_frame_title): Revert last change.
5505
d251c37c
EZ
55062012-06-22 Eli Zaretskii <eliz@gnu.org>
5507
5508 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5509 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5510 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5511 staticidx goes up to 1597 out of 1600 = 0x640.)
5512
f10deafb
PE
55132012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5514
5515 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5516 Otherwise, the umask might be mistakenly 0 while handling input signals.
5517
ec6de1e2
SM
55182012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5519
5520 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5521
28be1ada
DA
55222012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5523
5524 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5525 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5526 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5527 access to `contents' member of Lisp_Vector objects with AREF and ASET
5528 where appropriate.
5529
c6bf3022
CY
55302012-06-19 Chong Yidong <cyd@gnu.org>
5531
5532 * frame.c (delete_frame): When selecting a frame on a different
5533 text terminal, do not alter the terminal's top-frame.
5534
5535 * xdisp.c (format_mode_line_unwind_data): Record the target
5536 frame's selected window and its terminal's top-frame.
5537 (unwind_format_mode_line): Restore them.
5538 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5539 Callers changed.
5540 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5541 since tty frames can be explicitly named.
5542 (prepare_menu_bars): Likewise.
5543
5544 * term.c (Ftty_top_frame): New function.
5545
defd4196
PE
55462012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5547
5548 Port byte-code-meter to modern targets.
5549 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5550 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 5551 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
5552 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5553 (METER_1, METER_2): Simplify.
5554
1053a871
SM
55552012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5556
5557 * data.c (Fdefalias): Return `symbol' (bug#11686).
5558
b7e8d081
MR
55592012-06-18 Martin Rudalics <rudalics@gmx.at>
5560
5561 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
5562 gets killed during executing of this function (Bug#11665).
5563 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
5564 (Vkill_buffer_query_functions): In doc-string say that functions
5565 run by this hook should not change the current buffer.
5566
7ea2b339
PE
55672012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5568
5569 Fix recently-introduced process.c problems found by static checking.
5570 * process.c (write_queue_push, write_queue_pop, send_process):
5571 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5572 (write_queue_pop): Fix pointer signedness problem.
5573 (send_process): Remove unused local.
5574
96a313a1
CY
55752012-06-17 Chong Yidong <cyd@gnu.org>
5576
5577 * xdisp.c (redisplay_internal): No need to redisplay terminal
5578 frames that are not on top.
5579
20ca2e94
TN
55802012-06-17 Troels Nielsen <bn.troels@gmail.com>
5581
5582 * process.c (make_process): Initialize write_queue.
5583 (write_queue_push, write_queue_pop): New functions.
5584 (send_process): Use them to maintain correct ordering of process
5585 writes (Bug#10815).
5586
9a900ca9
PE
55872012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5588
310fbfa8
PE
5589 * lisp.h (eassert): Assume C89 or later.
5590 This removes the need for CHECK.
5591 (CHECK): Remove. Its comments about always evaluating its
5592 argument were confusing, as 'eassert' typically does not evaluate
5593 its argument.
5594
27bb1ca4
PE
5595 * coding.c (produce_chars): Use ptrdiff_t, not int.
5596
9a900ca9
PE
5597 * xterm.c (x_draw_underwave): Check for integer overflow.
5598 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5599
41b7f8bc 56002012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
5601
5602 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5603 referenced (Bug#11583).
5604
9b0e3eba
AA
56052012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5606
5607 Implement wave-style variant of underlining.
5608 * dispextern.h (face_underline_type): New enum.
5609 (face): Add field for underline type.
5610 * nsterm.m (ns_draw_underwave): New function.
5611 (ns_draw_text_decoration): Use it.
5612 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5613 New functions.
5614 (x_draw_glyph_string): Use them.
5615 * xfaces.c (Qline, Qwave): New Lisp objects.
5616 (check_lface_attrs, merge_face_ref)
1053a871
SM
5617 (Finternal_set_lisp_face_attribute, realize_x_face):
5618 Handle wave-style underline face attributes.
9b0e3eba
AA
5619 * xterm.c (x_draw_underwave): New function.
5620 (x_draw_glyph_string): Use it.
5621
0fb52f11
JB
56222012-06-16 Juanma Barranquero <lekktu@gmail.com>
5623
5624 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5625 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5626 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5627 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5628 ($(BLD)/w32select.$(O)): Update dependencies.
5629
e5560ff7
AS
56302012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5631
5632 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5633 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5634 * character.c (_fetch_multibyte_char_p): Remove.
5635 * alloc.c: Include "character.h" before "buffer.h".
5636 * bidi.c: Likewise.
5637 * buffer.c: Likewise.
5638 * bytecode.c: Likewise.
5639 * callint.c: Likewise.
5640 * callproc.c: Likewise.
5641 * casefiddle.c: Likewise.
5642 * casetab.c: Likewise.
5643 * category.c: Likewise.
5644 * cmds.c: Likewise.
5645 * coding.c: Likewise.
5646 * composite.c: Likewise.
5647 * dired.c: Likewise.
5648 * dispnew.c: Likewise.
5649 * doc.c: Likewise.
5650 * dosfns.c: Likewise.
5651 * editfns.c: Likewise.
5652 * emacs.c: Likewise.
5653 * fileio.c: Likewise.
5654 * filelock.c: Likewise.
5655 * font.c: Likewise.
5656 * fontset.c: Likewise.
5657 * fringe.c: Likewise.
5658 * indent.c: Likewise.
5659 * insdel.c: Likewise.
5660 * intervals.c: Likewise.
5661 * keyboard.c: Likewise.
5662 * keymap.c: Likewise.
5663 * lread.c: Likewise.
5664 * macros.c: Likewise.
5665 * marker.c: Likewise.
5666 * minibuf.c: Likewise.
5667 * nsfns.m: Likewise.
5668 * nsmenu.m: Likewise.
5669 * print.c: Likewise.
5670 * process.c: Likewise.
5671 * regex.c: Likewise.
5672 * region-cache.c: Likewise.
5673 * search.c: Likewise.
5674 * syntax.c: Likewise.
5675 * term.c: Likewise.
5676 * textprop.c: Likewise.
5677 * undo.c: Likewise.
5678 * unexsol.c: Likewise.
5679 * w16select.c: Likewise.
5680 * w32fns.c: Likewise.
5681 * w32menu.c: Likewise.
5682 * window.c: Likewise.
5683 * xdisp.c: Likewise.
5684 * xfns.c: Likewise.
5685 * xmenu.c: Likewise.
5686 * xml.c: Likewise.
5687 * xselect.c: Likewise.
5688
2f07e6af
EZ
56892012-06-16 Eli Zaretskii <eliz@gnu.org>
5690
1053a871
SM
5691 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5692 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 5693 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
5694 row.
5695 (handle_face_prop): Use chunk-relative overlay string index when
5696 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
5697 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5698 the rightmost. (Bug#11720)
2f07e6af 5699
29b83cec
AS
57002012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5701
5702 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5703 (CATEGORY_MEMBER): Enforce 1/0 value.
5704 * category.c (_temp_category_set): Remove.
5705
4c5501e9
EZ
57062012-06-16 Eli Zaretskii <eliz@gnu.org>
5707
5708 * window.c (Fdelete_other_windows_internal)
5709 (Fdelete_window_internal): Don't access frame's mouse highlight
5710 info of the initial frame. (Bug#11677)
5711
2b570124
PE
57122012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5713
e93864f9
PE
5714 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5715 Assume USE_2_TAGS_FOR_INTS.
5716 (xreload): Adjust $tagmask width to match recent lisp.h change.
5717
2b570124
PE
5718 Simplify lisp.h in minor ways that should not affect code.
5719 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5720 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5721 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5722 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5723 (INTTYPEBITS): New macro, for clarity.
5724 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
5725 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5726 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
5727 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5728 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5729
81755f69
JB
57302012-06-13 Juanma Barranquero <lekktu@gmail.com>
5731
5732 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5733
16192a57
GM
57342012-06-13 Glenn Morris <rgm@gnu.org>
5735
5736 * s/bsd-common.h (BSD4_3):
5737 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5738
646b5f55
AS
57392012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5740
5741 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5742 instead of union.
5743 (XLI, XIL): Define.
1053a871
SM
5744 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5745 Use them.
5746 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 5747 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 5748 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
5749 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5750 * frame.c (delete_frame): Remove outdated comment.
5751 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5752 USE_LISP_UNION_TYPE.
5753 (Fw32_unregister_hot_key): Likewise.
5754 (Fw32_toggle_lock_key): Likewise.
5755 * w32menu.c (add_menu_item): Likewise.
5756 (w32_menu_display_help): Use XIL instead of checking
5757 USE_LISP_UNION_TYPE.
5758 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5759 (init_heap): Likewise.
5760 * w32term.c (w32_read_socket): Update comment.
5761
1d3823c9
GM
57622012-06-13 Glenn Morris <rgm@gnu.org>
5763
c62ff706
GM
5764 * s/usg5-4-common.h, src/s/unixware.h:
5765 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5766
1d3823c9
GM
5767 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5768
bfe3e0a2
PE
57692012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5770
5771 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5772 * alloc.c (make_number) [!defined make_number]:
5773 Remove, as lisp.h always defines this now.
5774 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5775 (roundup_size): Verify that it is a power of 2.
5776 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5777 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5778 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5779 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5780 USE_LSB_TAG now is always defined to be either 0 or 1.
5781 All uses changed.
5782 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5783 code works fine either way, and efficiency is not a concern here,
5784 as the union type is for debugging, not for production.
5785 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5786 Use an inline function on all platforms when using the union type,
5787 since this is simpler and 'static inline' can be used portably
5788 within Emacs now.
5789 (LISP_INITIALLY_ZERO): New macro.
5790 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5791 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5792
45fa9c0f
GM
57932012-06-12 Glenn Morris <rgm@gnu.org>
5794
b4492cba
GM
5795 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5796
5797 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 5798
45fa9c0f
GM
5799 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5800 Move BROKEN_SIGIO to configure.
5801
5802 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5803 Move NO_TERMIO to configure.
5804
0e25d334
CY
58052012-06-12 Chong Yidong <cyd@gnu.org>
5806
5807 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5808 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5809 MagickExportImagePixels is undefined.
5810
43682bb6
PE
58112012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5812
5813 * image.c (imagemagick_load_image): Remove unused label.
5814
a9be7d2b
GM
58152012-06-11 Glenn Morris <rgm@gnu.org>
5816
5817 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5818 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5819 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5820 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5821
3017f87f
SM
58222012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5823
5824 * alloc.c (make_byte_code): New function.
5825 (Fmake_byte_code): Use it. Don't purify here.
5826 * lread.c (read1): Use it as well to avoid extra allocation.
5827
1b9b4cf4
CY
58282012-06-11 Chong Yidong <cyd@gnu.org>
5829
5830 * image.c (imagemagick_load_image): Implement transparency.
5831
95988fcf
AS
58322012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5833
5834 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5835 account for preceding backslashes. (Bug#11663)
5836
cd4eb164
CY
58372012-06-09 Chong Yidong <cyd@gnu.org>
5838
5839 * term.c: Support italics in capable terminals (Bug#9652).
5840 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5841 (turn_on_face): Output using TS_enter_italic_mode if available.
5842 Don't handle unused blinking and alt-charset cases.
5843 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5844 and tty_alt_charset_p cases.
5845 (tty_capable_p, init_tty): Support italics.
5846
5847 * termchar.h (struct tty_display_info): Add field for italics.
5848 Remove unused blink field.
5849
5850 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5851 Handle slant.
5852
5853 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5854 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5855 tty_alt_charset_p. Add tty_italic_p.
5856
ff88beb8
MA
58572012-06-09 Michael Albinus <michael.albinus@gmx.de>
5858
5859 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5860 dbus_type_is_basic if available.
5861 (xd_extract_signed, xd_extract_unsigned): Rename from
5862 extract_signed and extract_unsigned, respectively. Adapt callers.
5863
44286096
CY
58642012-06-09 Chong Yidong <cyd@gnu.org>
5865
1682701f
CY
5866 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5867
44286096
CY
5868 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5869 case (Bug#9752).
5870
d86feb17
PE
58712012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 * xdisp.c (vmessage): Treat frame message as multibyte.
5874 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5875 would generate the diagnostic "Making \302\247 buffer-local while
5876 let-bound!".
5877
d5c20fe8
EZ
58782012-06-08 Eli Zaretskii <eliz@gnu.org>
5879
5880 * dispnew.c (showing_window_margins_p): Undo last change, which
5881 was done due to an inadvertent commit.
5882 (adjust_frame_glyphs_for_frame_redisplay): Do call
5883 showing_window_margins_p.
5884
513749ee
SM
58852012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5886
5887 * eval.c (Fmake_var_non_special): New primitive.
5888 (syms_of_eval): Defsubr it.
5889 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5890
d4a8f5c1
JB
58912012-06-08 Juanma Barranquero <lekktu@gmail.com>
5892
5893 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5894 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5895
8bbbc977
EZ
58962012-06-08 Eli Zaretskii <eliz@gnu.org>
5897
5898 * alloc.c (allocate_vectorlike): Fix last change.
5899
f3372c87
DA
59002012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5901
5902 Block-based vector allocation of small vectors.
5903 * lisp.h (struct vectorlike_header): New field `nbytes',
5904 adjust comment accordingly.
5905 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 5906 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
5907 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5908 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5909 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5910 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5911 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5912 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5913 (roundup_size): New constant.
5914 (struct vector_block): New data type.
5915 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 5916 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
5917 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5918 (sweep_vectors): New functions.
5919 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 5920 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
5921 or equal to VBLOCK_BYTES_MAX.
5922 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5923 (init_alloc_once): Add call to init_vectors.
5924
4f18a4ed
SM
59252012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5926
5927 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5928
86f158bc
PE
59292012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5930
5931 * doprnt.c (doprnt): Truncate multibyte char correctly.
5932 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5933 would mishandle a string argument "Xc" if X was a multibyte
5934 character of length 2: it would truncate after X's first byte
5935 rather than including all of X.
5936
c5cfcbe0
CY
59372012-06-06 Chong Yidong <cyd@gnu.org>
5938
5939 * buffer.c (word_wrap): Doc fix.
5940
c05cf390
PE
59412012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5942
5943 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5944
0c3461de
GM
59452012-06-03 Glenn Morris <rgm@gnu.org>
5946
5947 * xdisp.c (tool-bar-style): Doc fix.
5948
c71232db
UM
59492012-06-03 Ulrich Müller <ulm@gentoo.org>
5950
5951 * Makefile.in (PAXCTL): Define.
5952 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5953 binary via PaX flags if the paxctl utility is available.
5954 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5955 Restore PaX flags to their default. (Bug#11398)
5956
383f7350
CY
59572012-06-03 Chong Yidong <cyd@gnu.org>
5958
5959 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5960 buffer (Bug#11226).
5961
5f2c76c6
CY
59622012-06-03 Chong Yidong <cyd@gnu.org>
5963
5964 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5965 (note_mode_line_or_margin_highlight): If there is no help echo,
5966 use mode-line-default-help-echo. Handle the case where the mouse
5967 position is past the end of the mode line string.
5968
5969 * buffer.c (buffer_local_value_1): New function, split from
5970 Fbuffer_local_value; can return Qunbound.
5971 (Fbuffer_local_value): Use it.
5972 (Vmode_line_format): Docstring tweaks.
5973
773d47f6
PE
59742012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5975
5976 * sysdep.c (system_process_attributes): Improve comment.
5977
f2d6a3df
SM
59782012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5979
5980 * keyboard.c: Export real-this-command to Elisp.
5981 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5982 and DEFVAR it. Update all users.
5983
63810350
PE
59842012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5985
7bd5c1f4
PE
5986 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5987
63810350
PE
5988 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5989 Convert pctcpu and pctmem to Lisp float properly.
5990 Let the compiler fold better, as 100.0/0x8000 is exact.
5991
a2821611
AS
59922012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5993
5994 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5995 cons_block.
5996
5fceba1d
PE
59972012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5998
5999 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6000
c98ff5dd
DA
60012012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6002
6003 For a 'struct window', replace some Lisp_Object fields to
6004 bitfields where appropriate, remove unused fields.
6005 * window.h (struct window): Remove unused 'last_mark_x' and
6006 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6007 change it's type from Lisp_Object to bitfield.
6008 Change type of 'force_start', 'optional_new_start',
6009 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6010 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6011
ca34e0be
PE
60122012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6013
6014 Pacify gcc -Wdouble-precision when using Xaw.
6015 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6016 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6017 Use 'float' consistently, rather than 'float' in most places
6018 and 'double' in a couple of places.
6019
efc00ab1 60202012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6021
6022 * xdisp.c (handle_stop): Detect whether we have overlay strings
6023 loaded by testing it->current.overlay_string_index to be
6024 non-negative, instead of checking whether n_overlay_strings is
6025 positive. (Bug#11587)
6026
efc00ab1 60272012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6028
6029 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6030
6031 * doc.c (Fsubstitute_command_keys): Doc fix.
6032
efc00ab1 60332012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6034
6035 * search.c (search_buffer): Remove calls to
6036 r_alloc_inhibit_buffer_relocation, as it is now called by
6037 maybe_unify_char, which was the cause of relocation of buffer text
6038 in bug#11519.
6039
efc00ab1 60402012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6041
6042 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6043 for the duration of call to load_charset, to avoid problems with
6044 callers of maybe_unify_char that access buffer text through C
6045 pointers.
6046
6047 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6048 decrement the inhibition flag, instead of just setting or
6049 resetting it.
6050
ba93a187
PE
60512012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6052
6053 Remove obsolete '#define static' cruft.
6054 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6055 This #undef was "temporary" in 2000; it is no longer needed
6056 now that '#define static' has gone away.
6057 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6058 (gray_bitmap_bits): Remove; no longer needed.
6059 All uses replaced with definiens.
6060 * xterm.c: Include "bitmaps/gray.xbm".
6061
9e4bf381
PE
60622012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6063
6064 Clean up __executable_start, monstartup when --enable-profiling.
6065 The following changes affect the code only when profiling.
6066 * dispnew.c (__executable_start): Rename from safe_bcopy.
6067 Define only on platforms that need it.
6068 * emacs.c: Include <sys/gmon.h> when profiling.
6069 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6070 (__executable_start): Remove decl, since lisp.h does it now.
6071 (safe_bcopy): Remove decl; no longer has that name.
6072 (main): Coalesce #if into single bit of code, for simplicity.
6073 Cast pointers to uintptr_t, since standard libraries want integers
6074 and not pointers.
6075 * lisp.h (__executable_start): New decl.
6076
32d72c2f
GM
60772012-05-31 Glenn Morris <rgm@gnu.org>
6078
6079 * image.c (Fimagemagick_types): Doc fix.
6080
baac5bc7
JM
60812012-05-30 Jim Meyering <meyering@redhat.com>
6082
6083 * callproc.c (Fcall_process_region): Include directory component
6084 in mkstemp error message (Bug#11586).
6085
72cb32cf
PE
60862012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6087
6088 * alloc.c, lisp.h (make_pure_vector): Now static.
6089
61b108cc
SM
60902012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6091
6092 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6093 Move to byte-run.el.
6094 (Fautoload): Do the hash-doc more carefully.
6095 * data.c (Fdefalias): Purify definition, except for keymaps.
6096 (Qdefun): Move from eval.c.
6097 * lisp.h (Qdefun): Remove.
6098 * lread.c (read1): Tiny simplification.
6099
471fe23d
TN
61002012-05-29 Troels Nielsen <bn.troels@gmail.com>
6101
934f3f58 6102 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6103 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6104 Bug#9642, but explicitly check that the buffer the overlay would
6105 be moved to is live and rearrange lines to make sure that errors
6106 will not put the overlay in an inconsistent state.
6107 (Fdelete_overlay): Cosmetics.
6108
85d0efd1
EZ
61092012-05-28 Eli Zaretskii <eliz@gnu.org>
6110
6111 * w32term.c (my_bring_window_to_top): New function.
6112 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6113 could be different from the original one.
6114 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6115 (Bug#11513)
6116
6117 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6118 by calling BringWindowToTop.
6119
6120 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6121 (WM_EMACS_END): Increase by one.
6122
da92a98c
PE
61232012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6124
6125 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6126 This avoids undefined behavior that might cause the eassert
6127 to not catch an out-of-range value.
6128
74d1f848
JB
61292012-05-28 Juanma Barranquero <lekktu@gmail.com>
6130
6131 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6132 Update dependencies.
6133
9e1a06fc
EZ
61342012-05-27 Eli Zaretskii <eliz@gnu.org>
6135
6136 * bidi.c (bidi_mirror_char): Fix last change.
6137
f3dd7312
AS
61382012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6139
6140 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6141 when referring to sectname field in printf format.
6142
81899c91
PE
61432012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6144
57b81a9f
PE
6145 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6146 Only r_alloc_inhibit_buffer_relocation needed to be added;
6147 the others were already declared.
6148
81899c91
PE
6149 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6150 before checking whether it's out of range. Put the check inside
6151 eassert. See
6152 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6153
33017faf 61542012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
6155
6156 * callproc.c (Fcall_process): Restore a line that was accidentally
6157 commented out in the 2011-02-13 change (bug#11547).
6158
33017faf 61592012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
6160
6161 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6162 defined on ralloc.c.
6163
6164 * buffer.c [REL_ALLOC]: Remove prototypes of
6165 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6166 they are now on lisp.h.
6167
6168 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6169
6170 * search.c (search_buffer): Use it to inhibit relocation of buffer
6171 text while re_search_2 is doing its job, because re_search_2 is
6172 passed C pointers to buffer text. (Bug#11519)
6173
23415acf
EZ
6174 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6175 Update value to 24.
6176
44e27368
EZ
6177 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6178 state after an additional call to move_it_in_display_line_to, keep
6179 the values of it->max_ascent and it->max_descent found for the
6180 entire line.
6181 (pos_visible_p): Revert the comparison against bottom_y to what it
6182 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6183 (Bug#11464)
6184
c1892f11
PE
61852012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6186
6187 Fix coding-related core dumps with gcc -ftrapv.
6188 The code was computing A - B, where A and B are pointers, and B is
6189 random garbage. This can lead to core dumps on platforms that
6190 have special pointer registers, and it also leads to core dumps on
6191 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6192 A - B only when B is initialized properly.
6193 * coding.c (coding_set_source, coding_set_destination): Return void.
6194 (coding_change_source, coding_change_destinations): New functions,
6195 with the old behaviors of coding_set_source and coding_set_destination.
6196 All callers that need an offset changed to use these new functions.
6197
eb7afdad
GM
61982012-05-26 Glenn Morris <rgm@gnu.org>
6199
6200 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6201
f12fdf02
EZ
62022012-05-26 Eli Zaretskii <eliz@gnu.org>
6203
53a63be6 6204 Extend mouse support on W32 text-mode console.
61b108cc
SM
6205 * xdisp.c (draw_row_with_mouse_face):
6206 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 6207
eb3f6f01 6208 * w32console.c: Include window.h.
61b108cc
SM
6209 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6210 New functions.
eb3f6f01
EZ
6211 (initialize_w32_display): Initialize mouse-highlight data.
6212
53a63be6
EZ
6213 * w32inevt.c: Include termchar.h and window.h.
6214 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6215 moves, call note_mouse_highlight. If help_echo changed, call
6216 gen_help_event to produce help-echo message in the echo area.
6217 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6218 highlight info.
6219
4cfd81f6
PE
62202012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6221
6222 * lread.c (read1): Simplify slightly to avoid an overflow warning
6223 with GCC 4.7.0 on x86-64.
6224
4446092a
EZ
62252012-05-26 Eli Zaretskii <eliz@gnu.org>
6226
6227 * bidi.c (bidi_mirror_char): Revert last change: an int is
6228 definitely wide enough here.
6229
42b2a986 62302012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 6231
42b2a986 6232 Fix integer width and related bugs (Bug#9874).
eb106a49 6233 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
6234 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6235 (string_bytes, check_sblock, allocate_string_data):
6236 (compact_small_strings, Fmake_bool_vector, make_string)
6237 (make_unibyte_string, make_multibyte_string)
6238 (make_string_from_bytes, make_specified_string)
6239 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6240 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6241 (mark_vectorlike):
6242 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6243 (allocate_pseudovector):
6244 Use int, not EMACS_INT, where int is wide enough.
6245 (inhibit_garbage_collection, Fgarbage_collect):
6246 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6247 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6248 int might not be wide enough.
6249 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6250 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6251 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6252 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6253 (bidi_level_of_next_char, bidi_move_to_visually_next):
6254 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6255 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6256 (Fkill_buffer, Fset_buffer_major_mode)
6257 (advance_to_char_boundary, Fbuffer_swap_text)
6258 (Fset_buffer_multibyte, overlays_at, overlays_in)
6259 (overlay_touches_p, struct sortvec, record_overlay_string)
6260 (overlay_strings, recenter_overlay_lists)
6261 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6262 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6263 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6264 (Foverlay_recenter, last_overlay_modification_hooks_used)
6265 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
6267 (validate_region): Omit unnecessary test for b <= e,
6268 since that's guaranteed by the previous test.
d311d28c
PE
6269 (adjust_overlays_for_delete): Avoid pos + length overflow.
6270 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6271 (report_overlay_modification):
6272 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6273 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6274 Omit pointer cast, which isn't needed anyway, and doesn't work
6275 after the EMACS_INT -> ptrdiff_t change.
02481186 6276 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
6277 * buffer.h: Adjust decls to match defn changes elsewhere.
6278 (struct buffer_text, struct buffer):
6279 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6280 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
6281 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6282 not int, to avoid needless 32-bit limit on 64-bit hosts.
6283 (exec_byte_code): Use tighter memory-full test, one that checks
6284 for alloca overflow. Don't compute the address of the object just
6285 before an array, as that's not portable. Use EMACS_INT, not
6286 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
6287 * callint.c (Fcall_interactively):
6288 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6289 * callproc.c (call_process_kill, Fcall_process):
6290 Don't assume pid_t fits into an Emacs fixnum.
6291 (call_process_cleanup, Fcall_process, child_setup):
6292 Don't assume pid_t fits into int.
6293 (call_process_cleanup, Fcall_process, delete_temp_file)
6294 (Fcall_process_region):
6295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6296 (Fcall_process): Simplify handling of volatile integers.
6297 Use int, not EMACS_INT, where int will do.
6298 * casefiddle.c (casify_object, casify_region, operate_on_word)
6299 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6301 (casify_object): Avoid integer overflow when overallocating buffer.
6302 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 6303 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
6304 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6305 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6306 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6307 integers are now checked earlier. All uses replaced with XINT.
6308 (ccl_driver):
6309 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6310 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
6311 (ccl_driver, Fregister_code_conversion_map):
6312 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
6313 (resolve_symbol_ccl_program): Check that vector header is in range.
6314 Always copy the vector, so that we can check its contents reliably
6315 now rather than having to recheck each instruction as it's being
6316 executed. Check that vector words fit in 'int'.
6317 (ccl_get_compiled_code, Fregister_ccl_program)
6318 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6319 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6320 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6321 contents are in range.
6322 (Fccl_execute_on_string): Check that status is in range.
6323 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6324 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6325 Accept and return EMACS_INT, not int, because callers can pass values
6326 out of 'int' range.
6327 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6328 (multibyte_chars_in_text, parse_str_as_multibyte)
6329 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6330 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6331 (string_escape_byte8, Fget_byte):
6332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 6333 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
6334 avoid mishandling large integers.
6335 * character.h: Adjust decls to match defn changes elsewhere.
6336 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6337 (Ffind_charset_region):
6338 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6339 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6340 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 6341 Don't assume fixnum fits in int.
d311d28c
PE
6342 (load_charset_map_from_vector, Fmap_charset_chars):
6343 Remove now-unnecessary CHECK_NATNUMs.
6344 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
6345 Don't rely on undefined behavior with signed left shift overflow.
6346 Don't assume unsigned int fits into fixnum, or that fixnum fits
6347 into unsigned int. Don't require max_code to be a valid fixnum;
6348 that's not true for gb10830 4-byte on a 32-bit host. Allow
6349 invalid_code to be a cons, for the same reason. Require code_offset
6350 to be a character. Avoid int overflow if max_char is close
6351 to INT_MAX.
6352 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6353 this is intended anyway and avoids some undefined behavior.
6354 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6355 INDEX_TO_CODE_POINT, as that's what it expects.
6356 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
6357 * charset.h (DECODE_CHAR): Return int, not unsigned;
6358 this is what was intended anyway, and it avoids undefined behavior.
6359 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6360 integer-overflow issues.
6361 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6362 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6363 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
6364 * chartab.c (Fmake_char_table, Fset_char_table_range)
6365 (uniprop_get_decoder, uniprop_get_encoder):
6366 Don't assume fixnum fits in int.
6367 * cmds.c (move_point): New function, that does the gist of
6368 Fforward_char and Fbackward_char, but does so while checking
6369 for integer overflow more accurately.
c96e5d6a 6370 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
6371 (Fforward_line, Fend_of_line, internal_self_insert)
6372 (internal_self_insert):
6373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6374 Fix a FIXME, by checking for integer overflow when calculating
6375 target_clm and actual_clm.
6376 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 6377 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
6378 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6379 (coding_alloc_by_making_gap, alloc_destination)
6380 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6381 (encode_coding_utf_16, detect_coding_emacs_mule)
6382 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6383 (detect_coding_iso_2022, decode_coding_iso_2022)
6384 (encode_invocation_designation, encode_designation_at_bol)
6385 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6386 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6387 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6388 (encode_coding_ccl, encode_coding_raw_text)
6389 (detect_coding_charset, decode_coding_charset)
6390 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6391 (produce_composition, produce_charset, produce_annotation)
6392 (decode_coding, handle_composition_annotation)
6393 (handle_charset_annotation, consume_chars, decode_coding_gap)
6394 (decode_coding_object, encode_coding_object, detect_coding_system)
6395 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6396 (code_convert_region, code_convert_string)
8f50130c
PE
6397 (Fdefine_coding_system_internal)
6398 (coding_set_source, coding_set_destination):
d311d28c
PE
6399 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6400 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6401 (Fdefine_coding_system_internal):
6402 Don't assume fixnums fit in int.
6403 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 6404 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
6405 (Funencodable_char_position, Fcheck_coding_systems_region)
6406 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 6407 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 6408 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 6409 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 6410 Don't access memory outside of the args array.
d311d28c 6411 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
6412 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6413 result of ENCODE_CHAR.
d311d28c
PE
6414 * coding.h: Adjust decls to match defn changes elsewhere.
6415 (struct coding_system):
6416 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6417 * composite.c (get_composition_id, find_composition)
6418 (run_composition_function, update_compositions)
6419 (compose_text, composition_gstring_put_cache)
6420 (composition_gstring_p, composition_gstring_width)
6421 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6422 (composition_compute_stop_pos, composition_reseat_it)
6423 (composition_update_it, struct position_record)
6424 (find_automatic_composition, composition_adjust_point)
6425 (Fcomposition_get_gstring, Ffind_composition_internal):
6426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6427 (update_compositions):
6428 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6429 * composite.h: Adjust decls to match defn changes elsewhere.
6430 (struct composition):
6431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6432 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6433 Do not attempt to compute the address of the object just before a
6434 buffer; this is not portable.
6435 (Faref, Faset):
6436 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6437 (Faset): Use int, not EMACS_INT, where int is wide enough.
6438 (Fstring_to_number): Don't assume fixnums fit in int.
6439 (Frem): Don't assume arg is nonnegative.
6440 * dbusbind.c (xd_append_arg): Check for integers out of range.
6441 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 6442 (extract_signed, extract_unsigned): New functions.
243e0530
PE
6443 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6444 (xd_get_connection_references): Return ptrdiff_t, not int.
6445 All uses changed.
6446 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6447 (xd_read_message_1):
6448 Use int, not unsigned, where the dbus API uses int.
6449 (Fdbus_message_internal): Don't overflow mtype.
6450 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
6451 * dired.c (directory_files_internal, file_name_completion, scmp)
6452 (file_name_completion_stat):
6453 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6454 (file_name_completion): Don't overflow matchcount.
6455 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6456 * dispextern.h: Adjust decls to match defn changes elsewhere.
6457 (struct text_pos, struct glyph, struct bidi_saved_info)
6458 (struct bidi_string_data, struct bidi_it, struct composition_it)
6459 (struct it):
6460 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6461 (struct display_pos, struct composition_it, struct it):
6462 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6463 * dispnew.c (increment_matrix_positions)
6464 (increment_row_positions, mode_line_string)
6465 (marginal_area_string):
6466 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 6467 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
6468 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6469 (duration_to_sec_usec): New function, to check for overflow better.
6470 (Fsleep_for, sit_for): Use it.
6471 * doc.c (get_doc_string, store_function_docstring):
6472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6473 (get_doc_string, Fsnarf_documentation):
6474 Use int, not EMACS_INT, where int is wide enough.
6475 (get_doc_string):
6476 Use SAFE_ALLOCA, not alloca.
6477 Check for overflow when converting EMACS_INT to off_t.
6478 * doprnt.c (doprnt):
6479 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6480 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6481 Don't assume uid_t fits into fixnum.
6482 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6483 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6484 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6485 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6486 (general_insert_function)
6487 (Finsert_char, make_buffer_string, make_buffer_string_both)
6488 (update_buffer_properties, Fbuffer_substring)
6489 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6490 (Fsubst_char_in_region, check_translation)
6491 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6492 (transpose_markers, Ftranspose_regions):
6493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6494 (clip_to_bounds): Move to lisp.h as an inline function).
6495 (Fconstrain_to_field): Don't assume integers are nonnegative.
6496 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6497 (Fsubst_char_in_region, Fsave_restriction):
6498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6499 (Femacs_pid): Don't assume pid_t fits into fixnum.
6500 (lo_time): Use int, not EMACS_INT, when int suffices.
6501 (lisp_time_argument): Check for usec out of range.
6502 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
6503 (Fuser_login_name, Fuser_full_name): Signal an error
6504 if a uid argument is out of range, rather than relying on
6505 undefined behavior.
c8d5c857
PE
6506 (Fformat_time_string): Remove now-unnecessary check.
6507 lisp_time_argument checks for out-of-range usec now.
243e0530 6508 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
6509 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6510 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6511 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6512 (init_cmdargs, Fdump_emacs):
6513 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6514 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6515 the bottom (typically) 32 bits of the fixnum.
6516 * eval.c (specpdl_size, call_debugger):
6517 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6518 (when_entered_debugger, Fbacktrace_debug):
6519 Don't assume fixnum can fit in int.
6520 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6521 the object just before a buffer; this is not portable.
6522 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6523 (grow_specpdl, unbind_to):
6524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6525 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6526 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 6527 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
6528 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6529 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6530 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6531 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6532 (a_write, e_write):
6533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6534 (Fcopy_file, non_regular_nbytes, read_non_regular)
6535 (Finsert_file_contents):
6536 Use int, not EMACS_INT, where int is wide enough.
6537 (READ_BUF_SIZE): Verify that it fits in int.
6538 (Finsert_file_contents): Check that counts are in proper range,
6539 rather than assuming fixnums fit into ptrdiff_t etc.
6540 Don't assume fixnums fit into int.
125b3835 6541 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
6542 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6543 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
6544 (string_char_to_byte, string_byte_to_char)
6545 (string_make_multibyte, string_to_multibyte)
6546 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6547 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6548 (substring_both, Fdelete, internal_equal, Ffillarray)
6549 (Fclear_string, mapcar1)
6550 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6551 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6552 (larger_vector, make_hash_table, maybe_resize_hash_table)
6553 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6554 (Fmaphash, secure_hash):
6555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6556 (concat): Check for string index and length overflow.
6557 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6558 (Frequire):
6559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6560 (larger_vector): New API (vec, incr_min, size_max) replaces old
6561 one (vec, new_size, init). This catches size overflow.
6562 INIT was removed because it was always Qnil.
6563 All callers changed.
6564 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6565 the upper bound on a hash table index size.
6566 (make_hash_table, maybe_resize_hash_table): Use it.
6567 (secure_hash): Computer start_byte and end_byte only after
6568 they're known to be in ptrdiff_t range.
6569 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6570 (Ffont_get_glyphs, Ffont_at):
6571 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6572 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6573 (Flist_fonts, Fopen_font):
6574 Don't assume fixnum can fit in int.
6575 (check_gstring): Don't assume index can fit in int.
6576 (font_match_p): Check that fixnum is a character, not a nonnegative
6577 fixnum, since the later code needs to stuff it into an int.
6578 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6579 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6580 conversion overflow issues.
6581 (Fopen_font): Check for integer out of range.
6582 (Ffont_get_glyphs): Don't assume index can fit in int.
6583 * font.h: Adjust decls to match defn changes elsewhere.
6584 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6585 integer overflow.
6586 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6587 printmax_t, where ptrdiff_t is wide enough.
6588 (Finternal_char_font):
6589 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6590 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6591 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6592 (Fset_frame_position, x_set_frame_parameters)
6593 (x_set_line_spacing, x_set_border_width)
6594 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6595 Check that fixnums are in proper range for system types.
6596 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6598 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6599 Use SAFE_ALLOCA_LISP, not alloca.
6600 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6601 intptr_t is wide enough.
6602 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6603 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6604 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6605 Check for fixnum out of range.
6606 * ftfont.c (ftfont_list): Don't assume index fits in int.
6607 Check that fixnums are in proper range for system types.
6608 (ftfont_shape_by_flt):
6609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
6610 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6611 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6612 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6613 Check that fixnums are in proper range for system types.
6614 * gnutls.h: Adjust decls to match defn changes elsewhere.
6615 * gtkutil.c (xg_dialog_run):
6616 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6617 (update_frame_tool_bar):
6618 Check that fixnums are in proper range for system types.
6619 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 6620 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
6621 * indent.c (last_known_column, last_known_column_point):
6622 (current_column_bol_cache):
6623 (skip_invisible, current_column, check_display_width):
6624 (check_display_width, scan_for_column, current_column_1)
6625 (Findent_to, Fcurrent_indentation, position_indentation)
6626 (indented_beyond_p, Fmove_to_column, compute_motion):
6627 (Fcompute_motion, Fvertical_motion):
6628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6629 (last_known_column_modified): Use EMACS_INT, not int.
6630 (check_display_width):
6631 (Fcompute_motion):
6632 Check that fixnums and floats are in proper range for system types.
6633 (compute_motion): Don't assume index or fixnum fits in int.
6634 (compute_motion, Fcompute_motion):
6635 Use int, not EMACS_INT, when it is wide enough.
6636 (vmotion): Omit local var start_hpos that is always 0; that way
6637 we don't need to worry about overflow in expressions involving it.
6638 * indent.h: Adjust decls to match defn changes elsewhere.
6639 (struct position):
6640 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6641 Use int, not EMACS_INT, where int is wide enough.
6642 Remove unused members ovstring_chars_done and tab_offset;
6643 all uses removed.
6644 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6645 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6646 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6647 (make_gap, copy_text, insert, insert_and_inherit)
6648 (insert_before_markers, insert_before_markers_and_inherit)
6649 (insert_1, count_combining_before, count_combining_after)
6650 (insert_1_both, insert_from_string)
6651 (insert_from_string_before_markers, insert_from_string_1)
6652 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6653 (adjust_after_replace, adjust_after_insert, replace_range)
6654 (replace_range_2, del_range, del_range_1, del_range_byte)
6655 (del_range_both, del_range_2, modify_region)
6656 (prepare_to_modify_buffer, signal_before_change)
6657 (signal_after_change, Fcombine_after_change_execute):
6658 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6659 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6660 (balance_an_interval, split_interval_right, split_interval_left)
6661 (find_interval, next_interval, update_interval)
6662 (adjust_intervals_for_insertion, delete_node, delete_interval)
6663 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6664 (static_offset_intervals, offset_intervals)
6665 (merge_interval_right, merge_interval_left, make_new_interval)
6666 (graft_intervals_into_buffer, temp_set_point_both)
6667 (temp_set_point, set_point, adjust_for_invis_intang)
6668 (set_point_both, move_if_not_intangible, get_property_and_range)
6669 (get_local_map, copy_intervals, copy_intervals_to_string)
6670 (compare_string_intervals, set_intervals_multibyte_1):
6671 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6672 * intervals.h: Adjust decls to match defn changes elsewhere.
6673 (struct interval):
6674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6675 * keyboard.c (this_command_key_count, this_single_command_key_start)
6676 (before_command_key_count, before_command_echo_length, echo_now)
6677 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6678 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6679 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6680 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6681 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6682 (last_non_minibuf_size, last_point_position, echo_truncate)
6683 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6684 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6685 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6686 (stuff_buffered_input):
6687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6688 (last_auto_save, command_loop_1, read_char):
6689 Use EMACS_INT, not int, to avoid integer overflow.
6690 (record_char): Avoid overflow in total_keys computation.
6691 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6692 * keyboard.h: Adjust decls to match defn changes elsewhere.
6693 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6694 (Fkey_description, Fdescribe_vector, Flookup_key):
6695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6696 (click_position): New function, to check that positions are in range.
6697 (Fcurrent_active_maps):
6698 (describe_command):
6699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6700 (Faccessible_keymaps, Fkey_description):
6701 (preferred_sequence_p):
6702 Don't assume fixnum can fit into int.
6703 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6704 Check for integer overflow in size calculations.
6705 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6706 avoid mishandling large integers.
6707 * lisp.h: Adjust decls to match defn changes elsewhere.
6708 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6709 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6710 (struct Lisp_Marker):
6711 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6712 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
6713 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6714 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6715 All callers changed.
6716 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6717 Assume the arg has valid form, since it always does.
6718 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6719 unsigned integer system type.
6720 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6721 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6722 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6723 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6724 (duration_to_sec_usec): New decl.
6725 * lread.c (read_from_string_index, read_from_string_index_byte)
6726 (read_from_string_limit, readchar, unreadchar, openp)
6727 (read_internal_start, read1, oblookup):
6728 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6729 (Fload, readevalloop, Feval_buffer, Feval_region):
6730 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6731 (openp): Check for out-of-range argument to 'access'.
6732 (read1): Use int, not EMACS_INT, where int is wide enough.
6733 Don't assume fixnum fits into int.
6efdadfd 6734 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
6735 (read_filtered_event): Use duration_to_sec_usec
6736 to do proper overflow checking on durations.
d311d28c
PE
6737 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6738 in size calculation.
6739 (Fexecute_kbd_macro):
6740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6741 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6742 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6743 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6744 (set_marker_both, set_marker_restricted_both, marker_position)
6745 (marker_byte_position, Fbuffer_has_markers_at):
6746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6747 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 6748 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
6749 It now merely ensures that the menu is large enough, without
6750 necessarily growing it, as this avoids some integer overflow issues.
6751 All callers changed.
6752 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6753 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6754 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6755 Use SAFE_ALLOCA_LISP, not alloca.
6756 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6757 to EMACS_INT. Check that fixnums are in proper range for system types.
6758 * minibuf.c (minibuf_prompt_width, string_to_object)
6759 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6760 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6761 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6762 (get_minibuffer, read_minibuf_unwind):
6763 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6764 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6765 this simplifies overflow checking. All callers changed.
6766 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6767 (Ftest_completion):
6768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6769 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6770 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6771 Check that fixnums are in proper range for system types.
6772 (Fx_create_frame, Fx_show_tip):
6773 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6774 * nsfont.m (ns_findfonts, nsfont_list_family):
6775 Don't assume fixnum fits in long.
6776 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6777 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6778 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6779 wide enough.
17fdb222 6780 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
6781 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6782 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6783 (PRINTDECLARE, PRINTPREPARE):
6784 (strout, print_string):
6785 (print, print_preprocess, print_check_string_charset_prop)
6786 (print_object):
6787 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6788 (PRINTDECLARE):
6789 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6791 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 6792 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 6793 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
6794 (print_error_message): Use SAFE_ALLOCA, not alloca.
6795 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
6796 (print_depth, new_backquote_output, print_number_index):
6797 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
6798 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6799 (Fset_process_window_size, Fformat_network_address)
6800 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 6801 (sigchld_handler):
d311d28c 6802 Check that fixnums are in proper range for system types.
d44287d4 6803 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
6804 Check for process-ids out of pid_t range rather than relying on
6805 undefined behavior.
e4d81efc 6806 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
6807 (Fformat_network_address, read_process_output, send_process)
6808 (Fprocess_send_region, status_notify):
6809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6810 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6811 (wait_reading_process_output, read_process_output, exec_sentinel):
6812 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6813 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6814 (Faccept_process_output): Use duration_to_sec_usec to do proper
6815 overflow checking on durations.
dde14581
PE
6816 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6817 Don't assume pid_t fits in int.
02481186
PE
6818 * process.h (struct Lisp_Process): Members tick and update_tick
6819 are now of type EMACS_INT, not int.
b62b53e8
PE
6820 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6821 configured --with-wide-int.
d311d28c
PE
6822 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6823 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6824 * search.c (looking_at_1, string_match_1):
6825 (fast_string_match, fast_c_string_match_ignore_case)
6826 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6827 (scan_newline, find_before_next_newline, search_command)
6828 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6829 (set_search_regs, wordify):
6830 (Freplace_match):
6831 (Fmatch_data):
6832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6833 (string_match_1, search_buffer, set_search_regs):
6834 (Fmatch_data):
6835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6836 (wordify): Check for overflow in size calculation.
6837 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6838 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6839 Check that fixnums are in proper range for system types.
6840 * sound.c (struct sound_device)
6841 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6842 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6843 (Fplay_sound_internal):
6844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 6845 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
6846 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6847 (Fparse_partial_sexp):
6848 Don't assume fixnums can fit in int.
6849 (struct lisp_parse_state, find_start_pos, find_start_value)
6850 (find_start_value_byte, find_start_begv)
6851 (update_syntax_table, char_quoted, dec_bytepos)
6852 (find_defun_start, prev_char_comend_first, back_comment):
6853 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6854 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6856 (Finternal_describe_syntax_value): Check that match_lisp is a
6857 character, not an integer, since the code stuffs it into int.
6858 (scan_words, scan_sexps_forward):
6859 Check that fixnums are in proper range for system types.
6860 (Fforward_word):
6861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6862 (scan_sexps_forward):
6863 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6864 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6865 * syntax.h: Adjust decls to match defn changes elsewhere.
6866 (struct gl_state_s):
6867 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
6868 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6869 MOST_POSITIVE_FIXNUM.
d311d28c
PE
6870 * sysdep.c (wait_for_termination_1, wait_for_termination)
6871 (interruptible_wait_for_termination, mkdir):
6872 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6873 (emacs_read, emacs_write):
6874 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
6875 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6876 and double all fit in int.
d311d28c
PE
6877 * term.c (set_tty_color_mode):
6878 Check that fixnums are in proper range for system types.
6879 * termhooks.h (struct input_event):
6880 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6881 * textprop.c (validate_interval_range, interval_of)
6882 (Fadd_text_properties, set_text_properties_1)
6883 (Fremove_text_properties, Fremove_list_of_text_properties)
6884 (Ftext_property_any, Ftext_property_not_all)
6885 (copy_text_properties, text_property_list, extend_property_ranges)
6886 (verify_interval_modification):
6887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6888 (Fnext_single_char_property_change)
6889 (Fprevious_single_char_property_change):
6890 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
6891 (copy_text_properties):
6892 Check for integer overflow in index calculation.
d311d28c
PE
6893 * undo.c (last_boundary_position, record_point, record_insert)
6894 (record_delete, record_marker_adjustment, record_change)
6895 (record_property_change):
6896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6897 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6898 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6899 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6900 (Fx_hide_tip, Fx_file_dialog):
6901 * w32menu.c (set_frame_menubar):
6902 Use ptrdiff_t, not int, for consistency with rest of code.
6903 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6904 (select_window, Fdelete_other_windows_internal)
6905 (window_scroll_pixel_based, window_scroll_line_based)
6906 (Frecenter, Fset_window_configuration):
6907 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6908 (Fset_window_hscroll, run_window_configuration_change_hook)
6909 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 6910 (Fscroll_other_window, Frecenter):
d311d28c
PE
6911 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6912 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6913 Don't assume fixnum fits in int.
6914 (Fset_window_scroll_bars):
6915 Check that fixnums are in proper range for system types.
6916 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6917 (string_pos, c_string_pos, number_of_chars, init_iterator)
6918 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6919 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6920 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
6921 (face_before_or_after_it_pos, handle_invisible_prop)
6922 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
6923 (display_prop_intangible_p, string_buffer_position_lim)
6924 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6925 (get_overlay_strings_1, get_overlay_strings)
6926 (iterate_out_of_display_property, forward_to_next_line_start)
6927 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6928 (get_next_display_element, set_iterator_to_next)
6929 (get_visually_first_element, compute_stop_pos_backwards)
6930 (handle_stop_backwards, next_element_from_buffer)
6931 (move_it_in_display_line_to, move_it_in_display_line)
6932 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6933 (add_to_log, message_dolog, message_log_check_duplicate)
6934 (message2, message2_nolog, message3, message3_nolog
6935 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6936 (current_message_1, truncate_echo_area, truncate_message_1)
6937 (set_message, set_message_1, store_mode_line_noprop)
6938 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6939 (text_outside_line_unchanged_p, check_point_in_composition)
6940 (reconsider_clip_changes)
6941 (redisplay_internal, set_cursor_from_row, try_scrolling)
6942 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6943 (redisplay_window, find_last_unchanged_at_beg_row)
6944 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6945 (trailing_whitespace_p, find_row_edges, display_line)
6946 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6947 (display_mode_element, store_mode_line_string)
6948 (pint2str, pint2hrstr, decode_mode_spec)
6949 (display_count_lines, display_string, draw_glyphs)
6950 (x_produce_glyphs, x_insert_glyphs)
6951 (rows_from_pos_range, mouse_face_from_buffer_pos)
6952 (fast_find_string_pos, mouse_face_from_string_pos)
6953 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6955 (safe_call, init_from_display_pos, handle_fontified_prop)
6956 (handle_single_display_spec, load_overlay_strings)
6957 (with_echo_area_buffer, setup_echo_area_for_printing)
6958 (display_echo_area, echo_area_display)
6959 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6960 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
6961 (redisplay_window, dump_glyph_row, display_mode_line)
6962 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 6963 (handle_display_spec, display_prop_string_p):
d311d28c
PE
6964 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6965 (handle_single_display_spec, build_desired_tool_bar_string)
6966 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6967 (get_specified_cursor_type):
6968 Check that fixnums are in proper range for system types.
6969 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6970 (Flookup_image_map):
6971 Don't assume fixnums fit in int.
6972 (compare_overlay_entries):
6973 Avoid mishandling comparisons due to subtraction overflow.
6974 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6975 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6976 (handle_tool_bar_click):
6977 Use int, not unsigned, since we prefer signed and the signedness
6978 doesn't matter here.
6979 (get_next_display_element, next_element_from_display_vector):
6980 Use int, not EMACS_INT, when int is wide enough.
6981 (start_hourglass): Use duration_to_sec_usec to do proper
6982 overflow checking on durations.
6983 * xfaces.c (Fbitmap_spec_p):
6984 Check that fixnums are in proper range for system types.
6985 (compare_fonts_by_sort_order):
6986 Avoid mishandling comparisons due to subtraction overflow.
6987 (Fx_family_fonts, realize_basic_faces):
6988 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6989 (Fx_family_fonts):
6990 Don't assume fixnum fits in int.
6991 Use SAFE_ALLOCA_LISP, not alloca.
6992 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6993 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6994 (face_at_buffer_position, face_for_overlay_string)
6995 (face_at_string_position):
6996 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6997 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6998 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6999 (Fx_show_tip):
7000 Check that fixnums are in proper range for system types.
7001 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7002 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7003 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7004 (Fx_change_window_property): Don't assume fixnums fit in int.
7005 * xfont.c (xfont_chars_supported):
7006 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7007 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7008 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7009 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7010 * xml.c (parse_region):
7011 * xrdb.c (magic_file_p):
7012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7013 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7014 (x_get_local_selection, x_reply_selection_request)
7015 (x_handle_selection_request, wait_for_property_change):
7016 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7017 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7018 short is wide enough.
7019 (x_send_client_event): Don't assume fixnum fits in int.
7020 * xterm.c (x_x_to_emacs_modifiers):
7021 Don't assume EMACS_INT overflows nicely into int.
7022 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7023 may come from Lisp.
7024 (handle_one_xevent): NATNUMP can eval its arg twice.
7025 (x_connection_closed):
7026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7027 * xterm.h: Adjust decls to match defn changes elsewhere.
7028 (struct scroll_bar): Use struct vectorlike_header
7029 rather than rolling our own approximation.
7030 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7031
c6574eb5
GM
70322012-05-25 Glenn Morris <rgm@gnu.org>
7033
7034 * lisp.mk (lisp): Update for more files being compiled now.
7035
e8d32c7e
SM
70362012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7037
48def666
SM
7038 * lread.c: Remove `read_pure' which makes no difference.
7039 (read_pure): Remove var.
7040 (unreadpure): Remove function.
7041 (readevalloop): Don't call read_list with -1 flag.
7042 (read1, read_vector): Don't test read_pure any more.
7043 (read_list): Simplify.
7044
e8d32c7e
SM
7045 * fileio.c, character.h: Minor style tweaks.
7046
4b2addb7
DA
70472012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7048
7049 * window.h (clip_changed): Remove useless declaration.
7050
584461b2
JB
70512012-05-22 Juanma Barranquero <lekktu@gmail.com>
7052
7053 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7054 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7055
34374650
PE
70562012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7057
7058 Remove src/m/*.
7059 This directory predates autoconf and is no longer needed nowadays.
7060 Move its few remaining bits of functionality to where they're needed.
7061 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7062 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7063 * m/template.h: Remove.
7064 * Makefile.in (M_FILE): Remove. All uses removed.
7065 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7066 * lisp.h (USE_LSB_TAG):
7067 * mem-limits.h (EXCEEDS_LISP_PTR):
7068 Use VAL_MAX, not VALBITS, in #if.
7069 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7070 (EMACS_UINT): Define unconditionally now.
7071 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7072 (BITS_PER_EMACS_INT): New constants, replacing
7073 what used to be in config.h, but not useful in #if.
7074 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7075 define them any more.
7076 (VAL_MAX): New macro.
7077 (VALMASK): Use it.
7078 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7079 BITS_PER_EMACS_INT, in #if.
7080 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7081 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7082 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7083 * s/ms-w32.h (DATA_START):
7084 Move here from removed file m/intel386.h.
7085 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7086 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7087
261cb4bb
PE
70882012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7089
7090 Assume C89 or later.
7091 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7092 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7093 (xrealloc):
7094 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7095 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7096 * textprop.c, tparam.c (NULL): Remove.
7097 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7098 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7099 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7100 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7101 * xterm.c (input_signal_count): Assume volatile works.
7102
ff23cd9f
KB
71032012-05-21 Ken Brown <kbrown@cornell.edu>
7104
7105 * xgselect.c (xg_select): Fix first argument in call to 'select'
7106 (bug#11508).
7107
1b170bc6
KB
71082012-05-20 Ken Brown <kbrown@cornell.edu>
7109
7110 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7111 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7112
b2f4d39f
KB
71132012-05-19 Ken Brown <kbrown@cornell.edu>
7114
7115 * xfns.c (x_in_use): Remove `static' qualifier.
7116 * xterm.h (x_in_use): Declare.
7117 * xgselect.c: Include xterm.h.
7118 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7119 and `display_arg' (bug#9754).
7120
003fdae2
PE
71212012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7122
9232a6d9
PE
7123 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7124
003fdae2
PE
7125 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7126 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7127
784b56e2
EZ
71282012-05-18 Eli Zaretskii <eliz@gnu.org>
7129
7130 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7131
7132 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7133 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7134
7135 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7136 reference to image_cache->refcount.
7137 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7138
a0a79cde
JL
71392012-05-17 Juri Linkov <juri@jurta.org>
7140
7141 * search.c (Fword_search_regexp, Fword_search_backward)
7142 (Fword_search_forward, Fword_search_backward_lax)
7143 (Fword_search_forward_lax): Move functions to isearch.el
7144 (bug#10145, bug#11381).
7145
b0572523
PE
71462012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7147
7148 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7149
9660f5fc
SM
71502012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7151
7152 * lread.c (init_obarray): Declare Qt and Qnil as special.
7153
4374de83
GM
71542012-05-14 Glenn Morris <rgm@gnu.org>
7155
7156 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 7157 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 7158
dc44c39a
PE
71592012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7160
078c97cb
PE
7161 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7162
dc44c39a
PE
7163 * unexaix.c: Port to more-recent AIX compilers.
7164 (report_error, report_error_1, make_hdr, copy_sym)
7165 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7166 Make arguments const char *, not char *, to avoid violations of C
7167 standard and to fix some AIX warnings reported by Gilles Pion.
7168
e18afed7 71692012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
7170
7171 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7172 already have overlays loaded.
7173 (handle_single_display_spec): Before returning without displaying
7174 fringe bitmap, synchronize the bidi iterator with the main display
7175 iterator, by calling iterate_out_of_display_property.
7176 (iterate_out_of_display_property): Detect buffer iteration by
7177 testing that it->string is a Lisp string.
7178 (get_next_display_element): When the current object is exhausted,
7179 and there's something on it->stack, call set_iterator_to_next to
7180 proceed with what's on the stack, instead of returning zero.
7181 (set_iterator_to_next): If called at the end of a Lisp string,
7182 proceed to consider_string_end without incrementing string
7183 position. Don't increment display vector index past the end of
7184 the display vector. (Bug#11417)
c8fb9dc6
EZ
7185 (pos_visible_p): Don't report a position visible when move_it_to
7186 stopped at the last line of window, which happens to be scanned
7187 backwards by the bidi iteration. (Bug#11464)
ac268e67 7188
e18afed7 71892012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
7190
7191 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7192 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
7193 are on a TTY, and thus unable to display on the fringes.
7194 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
7195 so we need to signal to the caller that this is a "replacing"
7196 display spec. This fixes display when the spec is invalid or we
7197 are on a TTY.
7198
e18afed7 71992012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
7200
7201 * unexaix.c (make_hdr): Fix typo in prototype.
7202 This bug broke the build on AIX. Problem reported by Gilles Pion.
7203
9d0a235a
MA
72042012-05-14 Michael Albinus <michael.albinus@gmx.de>
7205
7206 * keyboard.c (kbd_buffer_get_event): Read special events also in
7207 batch mode. (Bug#11415)
7208
9e6b06ed
GM
72092012-05-12 Glenn Morris <rgm@gnu.org>
7210
7211 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7212
c1a1d7a3
EZ
72132012-05-12 Eli Zaretskii <eliz@gnu.org>
7214
7215 * lisp.mk (lisp): Add newcomment.elc.
7216
3fe7cdc8
GM
72172012-05-12 Glenn Morris <rgm@gnu.org>
7218
7219 * Makefile.in (MKDIR_P): New, set by configure.
7220 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7221
53f7d2c0
PE
72222012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7223
7224 Remove unused function hourglass_started.
7225 * dispextern.h (hourglass_started):
7226 * w32fns.c (hourglass_started):
7227 * xdisp.c (hourglass_started): Remove.
7228
75aafb17
JB
72292012-05-10 Juanma Barranquero <lekktu@gmail.com>
7230
7231 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7232 Update dependencies.
7233
12959e8e
PE
72342012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7235
97107e2e
PE
7236 * xgselect.c (xg_select): Put maxfds+1 into a var.
7237 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7238
12959e8e
PE
7239 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7240
836d29b3
DA
72412012-05-10 Dave Abrahams <dave@boostpro.com>
7242
7243 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7244 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7245
5cb67954
MA
72462012-05-09 Michael Albinus <michael.albinus@gmx.de>
7247
7248 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7249 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7250 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7251 Initialize xd_registered_buses.
7252
3478ec45
PE
72532012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7254
b263a6b0
PE
7255 Untag more efficiently if USE_LSB_TAG.
7256 This is based on a proposal by YAMAMOTO Mitsuharu in
7257 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7258 For an admittedly artificial (nth 8000 longlist) benchmark on
7259 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7260 Emacs's overall text size by 1%.
7261 * lisp.h (XUNTAG): New macro.
7262 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7263 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7264 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7265 * eval.c (Fautoload):
7266 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7267 * frame.h (XFRAME): Use XUNTAG.
7268
3478ec45
PE
7269 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7270 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7271 Remove unportable assumptions about print widths of types like
7272 dbus_uint32_t.
7273 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7274 intptr_t when converting between pointer and integer, to avoid GCC
7275 warnings about wrong width.
7276
666b903b 72772012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
7278
7279 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7280 stack for each reader_thread, instead of defaulting to 8MB
7281 determined by the linker. This avoids failures in creating
7282 subprocesses on Windows 7, see the discussion in this thread:
7283 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7284
b120cc17
JC
72852012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7286
7287 Fix up display of the *Minibuf-0* buffer in the mini window.
7288 * keyboard.c (read_char): Don't clear the echo area if there's no
7289 message to clear.
7290 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 7291 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 7292
9a4b36f8
MA
72932012-05-07 Michael Albinus <michael.albinus@gmx.de>
7294
7295 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7296 batch mode.
7297
e5f9458f
CY
72982012-05-06 Chong Yidong <cyd@gnu.org>
7299
7300 * lisp.mk (lisp): Update.
7301
eceeb5fc 73022012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
7303
7304 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7305
71873e2b
SM
73062012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7307
7308 * data.c (PUT_ERROR): New macro.
7309 (syms_of_data): Use it. Add new error type `user-error'.
7310 * undo.c (user_error): New function.
7311 (Fprimitive_undo): Use it.
7312 * print.c (print_error_message): Adjust print style for `user-error'.
7313 * keyboard.c (user_error): New function.
7314 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7315
ab0fa4e4
PE
73162012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7317
7318 Do not limit current-time-string to years 1000..9999.
7319 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7320 (Fcurrent_time_string): Support any year that is supported by the
7321 underlying localtime representation. Don't use asctime, as it
7322 has undefined behavior for years outside the range -999..9999.
7323
7ed806a7
PE
73242012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7325
7326 Fix race conditions involving setenv, gmtime, localtime, asctime.
7327 Without this fix, interrupts could mess up code that uses these
7328 nonreentrant functions, since setting TZ invalidates existing
7329 tm_zone or tzname values, and since most of these functions return
7330 pointers to static storage.
7331 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7332 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7333 Grow the critical sections to include not just invoking
7334 localtime/gmtime, but also accessing these functions' results
7335 including their tm_zone values if any, and any related TZ setting.
7336 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
7337 so that the struct tm is saved in the critical section.
7338 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
7339 motivated by the fact that memory allocation needs to be outside
7340 the critical section.
7341
0c16dfed
DA
73422012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7343
7344 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7345 with RESET_INTERVAL.
7346
7347 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7348 Remove duplicated buffer name initialization.
7349
3f83ace8
JM
73502012-05-02 Jim Meyering <jim@meyering.net>
7351
7352 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7353
c7b8541e
JM
7354 * xfns.c (x_window): Use xstrdup (Bug#11375).
7355
90207a15 73562012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
7357
7358 * xdisp.c (pos_visible_p): If already at a newline from the
7359 display string before the 'while' loop, don't walk back the glyphs
7360 from it3.glyph_row. Solves assertion violation when the display
7361 string begins with a newline (egg.el). (Bug#11367)
7362
b593d6a9
AH
73632012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7364
7365 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7366 Move to simple.el.
7367
4737362e
GM
73682012-05-01 Glenn Morris <rgm@gnu.org>
7369
99cf43f9
GM
7370 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7371 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7372 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7373 All were removed before 23.1.
7374
9311dcff
GM
7375 * dispnew.c: Remove HAVE_LIBNCURSES test;
7376 it is always true on relevant platforms.
7377
4d5c6349
GM
7378 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7379 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7380
4737362e
GM
7381 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7382
74dd3a6b
AS
73832012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7384
7385 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7386 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7387 Remove.
7388
13c379ee
PE
73892012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 Do not avoid creating empty evaporating overlays (Bug#9642).
7392 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7393 That is, do not delete an evaporating overlay if it becomes
7394 empty after its bounds are adjusted to fit within its buffer.
7395 This fix caused other problems, and I'm reverting it until we get
7396 to the bottom of them.
7397
a8e7d6d7 73982012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
7399
7400 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7401
a8e7d6d7 74022012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
7403
7404 * xdisp.c (pos_visible_p): If the window start position is beyond
7405 ZV, start the display from buffer beginning. Prevents assertion
7406 violation in init_iterator when the minibuffer window is scrolled
7407 via the scroll bar.
7408
7409 * window.c (window_scroll_pixel_based): Likewise.
7410
a8e7d6d7 74112012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
7412
7413 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7414
a8e7d6d7 74152012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
7416
7417 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7418 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7419
a8e7d6d7 74202012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 7421
b593d6a9
AH
7422 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7423 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 7424
1c6900d9
EZ
74252012-04-26 Eli Zaretskii <eliz@gnu.org>
7426
4c3fa1d9
EZ
7427 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7428 display element, check also the underlying string or buffer
7429 character. (Bug#11341)
7430
1c6900d9
EZ
7431 * w32menu.c: Include w32heap.h.
7432 (add_menu_item): If the call to AppendMenuW (via
7433 unicode_append_menu) fails, disable Unicode menus only if we are
7434 running on Windows 9X/Me.
7435
42bf8205
AS
74362012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7437
7438 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7439 (xgetint): Add missing shift for LSB tags.
7440
b1bac16e
MR
74412012-04-24 Martin Rudalics <rudalics@gmx.at>
7442
7443 * keyboard.c (read_char): Don't wipe echo area for select window
7444 events: These might get delayed via `mouse-autoselect-window'
7445 (Bug#11304).
7446
d69621cc
JB
74472012-04-24 Juanma Barranquero <lekktu@gmail.com>
7448
7449 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7450 manipulation of :loaded-from data.
7451
02fd101b
JB
74522012-04-23 Juanma Barranquero <lekktu@gmail.com>
7453
7454 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7455 now a cons (bug#11311).
7456
888bec30
PE
74572012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7458
89a438bd
PE
7459 Do not create empty overlays with the evaporate property (Bug#9642).
7460 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7461 if it becomes empty after its bounds are adjusted to fit within
7462 its buffer. Without this fix, in a nonempty buffer (let ((o
7463 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7464 yields an empty overlay that has the evaporate property, which is
7465 not supposed to happen.
7466
1068fe4d
PE
7467 Fix minor GTK3 problems found by static checking.
7468 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7469 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7470 (struct _EmacsFixedClass, emacs_fixed_get_type):
7471 Move decls here from emacsgtkfixed.h, since they needn't be public.
7472 (emacs_fixed_get_type): Now static.
7473 (emacs_fixed_class_init): Omit unused local.
7474 (emacs_fixed_child_type): Remove; unused.
7475 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7476 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7477 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7478 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7479 (EMACS_FIXED_GET_CLASS): Remove; unused.
7480 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7481
888bec30
PE
7482 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7483 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7484
de85e130
PE
74852012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7486
d0baac98 7487 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 7488 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
7489 (__malloc_size_t, __malloc_ptrdiff_t):
7490 Remove. All uses removed, replaced by the definiens if needed,
7491 since we can assume C89 or better now.
7492 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7493 (protect_malloc_state, align, get_contiguous_space)
7494 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7495 (malloc_atfork_handler_child, malloc_enable_thread)
7496 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7497 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7498 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7499 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7500 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7501 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7502 Define using prototypes, not old style.
7503 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7504 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7505 (align): Don't assume that signed integer overflow wraps around.
7506 Omit unused local var.
7507 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7508 (_free_internal_nolock, memalign, mallochook, reallochook):
7509 Omit no-longer-needed casts.
7510 (valloc): Use getpagesize, not __getpagesize.
7511 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7512 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7513
de85e130
PE
7514 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7515
dcbf5805
MA
75162012-04-22 Michael Albinus <michael.albinus@gmx.de>
7517
7518 Move functions from C to Lisp. Make non-blocking method calls
7519 the default. Implement further D-Bus standard interfaces.
7520
7521 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7522 (QCdbus_request_name_allow_replacement)
7523 (QCdbus_request_name_replace_existing)
7524 (QCdbus_request_name_do_not_queue)
7525 (QCdbus_request_name_reply_primary_owner)
7526 (QCdbus_request_name_reply_in_queue)
7527 (QCdbus_request_name_reply_exists)
7528 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7529 (QCdbus_registered_serial, QCdbus_registered_method)
7530 (QCdbus_registered_signal): New Lisp objects.
7531 (XD_DEBUG_MESSAGE): Use sizeof.
7532 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7533 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7534 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7535 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7536 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7537 (xd_signature, xd_append_arg): Allow float for integer types.
7538 (xd_get_connection_references): New function.
b593d6a9
AH
7539 (xd_get_connection_address): Rename from xd_initialize.
7540 Return cached address.
dcbf5805
MA
7541 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7542 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7543 level.
7544 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 7545 Return number of refcounts.
dcbf5805
MA
7546 (Fdbus_get_unique_name): Make stronger parameter check.
7547 (Fdbus_message_internal): New defun.
7548 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7549 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7550 (Fdbus_send_signal, Fdbus_register_service)
7551 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7552 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7553 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7554 (Vdbus_compiled_version, Vdbus_runtime_version)
7555 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7556 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7557 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
7558 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7559 Adapt docstring.
dcbf5805 7560
52828e02
PE
75612012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7562
da05bc4c
PE
7563 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7564 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7565 Do not assume ptrdiff_t is the same width as 'int'.
7566
52828e02
PE
7567 * alloc.c: Handle unusual debugging option combinations.
7568 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7569 since the two debugging options are incompatible.
7570 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7571 is defined.
7572 (mem_init, mem_insert, mem_insert_fixup):
7573 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7574 (NEED_MEM_INSERT): Remove; no longer needed.
7575
f01769f9
LL
75762012-04-22 Leo Liu <sdl.web@gmail.com>
7577
7578 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7579
5790543d
PE
75802012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7581
7582 * sysdep.c [__FreeBSD__]: Minor cleanups.
7583 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7584 Use Emacs indenting style more consistently. Avoid some casts.
7585 Use 'double' consistently rather than mixing 'float' and 'double'.
7586
b91b7e4d
EW
75872012-04-21 Eduard Wiebe <usenet@pusto.de>
7588
b593d6a9
AH
7589 * sysdep.c (list_system_processes, system_process_attributes):
7590 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 7591
6114eb15
AS
75922012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7593
7594 * lisp.mk (lisp): Update.
7595
2f38dff7
PE
75962012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7597
7598 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7599 It is never used otherwise.
7600
4ae29f89
SM
76012012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7602
7603 * print.c (print_preprocess): Only check print_depth if print-circle
7604 is nil.
7605 (print_object): Check for cycles even when print-circle is nil and
7606 print-gensym is t, but only check print_depth if print-circle is nil.
7607
f30d612a
CY
76082012-04-20 Chong Yidong <cyd@gnu.org>
7609
7610 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7611 set the status to "failed" and ensure that sentinel is run.
7612
c07a4c0b 76132012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
7614
7615 * process.c (Fset_process_inherit_coding_system_flag)
7616 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 7617 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 7618
c07a4c0b 76192012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
7620
7621 * xdisp.c (string_buffer_position_lim): Limit starting position to
7622 BEGV.
7623 (set_cursor_from_row): If called for a mode-line or header-line
7624 row, return zero immediately.
7625 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
7626 farther than the first row after the header line, if any.
7627 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
7628 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7629
c07a4c0b 76302012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 7631
4ae29f89
SM
7632 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7633 (bug#11238).
ad3a2b41 7634
c07a4c0b 76352012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 76362012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
7637
7638 configure: new option --enable-gcc-warnings (Bug#11207)
7639 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7640 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7641 (ALL_CFLAGS): Use new macros rather than old.
7642 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7643 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7644 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7645 -Wunused-result, -Wunused-variable. This should go away once
7646 the Emacs and Gnulib regex code is merged.
7647 (xmalloc, xrealloc): Now static.
7648
aba027e8
PE
76492012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7650
7651 * dired.c (Fsystem_groups): Remove unused local.
7652
e5a36063
GM
76532012-04-17 Glenn Morris <rgm@gnu.org>
7654
7655 * dired.c (Fsystem_users): Doc fix.
7656
316411f0
DA
76572012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7658
7659 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7660 (syms_of_dired): Add them.
7661
9426aba4
PE
76622012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7663
b62a57be
PE
7664 Fix minor alloc.c problems found by static checking.
7665 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7666 New extern decls, to avoid calling undeclared functions.
7667 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7668 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7669 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7670 (NEED_MEM_INSERT): New macro.
7671 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 7672 Remove one incorrect comment and fix another.
b62a57be 7673
3539f31f
PE
7674 Fix minor ralloc.c problems found by static checking.
7675 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7676 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7677 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7678 (r_alloc_sbrk): Now static.
7679
a041960a
PE
7680 Improve ralloc.c interface checking.
7681 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7682 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7683 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7684 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7685 [REL_ALLOC]: ... to here, to check interface.
7686 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7687 Remove decls. This fixes an "It stinks!".
7688
9426aba4
PE
7689 * alloc.c (which_symbols): Fix alignment issue / type clash.
7690
d55c12ed
AS
76912012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7692
7693 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7694 (struct Lisp_Misc_Any): Likewise.
7695 (struct Lisp_Free): Likewise.
7696 * alloc.c (union aligned_Lisp_Symbol): Define.
7697 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7698 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7699 (union aligned_Lisp_Misc): Define.
7700 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7701 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 7702 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 7703
b948ce8b
PE
77042012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7705
7706 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7707 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7708 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7709 * s/netbsd.h, s/sol2-6.h:
7710 Remove definition of GC_MARK_STACK, since the default now works.
7711 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7712 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7713 no longer the default.
7714 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7715
35dc09a1 77162012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 7717
35dc09a1
GM
7718 * lread.c (lisp_file_lexically_bound_p):
7719 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 7720
35dc09a1
GM
77212012-04-14 Eli Zaretskii <eliz@gnu.org>
7722
7723 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7724 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7725
77262012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7727
7728 * nsterm.m (constrainFrameRect): Always constrain when there is only
7729 one screen (Bug#10962).
7730
bcd86815
KB
77312012-04-13 Ken Brown <kbrown@cornell.edu>
7732
7733 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7734
c25df26e
RT
77352012-04-13 Reuben Thomas <rrt@sc3d.org>
7736
7737 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7738
0fc59f1e
DC
77392012-04-11 Daniel Colascione <dancol@dancol.org>
7740
7741 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7742 against is gone. It's better to use vfork now so that when Cygwin
7743 gains a new, working vfork, we use it automatically (bug#10398).
7744
de8c03dc
SM
77452012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7746
7747 * window.c (save_window_save): Obey window-point-insertion-type.
7748
2f097256
GM
77492012-04-11 Glenn Morris <rgm@gnu.org>
7750
7751 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7752
453b951e
SM
77532012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7754
7755 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7756
75f1671a 77572012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
7758
7759 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7760 (force_quit_count): New var.
7761 (handle_interrupt): Use it.
7762
2a8ce227
JB
77632012-04-10 Juanma Barranquero <lekktu@gmail.com>
7764
7765 * w32.c (w32_delayed_load): Record the full path of the library
7766 being loaded (bug#10424).
7767
935396c0
GM
77682012-04-09 Glenn Morris <rgm@gnu.org>
7769
05920a43
GM
7770 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7771 not just in the obarray, before snarfing them. (Bug#11036)
7772
935396c0
GM
7773 * Makefile.in ($(leimdir)/leim-list.el):
7774 Pass EMACS rather than BUILT_EMACS.
7775
a18ecafa
TZ
77762012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7777
7778 * process.c (make_process):
7779 * process.h: Add integer `gnutls_handshakes_tried' member to
7780 process struct.
7781
6bbef4e5
JC
7782 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7783 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
7784
7785 * gnutls.c (gnutls_log_function2i): Convenience log function.
7786 (emacs_gnutls_read): Use new log functions,
7787 `gnutls_handshakes_tried' process member, and
7788 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7789 attempts per process (connection).
7790
b4d3bc10
CY
77912012-04-09 Chong Yidong <cyd@gnu.org>
7792
7793 * eval.c (Fuser_variable_p, user_variable_p_eh)
7794 (lisp_indirect_variable): Functions deleted.
7795 (Fdefvar): Caller changed.
7796
7797 * callint.c (Finteractive, Fcall_interactively):
7798 * minibuf.c (Fread_variable): Callers changed.
7799
70f4d973
EZ
78002012-04-09 Eli Zaretskii <eliz@gnu.org>
7801
7802 * xdisp.c (set_cursor_from_row): If the display string appears in
7803 the buffer at position that is closer to point than the position
7804 after the display string, display the cursor on the first glyph of
7805 the display string. Fixes cursor display when a 'display' text
7806 property immediately follows invisible text. (Bug#11094)
7807
cb3c2e3e
PE
78082012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7809
7810 composite.c: use 'double' consistently
7811 * composite.c (get_composition_id): Use 'double' consistently
7812 instead of converting 'float' to 'double' and vice versa; this is
7813 easier to understand and avoids a GCC warning.
7814
fd06db5d
GM
78152012-04-09 Glenn Morris <rgm@gnu.org>
7816
50fe702a
GM
7817 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7818 preparation for dumping it with emacs. (Bug#4789)
7819 (leimdir): New variable.
7820 ($(leimdir)/leim-list.el): New rule.
7821 (emacs$(EXEEXT)): Depend on leim-list.el.
7822
fd06db5d
GM
7823 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7824 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7825 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7826
55c131ee
AS
78272012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7828
7829 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7830 proper alignment.
7831
9209588f
JB
78322012-04-07 Juanma Barranquero <lekktu@gmail.com>
7833
7834 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7835 Remove unused local variable.
7836
e3fb2efb
PE
78372012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7838
7839 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7840 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7841 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7842 objects, as mark_maybe_pointer will catch them otherwise.
7843 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7844 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7845
b5385551
PE
78462012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7847
7848 Fix typo that broke non-Windows builds.
7849 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7850
9078ead6
EZ
78512012-04-07 Eli Zaretskii <eliz@gnu.org>
7852
7853 Support building on MS-Windows with libxml2.
7854
7855 * makefile.w32-in (OBJ2): Add xml.$(O).
7856 (GLOBAL_SOURCES): Add xml.c.
7857 ($(BLD)/xml.$(O)): New dependency list.
7858
7859 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7860 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7861 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7862 [!WINDOWSNT]: New macros.
7863 (init_libxml2_functions, libxml2_loaded_p): New functions.
7864 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7865 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7866 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7867 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7868 linked in).
6bbef4e5
JC
7869 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7870 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
7871 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7872
7873 * emacs.c: Don't include libxml/parser.h.
7874 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7875 xmlCleanupParser directly.
7876
7877 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7878
3811fdf3
EZ
78792012-04-07 Eli Zaretskii <eliz@gnu.org>
7880
7881 * indent.c (Fvertical_motion): If there is a display string at
7882 point, use it.vpos to compute how many lines to backtrack after
7883 move_it_to point. (Bug#11133)
7884
2f8e16b2
EZ
78852012-04-06 Eli Zaretskii <eliz@gnu.org>
7886
7887 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7888 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7889 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7890 macros related to unification of CJK characters. For the details,
7891 see the discussion following the message here:
7892 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7893
3d439cd1
CY
78942012-04-04 Chong Yidong <cyd@gnu.org>
7895
7896 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7897
8bc53d00
EZ
78982012-04-01 Eli Zaretskii <eliz@gnu.org>
7899
7900 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7901 instead of alloca. (Bug#11138)
7902
3b0512a3
AS
79032012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7904
7905 * w32menu.c (is_simple_dialog): Properly check lisp types.
7906 (Bug#11141)
7907
8427ddd2
EZ
79082012-03-31 Eli Zaretskii <eliz@gnu.org>
7909
979022ef
EZ
7910 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7911 position we get to after a call to move_it_to fails the
7912 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7913 only if we wind up in a string from display property. (Bug#11063)
7914
a6b1c7cc
EZ
7915 * window.c (Fdelete_other_windows_internal): Invalidate the row
7916 and column information about mouse highlight, so that redisplay
7917 restores it after reallocating the glyph matrices. (Bug#7464)
7918
8427ddd2
EZ
7919 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7920 string comes from a `display' text property, use the buffer
7921 position of that property as if we actually saw that position in
7922 the row's glyphs.
697ba24b
EZ
7923 (move_it_by_lines): Remove the assertion that
7924 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7925 violated when there's a before-string at the beginning of a line.
7926 (Bug#11063)
8427ddd2 7927
65a0a738
EZ
79282012-03-30 Eli Zaretskii <eliz@gnu.org>
7929
7930 * xdisp.c (append_space_for_newline): If the default face was
7931 remapped, use the remapped face for the appended newline.
7932 (extend_face_to_end_of_line): Use the remapped default face for
7933 extending the face to the end of the line.
7934 (display_line): Call extend_face_to_end_of_line when the default
7935 face was remapped. (Bug#11068)
7936
581355cc
EZ
79372012-03-29 Eli Zaretskii <eliz@gnu.org>
7938
7939 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7940
e8fc049f
SM
79412012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7942
7943 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7944
4fb9a543
GM
79452012-03-27 Glenn Morris <rgm@gnu.org>
7946
7947 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7948 Doc fixes.
7949
679910f1
KH
79502012-03-26 Kenichi Handa <handa@m17n.org>
7951
7952 * dispextern.h (struct glyph): Fix previous change. Change the
7953 bit length of glyphless.ch to 25 (Bug#11082).
7954
90d49b7f
CY
79552012-03-26 Chong Yidong <cyd@gnu.org>
7956
7957 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7958 (command_loop_1): Use it; inhibit selection update for
7959 handle-select-window too (Bug#8996).
7960
f514f6f0
FP
79612012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7962
e8fc049f 7963 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 7964
bf43fa51
KH
79652012-03-25 Kenichi Handa <handa@m17n.org>
7966
7967 * dispextern.h (struct glyph): Change the bit length of
7968 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7969
8a0c01dd
EZ
79702012-03-24 Eli Zaretskii <eliz@gnu.org>
7971
7972 * s/ms-w32.h (tzname): Include time.h before redirecting to
7973 _tzname. Fixes the MSVC build. (Bug#9960)
7974
7d1c3a76
AS
79752012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7976
8ed79523
AS
7977 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7978 characters.
7979
7d1c3a76
AS
7980 * xterm.c (XTread_socket): Only modify handling_signal if
7981 !SYNC_INPUT. (Bug#11080)
7982
e99a9b8b
EZ
79832012-03-23 Eli Zaretskii <eliz@gnu.org>
7984
7985 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7986 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7987 when fetching a multibyte character consumes more bytes than
7988 CHAR_BYTES returns, due to unification of CJK characters in
7989 string_char. (Bug#11073)
7990
5063c0e1
TN
79912012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7992
7993 * process.c (wait_reading_process_output): Handle pty disconnect
7994 by refraining from sending oneself a SIGCHLD (bug#10933).
7995
9f851fbd
CY
79962012-03-22 Chong Yidong <cyd@gnu.org>
7997
7998 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7999
5063c0e1 8000 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8001 Mark string as coming from a prefix property.
8002 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8003 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8004
fb5b8aca
CY
80052012-03-21 Chong Yidong <cyd@gnu.org>
8006
8007 * xfaces.c (Vface_remapping_alist): Doc fix.
8008
62356a1b
EZ
80092012-03-20 Eli Zaretskii <eliz@gnu.org>
8010
8011 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8012 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8013 Doc fixes.
62356a1b 8014
025de85b
CY
80152012-03-20 Chong Yidong <cyd@gnu.org>
8016
8017 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8018 to reflect default non-nil value of redisplay-dont-pause.
8019
4827f94e
KH
80202012-03-19 Kenichi Handa <handa@m17n.org>
8021
8022 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8023 it fit in a valid range (Bug#11003).
8024
e50a24a2
EZ
80252012-03-18 Eli Zaretskii <eliz@gnu.org>
8026
8027 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8028 that is not from display property, accept the row as a "cursor
8029 row" if one of the string's character has a non-nil `cursor'
8030 property. Fixes cursor positioning when there are newlines in
8031 overlay strings, e.g. in icomplete.el. (Bug#11035)
8032
9af5ed87
PE
80332012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8034
8035 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8036
d1f55f16
CY
80372012-03-12 Chong Yidong <cyd@gnu.org>
8038
8039 * eval.c (inhibit_lisp_code): Rename from
8040 inhibit_window_configuration_change_hook; move from window.c.
8041
8042 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8043 * window.c (run_window_configuration_change_hook)
8044 (syms_of_window): Callers changed.
8045
66c5eebd
CY
80462012-03-11 Chong Yidong <cyd@gnu.org>
8047
413df973
CY
8048 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8049
66c5eebd
CY
8050 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8051
1de11f56
CY
80522012-03-10 Chong Yidong <cyd@gnu.org>
8053
8054 * frame.c (other_visible_frames): Don't assume the selected frame
8055 is visible (Bug#10955).
8056
cae07000
SM
80572012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8058
8059 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8060
89c94350
JD
80612012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8062
8063 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8064 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8065 zero (Bug#10954).
8066
999dd333
GM
80672012-03-03 Glenn Morris <rgm@gnu.org>
8068
01a6dcc8 8069 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8070
de0100f2
EZ
80712012-03-02 Eli Zaretskii <eliz@gnu.org>
8072
8073 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8074 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8075 (redisplay_window, next_element_from_string): Fix typos in
8076 comments.
3e441275
EZ
8077 (redisplay_window): Pass to move_it_vertically the margin in
8078 pixels, not in screen lines.
de0100f2 8079
96a72ee9
GM
80802012-03-02 Glenn Morris <rgm@gnu.org>
8081
8082 * buffer.c (buffer-list-update-hook): Doc fix.
8083
312508d7
EZ
80842012-02-29 Eli Zaretskii <eliz@gnu.org>
8085
8086 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8087 push_it before setting up the iterator for the first overlay
8088 string, even if we have an empty string loaded.
8089 (next_overlay_string): If there's an empty string on the iterator
8090 stack, pop the stack. (Bug#10903)
8091
27f3c637
PE
80922012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8093
8094 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8095 Suggested by Stefan Monnier in
8096 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8097 * alloc.c (widen_to_Lisp_Object): New static function.
8098 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8099 and widening them to Lisp_Objects. This would work even if
8100 USE_LSB_TAG is defined and wide integers are used, which might
8101 happen in a future version of Emacs.
8102
3c9dfce6
CY
81032012-02-25 Chong Yidong <cyd@gnu.org>
8104
fa74b241
CY
8105 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8106 Doc fix.
8107
3c9dfce6
CY
8108 * xselect.c (Fx_selection_exists_p): Doc fix.
8109 (x_clipboard_manager_save_all): Print an informative message
8110 before saving to clipboard manager.
8111
9486df08
CY
81122012-02-24 Chong Yidong <cyd@gnu.org>
8113
8114 * keyboard.c (process_special_events): Handle all X selection
8115 requests in kbd_buffer, not just the next one (Bug#8869).
8116
f01d3321
CY
81172012-02-23 Chong Yidong <cyd@gnu.org>
8118
8119 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8120 call when setting menu-bar-lines and tool-bar-lines parameters.
8121 (unwind_create_frame_1): New helper function.
8122
8123 * window.c (inhibit_window_configuration_change_hook): New var.
8124 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8125 (syms_of_window): Initialize it.
f01d3321 8126
86b847b6
CY
81272012-02-22 Chong Yidong <cyd@gnu.org>
8128
8129 * xterm.c (x_draw_image_relief): Add missing type check for
8130 Vtool_bar_button_margin (Bug#10743).
8131
a59225b1
CY
81322012-02-21 Chong Yidong <cyd@gnu.org>
8133
8134 * fileio.c (Vfile_name_handler_alist): Doc fix.
8135
8136 * buffer.c (Fget_file_buffer): Protect against invalid file
8137 handler return value.
8138
310f5bd4
PE
81392012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8140
cb3a28cc
PE
8141 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8142 when computing $valmask.
8143
310f5bd4
PE
8144 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8145 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8146 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8147 It's useless in that case, and it can cause problems on hosts
8148 that allocate halves of EMACS_INT values separately.
8149 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8150 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8151 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8152 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8153 it avoids undefined behavior on hosts where shifting right by more
8154 than the word width has undefined behavior.
8155
2375c96a
CY
81562012-02-19 Chong Yidong <cyd@gnu.org>
8157
8158 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8159 (Funhandled_file_name_directory, Ffile_name_as_directory)
8160 (Fdirectory_file_name, Fexpand_file_name)
8161 (Fsubstitute_in_file_name): Protect against invalid file handler
8162 return values (Bug#10845).
8163
3eb49e71
EZ
81642012-02-18 Eli Zaretskii <eliz@gnu.org>
8165
8166 * .gdbinit (pitx): Fix incorrect references to fields of the
8167 iterator stack.
8168
7b926f3f
CY
81692012-02-17 Chong Yidong <cyd@gnu.org>
8170
8171 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8172
11273115
PE
81732012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8174
8175 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8176 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8177
c3a70e2b
CY
81782012-02-15 Chong Yidong <cyd@gnu.org>
8179
8180 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8181 marked as special. Also, starting docstrings with * is obsolete.
8182
0ca43699
AS
81832012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8184
8185 * gnutls.c (emacs_gnutls_write): Fix last change.
8186
2e8f3c56
LI
81872012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8188
8189 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8190 send_process.
8191
af70074f
SM
81922012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8193
8194 * keymap.c (Fsingle_key_description): Handle char ranges.
8195
95986d52
CY
81962012-02-12 Chong Yidong <cyd@gnu.org>
8197
afd83bd1
CY
8198 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8199 as that creates a dangerous corner case.
8200
95986d52
CY
8201 * window.c (Fdelete_window_internal): Invalidate the mouse
8202 highlight (Bug#9904).
8203
bd7da63e
GM
82042012-02-12 Glenn Morris <rgm@gnu.org>
8205
8206 * xselect.c (Fx_own_selection_internal)
8207 (Fx_get_selection_internal, Fx_disown_selection_internal)
8208 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8209 * nsselect.m (Fx_own_selection_internal)
8210 (Fx_disown_selection_internal, Fx_selection_exists_p)
8211 (Fx_selection_owner_p, Fx_get_selection_internal):
8212 Sync docs and argument specs with the xselect.c versions.
8213
77abcbc2
LI
82142012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8215
8216 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8217
90b671e2
EZ
82182012-02-11 Eli Zaretskii <eliz@gnu.org>
8219
1c0ca0b7
EZ
8220 * w32select.c (Fx_selection_exists_p): Sync doc string and
8221 argument list with xselect.c. (Bug#10783)
8222
8223 * w16select.c (Fx_selection_exists_p): Sync doc string and
8224 argument list with xselect.c. (Bug#10783)
90b671e2 8225
49241268
GM
82262012-02-10 Glenn Morris <rgm@gnu.org>
8227
8228 * fns.c (Fsecure_hash): Doc fix.
8229
f998bbe7 82302012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
8231
8232 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8233
0992bd9c
CY
82342012-02-07 Chong Yidong <cyd@gnu.org>
8235
8236 * buffer.c (Fbuffer_local_variables)
8237 (buffer_lisp_local_variables): Handle unbound vars correctly;
8238 don't let Qunbound leak into Lisp.
8239
af008560
GM
82402012-02-07 Glenn Morris <rgm@gnu.org>
8241
dd605cc4
GM
8242 * image.c (Fimagemagick_types): Doc fix.
8243
af008560
GM
8244 * image.c (imagemagick-render-type): Change it from a lisp object
8245 to an integer. Move the doc here from the lisp manual.
8246 Treat all values not equal to 0 the same.
8247
1449fa1d
CY
82482012-02-06 Chong Yidong <cyd@gnu.org>
8249
8250 * doc.c (store_function_docstring): Avoid applying docstring of
8251 alias to base function (Bug#2603).
8252
3723ec07
AS
82532012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8254
8255 * .gdbinit (pp1, pv1): Remove redundant defines.
8256 (pr): Use pp.
8257
79c1cc1e
CY
82582012-02-04 Chong Yidong <cyd@gnu.org>
8259
8260 * nsterm.m: Declare a global (Bug#10694).
8261
d7f29f8e
EZ
82622012-02-04 Eli Zaretskii <eliz@gnu.org>
8263
cae07000
SM
8264 * w32.c (get_emacs_configuration_options):
8265 Include --enable-checking, if specified, in the return value.
d7f29f8e 8266
3b95a6f9
MR
82672012-02-04 Martin Rudalics <rudalics@gmx.at>
8268
8269 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8270 after rounding frame sizes. (Bug#9723)
8271
d6fa96a6
EZ
82722012-02-04 Eli Zaretskii <eliz@gnu.org>
8273
8274 * keyboard.c (adjust_point_for_property): Don't position point
8275 before BEGV. (Bug#10696)
8276
df0b2940
PE
82772012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8278
8279 Handle overflow when computing char display width (Bug#9496).
8280 * character.c (char_width): Return EMACS_INT, not int.
8281 (char_width, c_string_width): Check for overflow when
8282 computing the width; this is possible now that individual
8283 characters can have unbounded width. Problem introduced
8284 by merge from Emacs 23 on 2012-01-19.
8285
6bee44d6
MA
82862012-02-02 Michael Albinus <michael.albinus@gmx.de>
8287
8288 * dbusbind.c (Fdbus_register_method): Mention the return value
8289 :ignore in the docstring.
8290
44f92739
GM
82912012-02-02 Glenn Morris <rgm@gnu.org>
8292
1b9f60cc
GM
8293 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8294
44f92739
GM
8295 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8296 Unconditionally set to t. (Bug#10673)
8297 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8298 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8299 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8300
c5d3843c
KH
83012012-02-02 Kenichi Handa <handa@m17n.org>
8302
8303 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8304 0, do not call append_composite_glyph.
8305
159462d4 83062012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
8307
8308 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8309 NULL (Bug#6988).
8310 (x_produce_glyphs): If the component of a composition is a null
8311 string, set it->pixel_width to 1 to avoid zero-width glyph.
8312
78cef877
EZ
83132012-02-01 Eli Zaretskii <eliz@gnu.org>
8314
8315 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8316 first 2 arguments are identical. This makes inserting large
8317 output from a subprocess an order of magnitude faster on
8318 MS-Windows, where all sbrk'ed memory is always contiguous.
8319
97897668
GM
83202012-01-31 Glenn Morris <rgm@gnu.org>
8321
8322 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 8323 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
8324 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8325
31fd3586
GM
83262012-01-29 Glenn Morris <rgm@gnu.org>
8327
8328 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8329
0e24a8b2
CY
83302012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8331
8332 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8333
cc0adcb0
CY
83342012-01-28 Chong Yidong <cyd@gnu.org>
8335
8336 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8337
acc28cb9
CY
83382012-01-26 Chong Yidong <cyd@gnu.org>
8339
9c69cfb7
CY
8340 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8341
acc28cb9
CY
8342 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8343 repeat counts (Bug#10507).
8344
48da7392
GM
83452012-01-26 Glenn Morris <rgm@gnu.org>
8346
8347 * lread.c (syms_of_lread): Doc fix.
8348
14af5f7f
CY
83492012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8350
8351 * coding.c (encode_designation_at_bol): Change return value to
8352 EMACS_INT.
8353
0b21c100
CY
83542012-01-25 Chong Yidong <cyd@gnu.org>
8355
8356 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8357
3c2907f7
CY
83582012-01-21 Chong Yidong <cyd@gnu.org>
8359
8360 * floatfns.c (Fcopysign): Make the second argument non-optional,
8361 since nil is not allowed anyway.
8362
959ad23f
AS
83632012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8364
8365 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8366 (send_process): Likewise.
8367
34a02f46
MR
83682012-01-19 Martin Rudalics <rudalics@gmx.at>
8369
8370 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
8371 (Vwindow_persistent_parameters): Do not use Qstate.
8372 Rewrite doc-strings.
34a02f46 8373
1259009a 83742012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
8375
8376 * character.c (char_width): New function.
70d4fdf6
GM
8377 (Fchar_width, c_string_width, lisp_string_width):
8378 Use char_width (Bug#9496).
25ed9e61 8379
6a6ee00d
MR
83802012-01-16 Martin Rudalics <rudalics@gmx.at>
8381
8382 * window.c (Vwindow_persistent_parameters): New variable.
8383 (Fset_window_configuration, save_window_save): Handle persistent
8384 window parameters.
8385
c85efaf7
EZ
83862012-01-14 Eli Zaretskii <eliz@gnu.org>
8387
8388 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8389 thrashing the stack of the thread. (Bug#9087)
8390
5944709e
PE
83912012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8392
8393 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8394
e71f5d99
EZ
83952012-01-11 Eli Zaretskii <eliz@gnu.org>
8396
8397 * xdisp.c (rows_from_pos_range): Handle the case where the
8398 highlight ends on a newline. (Bug#10464)
8399 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8400 he end column for display of highlight that ends on a newline
8401 before a R2L line.
8402
ce316182
GM
84032012-01-11 Glenn Morris <rgm@gnu.org>
8404
8405 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8406 from load-path also when installation-directory is nil. (Bug#10208)
8407
5b43da69
GM
84082012-01-10 Glenn Morris <rgm@gnu.org>
8409
74cc8ff9
GM
8410 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8411
7d8d6e4e
GM
8412 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8413 Update template values to be closer to their typical values these days.
5b43da69 8414
a0db8d43
EZ
84152012-01-09 Eli Zaretskii <eliz@gnu.org>
8416
8417 * xdisp.c (rows_from_pos_range): Accept additional argument
8418 DISP_STRING, and accept any glyph in a row whose object is that
8419 string as eligible for mouse highlight. Fixes mouse highlight of
8420 display strings from overlays. (Bug#10464)
8421
9a0115ab 84222012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 8423
b9110d6a 8424 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
8425 * fileio.c (auto_saving_dir_umask): New static var.
8426 (Fmake_directory_internal): Use it.
8427 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8428 creating the directory. The old code temporarily assigns
8429 too-generous permissions to the directory.
8430 (do_auto_save_eh): Clear it.
b9110d6a 8431 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
8432 that the var is always cleared.
8433
6c1bd3f3
EZ
84342012-01-07 Eli Zaretskii <eliz@gnu.org>
8435
8436 * search.c (scan_buffer): Pass character positions to
8437 know_region_cache, not byte positions. (Bug#6540)
8438
069d2b50
L
84392012-01-07 LynX <_LynX@bk.ru> (tiny change)
8440
8441 * w32.c (sys_rename): Report EXDEV when rename of a directory
8442 fails because the target is on another logical disk. (Bug#10284)
8443
75bf0d33
DB
84442012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8445
8446 * xterm.c (x_embed_request_focus): New function.
8447
8448 * xterm.h: Add prototype.
8449
8450 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8451
1c6e5a32
GM
84522012-01-05 Glenn Morris <rgm@gnu.org>
8453
8454 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8455
651e947e
EZ
84562012-01-01 Eli Zaretskii <eliz@gnu.org>
8457
8458 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8459 Load gnutls_transport_set_lowat only if GnuTLS version is below
8460 2.11.1.
8461 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8462 GnuTLS versions below 2.11.1.
8463
3778cdd8
AL
84642011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8465
8466 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8467 to the doc string advising against its use for altering the way
8468 windows are scrolled.
8469
0e5317f7
KH
84702011-12-28 Kenichi Handa <handa@m17n.org>
8471
8472 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8473 coding-system ASCII compatible only when it does not produce BOM
8474 on encoding (Bug#10383).
8475
93d5ca1f
JD
84762011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8477
8478 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8479 can scroll.
8480 (create_and_show_popup_menu): Always use menu_position_func for
8481 Gtk3 (Bug#10361).
8482
ca22b785
AS
84832011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8484
8485 * callint.c (Fcall_interactively): Don't truncate prompt string.
8486
d048e1e6
EZ
84872011-12-23 Eli Zaretskii <eliz@gnu.org>
8488
8489 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8490 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 8491 resumed from there (after widening). (Bug#10360)
d048e1e6 8492
5ccaba1f
JD
84932011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8494
8495 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8496
204ee57f
JD
84972011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8498
b81d40f0
JB
8499 * nsterm.m (x_free_frame_resources):
8500 Release f->output_data.ns->miniimage.
204ee57f
JD
8501 (ns_index_color): Fix indentation. Do not retain
8502 color_table->colors[i].
8503
8504 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8505 before returning.
8506
8507 * nsfns.m (x_set_background_color): Assign return value from
8508 ns_index_color to face-background instead of NSColor*.
8509 (ns_implicitly_set_icon_type): Fix indentation.
8510 Change assignment in for loop to comparison.
8511
8512 * emacs.c (ns_pool): New variable.
8513 (main): Assign ns_pool.
8514 (Fkill_emacs): Call ns_release_autorelease_pool.
8515
8516 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8517 autorelease fdesc, release fdAttrs and tdict.
8518 (ns_get_covering_families): Release charset.
8519 (ns_findfonts): Release NSFontDescriptor created with new.
8520 (ns_uni_to_glyphs): Fix indentation.
8521 (setString): Release attrStr before assigning new value.
8522
c803b2b7
JD
85232011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8524
678f4426
JD
8525 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8526 and NS_IMPL_COCOA.
8527 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8528 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8529
cd394be1 85302011-12-18 David Reitter <reitter@cmu.edu>
678f4426 8531
5fecd5fc
JD
8532 * nsterm.m (ns_term_init): Subscribe for notifications
8533 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8534 to method trackingNotification in EmacsMenu.
8535
8536 * nsmenu.m (trackingMenu): New variable.
3771cb17 8537 (trackingNotification): New method (from Aquamacs).
5fecd5fc 8538 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 8539 from Aquamacs (Bug#7030).
678f4426
JD
8540
85412011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 8542
c803b2b7
JD
8543 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8544 (symbol_to_nsstring): Fix indentation.
8545 (ns_symbol_to_pb): New function.
cae07000
SM
8546 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8547 (Fns_rotate_cut_buffers_internal): Remove.
8548 (Fns_store_selection_internal): Rename from
c803b2b7
JD
8549 Fns_store_cut_buffer_internal.
8550 (ns_get_foreign_selection, Fx_own_selection_internal)
8551 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
8552 (Fns_get_selection_internal, Fns_store_selection_internal):
8553 Use ns_symbol_to_pb and check if return value is nil.
8554 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8555 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
8556 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8557 renamed to Sns_store_selection_internal.
8558 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8559 and remove this function.
8560 (ns_handle_selection_clear): Remove, never used.
8561 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8562 here.
8563
e1b01a3a
KB
85642011-12-17 Ken Brown <kbrown@cornell.edu>
8565
8566 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8567 GID is unknown (Bug#10257).
8568
2adb6e85
PE
85692011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8570
8571 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8572 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8573 which caused a build failure on GNU/Linux IA-64. This problem was
8574 introduced by my 2011-10-07 patch.
8575
d1d7b339
JL
85762011-12-15 Juri Linkov <juri@jurta.org>
8577
8578 * image.c (imagemagick_error): New function. (Bug#10112)
8579 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8580 Use `imagemagick_error' where ImageMagick functions return
8581 `MagickFalse'.
8582 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8583 proper order.
8584
100d5755
KH
85852011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8586
8587 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8588 fill background (Bug#8992).
8589
454592a6
MR
85902011-12-13 Martin Rudalics <rudalics@gmx.at>
8591
8592 * window.c (Vwindow_combination_resize)
8593 (Vwindow_combination_limit): Use t instead of non-nil in
8594 doc-strings.
61d4b438
MR
8595 (Vrecenter_redisplay): Add first sentence of doc-string on
8596 separate line.
53524d93 8597 (Frecenter): Fix doc-string typo.
454592a6 8598
3633e3aa
KH
85992011-12-11 Kenichi Handa <handa@m17n.org>
8600
8601 * coding.c (Funencodable_char_position): Pay attention to the
8602 buffer text relocation (Bug#9389).
8603
7b9d523a 86042011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 8605
7b9d523a
JD
8606 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8607 gtk_init (Bug#10100).
8608
b73189c6
EZ
86092011-12-10 Eli Zaretskii <eliz@gnu.org>
8610
8611 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8612 IT->string is nil. (Bug#10263)
8613
f7dfe5d6
JD
86142011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8615
83faebb4
JD
8616 * nsterm.h (x_free_frame_resources): Declare.
8617
f7dfe5d6
JD
8618 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8619 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8620
8621 * nsterm.h (ns_get_defaults_value): Declare.
8622
8623 * nsterm.m (ns_default): Call ns_get_defaults_value.
8624
7cd4e72c
EZ
86252011-12-09 Eli Zaretskii <eliz@gnu.org>
8626
8627 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8628 (Bug#10170)
8629
b34d7317
YM
86302011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8631
8632 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8633 that where the value of an _OBJC_* symbol points to is in the .bss
8634 section (Bug#10240).
8635
76470ad1
KH
86362011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8637
8638 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 8639 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 8640
745fff94
KH
86412011-12-08 Kenichi Handa <handa@m17n.org>
8642
8643 * ftfont.c (get_adstyle_property): Fix previous change
8644 (Bug#10233).
8645
6e44397c
JB
86462011-12-07 Juanma Barranquero <lekktu@gmail.com>
8647
8648 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8649 dirs from the default value of EMACSLOADPATH (bug#10208).
8650
7efa6272
GM
86512011-12-07 Glenn Morris <rgm@gnu.org>
8652
8653 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8654 installation and source directories as well. (Bug#10208)
8655
f6fc4d87
CY
86562011-12-06 Chong Yidong <cyd@gnu.org>
8657
8658 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8659
2bf26180
GM
86602011-12-06 Glenn Morris <rgm@gnu.org>
8661
8662 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8663 as an error, not just -1. (Bug#10217)
8664
3a6ad4f0
CY
86652011-12-05 Chong Yidong <cyd@gnu.org>
8666
8667 * keyboard.c (process_special_events): New function.
8668 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8669
75a3b399
PE
86702011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8671
8672 * coding.c (encode_designation_at_bol): Don't use uninitialized
8673 local variable (Bug#9318).
8674
c3c9e25e
KH
86752011-12-05 Kenichi Handa <handa@m17n.org>
8676
8677 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8678 return Qnil (Bug#8046, Bug#10193).
8679
5eb05ea3
KH
86802011-12-05 Kenichi Handa <handa@m17n.org>
8681
8682 * coding.c (encode_designation_at_bol): New args charbuf_end and
8683 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
8684 (coding_set_source): Return how many bytes coding->source was
8685 relocated.
8686 (coding_set_destination): Return how many bytes
8687 coding->destination was relocated.
8688 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 8689 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
8690
86912011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8692
8693 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8694 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8695 macro (Bug#9318).
8696
86972011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8698
8699 The following changes are to fix Bug#9318.
8700
a79703f5 8701 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
8702 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8703 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 8704 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 8705
7dbda6df
JB
87062011-12-05 Juanma Barranquero <lekktu@gmail.com>
8707
8708 * lisp.h (process_quit_flag): Fix external declaration.
8709
6d5eb5b0
SM
87102011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8711
8712 Don't macro-inline non-performance-critical code.
8713 * eval.c (process_quit_flag): New function.
8714 * lisp.h (QUIT): Use it.
8715
a0c3fad0
JD
87162011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8717
8718 * nsfns.m (get_geometry_from_preferences): New function.
8719 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8720
6c07aac2
AS
87212011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8722
8723 * emacs.c (Qkill_emacs): Define.
8724 (syms_of_emacs): Initialize it.
8725 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8726 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
8727 (quit_throw_to_read_char): Add parameter `from_signal'.
8728 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
8729 * lisp.h (QUIT): Call Fkill_emacs if requested.
8730
c052ead4
JD
87312011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8732
8733 * widget.c (update_wm_hints): Return if wmshell is null.
8734 (widget_update_wm_size_hints): New function.
8735
8736 * widget.h (widget_update_wm_size_hints): Declare.
8737
8738 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8739 widget_update_wm_size_hints (Bug#10104).
8740
9e49252b
EZ
87412011-12-03 Eli Zaretskii <eliz@gnu.org>
8742
8743 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8744 before a newline, prepare the bidi iterator for consuming the
8745 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 8746 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 8747
02b16839
JL
87482011-12-02 Juri Linkov <juri@jurta.org>
8749
8750 * search.c (Fword_search_regexp): New Lisp function created from
8751 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8752 (Fword_search_backward, Fword_search_forward)
8753 (Fword_search_backward_lax, Fword_search_forward_lax):
8754 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8755 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8756
0068070e
SM
87572011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8758
8759 * fileio.c (Finsert_file_contents): Move after-change-function call
8760 to before the "handled:" label, since all "goto handled" appear in
8761 cases where the *-change-functions have already been properly called
8762 (bug#10117).
8763
3360a3fc
AS
87642011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8765
8766 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8767 waiting for input. (Bug#10169)
8768
73d6c093
EZ
87692011-11-30 Eli Zaretskii <eliz@gnu.org>
8770
8771 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8772 verifies glyph row's hash code--we have just reallocated the
8773 glyphs, so their contents can be complete garbage. (Bug#10164)
8774
febe6bea
JB
87752011-11-30 Juanma Barranquero <lekktu@gmail.com>
8776
8777 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8778
801a4313
EZ
87792011-11-30 Eli Zaretskii <eliz@gnu.org>
8780
8781 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8782 attributes are tested _before_ calling verify_row_hash, to protect
8783 against GCC re-ordering of the tests. (Bug#10164)
8784
2b56b87e
JD
87852011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8786
8787 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8788
8789 * xterm.c (handle_one_xevent): Only set async_visible and friends
8790 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 8791 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
8792 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8793
dbf31225
PE
87942011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8795
8796 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8797 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8798 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8799 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8800 All uses changed to use GCPRO1 etc.
8801 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8802 Revert to old implementation (i.e., before 2011-03-11).
8803
1305621b
YM
88042011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8805
8806 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8807 of scroll runs so as to avoid assigning disabled bogus rows and
8808 unnecessary graphics copy operations.
8809
8c9afb46
EZ
88102011-11-27 Eli Zaretskii <eliz@gnu.org>
8811
8812 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8813 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8814 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8815 (malloc, free, realloc, calloc): Redirect to e_* only when
8816 compiling Emacs.
8817
8818 * lisp.h (GCTYPEBITS): Move before first use.
8819 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8820 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8821 this macro definition.
8822
8823 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8824 _MSC_VER.
8825
54e9e3bf
JD
88262011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8827
6d5eb5b0
SM
8828 * gtkutil.c (xg_create_frame_widgets):
8829 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
8830 present with Gtk+ 2.0.
8831
83aca1cb
PE
88322011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8833
8834 * fileio.c (Finsert_file_contents): Undo previous change; see
8835 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8836
5b76caa4
PE
88372011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8838
8839 Rename locals to avoid shadowing.
8840 * fileio.c (Finsert_file_contents):
8841 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8842 * process.c (wait_reading_process_output):
8843 Rename inner 'proc' to 'p' to avoid shadowing.
8844 Indent for consistency with usual Emacs style.
8845
8c535114
EZ
88462011-11-25 Eli Zaretskii <eliz@gnu.org>
8847
8848 * xdisp.c (redisplay_window): If cursor row is not fully visible
8849 after recentering, and scroll-conservatively is set to a large
8850 number, scroll window by a few more lines to make the cursor fully
8851 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
8852 (start_display): Don't move to the next line if the display should
8853 start at a newline that is part of a display vector or an overlay
8854 string. (Bug#10119)
8c535114 8855
fa4fdb5c
JL
88562011-11-24 Juri Linkov <juri@jurta.org>
8857
8858 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8859 after the `MagickPingImage' call. (Bug#10112)
8860
90ec88df
CY
88612011-11-23 Chong Yidong <cyd@gnu.org>
8862
8863 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8864
56e2e794
MR
88652011-11-23 Martin Rudalics <rudalics@gmx.at>
8866
8867 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8868 making another buffer current. (Bug#10114)
8869
b6e64c41
GM
88702011-11-23 Glenn Morris <rgm@gnu.org>
8871
8872 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8873
6b21de18
CY
88742011-11-23 Chong Yidong <cyd@gnu.org>
8875
8876 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8877 using it (Bug#5984).
8878
b12cd789
EZ
88792011-11-22 Eli Zaretskii <eliz@gnu.org>
8880
8881 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8882 and header-lines, as they don't have one computed for them.
8883 (Bug#10098)
8884
8885 * .gdbinit (prow): Make displayed values more self-explaining.
8886 Add row's hash code.
8887
261b6fd4
LMI
88882011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8889
8890 * process.c (wait_reading_process_output): Fix asynchrounous
8891 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 8892 (wait_reading_process_output): Add comment and URL.
261b6fd4 8893
e7cfd277
JD
88942011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8895
8896 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8897
a9b9b7f5
CY
88982011-11-21 Chong Yidong <cyd@gnu.org>
8899
8900 * window.c (Fnext_window, Fprevious_window): Doc fix.
8901
b0d15b4f
SM
89022011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8903
8904 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8905
fe7a3057
JB
89062011-11-20 Juanma Barranquero <lekktu@gmail.com>
8907
8908 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8909
d2999b1a
MR
89102011-11-20 Martin Rudalics <rudalics@gmx.at>
8911
8912 * window.c (Fset_window_combination_limit): Rename argument
8913 STATUS to LIMIT.
8914 (Vwindow_combination_limit): Remove "status" from doc-string.
8915
d5ff9cd0
AS
89162011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8917
8918 * m/ibms390.h: Remove.
8919 * m/ibms390x.h: Don't include "ibms390.h".
8920
a5bb9bd3
SM
89212011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8922
8923 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8924 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8925
cd1181db
JB
89262011-11-20 Juanma Barranquero <lekktu@gmail.com>
8927
8928 * casetab.c (Fset_case_table):
8929 * charset.c (Fcharset_after): Fix typos.
8930
615a3b8d 89312011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 8932
17e845af
PE
8933 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8934 Otherwise, valgrind does not work on some platforms.
8935 Problem reported by Andreas Schwab in
6a0bf43d
PE
8936 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8937 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8938 is set, removing the need for VIRT_ADDRESS_VARIES.
8939 (PURE_P): Use a more-efficient implementation that needs just one
8940 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8941 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8942 to 4 (xorl, subq, cmpq, setbe).
8943 * alloc.c (pure): Always extern now, since that's the
8944 VIRT_ADDR_VARIES behavior.
8945 (PURE_POINTER_P): Use a single comparison, not two, for
8946 consistency with the new puresize.h.
8947 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8948 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8949 Remove VIRT_ADDR_VARIES no longer needed.
8950
f8fe6f96
EZ
89512011-11-19 Eli Zaretskii <eliz@gnu.org>
8952
8953 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8954 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8955 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8956 behave as if the cursor position were at the window margin.
8957
8958 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8959 and the cursor position is out of bounds, behave as if the cursor
8960 position were at the window margin. (Bug#10075)
8961
df05a53c
CY
89622011-11-18 Chong Yidong <cyd@gnu.org>
8963
8964 * window.c (Fwindow_combination_limit): Make first argument
8965 non-optional, since it is meaningless for live windows like the
8966 selected window.
61ccba97 8967
2071918e
DA
89682011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8969
8970 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8971
b50a28de
SM
89722011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8973
8974 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8975 (graft_intervals_into_buffer): Simplify.
8976
015137db
EZ
89772011-11-18 Eli Zaretskii <eliz@gnu.org>
8978
8979 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8980 hash values of the two rows.
8981 (copy_row_except_pointers): Preserve the used[] arrays and the
8982 hash values of the two rows. (Bug#10035)
68c95424 8983 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
8984
8985 * xdisp.c (row_hash): New function, body extracted from
8986 compute_line_metrics.
8987 (compute_line_metrics): Call row_hash, instead of computing the
8988 hash code inline.
8989
8990 * dispnew.c (verify_row_hash): Call row_hash for computing the
8991 hash code of a row, instead of duplicating code from xdisp.c.
8992
8993 * dispextern.h (row_hash): Add prototype.
8994
a2addb04
TH
89952011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8996
8997 * frame.c (delete_frame): Don't delete the terminal when the last
8998 X frame is closed if emacs is built with GTK toolkit.
8999
df85d315
JB
90002011-11-17 Juanma Barranquero <lekktu@gmail.com>
9001
9002 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9003
a0c2d0ae
MR
90042011-11-17 Martin Rudalics <rudalics@gmx.at>
9005
9006 * window.c (Vwindow_splits): Rename to
9007 Vwindow_combination_resize. Suggested by Juri Linkov.
9008 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9009 of Vwindow_splits.
9010
58179cce
JB
90112011-11-16 Juanma Barranquero <lekktu@gmail.com>
9012
7877f373
JB
9013 * nsfns.m (Fns_font_name):
9014 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9015
b6f67890
MR
90162011-11-16 Martin Rudalics <rudalics@gmx.at>
9017
9018 * window.h (window): Rename slot "nest" to "combination_limit".
9019 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9020 (Fset_window_nest): Rename to Fset_window_combination_limit.
9021 (Vwindow_nest): Rename to Vwindow_combination_limit.
9022 (recombine_windows, make_parent_window, make_window)
9023 (Fsplit_window_internal, saved_window)
9024 (Fset_window_configuration, save_window_save): Rename all
9025 occurrences of window_nest to window_combination_limit.
9026
c7015153
JB
90272011-11-15 Juanma Barranquero <lekktu@gmail.com>
9028
9029 * image.c (imagemagick_load_image): Fix typo.
9030
322ad6ec
EZ
90312011-11-14 Eli Zaretskii <eliz@gnu.org>
9032
9033 * xdisp.c (display_line): Move the call to
9034 highlight_trailing_whitespace before the call to
9035 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9036 faces of all the glyphs to compute ROW's hash value.
9037 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9038
f067b8ec
JB
90392011-11-14 Juanma Barranquero <lekktu@gmail.com>
9040
9041 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9042 just return (bug#10044).
9043
1e5b2111
EZ
90442011-11-12 Eli Zaretskii <eliz@gnu.org>
9045
7ef3cbd5
EZ
9046 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9047 with user-defined heap size. Bump the default size of the temacs
9048 heap to 27MB, to avoid memory warning when running temacs.
9049 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9050
1e5b2111
EZ
9051 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9052 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9053 (verify_row_hash) [XASSERTS]: New function.
9054 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9055 that the hash value of glyph rows is correct.
1e5b2111 9056
89d61221
MR
90572011-11-12 Martin Rudalics <rudalics@gmx.at>
9058
9059 * window.h (window): Remove splits slot.
9060 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9061 (Fdelete_other_windows_internal, make_parent_window)
9062 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9063 (Fset_window_configuration, save_window_save): Don't deal with
9064 split status of windows.
9065 (saved_window): Remove splits slot.
9066 (Vwindow_splits): Rewrite doc-string.
9067
97f18cc8
JD
90682011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9069
9070 * xfns.c (unwind_create_frame):
9071 * nsfns.m (unwind_create_frame):
9072 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9073 Vframe_list (Bug#9999).
9074
22a648b4
DA
90752011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9076
0b381c7e 9077 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9078
659afede
KH
90792011-11-11 Kenichi Handa <handa@m17n.org>
9080
9081 * callproc.c (Fcall_process): Set the member dst_multibyte of
9082 process_coding.
9083
9ac0394b
KH
90842011-11-11 Johan Bockgård <bojohan@gnu.org>
9085
9086 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9087 avoid a crash (bug#9496).
9088
2fbdc249
CY
90892011-11-09 Chong Yidong <cyd@gnu.org>
9090
9091 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9092 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9093
ac6b1f81
PE
90942011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9095
9096 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9097
09db192c
PE
90982011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9099
9100 Avoid some portability problems by eschewing 'extern inline' functions.
9101 The trivial performance wins aren't worth the portability hassles; see
9102 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9103 et seq.
9104 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9105 (window_box_width, window_box_left, window_box_left_offset)
9106 (window_box_right, window_box_right_offset): Undo previous change,
9107 by removing the "extern"s.
9108 * intervals.c (adjust_intervals_for_insertion)
9109 (adjust_intervals_for_deletion): Undo previous change,
9110 making these static again.
9111 (offset_intervals, temp_set_point_both, temp_set_point)
9112 (copy_intervals_to_string): No longer inline.
9113 * xdisp.c (window_text_bottom_y, window_box_width)
9114 (window_box_height, window_box_left_offset)
9115 (window_box_right_offset, window_box_left, window_box_right)
9116 (window_box): No longer inline.
9117
105216ed
CY
91182011-11-08 Chong Yidong <cyd@gnu.org>
9119
9120 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9121 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9122 Signal an error if not a live window.
105216ed
CY
9123 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9124 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9125
ae9e237f
JB
91262011-11-07 Juanma Barranquero <lekktu@gmail.com>
9127
9128 * lisp.h (syms_of_abbrev): Remove declaration.
9129 Reported by CHENG Gao <chenggao@royau.me>.
9130
c7aa8333
EZ
91312011-11-07 Eli Zaretskii <eliz@gnu.org>
9132
9133 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9134 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9135 of temacs in GUI mode.
9136
be7f5545
MR
91372011-11-07 Martin Rudalics <rudalics@gmx.at>
9138
9139 * window.h: Declare delete_all_child_windows instead of
9140 delete_all_subwindows.
9141 * window.c (Fwindow_nest, Fset_window_nest)
9142 (Fset_window_new_total, Fset_window_new_normal)
9143 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9144 (delete_all_subwindows): Rename to delete_all_child_windows.
9145 (Fdelete_other_windows_internal, Fset_window_configuration):
9146 Call delete_all_child_windows instead of delete_all_subwindows.
9147 * frame.c (delete_frame): Call delete_all_child_windows instead
9148 of delete_all_subwindows.
9149
ca78dc43
PE
91502011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9151
9152 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9153 This is also needed for porting to any host where GC_MARK_STACK is
9154 not GC_MAKE_GCPROS_NOOPS.
9155 (which_symbols): Use it.
9156
a0241d01
KH
91572011-11-07 Kenichi Handa <handa@m17n.org>
9158
9159 * coding.c (coding_set_destination): Check coding->src_pos only
9160 when coding->src_object is a buffer (bug#9910).
9161
9162 * process.c (send_process): Set the member src_multibyte of coding
9163 to 0 (bug#9911) when sending a unibyte text.
9164
9165 * callproc.c (Fcall_process): Set the member src_multibyte of
9166 process_coding to 0 (bug#9912).
9167
a64bfdfa 91682011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
9169
9170 * xmenu.c (cleanup_widget_value_tree): New function.
9171 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9172 calling free_menubar_widget_value_tree directly (Bug#9830).
9173
cb41b32a
PE
91742011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9175
9176 Fix some portability problems with 'inline'.
9177 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9178 (window_box_width, window_box_left, window_box_left_offset)
9179 (window_box_right, window_box_right_offset): Declare extern.
9180 Otherwise, these inline functions do not conform to C99 and
9181 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9182 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9183 * intervals.c (adjust_intervals_for_insertion)
9184 (adjust_intervals_for_deletion): Now extern, because otherwise the
9185 extern inline functions 'offset_intervals' couldn't refer to it.
9186 (static_offset_intervals): Remove.
9187 (offset_intervals): Rewrite using the old contents of
9188 static_offset_intervals. The old version didn't conform to C99
9189 because an extern inline function contained a reference to an
9190 identifier with static linkage.
9191
b7041366
AS
91922011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9193
9194 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9195 GC.
9196
88a37c4d
EZ
91972011-11-06 Eli Zaretskii <eliz@gnu.org>
9198
9199 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9200 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9201 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9202 return Qleft_to_right.
9203
49745b39
CY
92042011-11-06 Chong Yidong <cyd@gnu.org>
9205
9206 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9207 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9208 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9209 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9210 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9211 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9212 (Fwindow_vscroll): Doc fix.
9213 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9214 argument, since it makes no sense to pass a live window and for
9215 consistency with window-child.
9216
1f05cd82
CS
92172011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9218
9219 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9220 support MSVC.
9221
22610910
JR
92222011-11-05 Jason Rumney <jasonr@gnu.org>
9223
9224 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9225 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9226 fonts (Bug#6029).
9227 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9228 bitwise arithmetic preventing use of unicode-sip and non-truetype
9229 opentype fonts.
9230
a06776b2
EZ
92312011-11-05 Eli Zaretskii <eliz@gnu.org>
9232
3ad924ba
EZ
9233 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9234 "emacs"-only part.
9235
a06776b2
EZ
9236 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9237 initialization code to keep similarity to xfns.c after changes
9238 from 2011-11-05.
9239
c9e7db78
JD
92402011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9241
a97f8f3f
JD
9242 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9243 (unwind_create_frame): New function (Bug#9943).
9244 (Fx_create_frame): Restructure code to be more similar to the one in
9245 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9246 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9247 Move terminal->reference_count++ just before making the frame official
9248 (Bug#9943).
9249
9250 * nsterm.m (x_free_frame_resources): New function.
9251 (x_destroy_window): Move code to x_free_frame_resources.
9252
c9e7db78 9253 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
9254 (Fx_create_frame, x_create_tip_frame):
9255 Move terminal->reference_count++ just before making the frame
75f1671a 9256 official. Move initialization of image_cache_refcount and
c9e7db78
JD
9257 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9258
a6fc3b5c
EZ
92592011-11-05 Eli Zaretskii <eliz@gnu.org>
9260
9261 Support MSVC build with newer versions of Visual Studio.
9262 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9263 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9264 nt/gmake.defs.
9265
9266 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9267 which are not supported by MSVC.
9268 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9269 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9270 bitfields.
9271 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9272 types in bitfields.
9273 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9274
9275 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9276
58179cce 92772011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
9278
9279 Support MSVC build with newer versions of Visual Studio.
9280 * w32.c: Don't include w32api.h for MSVC.
9281 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9282
9283 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9284 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9285 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9286 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9287 e_* cousins.
9288 (alloca) [_MSC_VER]: Define to _alloca.
9289
9290 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9291
9292 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9293
a58c13ed
EZ
92942011-11-04 Eli Zaretskii <eliz@gnu.org>
9295
9296 * xdisp.c (note_mouse_highlight): If either of
9297 previous/next-single-property-change returns nil, treat that as
9298 the beginning or the end of the buffer. (Bug#9955)
9299
fe0b6370
JD
93002011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9301
a58c13ed 9302 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
9303 label is not null (Bug#9951).
9304 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9305 may be NULL.
9306
89bd5ee1
EZ
93072011-11-04 Eli Zaretskii <eliz@gnu.org>
9308
9309 * window.c (Fwindow_body_size): Mention in the doc string that the
9310 return value is in frame's canonical units. (Bug#9949)
9311
84c3edb9
EZ
93122011-11-03 Eli Zaretskii <eliz@gnu.org>
9313
4e2fb5c7
EZ
9314 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9315
84c3edb9 9316 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 9317 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 9318 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 9319
bc17a887
EZ
93202011-11-01 Eli Zaretskii <eliz@gnu.org>
9321
9322 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9323 Don't stop backward scan on the continuation glyph, even though
9324 its CHARPOS is positive.
6d5eb5b0
SM
9325 (mouse_face_from_buffer_pos, note_mouse_highlight):
9326 Rename cover_string to disp_string.
bc17a887 9327
4ee88440
MR
93282011-11-01 Martin Rudalics <rudalics@gmx.at>
9329
9330 * window.c (temp_output_buffer_show): Don't use
9331 Vtemp_buffer_show_specifiers.
9332 (Vtemp_buffer_show_specifiers): Remove unused variable.
9333
c2ff3c02
EZ
93342011-10-30 Eli Zaretskii <eliz@gnu.org>
9335
9336 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9337 past the beginning of the current glyph matrix.
9338
58179cce 93392011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
9340
9341 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9342 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9343 HAVE_GTK3 (Bug#9869).
b77a6a7f 9344
3b574623
JD
9345 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9346 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9347
b77a6a7f
JD
9348 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9349
9350 * xterm.c: Declare x_handle_net_wm_state to return int.
9351 (handle_one_xevent): Check if we are iconified but don't have
9352 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9353 (get_current_wm_state): Return non-zero if not hidden,
9354 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9355 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9356 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9357 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9358
196e41e4
PE
93592011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9360
9361 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9362 so that this new function doesn't get optimized away by a
9363 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9364
021f2e1a
AS
93652011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9366
9367 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9368
8b058d44
EZ
93692011-10-29 Eli Zaretskii <eliz@gnu.org>
9370
9371 Fix the `xbytecode' command.
9372 * .gdbinit (xprintbytestr): New command.
b50a28de 9373 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
9374 (xbytecode): Print the byte-code string as well.
9375
4452fb80
EZ
93762011-10-29 Kim Storm <storm@cua.dk>
9377
8b058d44
EZ
9378 * alloc.c (which_symbols): New function.
9379
21b72067
AS
93802011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9381
9382 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9383 line. (Bug#9903)
9384
83ed7b5c
GM
93852011-10-29 Glenn Morris <rgm@gnu.org>
9386
9387 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9388 Not clear what it was for, and it causes various bugs. (Bug#9839)
9389
5a7a728b
EZ
93902011-10-28 Eli Zaretskii <eliz@gnu.org>
9391
9392 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9393 possible random value that matches one of those tested as
9394 condition to clear the mouse face.
9395
d3d0842f
CY
93962011-10-28 Chong Yidong <cyd@gnu.org>
9397
9398 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9399
31b39d13
DN
94002011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9401
9402 * window.c (make_window): Initialize phys_cursor_on_p.
9403
9aba6043
SM
94042011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9405
9406 * lisp.h (struct Lisp_Symbol): Update comments.
9407
c20992f4
JB
94082011-10-28 Juanma Barranquero <lekktu@gmail.com>
9409
9410 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9411
db4f02f2
EZ
94122011-10-28 Eli Zaretskii <eliz@gnu.org>
9413
9414 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9415 <oslsachem@gmail.com> for helping to debug this.
9416
9417 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9418 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9419 (g_b_init_get_glyph_outline_w): New static variables.
9420 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9421 (GetGlyphOutlineW_Proc): New typedefs.
9422 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
9423 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9424 New functions.
9425 (w32font_open_internal, compute_metrics):
9426 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
9427 instead of calling the "wide" APIs directly.
9428
9429 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9430
9431 * w32.h (syms_of_w32font): Add prototype.
9432
87e68db4
JB
94332011-10-27 Juanma Barranquero <lekktu@gmail.com>
9434
9435 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9436 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9437 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9438 (Fmove_to_window_line): Doc fix.
9439
435c1d67
CY
94402011-10-27 Chong Yidong <cyd@gnu.org>
9441
9442 * process.c (make_process): Set gnutls_state to NULL.
9443
9444 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9445 non-NULL, regardless of GNUTLS_INITSTAGE.
9446 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9447 an error. Set process slots as soon as we allocate them.
9448
9449 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9450
9c6c6f49
CY
94512011-10-27 Chong Yidong <cyd@gnu.org>
9452
9aba6043
SM
9453 * gnutls.c (emacs_gnutls_deinit): New function.
9454 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
9455 (Fgnutls_deinit, Fgnutls_boot): Use it.
9456
9457 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9458 (deactivate_process): Call emacs_gnutls_deinit.
9459
657d08d3
JB
94602011-10-27 Juanma Barranquero <lekktu@gmail.com>
9461
9462 * image.c (x_create_x_image_and_pixmap):
9463 * w32.c (sys_rename, w32_delayed_load):
9464 * w32font.c (fill_in_logfont):
9465 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9466
5430d399
JB
94672011-10-26 Juanma Barranquero <lekktu@gmail.com>
9468
9469 * w32fns.c (w32_default_color_map): New function,
9470 extracted from Fw32_default_color_map.
a7ef684b 9471 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 9472
fe0055fa
PE
94732011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9474
9475 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9476
e6346438
SM
94772011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9478
9479 * keyboard.c (test_undefined): New function (bug#9751).
9480 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9481
e112cc37
ET
94822011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9483
9484 * sysdep.c (init_sys_modes): Fix the check for the controlling
9485 terminal (Bug#6649).
9486
7b5d6677
EZ
94872011-10-20 Eli Zaretskii <eliz@gnu.org>
9488
9489 * dispextern.h (struct bidi_it): New member next_en_type.
9490
9491 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9492 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9493 current character, check also for next_en_type being WEAK_EN.
9494 (bidi_resolve_weak): Don't enter the expensive loop if the current
9495 position is before next_en_pos. Record the bidi type of the first
9496 non-ET, non-BN character we find, in addition to its position.
9497 (bidi_level_of_next_char): Invalidate next_en_type when
9498 next_en_pos is over-stepped.
9499
7da0b018
PE
95002011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9501
9502 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9503 * editfns.c: Rewrite current-time-zone so that it invokes
9504 the equivalent of (format-time-string "%Z") to get the time zone name.
9505 This fixes a bug when the time zone name contains characters that
9506 need converting from the system time locale to Emacs internal format.
9507 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9508 that patch fixed format-time-string to do the conversion, but
9509 I forgot to fix current-time-zone.
9510 (format_time_string): New function, containing most of
9511 what Fformat_time_string used to contain.
9512 (Fformat_time_string): Rewrite in terms of format_time_string.
9513 This doesn't change this function's behavior.
9514 (current-time-zone): Rewrite to use format_time_string.
9515 This fixes the bug reported by Michael Schierl in
9516 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9517 Jason Rumney's 2007-06-07 change worked around this bug, but
9518 didn't fix it.
9519 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9520
8547b010
EZ
95212011-10-19 Eli Zaretskii <eliz@gnu.org>
9522
9523 * xdisp.c (start_display): If the character at POS is displayed
9524 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
9525 (try_window_reusing_current_matrix): If a line ends in a display
9526 vector or the next line starts in a display vector, continue
9527 redrawing the window even though the character position of
9528 start_row was reached.
8547b010
EZ
9529 (Bug#9771, part 2)
9530
4e948d15
CY
95312011-10-18 Chong Yidong <cyd@gnu.org>
9532
9533 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9534 with nobreak-char-display too.
9535
4787455f
EZ
95362011-10-18 Eli Zaretskii <eliz@gnu.org>
9537
9538 Fix part 3 of bug#9771.
9539 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9540 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9541 non-neutral characters if the current character is a paragraph
9542 separator (a.k.a. Newline). This avoids running the same
9543 expensive loop twice, once when we consume the preceding newline
9544 and the other time when the line actually needs to be displayed.
9545 Avoid the loop when we see neutrals on the base embedding level
9546 following a character whose directionality is the same as the
9547 paragraph's. This avoids running the expensive loop when a line
9548 ends in a long sequence of neutrals, like control characters.
9549 Add assertion against STRONG_AL type. Slightly rearrange code
9550 that determines the type of a neutral given the first non-neutral
9551 that follows it.
9552 (bidi_level_of_next_char): Set next_en_pos to zero when
9553 invalidating its info.
9554
2c91f553
EZ
95552011-10-17 Eli Zaretskii <eliz@gnu.org>
9556
9557 * xdisp.c (push_display_prop): Determine whether to record string
9558 or buffer position by IT->string, not by IT->method. Allow
9559 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
9560 (move_it_vertically_backward): Don't look for character position
9561 immediately after the newline when in a continuation line.
9562 (Bug#9771, part 1)
2c91f553 9563
c7b08b0d
MR
95642011-10-15 Martin Rudalics <rudalics@gmx.at>
9565
9566 * window.c (coordinates_in_window): Rewrite and delabelize
9567 vertical border check. (Bug#5357) (Bug#9618)
9568
6b02f655
SM
95692011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9570
9571 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9572 errors in XSetWindowBorder (bug#9310).
9573
81d40c92
DA
95742011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9575
9576 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9577 avoid crash when xmalloc overrun checking is enabled.
9578
d4172c3b
EZ
95792011-10-13 Eli Zaretskii <eliz@gnu.org>
9580
9581 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9582 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9583 cursor motion with <left> and <right> arrow keys.
9584
9585 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9586 some callers set that themselves.
9587
b00eea75
EZ
95882011-10-12 Eli Zaretskii <eliz@gnu.org>
9589
9590 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9591 display string and the previous row comes from the same string and
9592 is empty. (Bug#9739) (Bug#9738)
9593
8fe012c4
SM
95942011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9595
9596 * doc.c (get_doc_string): Encode file name (bug#9735).
9597
0074aef2
EZ
95982011-10-12 Eli Zaretskii <eliz@gnu.org>
9599
79beb178
EZ
9600 * bidi.c (bidi_level_of_next_char):
9601 * xdisp.c (get_visually_first_element): Remove old incorrect
9602 comments regarding the Unicode Line Separator character.
9603
0074aef2
EZ
9604 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9605
6e4b3fbe
DA
96062011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9607
9608 * alloc.c (Fgc_status): Do not access beyond zombies array
9609 boundary if nzombies > MAX_ZOMBIES.
9610 * alloc.c (dump_zombies): Add missing format specifier.
9611
0324f3af
PE
96122011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9613
b5525cac
PE
9614 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9615 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9616
0324f3af
PE
9617 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9618 Some packages use them to denote characters with modifiers.
9619
e9b5f888
AS
96202011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9621
9622 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9623 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9624 matching a pp-number. Rename parameter var to var1.
9625
127827c0
SM
96262011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9627
9628 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9629
c8fd3bd0
GM
96302011-10-08 Glenn Morris <rgm@gnu.org>
9631
9632 * callint.c (Fcall_interactively): Give a more explicit error for the
9633 'c' case with a non-character input. (Bug#8479)
9634
352ec8ff
EZ
96352011-10-08 Eli Zaretskii <eliz@gnu.org>
9636
03669ccb
EZ
9637 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9638 lines.
7061c986
EZ
9639 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9640 lines that are hscrolled on the left.
03669ccb 9641
352ec8ff
EZ
9642 * dispnew.c (buffer_posn_from_coords): Account for a possible
9643 presence of header-line. (Bug#4426)
9644
a66cfb1c
SM
96452011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9646
6b02f655
SM
9647 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9648 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 9649
7c5ee88e
PE
96502011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9651
9652 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9653 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9654 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9655 this makes Emacs dump core during garbage collection on rare
9656 occasions. sizeof is obviously inferior to offsetof here, so
9657 stick with offsetof.
9658 (GC_POINTER_ALIGNMENT): New macro.
9659 (mark_memory): Omit 3rd (offset) arg; caller changed.
9660 Don't assume EMACS_INT alignment is the same as pointer alignment.
9661
df1bbe5b
SM
96622011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9663
9664 * keyboard.c (read_key_sequence_remapped): New var.
9665 (read_key_sequence): Compute remapping in the right buffer.
9666 (command_loop_1): Use read_key_sequence's remapping directly.
9667
51553db6
SM
96682011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9669
32c1fffd
SM
9670 * dired.c (file_name_completion): Don't expand file name.
9671 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9672 before checking file name handler.
9673
51553db6
SM
9674 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9675 they've been requested explicitly (bug#9591).
9676
b6bd1599 96772011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
9678
9679 * keymap.c (Fsingle_key_description): Use make_specified_string
9680 instead of build_string to build string from push_key_description.
9681 (Bug#5193)
9682
f701dc2a
PE
96832011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9684
4222c55d
PE
9685 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9686 This fixes a Y2038 bug on 64-bit hosts.
9687 * buffer.c (reset_buffer):
9688 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9689 (Fclear_buffer_auto_save_failure):
9690 Use 0, not -1, to represent an unset failure time, since time_t
9691 might not be signed.
9692
f701dc2a
PE
9693 Remove dependency on glibc malloc internals.
9694 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9695 Move back here from lisp.h, but with their new implementations.
9696 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9697 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9698 * charset.c (charset_table_init): New static var.
9699 (syms_of_charset): Use it instead of xmalloc. This removes a
9700 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9701 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9702 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9703 Move back to alloc.c.
9704 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9705 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9706
9ceebf39
JD
97072011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9708
9709 * nsterm.m (windowDidResize): Call x_set_window_size only when
9710 ns_in_resize is true. Otherwise set pixelwidth/height and
9711 call change_frame_size (Bug#9628).
9712
cb993c58
PE
97132011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9714
3930c88b
PE
9715 Port --enable-checking=all to Fedora 14 x86-64.
9716 * charset.c (syms_of_charset): Also account for glibc malloc's
9717 internal overhead when calculating the initial malloc maximum.
9718
cb993c58
PE
9719 Port --enable-checking=all to Fedora 14 x86.
9720 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9721 Move to lisp.h.
9722 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9723 (overrun_check_realloc, overrun_check_free):
9724 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9725 That way, xmalloc returns a properly-aligned pointer even if
9726 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9727 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9728 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9729 into account when calculating the initial malloc maximum.
9730 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9731 Move here from alloc.c, so that charset.c can use it too.
9732 Properly align; the old code wasn't right for common 32-bit hosts
9733 when configured with --enable-checking=all.
9734 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9735 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9736
31bed486
EZ
97372011-09-29 Eli Zaretskii <eliz@gnu.org>
9738
04c70788 9739 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
9740 use EDOM.
9741
fbcaa2f3
EZ
97422011-09-28 Eli Zaretskii <eliz@gnu.org>
9743
9744 * xdisp.c (compute_display_string_end): If there's no display
9745 string at CHARPOS, return -1.
9746
9747 * bidi.c (bidi_fetch_char): When compute_display_string_end
9748 returns a negative value, treat the character as a normal
9749 character not covered by a display string. (Bug#9624)
9750
a239d4e9
JB
97512011-09-28 Juanma Barranquero <lekktu@gmail.com>
9752
9753 * lread.c (Fread_from_string): Fix typo in docstring.
9754
88652fd5
EZ
97552011-09-27 Eli Zaretskii <eliz@gnu.org>
9756
9757 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9758 newline, reseat the iterator instead of bidi-iterating there one
9759 character at a time. (Bug#9610)
32c1fffd
SM
9760 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9761 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 9762
ed497dd4
AS
97632011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9764
9765 * lread.c (readevalloop): Use correct code for NBSP.
9766 (read1): Likewise. (Bug#9608)
9767
b2bf61aa
MA
97682011-09-25 Michael Albinus <michael.albinus@gmx.de>
9769
9770 * dbusbind.c (Fdbus_register_signal): When service is not
9771 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9772
32bbb17c
GM
97732011-09-25 Glenn Morris <rgm@gnu.org>
9774
9775 * buffer.c (truncate-lines): Doc fix.
9776
94e0933e
CY
97772011-09-24 Chong Yidong <cyd@stupidchicken.com>
9778
9779 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9780 (Fset_window_next_buffers): Doc fix.
9781
cddde921
GM
97822011-09-24 Glenn Morris <rgm@gnu.org>
9783
9784 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9785
1260aef1
PE
97862011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9787
25b4bfa0
PE
9788 Fix minor problems found by static checking.
9789 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
9790 * indent.c (Fvertical_motion): Fix == vs = typo.
9791
e3cbd34b
EZ
97922011-09-24 Eli Zaretskii <eliz@gnu.org>
9793
a66cfb1c
SM
9794 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9795 Default value is now t. Doc fix.
6bf7006f 9796
e3cbd34b 9797 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 9798 logic when moving up, not only when moving down. Fix the
e3cbd34b 9799 confusing name and values of the it_overshoot_expected variable;
32c1fffd 9800 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
9801
9802 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9803 CHARPOS is covered by a display string which includes newlines.
9804 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9805 is covered by a display string with embedded newlines.
9806
a3de0cbd
MA
98072011-09-24 Michael Albinus <michael.albinus@gmx.de>
9808
9809 * dbusbind.c (Fdbus_register_signal): Add match rule to
9810 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
9811 (Fdbus_register_method, Vdbus_registered_objects_table):
9812 Fix docstring.
a3de0cbd 9813
b260039d
JM
98142011-09-24 Jim Meyering <meyering@redhat.com>
9815
32c1fffd 9816 do not ignore write error for any output size
b260039d
JM
9817 The previous change was incomplete.
9818 While it makes emacs --batch detect the vast majority of stdout
9819 write failures, errors were still ignored whenever the output size is
9820 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9821 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9822 && echo FAIL: ignored write error
9823 FAIL: ignored write error
9824 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9825 && echo FAIL: ignored write error
9826 FAIL: ignored write error
9827 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9828
8eca8a7c
AS
98292011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9830
9831 * emacs.c (Fkill_emacs): In noninteractive mode exit
9832 non-successfully if a write error occurred on stdout. (Bug#9574)
9833
3341db62
EZ
98342011-09-21 Eli Zaretskii <eliz@gnu.org>
9835
9836 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9837 the xassert test.
9838
9839 * dispextern.h (struct it): Update the comment documenting what
9840 can it->OBJECT be.
9841
8c203dbf
EZ
98422011-09-20 Eli Zaretskii <eliz@gnu.org>
9843
9844 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9845 a display string, extend search for cursor position to end of row.
9846 (find_row_edges): If the row ends in a newline from a display
9847 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9848 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
9849 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9850 non-empty line. Fixes confusing cursor motion with arrow keys at
9851 the beginning of a line that starts with whitespace.
8c203dbf 9852
a4824228
LMI
98532011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9854
9855 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9856 (bug#9493).
9857
33ed493b
CY
98582011-09-18 Chong Yidong <cyd@stupidchicken.com>
9859
9860 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9861 boolean (Bug#9154).
9862
56cd55c8
EZ
98632011-09-18 Eli Zaretskii <eliz@gnu.org>
9864
9865 * xdisp.c (display_line): Record maximum and minimum buffer
9866 positions even if no glyphs were produced (e.g., by a zero-width
9867 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9868 buffer positions that will be removed from the glyph row because
9869 they don't fit.
c02dcedf
EZ
9870 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9871 column is beyond frame width: don't subtract 1 "pixel" when
9872 computing width of the stretch.
3e62b7e0
EZ
9873 (reseat_at_next_visible_line_start): Undo the change made on
9874 2011-09-17 that saved paragraph information and restored it after
9875 the call to `reseat'. (Bug#9545)
56cd55c8 9876
5ed99d36 98772011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
9878
9879 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9880 and turn window cursor on if cleared (Bug#9415).
9881
5ed99d36 98822011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
9883
9884 * search.c (boyer_moore): Take unibyte characters from pattern
9885 literally. (Bug#9458)
9886
9bade7b2
EZ
98872011-09-18 Eli Zaretskii <eliz@gnu.org>
9888
9889 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9890
e5e9d610
PE
98912011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9892
87e4427a
PE
9893 Fix minor problem found by static checking.
9894 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9895 initialized, to pacify gcc -Wuninitialized.
9896
e5e9d610
PE
9897 * fileio.c: Report proper errno when syscall falls.
9898 (Finsert_file_contents): Save and restore errno,
9899 so that report_file_error outputs the correct diagnostic.
9900 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9901
a1674f0b
EZ
99022011-09-18 Eli Zaretskii <eliz@gnu.org>
9903
9904 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9905
fbfb6dd4
EZ
99062011-09-17 Eli Zaretskii <eliz@gnu.org>
9907
9908 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9909 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9910
bb187662
EZ
99112011-09-17 Eli Zaretskii <eliz@gnu.org>
9912
1137e8b8 9913 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 9914 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
9915
9916 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9917 (bidi_find_paragraph_start): Search back for paragraph beginning
9918 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9919 (bidi_move_to_visually_next): Only trigger paragraph-related
9920 computations when the last character is a newline or at EOB, not
9921 just any NEUTRAL_B. (Bug#9470)
9922
bb187662
EZ
9923 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9924 truncated lines if point is covered by a display string. (Bug#9524)
9925
2e621251
PE
99262011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9927
9928 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9929 (cons_to_x_long): New function.
9930 (lisp_data_to_selection_data): Use it. Correct the test for
9931 short-versus-long data; it was negated. Break out of vector
9932 loop, for efficiency, when a long datum is discovered.
9933
91a15bc6
SM
99342011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9935
9936 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9937
b41c3a35
EZ
99382011-09-16 Eli Zaretskii <eliz@gnu.org>
9939
9940 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9941 GCC PR/17406) by declaring this function with external scope.
9942
7812ba2d
PE
99432011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9944
9945 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9946 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9947
cf7edc2a
AS
99482011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9949
9950 * editfns.c (Fformat): Correctly handle text properties on "%%".
9951
bd01620e
EZ
99522011-09-15 Eli Zaretskii <eliz@gnu.org>
9953
9954 * xterm.c (x_draw_composite_glyph_string_foreground):
9955 * w32term.c (x_draw_composite_glyph_string_foreground):
9956 * term.c (encode_terminal_code):
9957 * composite.c (composition_update_it, get_composition_id):
9958 * xdisp.c (get_next_display_element)
9959 (fill_composite_glyph_string): Add comments about special meaning
9960 of TAB characters in a composition.
9961
a02719a3
PE
99622011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
9965 This occurs when processing a multibyte format.
9966 Problem reported by Wolfgang Jenker.
a02719a3 9967
72589a3c
JB
99682011-09-15 Johan Bockgård <bojohan@gnu.org>
9969
9970 * xdisp.c (try_cursor_movement): Only check for exact match if
9971 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9972
1c14176c
PE
99732011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9974
9975 Remove unused external symbols.
9976 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9977 * xdisp.c (calc_pixel_width_or_height): Now static.
9978 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9979 * indent.c (check_display_width):
9980 * w32term.c: Fix comment to match code.
9981 * xterm.c, xterm.h (x_catching_errors): Remove.
9982
d2eea5b5
PE
99832011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9984
9985 * xselect.c: Use signed conversions more consistently (Bug#9498).
9986 (selection_data_to_lisp_data): Assume incoming selection data are
9987 signed integers, not unsigned. This is to be consistent with
9988 outgoing selection data, which was modified to use signed integers
9989 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9990 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9991 expects long, not unsigned long.
9992
46888499
EZ
99932011-09-14 Eli Zaretskii <eliz@gnu.org>
9994
9995 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9996 computation of loop end. Reported by Johan Bockgård
9997 <bojohan@gnu.org>.
9998
ef8ef9fb
CY
99992011-09-13 Chong Yidong <cyd@stupidchicken.com>
10000
10001 * frame.c (Fother_visible_frames_p): Function deleted.
10002
fa819fed
EZ
100032011-09-12 Eli Zaretskii <eliz@gnu.org>
10004
10005 * indent.c (compute_motion): Process display vector front to back
10006 rather than the other way around. (Bug#2496)
10007
2ba8e008
SM
100082011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10009
10010 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10011
20f53c69
CY
100122011-09-11 Chong Yidong <cyd@stupidchicken.com>
10013
10014 * minibuf.c (Fread_from_minibuffer): Doc fix.
10015
d562d7a4
EZ
100162011-09-11 Eli Zaretskii <eliz@gnu.org>
10017
10018 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10019 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10020
1c4d7f3d
LMI
100212011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10022
10023 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10024 value for non-existent files.
10025
b885bf36
EZ
100262011-09-11 Eli Zaretskii <eliz@gnu.org>
10027
10028 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10029 set its "size" to -1. This will set the modtime_size field of
10030 the corresponding buffer to -1, which is what
10031 verify-visited-file-modtime expects for files that do not exist.
10032 (Bug#9139)
10033
6612f0bf
PE
100342011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10035
10036 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10037 here ...
10038 * lisp.h: ... from here. push_key_description is no longer
10039 defined in keyboard.c, so its declaration should not be in
10040 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10041 logically belongs with push_key_description.
10042
dfb3f755
PE
100432011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10044
10045 * buffer.h: Include <sys/types.h> instead of <time.h>.
10046 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10047 Problem reported by Herbert J. Skuhra.
10048
3134906c
LMI
100492011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10050
10051 * xml.c (parse_region): Make the parsing work for
10052 non-comment-starting XML files again (bug#9144).
10053
8d903f4e
AS
100542011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10055
10056 * image.c (gif_load): Fix calculation of bottom and right corner.
10057 (Bug#9468)
10058
80ad64f4
EZ
100592011-09-10 Eli Zaretskii <eliz@gnu.org>
10060
10061 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10062 redisplay in small windows.
10063
208a048d
EZ
100642011-09-09 Eli Zaretskii <eliz@gnu.org>
10065
10066 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10067
9b1c252e
MR
100682011-09-08 Martin Rudalics <rudalics@gmx.at>
10069
10070 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10071 Operate on live windows only.
10072
2949f33b
JB
100732011-09-08 Juanma Barranquero <lekktu@gmail.com>
10074
10075 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10076
e08dcafd
EZ
100772011-09-07 Eli Zaretskii <eliz@gnu.org>
10078
10079 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10080 only under bidi iteration.
10081
115b96bd
JD
100822011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10083
10084 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10085
c8199d0f
PE
100862011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10087
10088 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10089 Without this fix, the command to link temacs failed due to an
10090 undefined symbol __builtin_isnan. This is because
10091 /usr/include/iso/math_c99.h #defines isnan(x) to
10092 __builtin_isnan(x), but the bundled gcc, which identifies itself
10093 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10094 a __builtin_isnan.
10095 * floatfns.c (isnan): #undef, and then #define to a clone of
10096 what's in data.c.
10097 (Fisnan): Always define, since it's always available now.
10098 (syms_of_floatfns): Always define isnan at the Lisp level.
10099
e39b275c 101002011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10101
10102 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10103
b2db44d9 101042011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10105
f4af5137 10106 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10107 The previous code assumed that file offsets (off_t values) fit in
10108 EMACS_INT variables, which is not true on typical 32-bit hosts.
10109 The code messed up by falsely reporting buffer overflow in cases
10110 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10111 when "big" contains more than 2**29 bytes, even though this
10112 inserts just one byte and does not overflow the buffer.
10113 (Finsert_file_contents): Store file offsets as off_t
10114 values, not as EMACS_INT values. Check for overflow when
10115 converting between EMACS_INT and off_t. When checking for
10116 buffer overflow or for overlap, take the offsets into account.
10117 Don't use EMACS_INT for small values where int suffices.
10118 When checking for overlap, fix a typo: ZV was used where
10119 ZV_BYTE was intended.
10120 (Fwrite_region): Don't assume off_t fits into 'long'.
10121 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10122
ecfc0a49
MA
101232011-09-05 Michael Albinus <michael.albinus@gmx.de>
10124
10125 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10126
6511acf2 101272011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10128
0999621a 10129 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10130
10131 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10132 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10133 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10134 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10135 (modify_event_symbol): Do not assume that the length of
10136 name_alist_or_stem is safe to alloca and fits in int.
10137 (Fexecute_extended_command): Likewise for function name and binding.
10138 (Frecursion_depth): Wrap around reliably on integer overflow.
10139 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10140 since some callers pass EMACS_INT values.
10141 (Fsingle_key_description): Don't crash if symbol name contains more
10142 than MAX_ALLOCA bytes.
10143 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10144 (get_minibuffer): Arg is now EMACS_INT, not int.
10145 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 10146 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
10147 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10148
2be7d702
PE
10149 * dbusbind.c (signature_cat): New function.
10150 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
10151 Do not overrun buffer; instead, report string overflow.
10152
9d1df220
PE
10153 * dispnew.c (add_window_display_history): Don't overrun buffer.
10154 Truncate instead; this is OK since it's just a log.
10155
33ef5c64
PE
10156 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10157 even if the time zone offset is outlandishly large.
10158 Don't mishandle offset == INT_MIN.
10159
66c6fdd5
PE
10160 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10161 when creating daemon; the previous buffer-overflow check was incorrect.
10162
d749b01b
PE
10163 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10164 which has the guts of the old verror function.
10165
b5cd1905
PE
10166 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10167 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10168
6e1a67fb
PE
10169 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10170 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 10171 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 10172 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
10173 length of string rather than counting it via multiple sprintfs;
10174 that's simpler and more reliable.
c21721cc
PE
10175 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10176 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10177 sprintf, in case result does not fit in int.
10178
c57b67fc
PE
10179 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10180 (fontset_from_font): Print it.
10181
8a401434
PE
10182 * frame.c (tty_frame_count): Now printmax_t, not int.
10183 (make_terminal_frame, set_term_frame_name): Print it.
10184 (x_report_frame_params): In X, window IDs are unsigned long,
10185 not signed long, so print them as unsigned.
10186 (validate_x_resource_name): Check for implausibly long names,
10187 and don't assume name length fits in 'int'.
10188 (x_get_resource_string): Don't blindly alloca invocation name;
10189 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10190 not fit in int.
10191
6e1a67fb
PE
10192 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10193 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
10194 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10195
0df02bf3
PE
10196 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10197 Use esprintf, not sprintf, in case result does not fit in int.
10198
48e30793
PE
10199 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10200 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10201 it as a large positive number.
10202 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10203 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10204
a66ff6d8
PE
10205 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10206 in case result does not fit in int.
10207
aca216ff
PE
10208 * print.c (float_to_string): Detect width overflow more reliably.
10209 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10210 buffer overrun. Don't assume list length fits in 'int'. Treat
10211 print length of 0 as 0, not as infinity; to be consistent with other
10212 uses of print length in this function. Don't overflow print length
10213 index. Don't assume hash table size fits in 'long', or that
10214 vectorlike size fits in 'unsigned long'.
10215
31c286f7
PE
10216 * process.c (make_process): Use printmax_t, not int, to format
10217 process-name gensyms.
10218
55e5faa1
PE
10219 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10220
80f2e268
PE
10221 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10222 to avoid potential buffer overrun.
10223
670741ab
PE
10224 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10225 if X resource line is longer than 512 bytes.
10226
b7163a50
PE
10227 * xfns.c (x_window): Make sprintf buffer a bit bigger
10228 to avoid potential buffer overrun.
10229
ae58ff1f
PE
10230 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10231
c43c8a6a
PE
10232 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10233
3f8236f4
PE
102342011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10235
53e9fe90 10236 Integer overflow fixes for scrolling, etc.
6511acf2
PE
10237 Without these, Emacs silently mishandles large integers sometimes.
10238 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
10239 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10240
6511acf2
PE
10241 * xdisp.c (try_window_id): Check Emacs fixnum range before
10242 converting to 'int'.
806add1d 10243
6511acf2 10244 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
10245 Check that an Emacs fixnum is in range before assigning it to 'int'.
10246 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10247 values converted from Emacs fixnums.
10248 (Frecenter): Don't wrap around a line count if it is out of 'int'
10249 range; instead, treat it as an extreme value.
10250 (Fset_window_configuration, compare_window_configurations):
10251 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10252
6511acf2
PE
10253 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10254 that can exceed INT_MAX. Check that EMACS_INT value is in range
10255 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
10256 (match_limit): Don't assume that a fixnum can fit in 'int'.
10257
6511acf2 10258 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
10259 exceed INT_MAX.
10260
6511acf2 10261 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
10262 (Fvertical_motion): Don't wrap around LINES values that don't fit
10263 in 'int'. Instead, treat them as extreme values. This is good
10264 enough for windows, which can't have more than INT_MAX lines anyway.
10265
fcb901a7
LMI
102662011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10267
0f2f6b6d
LMI
10268 * Require libxml/parser.h to avoid compilation warning.
10269
fcb901a7
LMI
10270 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10271
10272 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10273 since this reportedly can destroy thread storage.
10274
6e20a0d4
CY
102752011-08-30 Chong Yidong <cyd@stupidchicken.com>
10276
10277 * syntax.c (find_defun_start): Update all cache variables if
10278 exiting early (Bug#9401).
10279
148ae00e
EZ
102802011-08-30 Eli Zaretskii <eliz@gnu.org>
10281
f6cfbd8f
EZ
10282 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10283
148ae00e
EZ
10284 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10285 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10286 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10287
10288 * term.c (tty_append_glyph): New function.
10289 (produce_stretch_glyph): Static function and its prototype deleted.
10290
a66cfb1c
SM
10291 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10292 Add prototypes.
148ae00e 10293
c4a07a4c
PE
102942011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10295
10296 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10297 when checking :margin (Bug#9390).
10298 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 10299 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
10300 so that the name doesn't mislead. All uses changed.
10301
6bc8cd65
JB
103022011-08-28 Johan Bockgård <bojohan@gnu.org>
10303
10304 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10305 set_tty_hooks.
10306
dca4927e
EZ
103072011-08-27 Eli Zaretskii <eliz@gnu.org>
10308
10309 * xdisp.c (move_it_to): Don't bail out early when reaching
10310 position beyond to_charpos, if we are scanning backwards.
10311 (move_it_vertically_backward): When DY == 0, make sure we get to
10312 the first character in the line after the newline.
10313
f2cad773
PE
103142011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10315
10316 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10317 (ccl_driver): Do not generate an out-of-range pointer.
10318 (Fccl_execute_on_string): Remove unnecessary check for
10319 integer overflow, noted by Stefan Monnier in
10320 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10321 Remove a FIXME that didn't need fixing.
10322 Simplify the newly-introduced buffer reallocation code.
10323
0cae2cdb
JB
103242011-08-27 Juanma Barranquero <lekktu@gmail.com>
10325
10326 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10327
5fc295a4 103282011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 10329
70c60eb2 10330 Integer and memory overflow issues (Bug#9196).
726e0ab1 10331
d31850da
PE
10332 * doc.c (get_doc_string): Rework so that
10333 get_doc_string_buffer_size is the actual buffer size, rather than
10334 being 1 less than the actual buffer size; this makes xpalloc more
10335 convenient.
10336
a69fbedb
PE
10337 * image.c (x_allocate_bitmap_record, cache_image):
10338 * xselect.c (Fx_register_dnd_atom):
10339 Simplify previous changes by using xpalloc.
10340
fe5c5d37
PE
10341 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10342 since either will do and ptrdiff_t is convenient with xpalloc.
10343
0065d054
PE
10344 * charset.c (charset_table_size)
10345 (struct charset_sort_data.priority): Now ptrdiff_t.
10346 (charset_compare): Don't overflow if priorities differ greatly.
10347 (Fsort_charsets): Don't assume list length fits in int.
10348 Check for size-calculation overflow when allocating sort data.
10349 (syms_of_charset): Allocate an initial charset table that is
10350 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10351
10352 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10353
10354 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10355 The actual value is always <= INT_MAX, and leaving it unsigned made
10356 overflow checking harder.
10357
10358 * dispextern.h (struct glyph_matrix.rows_allocated)
10359 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10360 with xpalloc. The values are still always <= INT_MAX.
10361
10362 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10363
10364 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10365 (SAFE_NALLOCA): New macro.
10366
10367 * region-cache.c (struct boundary.pos, find_cache_boundary)
10368 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10369 (set_cache_region, invalidate_region_cache)
10370 (revalidate_region_cache, know_region_cache, region_cache_forward)
10371 (region_cache_backward, pp_cache):
10372 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10373 so that ptrdiff_t * can be passed to xpalloc.
10374 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10375 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10376 (pp_cache): Don't assume cache_len fits in int.
10377 * region-cache.h: Adjust extern decls to match.
10378
10379 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10380 EMACS_INT, since either will do, for xpalloc.
10381
10382 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10383 (xnmalloc, xnrealloc, xpalloc): New functions.
10384
726e0ab1
PE
10385 * bidi.c (bidi_shelve_header_size): New constant.
10386 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10387 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10388
51f30bc5 10389 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
10390 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10391 (overlay_strings):
10392 Don't update size of array until after memory allocation succeeds,
10393 because xmalloc/xrealloc may not return.
0065d054
PE
10394 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10395 now that we have proper integer overflow checking.
10396 (record_overlay_string, overlay_strings): Catch overflows when
10397 calculating size of overlay_str_buf.
726e0ab1 10398
0065d054
PE
10399 * callproc.c (Fcall_process): Check for size overflow when
10400 calculating size of args2.
10401 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10402 Normally we prefer signed values, but sticking with ptrdiff_t would
10403 require adding more-complicated checks.
726e0ab1
PE
10404
10405 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10406 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10407 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 10408 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
10409
10410 * character.c (Fstring): Check for size-calculation overflow.
10411
10412 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10413 unnecessary integer overflow. Check for size overflow.
10414 (encode_coding_object): Don't update size until xmalloc succeeds.
10415
10416 * composite.c (get_composition_id): Check for overflow in glyph
10417 length calculations.
10418
10419 Integer and memory overflow fixes for display code.
10420 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10421 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10422 (scrolling_window): Check for overflow in size calculations.
10423 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10424 Don't assume glyph table len fits in int.
10425 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10426 (row_table_size): Now ptrdiff_t, not int.
10427 (scrolling_window): Avoid overflow in size calculations.
10428 Don't update size until allocation succeeds.
10429 * fns.c (concat): Check for overflow in size calculations.
10430 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10431 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10432 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10433
10434 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10435 (get_doc_string): Check for size calculation overflow.
10436 Don't update size until allocation succeeds.
10437 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10438 EMACS_INT, where ptrdiff_t will do.
10439 (Fsubstitute_command_keys): Check for string overflow.
10440
10441 * editfns.c (set_time_zone_rule): Don't assume environment length
10442 fits in int.
10443 (message_length): Now ptrdiff_t, not int.
10444 (Fmessage_box): Don't update size until allocation succeeds.
10445 Don't assume message length fits in int.
10446 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10447
0065d054
PE
10448 * emacs.c (main): Do not reallocate argv, since there is a null at
10449 the end that can be overwritten, and this way there's no need to
10450 worry about size-calculation overflow.
10451 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
10452
10453 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10454 alloc succeeds.
10455 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10456
10457 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10458 (x_set_scroll_bar_width, x_figure_window_size):
10459 Check for integer overflow.
10460 (x_set_alpha): Do not assume XINT fits in int.
10461
10462 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10463 This is for the members text_lines, text_cols, total_lines, total_cols,
10464 where the system imposes an 'int' limit.
10465
10466 * fringe.c (Fdefine_fringe_bitmap):
10467 Don't update size until alloc works.
10468
10469 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10470 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10471
10472 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10473 Check for size-calculation overflow.
10474 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10475 do, as we prefer signed integers.
10476 (id_to_widget.max_size, id_to_widget.used)
10477 (xg_store_widget_in_map, xg_remove_widget_from_map)
10478 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10479 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10480 Use and return ptrdiff_t, not int.
10481 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10482 * gtkutil.h: Change prototypes to match the above.
10483
10484 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10485 are duplicate now that they've been promoted to lisp.h.
10486 (x_allocate_bitmap_record, x_alloc_image_color)
10487 (make_image_cache, cache_image, xpm_load):
10488 Don't update size until alloc is done.
10489 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10490 (x_detect_edges):
3256efce 10491 Check for size calculation overflow.
726e0ab1
PE
10492 (ct_colors_allocated_max): New constant.
10493 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10494 overflow.
3256efce 10495
726e0ab1
PE
10496 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10497 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10498 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10499 Use ptrdiff_t, not int, to count maps.
10500 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
10501 calculations. Don't update size until allocation succeeds.
10502 Redo calculations to avoid overflow.
726e0ab1
PE
10503 * keyboard.h: Change prototypes to match the above.
10504
10505 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10506 to count maps.
10507 (current_minor_maps): Check for size calculation overflow.
10508 * keymap.h: Change prototypes to match the above.
10509
10510 * lread.c (read1, init_obarray): Don't update size until alloc done.
10511
10512 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10513 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10514
726e0ab1
PE
10515 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10516 Now ptrdiff_t, not int.
10517 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10518 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10519
10520 * process.c (Fnetwork_interface_list): Check for overflow
10521 in size calculation.
10522
10523 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10524
10525 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10526 overflow. Don't bother calling xmalloc when xrealloc will do.
10527
10528 * search.c (Freplace_match): Check for size calculation overflow.
10529 (Fset_match_data): Don't assume list lengths fit in 'int'.
10530
10531 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10532 for command line length. Do not attempt to address one before the
10533 beginning of an array, as that's not portable.
10534
10535 * term.c (max_frame_lines): Remove; unused.
10536 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10537 not int.
10538 (encode_terminal_code, calculate_costs): Check for size
10539 calculation overflow.
10540 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10541 table lengths and related sizes. Don't update size until alloc
10542 done. Redo calculations to avoid overflow.
10543 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10544
10545 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10546 subtracting pointers.
10547 (gobble_line): Check for overflow more carefully. Don't update size
10548 until alloc done.
10549
10550 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10551 Don't update size until alloc done.
10552 Redo size calculations to avoid overflow.
10553 Check for size calculation overflow.
0065d054 10554 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
10555
10556 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10557 Use ptrdiff_t, not int, for sizes.
10558 (store_mode_line_noprop_char): Don't update size until alloc done.
10559
0065d054
PE
10560 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10561 Use ptrdiff_t, not int, for sizes.
10562 (Finternal_make_lisp_face, cache_face):
10563 Check for size calculation overflow.
10564 (cache_face): Treat size calculation overflows as if they were
10565 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
10566
10567 * xfns.c (x_encode_text, x_set_name_internal)
10568 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10569 sizes, since they can exceed INT_MAX in size. Check for size
10570 calculation overflow.
10571
0065d054
PE
10572 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10573 (xg_select): Check for size calculation overflow.
726e0ab1
PE
10574 Don't update size until alloc done.
10575
0065d054 10576 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 10577 as sprintf is limited to int lengths.
1d526e2f 10578
252c5ee1
PE
10579 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10580 (X_LONG_MIN): New macros.
864d7ce7
PE
10581 Use them to make the following changes clearer.
10582 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10583 This change doesn't affect the value now, but it may help remind
10584 future maintainers not to raise the value too much later.
10585 (SELECTION_QUANTUM): Remove, replacing with ...
10586 (selection_quantum): ... new function, which avoids overflow.
10587 All uses changed.
10588 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10589 assumption that selection length fits in 'int'.
10590 (x_reply_selection_request, x_handle_selection_request)
10591 (x_get_window_property, receive_incremental_selection)
10592 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10593 (lisp_data_to_selection_data, clean_local_selection_data):
10594 Use ptrdiff_t, not int, to record length of selection.
10595 (x_reply_selection_request, x_get_window_property)
10596 (receive_incremental_selection, x_property_data_to_lisp):
10597 Redo calculations to avoid overflow.
10598 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 10599 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
10600 something.
10601 (x_get_window_property, receive_incremental_selection)
10602 (lisp_data_to_selection_data, x_property_data_to_lisp):
10603 Check for size-calculation overflow.
10604 (x_get_window_property, receive_incremental_selection)
10605 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10606 Don't store size until memory allocation succeeds.
10607 (x_get_window_property): Plug memory leak on memory exhaustion.
10608 Don't double-block input; malloc is safe here. Don't assume 2**34
10609 - 4 fits in unsigned long. Add an xassert to check
10610 XGetWindowProperty overflow. Be more careful about overflow
10611 calculations, and distinguish size from memory overflow better.
10612 (receive_incremental_selection): When tracing, don't assume
10613 unsigned int is less than INT_MAX.
10614 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10615 harmful) conversions of unsigned short to int.
10616 (lisp_data_to_selection_data): Don't assume that integers
10617 in the range -65535 through -1 fit in an X unsigned short.
10618 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10619 result parameters unless successful. Rely on cons_to_unsigned
10620 to report problems with elements; the old code wasn't right anyway.
10621 (x_check_property_data): Check for int overflow; we cannot use
10622 a wider type due to X limits.
10623 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10624
726e0ab1 10625 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 10626
0065d054
PE
10627 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10628 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
10629 (x_color_cells): Don't store size until memory allocation succeeds.
10630 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 10631 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
10632 (x_term_init): Don't assume length fits in int (sprintf is limited
10633 to int size).
bc18e09d 10634
ebfa62c0
PE
10635 Use ptrdiff_t for composition IDs.
10636 * character.c (lisp_string_width):
10637 * composite.c (composition_table_size, n_compositions)
10638 (get_composition_id, composition_gstring_from_id):
10639 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10640 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10641 * window.c (Frecenter):
10642 Use ptrdiff_t, not int, for composition IDs.
10643 * composite.c (get_composition_id): Check for integer overflow.
10644 * composite.h: Adjust prototypes to match the above changes.
10645
d3411f89
PE
10646 Use ptrdiff_t for hash table indexes.
10647 * category.c (hash_get_category_set):
10648 * ccl.c (ccl_driver):
10649 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10650 * coding.c (coding_system_charset_list, detect_coding_system):
10651 * coding.h (struct coding_system.id):
10652 * composite.c (get_composition_id, gstring_lookup_cache):
10653 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10654 * image.c (xpm_get_color_table_h):
10655 * lisp.h (hash_lookup, hash_put):
10656 * minibuf.c (Ftest_completion):
10657 Use ptrdiff_t for hash table indexes, not int (which is too
10658 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10659 32-bit --with-wide-int hosts).
10660
e097a6fa
PE
10661 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10662 Add a FIXME comment about memory leaks.
10663 (syms_of_charset): Don't assume xmalloc returns.
10664
5637687f
PE
10665 Don't assume that stated character widths fit in int.
10666 * character.c (Fchar_width, c_string_width, lisp_string_width):
10667 * character.h (CHAR_WIDTH):
10668 * indent.c (MULTIBYTE_BYTES_WIDTH):
10669 Use sanitize_char_width to avoid undefined and/or bad behavior
10670 with outlandish widths.
a66cfb1c 10671 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
10672 now that we have two such functions. All uses changed.
10673 (sanitize_char_width): New inline function.
10674
a2271ba2
PE
10675 Don't assume that tab-width fits in int.
10676 * character.h (sanitize_width): New inline function.
10677 (SANE_TAB_WIDTH): New macro.
10678 (ASCII_CHAR_WIDTH): Use it.
10679 * indent.c (sane_tab_width): Remove. All uses replaced by
10680 SANE_TAB_WIDTH (current_buffer).
10681 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10682
18c52557
PE
10683 * fileio.c: Integer overflow issues with file modes.
10684 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10685
caeeedc1
PE
10686 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10687 Remove unreachable code.
10688 (read_hex, load_charset_map_from_file): Check for integer overflow.
10689
6df6ae42 10690 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
10691 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10692 (x_send_scroll_bar_event): Likewise. Check that the size does not
10693 exceed limits imposed by XClientMessageEvent, as well as the usual
10694 ptrdiff_t and size_t limits.
10695
b13995db
PE
10696 * keyboard.c: Overflow, signedness and related fixes.
10697 (make_lispy_movement): Use same integer type in forward decl
10698 that is used in the definition.
10699 (read_key_sequence, keyremap_step):
10700 Change bufsize argument back to int, undoing my 2011-03-30 change.
10701 We prefer signed types, and int is wide enough here.
10702 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10703 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10704 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10705 length, not size_t. Use ptrdiff_t for index, not int.
10706 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10707 possibility of integer overflow.
10708
13464394
PE
10709 Overflow, signedness and related fixes for images.
10710
10711 * dispextern.h (struct it.stack[0].u.image.image_id)
10712 (struct_it.image_id, struct image.id, struct image_cache.size)
10713 (struct image_cache.used, struct image_cache.ref_count):
10714 * gtkutil.c (update_frame_tool_bar):
10715 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10716 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10717 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10718 * nsmenu.m (update_frame_tool_bar):
10719 * xdisp.c (calc_pixel_width_or_height):
10720 * xfns.c (image_cache_refcount):
10721 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10722 on typical 64-bit hosts.
10723
10724 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10725 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10726 Omit unnecessary casts to int.
10727 (parse_image_spec): Check that integers fall into 'int' range
10728 when the callers expect that.
10729 (image_ascent): Redo ascent calculation to avoid int overflow.
10730 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10731 (lookup_image): Remove unnecessary tests.
10732 (xbm_image_p): Locals are now of int, not EMACS_INT,
10733 since parse_image_check makes sure they fit into int.
10734 (png_load, gif_load, svg_load_image):
10735 Prefer int to unsigned where either will do.
10736 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
10737 old tiff_error_handler and tiff_warning_handler.
10738 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
10739 stack buffer overflows. It uses only the features of vsnprintf
10740 that are common to both POSIX and native Microsoft.
10741 (tiff_error_handler, tiff_warning_handler): Use it.
10742 (tiff_load, gif_load, imagemagick_load_image):
10743 Don't assume :index value fits in 'int'.
10744 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10745 (imagemagick_load_image): Check that crop parameters fit into
10746 the integer types that MagickCropImage accepts. Don't assume
10747 Vimagemagick_render_type has a nonnegative value. Don't assume
10748 size_t fits in 'long'.
10749 (gs_load): Use printmax_t to print the widest integers possible.
10750 Check for integer overflow when computing image height and width.
10751
c11821d4
EZ
107522011-08-26 Eli Zaretskii <eliz@gnu.org>
10753
10754 * xdisp.c (redisplay_window): Don't force window start if point
10755 will be invisible in the resulting window. (Bug#9324)
10756
0c95fcf7
EZ
107572011-08-25 Eli Zaretskii <eliz@gnu.org>
10758
10759 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10760 the display spec is of the form `(space ...)'.
10761 (handle_display_spec): Return the value returned by
10762 handle_single_display_spec, not just 1 or zero.
10763 (handle_single_display_spec): If the display spec is of the form
10764 `(space ...)', and specifies display in the text area, return 2
10765 rather than 1.
fee65a97 10766 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
10767 accurately, and prefer exact match for point under bidi.
10768 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
10769
10770 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10771 into disp_prop; all users changed.
10772
10773 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10774 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10775 for the text covered by the display property.
10776
e4ed06f1
CY
107772011-08-25 Chong Yidong <cyd@stupidchicken.com>
10778
10779 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10780 Change return value to nil.
10781 (Frecord_buffer): Delete unused function.
10782
f67cdd7f
EZ
107832011-08-24 Eli Zaretskii <eliz@gnu.org>
10784
5980d4c6
EZ
10785 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10786 buffers, return left-to-right.
8610fe8b
EZ
10787 (set_cursor_from_row): Consider candidate row a win if its glyph
10788 represents a newline and point is on that newline. Fixes cursor
10789 positioning on the newline at EOL of R2L text within L2R
10790 paragraph, and vice versa.
10791 (try_cursor_movement): Check continued rows, in addition to
10792 continuation rows. Fixes unwarranted scroll when point enters a
10793 continued line of R2L text within an L2R paragraph, or vice versa.
10794 (cursor_row_p): Consider the case of point being equal to
10795 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10796 from the end of a short line to the beginning of a continued line
10797 of R2L text within L2R paragraph.
10798 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10799 composed characters.
5980d4c6 10800
f67cdd7f
EZ
10801 * bidi.c (bidi_check_type): Use xassert.
10802 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10803 members.
10804
bca633fb
EZ
108052011-08-23 Eli Zaretskii <eliz@gnu.org>
10806
10807 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10808 a character.
10809
4a5885a7
CY
108102011-08-23 Chong Yidong <cyd@stupidchicken.com>
10811
10812 * nsfont.m (ns_otf_to_script): Fix typo.
10813
0902a04e
KH
108142011-08-22 Kenichi Handa <handa@m17n.org>
10815
10816 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10817 extra slot even if the purpose is char-code-property-table.
10818
1a2e6670
EZ
108192011-08-23 Eli Zaretskii <eliz@gnu.org>
10820
8ddde651
EZ
10821 * xdisp.c (redisplay_window): When computing centering_position,
10822 account for the height of the header line. (Bug#8874)
10823
425cc014
EZ
10824 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10825 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10826 candidate is selected by the mouse, and that candidate has a
10827 composed character under the mouse.
10828
1a2e6670
EZ
10829 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10830 coordinates reported by pos-visible-in-window-p for a composed
10831 character in column zero.
10832
8b76d6f8
SM
108332011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10834
10835 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10836
dac347dd
EZ
108372011-08-22 Eli Zaretskii <eliz@gnu.org>
10838
10839 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10840 consider it a hit if to_charpos is anywhere in the range of the
10841 composed buffer positions.
10842
e013fb34
CY
108432011-08-22 Chong Yidong <cyd@stupidchicken.com>
10844
10845 * image.c (gif_load): Don't assume that each subimage has the same
10846 dimensions as the base image. Handle disposal method that is
10847 "undefined" by the gif spec (Bug#9335).
10848
bd1ba3e8
CY
108492011-08-20 Chong Yidong <cyd@stupidchicken.com>
10850
10851 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 10852 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 10853
54a1215b
EZ
108542011-08-19 Eli Zaretskii <eliz@gnu.org>
10855
823564e5
EZ
10856 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10857 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10858 from an Org mode buffer to a Speedbar frame.
10859
54a1215b
EZ
10860 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10861 a composition, take its buffer position from IT->cmp_it.charpos.
10862 Fixes cursor positioning at the beginning of a line that begins
10863 with a composed character.
10864
9778ebcc
EZ
108652011-08-18 Eli Zaretskii <eliz@gnu.org>
10866
0be6ee06
EZ
10867 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10868 character bidirectional type, use STRONG_L instead. Fixes crashes
10869 in a buffer produced by `describe-categories'.
10870
9778ebcc
EZ
10871 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10872 members before the level stack, so they would be saved and
10873 restored when copying iterator state. Fixes incorrect reordering
10874 around TABs covered by display properties.
10875
156bffbe
AS
108762011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10877
6b02f655 10878 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 10879
72ad093b
CY
108802011-08-17 Chong Yidong <cyd@stupidchicken.com>
10881
10882 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
10883 (internal_condition_case_2, internal_condition_case_n):
10884 Remove unnecessary aborts (Bug#9081).
72ad093b 10885
35774242
EZ
108862011-08-17 Eli Zaretskii <eliz@gnu.org>
10887
10888 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10889 has no `load' handler, try opening the file locally. (Bug#9311)
10890
db76dd85
KB
108912011-08-16 Ken Brown <kbrown@cornell.edu>
10892
10893 * gmalloc.c: Expand comment.
10894
b215eee5
EZ
108952011-08-16 Eli Zaretskii <eliz@gnu.org>
10896
10897 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10898 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10899
a4579d33
KB
109002011-08-16 Ken Brown <kbrown@cornell.edu>
10901
10902 Fix memory allocation problems in Cygwin build (Bug#9273).
10903
10904 * unexcw.c ( __malloc_initialized): Declare external variable.
10905 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10906
8b76d6f8
SM
10907 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10908 New variables.
a4579d33
KB
10909 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10910 dumped emacs.
10911 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10912 in the static heap.
10913 [CYGWIN] (special_realloc): New function.
10914 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10915 requests to realloc storage in the static heap.
10916
3ebec551
PE
109172011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10918
10919 * bidi.c (bidi_initialize): Remove unused local.
10920
9fd8be00
EZ
109212011-08-15 Eli Zaretskii <eliz@gnu.org>
10922
6b02f655
SM
10923 * bidimirror.h:
10924 * biditype.h: Remove file.
10925 * makefile.w32-in ($(BLD)/bidi.$(O)):
10926 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
10927
10928 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10929
10930 * chartab.c: Improve commentary for the uniprop_table API.
10931
32413314
EZ
10932 * bidi.c (bidi_paragraph_init): Support zero value of
10933 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
10934 (bidi_initialize): Use uniprop_table instead of including
10935 biditype.h and bidimirror.h.
32413314 10936
9fd8be00
EZ
10937 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10938 coordinates of the iterator when restoring from ppos_it.
10939 (Bug#9296)
10940
5cf2b69b
KH
109412011-08-14 Kenichi Handa <handa@m17n.org>
10942
10943 * process.c (create_process): Call setup_process_coding_systems
72ad093b 10944 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 10945
daf17d00
EZ
109462011-08-14 Eli Zaretskii <eliz@gnu.org>
10947
10948 * xdisp.c (move_it_in_display_line_to): Don't invoke
10949 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10950 ppos_it. Fixes vertical cursor motion when line beginning is
10951 covered by an image. (Bug#9296)
10952
08e3161a
JD
109532011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10954
10955 * nsterm.h (ns_run_ascript): Declare.
10956 (NSAPP_DATA2_RUNASSCRIPT): Define.
10957
10958 * nsfns.m (as_script, as_result, as_status): New static variables.
10959 (ns_run_ascript): New function.
5e617bc2 10960 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
10961 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10962 the event loop. Get status from as_status (Bug#7276).
10963
10964 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10965 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10966 the event loop (Bug#7276).
10967
a3720aa2
AS
109682011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10969
10970 * gnutls.c (QCgnutls_bootprop_priority)
10971 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10972 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10973 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10974 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10975 (QCgnutls_bootprop_verify_hostname_error)
10976 (QCgnutls_bootprop_callbacks_verify): Rename from
10977 Qgnutls_bootprop_..., all uses changed.
10978
10979 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10980 uses changed.
10981
0a0d27fb
PE
109822011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10983
19d5c50c
PE
10984 * xfaces.c (Qframe_set_background_mode): Now static.
10985 * dispextern.h (Qframe_set_background_mode): Remove decl.
10986
0a0d27fb
PE
10987 * process.c (Fnetwork_interface_info): Declare local only if needed.
10988
377538cb
JD
109892011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10990
10991 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10992 (Fnetwork_interface_list): Allocate in increments of bytes instead
10993 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10994 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10995 sockaddr.
10996 (struct ifflag_def): notrailers is smart on OSX.
10997 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10998 Get hardware address with getifaddrs if available.
10999
08fff70c
EZ
110002011-08-12 Eli Zaretskii <eliz@gnu.org>
11001
11002 * xdisp.c (iterate_out_of_display_property): xassert that
11003 IT->position is set to within IT->object's boundaries. Break from
11004 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11005 when IT->position is set up wrongly due to some bug.
11006 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11007 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11008 entry. Force push_it to save on the stack the current
11009 buffer/string position, to be restored by pop_it. Fix flags in
11010 the iterator structure wrt the object coming from a display
11011 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11012 properties. (Bug#9284)
11013
7be1c708 110142011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11015
7be1c708
CY
11016 * fontset.c (fontset_get_font_group): Add proper type checks.
11017 (Bug#9172)
aac0c6e3 11018
7be1c708 110192011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11020
7be1c708
CY
11021 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11022 and LC_VERSION_MIN_MACOSX.
11023 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11024 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11025
97bb72a6
EZ
110262011-08-08 Eli Zaretskii <eliz@gnu.org>
11027
11028 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11029 no-display-properties-and-no-overlays under bidi display.
11030 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11031 properties and overlays.
97bb72a6 11032
d5617611
CY
110332011-08-08 Chong Yidong <cyd@stupidchicken.com>
11034
37e11a63
CY
11035 * editfns.c (Fset_time_zone_rule): Document relationship with the
11036 setenv function.
11037
d5617611
CY
11038 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11039 the font entity extracted from the cache (Bug#8109).
11040
58872834
CY
110412011-08-07 Chong Yidong <cyd@stupidchicken.com>
11042
11043 * composite.c (autocmp_chars): Don't reset point. That is done by
11044 restore_point_unwind (Bug#5984).
11045
75bfc667
JL
110462011-08-07 Juri Linkov <juri@jurta.org>
11047
11048 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11049 to show the arg `TIME' instead of `TIMEVAL'.
11050
d1410150
EZ
110512011-08-06 Eli Zaretskii <eliz@gnu.org>
11052
11053 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11054 display property strides EOL and includes a newline, as in
11055 longlines-mode. (Bug#9254)
75b771e4
EZ
11056 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11057 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11058
11059 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11060 is non-zero, even if the data buffer is NULL. Fixes a crash in
11061 vertical-motion with longlines-mode. (Bug#9254)
11062
35928349
EZ
110632011-08-05 Eli Zaretskii <eliz@gnu.org>
11064
ec7cc85b
EZ
11065 * bidi.c <bidi_cache_total_alloc>: Now static.
11066 (bidi_initialize): Initialize bidi_cache_total_alloc.
11067
8b76d6f8 11068 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11069 cache. (Bug#9221)
11070
11071 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11072 amount allocated this far in `bidi_cache_total_alloc'.
11073 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11074 non-zero, only free the data buffer without restoring the cache
11075 contents. All callers changed.
11076
11077 * dispextern.h (bidi_unshelve_cache): Update prototype.
11078
11079 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11080 (move_it_in_display_line, move_it_to)
11081 (move_it_vertically_backward, move_it_by_lines): Replace the call
11082 to xfree to an equivalent call to bidi_unshelve_cache.
11083 (move_it_in_display_line_to): Fix logic of returning
412b6358 11084 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11085
e2e2423b
EZ
110862011-08-05 Eli Zaretskii <eliz@gnu.org>
11087
11088 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11089 came from a string character with a `cursor' property. (Bug#9229)
11090
ae9e757a
JD
110912011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11092
11093 * Makefile.in (LIB_PTHREAD): New variable.
11094 (LIBES): Add LIB_PTHREAD (Bug#9216).
11095
11096 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11097 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11098
213bd7f2
AS
110992011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11100
6b02f655 11101 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11102
99aaf75f
JD
111032011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11104
11105 * xterm.c (x_find_topmost_parent): New function.
11106 (x_set_frame_alpha): Find topmost parent window with
11107 x_find_topmost_parent and set the property there also (bug#9181).
11108 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11109
c74e9d86
PE
111102011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11111
11112 * callproc.c (Fcall_process): Avoid vfork clobbering
11113 the local vars buffer, coding_systems, current_dir.
11114
640c8776
SM
111152011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11116
11117 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11118
f26d0e4c
PE
111192011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11120
8a10d76c
PE
11121 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11122 so that it is not optimized away.
11123
f26d0e4c
PE
11124 * xdisp.c (compute_display_string_pos): Remove unused local.
11125
55439c61
EZ
111262011-08-02 Eli Zaretskii <eliz@gnu.org>
11127
11128 Fix slow cursor motion and scrolling in large buffers with
11129 selective display, like Org Mode buffers. (Bug#9218)
11130
11131 * dispextern.h (struct bidi_it): New member disp_prop_p.
11132
11133 * xdisp.c: Remove one-slot cache of display string positions.
11134 (compute_display_string_pos): Accept an additional argument
5e617bc2 11135 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11136 for a display string or property. If found, set DISP_PROP_P
11137 non-zero.
11138
11139 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11140 DISP_PROP_P, and pass it to compute_display_string_pos.
11141 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
11142 non-zero. All callers of bidi_fetch_char changed.
11143
fb33fa43
SM
111442011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11145
11146 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11147
b099e063
DM
111482010-12-03 Don March <don@ohspite.net>
11149
11150 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11151 last character M-[char] is translated to ESC [char] (bug#7541).
11152
5cc7f7af
KH
111532011-08-02 Kenichi Handa <handa@m17n.org>
11154
d0fffa3f 11155 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
11156
11157 * chartab.c (uniprop_table): Make it non-static.
11158
525d5e6e
EZ
111592011-08-01 Eli Zaretskii <eliz@gnu.org>
11160
11161 * xdisp.c (forward_to_next_line_start): Accept additional argument
11162 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11163 on the newline.
11164 (reseat_at_next_visible_line_start): Use the bidi iterator state
11165 returned by forward_to_next_line_start to restore the state of
11166 it->bidi_it after backing up to previous newline. (Bug#9212)
11167
31011111
AS
111682011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11169
11170 * regex.c (re_comp): Protoize.
11171 (re_exec): Fix return type.
11172 (regexec): Fix type of `ret'. (Bug#9203)
11173
476371c4
PE
111742011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11175
e5d76069
PE
11176 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11177 This is needed if max-image-size is a floating-point number.
11178
9a79b20c
AS
111792011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11180
11181 * print.c (print_object): Print empty symbol as ##.
11182
11183 * lread.c (read1): Read ## as empty symbol.
11184
d8c2fa78
AA
111852011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11186
11187 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11188 setting frame foreground color (Bug#9175).
11189 (x_set_background_color): Likewise.
11190
ffe57a7a
AA
11191 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11192 contents (Bug#9176).
11193 (EmacsTooltip -init): Remove bezels and add shadows to
11194 tooltip windows.
11195
bf3492a5
AA
11196 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11197 or scroll bar (Bug#8470).
11198
d55e9c53
AA
11199 * nsfont.m (nsfont_open): Remove assignment to voffset and
11200 unnecessary vars hshink, expand, hd, full_height, min_height.
11201 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11202
11203 * nsterm.h (nsfont_info): Remove voffset field.
11204
d8c2fa78 112052011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
11206
11207 Implement strike-through and overline on NextStep (Bug#8863).
11208
11209 * nsfont.m (nsfont_open): Use underline position provided by font,
11210 instead of hard-coded value of 2.
11211 (nsfont_draw): Call ns_draw_text_decoration instead.
11212
11213 * nsterm.h: Add declaration for ns_draw_text_decoration.
11214
11215 * nsterm.m (ns_draw_text_decoration): New function for drawing
11216 underline, overline, and strike-through.
11217 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11218 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 11219 accommodate underlining, etc.
4843aac3 11220
4cc60b9b
EZ
112212011-07-28 Eli Zaretskii <eliz@gnu.org>
11222
bc7ece87
EZ
11223 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11224 default.
4cc60b9b 11225
476371c4
PE
112262011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11227
66606eea
PE
11228 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11229 Without this fix, if a signal arrives just after memory fills up,
11230 'malloc' might be invoked reentrantly.
11231
476371c4
PE
11232 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11233 In other words, assume that every image size is allowed, on non-X
11234 hosts. This assumption is probably wrong, but it lets Emacs compile.
11235
f3fcc40d
AS
112362011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11237
11238 * regex.c (re_iswctype): Convert return values to boolean.
11239
350c992f
EZ
112402011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11241
11242 * xdisp.c (compute_display_string_pos): Don't use cached display
11243 string position if the buffer had its restriction changed.
11244 (Bug#9184)
11245
5266b4bb
PE
112462011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11247
11248 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11249
2573a837 112502011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 11251
41f55ccd 11252 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 11253
39e378da
PE
11254 * bidi.c: Integer size and overflow fixes.
11255 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11256 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11257 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11258 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11259 (bidi_find_other_level_edge):
11260 Use ptrdiff_t instead of EMACS_INT where either will do.
11261 This works better on 32-bit hosts configured --with-wide-int.
11262 (bidi_cache_ensure_space): Check for size-calculation overflow.
11263 Use % rather than repeated addition, for better worst-case speed.
11264 Don't set bidi_cache_size until after xrealloc returns, because it
11265 might not return.
11266 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
11267 (bidi_cache_ensure_space): Also check that the bidi cache size
11268 does not exceed that of the largest Lisp string or buffer. See Eli
11269 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 11270
5e927815
PE
11271 * alloc.c (__malloc_size_t): Remove.
11272 All uses replaced by size_t. See Andreas Schwab's note
11273 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11274
ca4aa935
PE
11275 * image.c: Improve checking for integer overflow.
11276 (check_image_size): Assume that f is nonnull, since
11277 it is always nonnull in practice. This is one less thing to
11278 worry about when checking for integer overflow later.
11279 (x_check_image_size): New function, which checks for integer
11280 overflow issues inside X.
11281 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11282 This removes the need for a memory_full check.
11283 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11284 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11285 (xbm_read_bitmap_data): Change locals back to 'int', since
11286 their values must fit in 'int'.
11287 (xpm_load_image, png_load, tiff_load):
11288 Invoke x_create_x_image_and_pixmap earlier,
11289 to avoid much needless work if the image is too large.
11290 (tiff_load): Treat overly large images as if
11291 x_create_x_image_and_pixmap failed, not as malloc failures.
11292 (gs_load): Use x_check_image_size.
11293
5f8f9cc2
PE
11294 * gtkutil.c: Omit integer casts.
11295 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11296 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11297
5adf60bc
PE
11298 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11299
c8907a93
PE
11300 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11301 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11302 would wrongly return t on a 64-bit host.
11303
e3c25c68
PE
11304 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11305 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11306 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11307 and therefore cause GCC to emit a bogus diagnostic in some cases.
11308
3f791afe
PE
11309 * image.c: Integer signedness and overflow and related fixes.
11310 This is not an exhaustive set of fixes, but it's time to
11311 record what I've got.
11312 (lookup_pixel_color, check_image_size): Remove redundant decls.
11313 (check_image_size): Don't assume that arbitrary EMACS_INT values
11314 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11315 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11316 (tiff_load, imagemagick_load_image):
11317 Check for overflow in size calculations.
11318 (x_create_x_image_and_pixmap): Remove unnecessary test for
11319 xmalloc returning NULL; that can't happen.
11320 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11321 (xpm_color_bucket): Use better integer hashing function.
11322 (xpm_cache_color): Don't possibly over-allocate memory.
11323 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11324 (gif_memory_source):
11325 Use ptrdiff_t, not int or size_t, to record sizes.
11326 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11327 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11328 either works, as we prefer signed integers.
11329 (tiff_read_from_memory, tiff_write_from_memory):
11330 Return tsize_t, not size_t, since that's what the TIFF API wants.
11331 (tiff_read_from_memory): Don't fail simply because the read would
11332 go past EOF; instead, return a short read.
11333 (tiff_load): Omit no-longer-needed casts.
11334 (Fimagemagick_types): Don't assume size fits into 'int'.
11335
3cc5a532
PE
11336 Improve hashing quality when configured --with-wide-int.
11337 * fns.c (hash_string): New function, taken from sxhash_string.
11338 Do not discard information about ASCII character case; this
11339 discarding is no longer needed.
11340 (sxhash-string): Use it. Change sig to match it. Caller changed.
11341 * lisp.h: Declare it.
11342 * lread.c (hash_string): Remove, since we now use fns.c's version.
11343 The fns.c version returns a wider integer if --with-wide-int is
11344 specified, so this should help the quality of the hashing a bit.
11345
b312a492
PE
11346 * emacs.c: Integer overflow minor fix.
11347 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11348 Define only if GNU_LINUX.
11349 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11350
dfd153ae
PE
11351 * dispnew.c: Integer signedness and overflow fixes.
11352 Remove unnecessary forward decls, that were a maintenance hassle.
11353 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11354 All uses changed.
11355 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11356 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11357 (prepare_desired_row, line_draw_cost):
11358 Use int, not unsigned, where either works.
11359 (save_current_matrix, restore_current_matrix):
11360 Use ptrdiff_t, not size_t, where either works.
11361 (init_display): Check for overflow more accurately, and without
11362 relying on undefined behavior.
11363
a81d11a3
PE
11364 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11365 Remove, replacing with the new symbols in lisp.h. All uses changed.
11366 * fileio.c (make_temp_name):
11367 * filelock.c (lock_file_1, lock_file):
11368 * xdisp.c (message_dolog):
11369 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11370 Use pMd etc. instead.
11371 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11372 replacing the pWIDE etc. symbols removed from editfns.c.
11373
3300e6fd
PE
11374 * keyboard.h (num_input_events): Now uintmax_t.
11375 This is (very slightly) less likely to mess up due to wraparound.
11376 All uses changed.
11377
fd05c7e9
PE
11378 * buffer.c: Integer signedness fixes.
11379 (alloc_buffer_text, enlarge_buffer_text):
11380 Use ptrdiff_t rather than size_t when either will do, as we prefer
11381 signed integers.
11382
903fe15d
PE
11383 * alloc.c: Integer signedness and overflow fixes.
11384 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11385 (__malloc_size_t): Default to size_t, not to int.
11386 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11387 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11388 Prefer ptrdiff_t to size_t when either would do, as we prefer
11389 signed integers.
11390 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11391 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11392 Now const. Initialize with values that are in range even if char
11393 is signed.
11394 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11395 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11396 These functions do the right thing with sizes > 2**32.
11397 (check_depth): Now ptrdiff_t, not int.
11398 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11399 Adjust to new way of storing sizes. Check for size overflow bugs
11400 in rest of code.
11401 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11402 slightly wrong anyway, as it missed one instance of
11403 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11404 (refill_memory_reserve): Omit needless cast to size_t.
11405 (mark_object_loop_halt): Mark as externally visible.
11406
ac82cc6a
PE
11407 * xselect.c: Integer signedness and overflow fixes.
11408 (Fx_register_dnd_atom, x_handle_dnd_message):
11409 Use ptrdiff_t, not size_t, since we prefer signed.
11410 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11411 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11412 x_dnd_atoms_size and x_dnd_atoms_length.
11413
c2d1e36d
PE
11414 * doprnt.c: Prefer signed to unsigned when either works.
11415 * eval.c (verror):
11416 * doprnt.c (doprnt):
11417 * lisp.h (doprnt):
11418 * xdisp.c (vmessage):
11419 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11420 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11421 prefer signed arithmetic to avoid comparison confusion.
11422 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11423 but is a bit tricky.
11424
0e926e56
PE
11425 Assume freestanding C89 headers, string.h, stdlib.h.
11426 * data.c, doprnt.c, floatfns.c, print.c:
11427 Include float.h unconditionally.
11428 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11429 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11430 * regex.c: Likewise for stddef.h, string.h.
11431 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11432 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11433 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11434 (STDC_HEADERS): Remove obsolete defines.
11435 * sysdep.c: Include limits.h unconditionally.
11436
9cfdb3ec
PE
11437 Assume support for memcmp, memcpy, memmove, memset.
11438 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11439 * regex.c (memcmp, memcpy):
11440 Remove; we assume C89 now.
11441
11442 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11443 (__malloc_safe_bcopy): Remove; no longer needed.
11444
cf950e6b 11445 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
11446 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11447 well either way, and we prefer signed to unsigned.
11448
dbf38e02
LMI
114492011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11450
11451 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11452 closes the connection while we're reading (bug#9182).
11453
d6f0886c 114542011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 11455
d6f0886c
JD
11456 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11457 are specified (Bug#9168).
24e0f6b1 11458
2eb1f9e6
PE
114592011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11460
11461 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11462 Found by GCC static checking and --with-wide-int on a 32-bit host.
11463
22381272 114642011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
11465
11466 * xdisp.c (compute_display_string_pos): Fix logic of caching
11467 previous display string position. Initialize cached_prev_pos to
11468 -1. Fixes slow-down at the beginning of a buffer.
11469
f25e39b4
EZ
114702011-07-24 Eli Zaretskii <eliz@gnu.org>
11471
11472 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11473 for attrs[LFACE_FONTSET_INDEX].
11474
04c4b52e
PE
114752011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11476
11477 * xml.c (parse_region): Remove unused local
11478 that was recently introduced.
11479
c1734fbd
EZ
114802011-07-23 Eli Zaretskii <eliz@gnu.org>
11481
be18c5a5
EZ
11482 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11483 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11484
c1734fbd
EZ
11485 * xdisp.c (move_it_in_display_line_to): Record the best matching
11486 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
11487 exit if none of the characters scanned was an exact match.
11488 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
11489 when exact match is impossible due to invisible text, and the
11490 lines are truncated.
11491
a258d627
JD
114922011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11493
11494 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11495 for OSX >= 10.7.
11496
b6d5a689
EZ
114972011-07-22 Eli Zaretskii <eliz@gnu.org>
11498
0f74f785
EZ
11499 Fix a significant slow-down of cursor motion with C-n, C-p,
11500 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11501 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 11502 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
11503 (next_element_from_buffer): Call compute_stop_pos_backwards to
11504 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
11505 base_level_stop.
11506 (reseat): Don't look for prev_stop, as that could mean a very long
11507 run.
11508 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11509 <cached_disp_overlay_modiff>: Cache for last found display string
11510 position.
551918c1 11511 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
11512 about the same buffer in the same area of character positions, and
11513 the buffer wasn't changed since the time the display string
11514 position was cached.
551918c1 11515
b2d0c91a
EZ
115162011-07-22 Eli Zaretskii <eliz@gnu.org>
11517
11518 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11519 is an integer, which is important for empty lines. (Bug#9149)
11520
043604ee
CY
115212011-07-22 Chong Yidong <cyd@stupidchicken.com>
11522
11523 * frame.c (Fmodify_frame_parameters): In tty case, update the
11524 default face if necessary (Bug#4238).
11525
da4adb04
CY
115262011-07-21 Chong Yidong <cyd@stupidchicken.com>
11527
11528 * editfns.c (Fstring_to_char): No need to explain what a character
11529 is in the docstring (Bug#6576).
11530
9abd0532
LMI
115312011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11532
11533 * xml.c (parse_region): Make sure we always return a tree.
11534
36881d16
HK
115352011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11536
11537 * xml.c (parse_region): If a document contains only comments,
11538 return that, too.
11539
1e98674d
LMI
115402011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11541
11542 * xml.c (make_dom): Return comments, too.
11543
590bd467
PE
115442011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11545
11546 Port to OpenBSD.
11547 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11548 and the surrounding thread.
11549 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11550 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11551 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11552 timer goes off.
11553 * s/openbsd.h (BROKEN_SIGIO): Define.
11554 * unexelf.c (unexec) [__OpenBSD__]:
11555 Don't update the .mdebug section of the Alpha COFF symbol table.
11556
f41628b2
LMI
115572011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11558
11559 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11560 (bug#8460).
11561
b59b67c5
PE
115622011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11563
15e3a074
PE
11564 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11565 This fixes some race conditions on the permissions of any newly
11566 created file.
11567
41bed37d
PE
11568 * alloc.c (valid_pointer_p): Use pipe, not open.
11569 This fixes some permissions issues when debugging.
11570
b59b67c5
PE
11571 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11572 If fchown fails to set both uid and gid, try to set just gid,
11573 as that is sometimes allowed. Adjust the file's mode to eliminate
11574 setuid or setgid bits that are inappropriate if fchown fails.
11575
925a6be7
SM
115762011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11577
11578 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11579 to compare Lisp_Objects.
11580 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11581 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11582 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11583
52968808
AS
115842011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11585
0a6a104b
AS
11586 * lread.c (read_integer): Unread even EOF character.
11587 (read1): Likewise. Properly record start position of symbol.
11588
52968808
AS
11589 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11590 symbol character follows.
11591
9e381cdd
PE
115922011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11593
11594 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11595 This works around a problem with the previous change to Fcopy_file.
11596 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11597 and without this change, GCC might complain about discarding
11598 fchown's return value.
11599
b5641435
JB
116002011-07-16 Juanma Barranquero <lekktu@gmail.com>
11601
11602 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11603
a8031457
PE
116042011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11605
11606 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11607
dd889327
LMI
116082011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11609
750c33f7
LMI
11610 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11611 it's used from the C level.
11612
dd889327
LMI
11613 * process.c: Use the same condition for POLL_FOR_INPUT in both
11614 keyboard.c and process.c (bug#1858).
11615
87e86684
LM
116162011-07-09 Lawrence Mitchell <wence@gmx.li>
11617
11618 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11619 (Fgnutls_boot): Use it.
11620
64348f40
AS
116212011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11622
11623 * doc.c (Fsubstitute_command_keys): Revert last change.
11624
1d698799
LMI
116252011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11626
f863868c
LMI
11627 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11628 quotes the next character, and doesn't affect other longer
11629 sequences (bug#8935).
11630
1d698799
LMI
11631 * lread.c (syms_of_lread): Clarify that is isn't only
11632 `eval-buffer' and `eval-defun' that's affected by
11633 `lexical-binding' (bug#8460).
11634
aa4b6df6
EZ
116352011-07-15 Eli Zaretskii <eliz@gnu.org>
11636
11637 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 11638 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 11639
5d856da6
PE
116402011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11641
ad6042bb
PE
11642 Fix minor problems found by static checking.
11643 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11644 (elsz): Now a signed constant, not a size_t var. We prefer signed
11645 types to unsigned, to avoid integer comparison confusion. Without
11646 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11647 "cannot optimize loop, the loop counter may overflow", a symptom
11648 of the confusion.
f00bbb22 11649 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
11650 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11651
6468f31c
LMI
116522011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11653
49080b10
LMI
11654 * search.c (Fre_search_backward): Mention `case-fold-search' in
11655 all the re_search_* functions (bug#8138).
11656
6468f31c
LMI
11657 * keyboard.c (Fopen_dribble_file): Document when the file is
11658 closed (bug#8056).
11659
c965adc5
EZ
116602011-07-14 Eli Zaretskii <eliz@gnu.org>
11661
df9733bf
EZ
11662 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11663 bidi_cache_idx.
11664
0bb23927
EZ
11665 Support bidi reordering of display and overlay strings.
11666 * xdisp.c (compute_display_string_pos)
11667 (compute_display_string_end): Accept additional argument STRING.
11668 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11669 (reseat_to_string): Initialize bidi_it->string.s and
11670 bidi_it->string.schars.
11671 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
11672 NULL (avoids a crash in bidi_paragraph_init).
11673 Initialize itb.string.lstring.
0bb23927
EZ
11674 (init_iterator): Call bidi_init_it only of a valid
11675 buffer position was specified. Initialize paragraph_embedding to
11676 L2R.
11677 (reseat_to_string): Initialize the bidi iterator.
11678 (display_string): If we need to ignore text properties of
11679 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11680 original value of -1 will not work with bidi.)
11681 (compute_display_string_pos): First arg is now struct
11682 `text_pos *'; all callers changed. Support display properties on
11683 Lisp strings.
11684 (compute_display_string_end): Support display properties on Lisp
11685 strings.
11686 (init_iterator, reseat_1, reseat_to_string): Initialize the
11687 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11688 when iterating on a string not from display properties).
640c8776
SM
11689 (compute_display_string_pos, compute_display_string_end):
11690 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
11691 arrow keys.
11692 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
11693 base_level_stop; instead, set base_level_stop to BEGV.
11694 Fixes crashes in vertical-motion.
0bb23927
EZ
11695 (next_element_from_buffer): Improve commentary for when
11696 the iterator is before prev_stop.
11697 (init_iterator): Initialize bidi_p from the default value of
11698 bidi-display-reordering, not from buffer-local value. Use the
11699 buffer-local value only if initializing for buffer iteration.
11700 (handle_invisible_prop): Support invisible properties on strings
11701 that are being bidi-reordered.
11702 (set_iterator_to_next): Support bidi reordering of C strings and
11703 Lisp strings.
11704 (next_element_from_string): Support bidi reordering of Lisp
11705 strings.
11706 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
11707 (display_string): Support display of R2L glyph rows.
11708 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
11709 (init_iterator): Don't initialize it->bidi_p for strings
11710 here.
11711 (reseat_to_string): Initialize it->bidi_p for strings here.
11712 (next_element_from_string, next_element_from_c_string)
11713 (next_element_from_buffer): Add xassert's for correspondence
11714 between IT's object being iterated and it->bidi_it.string
11715 structure.
11716 (face_before_or_after_it_pos): Support bidi iteration.
11717 (next_element_from_c_string): Handle the case of the first string
11718 character that is not the first one in the visual order.
11719 (get_visually_first_element): New function, refactored from common
11720 parts of next_element_from_buffer, next_element_from_string, and
11721 next_element_from_c_string.
11722 (tool_bar_lines_needed, redisplay_tool_bar)
11723 (display_menu_bar): Force left-to-right direction. Add a FIXME
11724 comment for making that be controlled by a user option.
11725 (push_it, pop_it): Save and restore the state of the
11726 bidi iterator. Save and restore the bidi_p flag.
11727 (pop_it): Iterate out of display property for string iteration as
11728 well.
11729 (iterate_out_of_display_property): Support iteration over strings.
11730 (handle_single_display_spec): Set up it->bidi_it for iteration
11731 over a display string, and call bidi_init_it.
11732 (handle_single_display_spec, next_overlay_string)
11733 (get_overlay_strings_1, push_display_prop): Set up the bidi
11734 iterator for displaying display or overlay strings.
11735 (forward_to_next_line_start): Don't use the shortcut if
11736 bidi-iterating.
11737 (back_to_previous_visible_line_start): If handle_display_prop
11738 pushed the iterator stack, restore the internal state of the bidi
11739 iterator by calling bidi_pop_it same number of times.
11740 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11741 and we are bidi-iterating, don't decrement the iterator position;
11742 instead, set the first_elt flag in the bidi iterator, to produce
11743 the same effect.
11744 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11745 (push_display_prop): xassert that we are iterating a buffer.
11746 (push_it, pop_it): Save and restore paragraph_embedding member.
11747 (handle_single_display_spec, next_overlay_string)
11748 (get_overlay_strings_1, reseat_1, reseat_to_string)
11749 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11750 correctly. Don't assume unibyte strings are not bidi-reordered.
11751 (compute_display_string_pos)
11752 (compute_display_string_end): Fix handling the case of C string.
11753 (push_it, pop_it): Save and restore from_disp_prop_p.
11754 (handle_single_display_spec, push_display_prop): Set the
11755 from_disp_prop_p flag.
11756 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11757 (pop_it): Call iterate_out_of_display_property only if we are
11758 popping after iteration over a string that came from a display
11759 property. Fix a typo in popping stretch info. Add an assertion
11760 for verifying that the iterator position is in sync with the bidi
11761 iterator.
11762 (handle_single_display_spec, get_overlay_strings_1)
11763 (push_display_prop): Fix initialization of paragraph direction for
11764 string when that of the parent object is not yet determined.
11765 (reseat_1): Call bidi_init_it to resync the bidi
11766 iterator with IT's position. (Bug#7616)
11767 (find_row_edges): If ROW->start.pos gives position
11768 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11769 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11770 Reset the from_disp_prop_p flag.
11771 (SAVE_IT, RESTORE_IT): New macros.
11772 (pos_visible_p, face_before_or_after_it_pos)
11773 (back_to_previous_visible_line_start)
11774 (move_it_in_display_line_to, move_it_in_display_line)
11775 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11776 (try_scrolling, redisplay_window, display_line): Use them when
11777 saving a temporary copy of the iterator and restoring it back.
11778 (back_to_previous_visible_line_start, reseat_1)
11779 (init_iterator): Empty the bidi cache "stack".
11780 (move_it_in_display_line_to): If iterator ended up at
11781 EOL, but we never saw any buffer positions smaller than
11782 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11783 motion in bidi-reordered lines.
11784 (move_it_in_display_line_to): Record prev_method and prev_pos
11785 immediately before the call to set_iterator_to_next. Fixes cursor
11786 motion in bidi-reordered lines with stretch glyphs and strings
11787 displayed in margins. (Bug#8133) (Bug#8867)
11788 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11789 TO_CHARPOS.
640c8776
SM
11790 (pos_visible_p): Support positions in bidi-reordered lines.
11791 Save and restore bidi cache.
0bb23927
EZ
11792
11793 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11794 (bidi_paragraph_info): Delete unused struct.
11795 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11796 (bidi_cache_start): New variable.
11797 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11798 to zero.
11799 (bidi_cache_fetch_state, bidi_cache_search)
11800 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11801 (bidi_cache_find, bidi_peek_at_next_level)
11802 (bidi_level_of_next_char, bidi_find_other_level_edge)
11803 (bidi_move_to_visually_next): Compare cache index with
11804 bidi_cache_start rather than with zero.
11805 (bidi_fetch_char): Accept new argument STRING; all callers
11806 changed. Support iteration over a string. Support strings with
11807 display properties. Support unibyte strings. Fix the type of
11808 `len' according to what STRING_CHAR_AND_LENGTH expects.
11809 (bidi_paragraph_init, bidi_resolve_explicit_1)
11810 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
11811 (bidi_level_of_next_char, bidi_move_to_visually_next):
11812 Support iteration over a string.
0bb23927
EZ
11813 (bidi_set_sor_type, bidi_resolve_explicit_1)
11814 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11815 can now be zero (for strings); special values 0 and -1 were
11816 changed to -1 and -2, respectively.
11817 (bidi_char_at_pos): New function.
11818 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11819 Call it instead of FETCH_MULTIBYTE_CHAR.
11820 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11821 initialized to valid values.
11822 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11823 values.
11824 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11825 the test for valid cached positions. Fix the logic for looking up
11826 the sentinel state in the cache. GCPRO the Lisp string we are
11827 iterating.
11828 (bidi_push_it, bidi_pop_it): New functions.
11829 (bidi_initialize): Initialize the bidi cache start stack pointer.
11830 (bidi_cache_ensure_space): New function, refactored from part of
11831 bidi_cache_iterator_state. Don't assume the required size is just
11832 one BIDI_CACHE_CHUNK away.
11833 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11834 (bidi_count_bytes, bidi_char_at_pos): New functions.
11835 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11836 always valid if bidi_cache_idx is valid.
11837 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11838 is valid if it's going to be used.
11839 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11840 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
11841 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11842 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
11843 (bidi_find_other_level_edge, bidi_cache_start_stack):
11844 All variables related to cache indices are now EMACS_INT.
c965adc5 11845
0bb23927
EZ
11846 * dispextern.h (struct bidi_string_data): New structure.
11847 (struct bidi_it): New member `string'. Make flag members be 1-bit
11848 fields, and put them last in the struct.
640c8776
SM
11849 (compute_display_string_pos, compute_display_string_end):
11850 Update prototypes.
0bb23927
EZ
11851 (bidi_push_it, bidi_pop_it): Add prototypes.
11852 (struct iterator_stack_entry): New members bidi_p,
11853 paragraph_embedding, and from_disp_prop_p.
11854 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
11855 (bidi_shelve_cache, bidi_unshelve_cache):
11856 Declare prototypes.
0bb23927
EZ
11857
11858 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11859 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11860 and vector-like objects.
11861
11862 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11863 cache around display iteration.
11864
11865 * window.c (Fwindow_end, window_scroll_pixel_based)
11866 (displayed_window_lines, Frecenter): Save and restore the bidi
11867 cache around display iteration.
11868
3bbd2265
LMI
118692011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11870
11871 * editfns.c (Fdelete_region): Clarify the use of the named
11872 parameters (bug#6788).
11873
adc47434
MR
118742011-07-14 Martin Rudalics <rudalics@gmx.at>
11875
11876 * indent.c (Fvertical_motion): Set and restore w->pointm when
11877 saving and restoring the window's buffer (Bug#9006).
11878
837c31f8
LMI
118792011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11880
11881 * editfns.c (Fstring_to_char): Clarify just what is returned
11882 (bug#6576). Text by Eli Zaretskii.
11883
ac389d0c
JB
118842011-07-13 Juanma Barranquero <lekktu@gmail.com>
11885
11886 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11887
0be0ce47
EZ
118882011-07-13 Eli Zaretskii <eliz@gnu.org>
11889
11890 * buffer.c (mmap_find): Fix a typo.
11891
cd18e7e3
JB
118922011-07-13 Johan Bockgård <bojohan@gnu.org>
11893
11894 Fix execution of x selection hooks.
11895 * xselect.c (Qx_lost_selection_functions)
11896 (Qx_sent_selection_functions): New vars.
11897 (syms_of_xselect): DEFSYM them.
11898 (x_handle_selection_request): Pass Qx_sent_selection_functions
11899 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11900 (x_handle_selection_clear,x_clear_frame_selections):
11901 Pass Qx_lost_selection_functions rather than
11902 Vx_lost_selection_functions to Frun_hook_with_args.
11903
47ea7f44
PE
119042011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11905
ac389d0c 11906 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
11907 The old code sometimes used this field without initializing it.
11908
47ea7f44
PE
11909 * alloc.c (gc_sweep): Don't read past end of array.
11910 In theory, the old code could also have corrupted Emacs internals,
11911 though it'd be very unlikely.
11912
bc985c87
AS
119132011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11914
11915 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 11916 argument. (Bug#4026)
bc985c87 11917
0cf34688
LMI
119182011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11919
b3dadd76
LMI
11920 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11921 key" (bug#4257).
11922
0cf34688
LMI
11923 * window.c (Fset_window_start): Doc fix (bug#4199).
11924 (Fset_window_hscroll): Ditto.
11925
270768cd
PE
119262011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11927
077e3dda 11928 Fix minor new problems caught by GCC 4.6.1.
270768cd 11929 * term.c (init_tty): Remove unused local.
490011a6 11930 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 11931 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 11932 not used otherwise.
270768cd 11933
b1f58454
CY
119342011-07-12 Chong Yidong <cyd@stupidchicken.com>
11935
11936 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11937
22b9578d
LMI
119382011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11939
6e70ab07
LMI
11940 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11941 are the mini-buffer and the echo area (bug#3320).
11942
22b9578d
LMI
11943 * term.c (init_tty): Remove support for supdup, c10 and perq
11944 terminals, which are no longer supported (bug#1482).
11945
8974cc9f
JB
119462011-07-10 Johan Bockgård <bojohan@gnu.org>
11947
11948 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11949
a560d974
JD
119502011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11951
11952 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11953 for non-popups (Bug#3642).
11954
1dae0f0a
AS
119552011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11956
268c2c36 11957 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 11958 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
11959 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11960 * cm.c (losecursor): Likewise.
1dae0f0a
AS
11961 * data.c (fmod): Likewise.
11962 * dispnew.c (swap_glyphs_in_rows): Likewise.
11963 * emacs.c (memory_warning_signal): Likewise.
11964 * floatfns.c (float_error): Likewise.
11965 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11966 (otf_open, font_otf_capability, generate_otf_features)
11967 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11968 Likewise.
11969 * image.c (pbm_read_file): Likewise.
11970 * indent.c (string_display_width): Likewise.
11971 * intervals.c (check_for_interval, search_for_interval)
11972 (inc_interval_count, count_intervals, root_interval)
11973 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11974 * lread.c (defalias): Likewise.
268c2c36 11975 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
11976 * regex.c (set_image_of_range_1, set_image_of_range)
11977 (regex_grow_registers): Likewise.
11978 * sysdep.c (strerror): Likewise.
11979 * termcap.c (valid_filename_p, tprint, main): Likewise.
11980 * tparam.c (main): Likewise.
11981 * unexhp9k800.c (run_time_remap, save_data_space)
11982 (update_file_ptrs, read_header, write_header, calculate_checksum)
11983 (copy_file, copy_rest, display_header): Likewise.
11984 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11985 Likewise.
11986 * xdisp.c (check_it): Likewise.
11987 * xfaces.c (register_color, unregister_color, unregister_colors):
11988 Likewise.
11989 * xfns.c (print_fontset_result): Likewise.
11990 * xrdb.c (member, fatal, main): Likewise.
11991
99033785
PE
119922011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11993
11994 Fix minor problems found by static checking (Bug#9031).
11995 * chartab.c (char_table_set_range, map_sub_char_table):
11996 Remove unused locals.
11997 (uniprop_table): Now static.
11998 * composite.c (_work_char): Remove unused static var.
11999
9cb2ac56
JB
120002011-07-09 Juanma Barranquero <lekktu@gmail.com>
12001
12002 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12003
f25661f0
JD
120042011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12005
12006 * gtkutil.c (qttip_cb): Remove code without function.
12007
8278c4fe
EZ
120082011-07-09 Eli Zaretskii <eliz@gnu.org>
12009
12010 * w32.c (pthread_sigmask): New stub.
12011
1692ae2d 120122011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12013
8a6ebd58 12014 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12015 sigprocmask is portable only for single-threaded applications, and
12016 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12017 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12018 (LIBES): Use it.
12019 * callproc.c (Fcall_process):
12020 * process.c (create_process):
12021 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12022 Use pthread_sigmask, not sigprocmask.
123403e4 12023
1b854618
JD
120242011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12025
12026 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12027 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12028 wrong (Bug#8591).
12029
3fe4b549
JD
120302011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12031
0ce7e563
JD
12032 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12033 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12034 (xg_hide_tooltip): Fix comment.
12035
3fe4b549
JD
12036 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12037 in registerServicesMenuSendTypes.
12038 (validRequestorForSendType): Don't check ns_return_types.
12039
12040 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12041 ns_return_type.
12042
5df75e47
JR
120432011-07-08 Jason Rumney <jasonr@gnu.org>
12044
22610910
JR
12045 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12046 SH_SHOW for hidden windows (Bug#5482).
12047
5df75e47
JR
12048 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12049 frame struct members of non-existent frames (Bug#6284).
12050
699c10bd
JD
120512011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12052
4393663b
JD
12053 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12054 variable firstTime not needed on OSX >= 10.6.
12055 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12056 >= 10.5. Use setKnobProportion, setDoubleValue.
12057
12058 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12059 (MAC_OS_X_VERSION_10_5): Define if not defined.
12060 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12061 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12062 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12063
12064 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12065 cString and lossyCString on OSX >= 10.4.
4393663b 12066
58179cce 12067 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12068 sizeToFit on OSX >= 10.2.
12069
12070 * nsimage.m (allocInitFromFile): Don't use deprecated method
12071 bestRepresentationForDevice on OSX >= 10.6.
12072
12073 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12074 to avoid warning.
12075
12076 * emacs.c: Declare unexec_init_emacs_zone.
12077
a63e0781
JD
12078 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12079
699c10bd
JD
12080 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12081
12082 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12083 on svcsMenu (Bug#8842).
12084
12085 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12086 ns_return_types.
12087 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12088
12089 * nsterm.m (QUTF8_STRING): Declare.
12090 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12091 (validRequestorForSendType): Return type is (id).
12092 Change indexOfObjectIdenticalTo to indexOfObject.
12093 Check if we have local selection before returning self (Bug#8842).
12094 (writeSelectionToPasteboard): Put local selection into paste board
12095 if we have a local selection (Bug#8842).
12096 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12097
12098 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12099 (ns_get_local_selection): Declare.
12100
54e10184
LMI
121012011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12102
9888ff71
LMI
12103 * keymap.c (describe_map_tree): Don't insert a double newline at
12104 the end of the buffer (bug#1169) and return whether we inserted
12105 something.
12106
54e10184
LMI
12107 * callint.c (Fcall_interactively): Change "reading args" to
12108 "providing args" to try to clarify what it does (bug#1010).
12109
15fa4783
KH
121102011-07-07 Kenichi Handa <handa@m17n.org>
12111
12112 * composite.c (composition_compute_stop_pos): Ignore a static
12113 composition starting before CHARPOS (Bug#8915).
12114
12115 * xdisp.c (handle_composition_prop): Likewise.
12116
a8815b00
EZ
121172011-07-07 Eli Zaretskii <eliz@gnu.org>
12118
12119 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12120 (Bug#9015)
12121
ef7b981d 121222011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12123
12124 * character.h (unicode_category_t): New enum type.
12125
12126 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12127 (Qchar_code_property_table): New variable.
12128 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12129 (UNIPROP_COMPRESSED_FORM_P): New macros.
12130 (char_table_ascii): Uncompress the compressed values.
12131 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12132 Uncompress the compressed values.
ac389d0c 12133 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12134 (char_table_ref_and_range): Uncompress the compressed values.
12135 (sub_char_table_set): New arg is_uniprop. Callers changed.
12136 Uncompress the compressed values.
12137 (sub_char_table_set_range): Args changed. Callers changed.
12138 (char_table_set_range): Adjuted for the above change.
12139 (map_sub_char_table): Delete args default_val and parent. Add arg
12140 top. Give decoded values to a Lisp function.
640c8776 12141 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
12142 values to a Lisp function. Gcpro more variables.
12143 (uniprop_table_uncompress)
12144 (uniprop_decode_value_run_length): New functions.
12145 (uniprop_decoder, uniprop_decoder_count): New variables.
12146 (uniprop_get_decoder, uniprop_encode_value_character)
12147 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12148 New functions.
12149 (uniprop_encoder, uniprop_encoder_count): New variables.
12150 (uniprop_get_encoder, uniprop_table)
12151 (Funicode_property_table_internal, Fget_unicode_property_internal)
12152 (Fput_unicode_property_internal): New functions.
12153 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12154 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 12155 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
12156 char-code-property-alist.
12157
640c8776 12158 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
12159 Vunicode_category_table.
12160
640c8776 12161 * font.c (font_range): Adjust for the change of
c805dec0
KH
12162 Vunicode_category_table.
12163
76b397fb
DN
121642011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12165
12166 * m/iris4d.h: Remove file, move contents ...
12167 * s/irix6-5.h: ... here.
12168
22b4128e
PE
121692011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12170
12171 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
12172 * alloc.c (mark_buffer):
12173 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12174 (clone_per_buffer_values): Don't assume that
22b4128e
PE
12175 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12176 This isn't true in general, and it's particularly not true
12177 if Emacs is configured with --with-wide-int.
12178 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12179 New macros, used in the buffer.c change.
12180
869795d6
JD
121812011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12182
12183 * xsettings.c: Use both GConf and GSettings if both are available.
12184 (store_config_changed_event): Add comment.
12185 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12186 (store_tool_bar_style_changed): New functions.
5e617bc2 12187 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
12188 (struct xsettings): Move font inside HAVE_XFT.
12189 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 12190 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 12191 Move inside HAVE_XFT.
640c8776 12192 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
12193 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12194 also.
12195 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 12196 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 12197 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
12198 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12199 (parse_settings): Move check for font inside HAVE_XFT.
12200 (read_settings, apply_xft_settings): Add comment.
12201 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12202 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12203 call store_font_name_changed.
12204 (xft_settings_event): Add comment.
12205 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12206 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12207 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12208 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12209 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
12210 (xsettings_get_system_font, xsettings_get_system_normal_font):
12211 Add comment.
869795d6 12212
d8ed26bd
PE
122132011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12214
12215 Random fixes. E.g., (random) never returned negative values.
12216 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12217 subseconds part to the entropy, as that's a bit more random.
12218 Prefer signed to unsigned, since the signedness doesn't matter and
12219 in general we prefer signed. When given a limit, use a
12220 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12221 latter isn't right if USE_2_TAGS_FOR_INTS.
12222 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12223 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12224
cabf1cac
SM
122252011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12226
12227 * textprop.c (text_property_stickiness):
12228 Obey Vtext_property_default_nonsticky.
12229 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12230 * w32fns.c (syms_of_w32fns):
12231 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12232
6e9b2be9
PE
122332011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12234
12235 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12236 This is more efficient than Ffile_directory_p and avoids a minor race.
12237
90186c68
LMI
122382011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12239
7c301272
LMI
12240 * buffer.c (Foverlay_put): Say what the return value is
12241 (bug#7835).
12242
c4f2d8d4
LMI
12243 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12244 is a directory before asking whether to use the file name
12245 (bug#7564).
ad637907
LMI
12246 (barf_or_query_if_file_exists): Make the "File is a directory"
12247 error be more correct.
c4f2d8d4 12248
90186c68
LMI
12249 * fns.c (Frequire): Remove the mention of the .gz files, since
12250 that's installation-specific, but keep the mention of
12251 `get-load-suffixes'.
12252
da64016e
PE
122532011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12254
12255 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12256 Report string overflow if the output is too long.
12257
7d47b580
JB
122582011-07-04 Juanma Barranquero <lekktu@gmail.com>
12259
a555cb87
JB
12260 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12261 (syms_of_gnutls): Remove duplicate DEFSYM for
12262 Qgnutls_bootprop_verify_hostname_error, an error for
12263 Qgnutls_bootprop_verify_error (which is no longer used).
12264
7d47b580
JB
12265 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12266 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12267 Also (re)move comments that are misplaced or no longer relevant.
12268
1e49bfab
LMI
122692011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12270
12271 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12272
1485f4c0
CY
122732011-07-03 Chong Yidong <cyd@stupidchicken.com>
12274
12275 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12276 and background color parameters if they have been changed.
12277
a9ab721e
LMI
122782011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12279
12280 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12281
cf7cff57
PE
122822011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12283
2e13213d
PE
12284 * xsettings.c (SYSTEM_FONT): Define only when used.
12285 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12286
cf7cff57
PE
12287 * keymap.c (access_keymap_1): Now static.
12288
7a8e04f7
CY
122892011-07-02 Chong Yidong <cyd@stupidchicken.com>
12290
12291 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12292 leave any prefix arg for the up event (Bug#1586).
12293
61352f62
LMI
122942011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12295
69bb1ef7
LMI
12296 * lread.c (syms_of_lread): Mention single symbols defined by
12297 `defvar' or `defconst' (bug#7154).
12298
61352f62 12299 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 12300 (Frequire): Mention get-load-suffixes.
61352f62 12301
28545e04
MR
123022011-07-02 Martin Rudalics <rudalics@gmx.at>
12303
12304 * window.h (window): Remove clone_number slot.
12305 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12306 Remove.
12307 (make_parent_window, make_window, saved_window)
12308 (Fset_window_configuration, save_window_save): Don't deal with
12309 clone numbers.
12310 * buffer.c (Qclone_number): Remove declaration.
12311 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12312
3349e122
SM
123132011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12314
12315 Add multiple inheritance to keymaps.
12316 * keymap.c (Fmake_composed_keymap): New function.
12317 (Fset_keymap_parent): Simplify.
12318 (fix_submap_inheritance): Remove.
12319 (access_keymap_1): New function extracted from access_keymap to handle
12320 embedded parents and handle lists of maps.
12321 (access_keymap): Use it.
12322 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12323 (Fcopy_keymap): Handle embedded parents.
12324 (Fcommand_remapping, define_as_prefix): Simplify.
12325 (Fkey_binding): Simplify.
12326 (syms_of_keymap): Move minibuffer-local-completion-map,
12327 minibuffer-local-filename-completion-map,
12328 minibuffer-local-must-match-map, and
12329 minibuffer-local-filename-must-match-map to Elisp.
12330 (syms_of_keymap): Defsubr make-composed-keymap.
12331 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12332 (parse_menu_item): Trivial simplification.
12333
3279eb87
GM
123342011-07-01 Glenn Morris <rgm@gnu.org>
12335
12336 * Makefile.in (SETTINGS_LIBS): Fix typo.
12337
39cb9e56 123382011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
12339
12340 * coding.c (Fencode_coding_string): Record the last coding system
12341 used, as the function doc string says (bug#8738).
12342
0949d2b6
JD
123432011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12344
12345 * xsettings.c (store_monospaced_changed): Take new font as arg and
12346 check for change against current_mono_font.
12347 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12348 (emacs_settings_constructor, emacs_settings_get_property)
12349 (emacs_settings_set_property, emacs_settings_class_init)
12350 (emacs_settings_init, gsettings_obj): Remove.
12351 (something_changedCB): New function for HAVE_GSETTINGS.
12352 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12353 with value as argument.
12354 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12355 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 12356 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
12357 "changed".
12358
12359 * xgselect.c: Add defined (HAVE_GSETTINGS).
12360 (xgselect_initialize): Ditto.
12361
12362 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12363 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12364 xg_select.
12365
bbc6b304
PE
123662011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12367
12368 * eval.c (struct backtrace): Simplify and port the data structure.
12369 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12370 signed bit field, as this assumption is not portable and it makes
12371 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12372 "char debug_on_exit : 1" as this is not portable either; instead,
12373 use the portable "unsigned int debug_on_exit : 1". Remove unused
12374 member evalargs. Remove obsolete comments about cc bombing out.
12375
9851bfc5
JD
123762011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12377
51bb811f 12378 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
12379 Let HAVE_GSETTINGS override HAVE_GCONF.
12380 (store_monospaced_changed): New function.
12381 (EMACS_SETTINGS): A new type derived from GObject to handle
12382 GSettings notifications.
12383 (emacs_settings_constructor, emacs_settings_get_property)
12384 (emacs_settings_set_property, emacs_settings_class_init):
12385 New functions.
12386 (gsettings_client, gsettings_obj): New variables.
12387 (GSETTINGS_SCHEMA): New define.
12388 (something_changedCB): Call store_monospaced_changed.
12389 (init_gsettings): New function.
12390 (xsettings_initialize): Call init_gsettings.
12391 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12392 to NULL.
12393
640c8776 12394 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
12395 GCONF_CFLAGS/LIBS.
12396
5386012d
MR
123972011-06-29 Martin Rudalics <rudalics@gmx.at>
12398
12399 * window.c (resize_root_window, grow_mini_window)
12400 (shrink_mini_window): Rename Qresize_root_window to
12401 Qwindow_resize_root_window and Qresize_root_window_vertically to
12402 Qwindow_resize_root_window_vertically.
12403
f13e0b08
PE
124042011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12405
12406 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12407
94515237
JB
124082011-06-27 Juanma Barranquero <lekktu@gmail.com>
12409
12410 * makefile.w32-in: Redesign dependencies so they reflect more
12411 clearly which files are directly included by each source file,
12412 and not through other includes.
12413
e43b6e43
MR
124142011-06-27 Martin Rudalics <rudalics@gmx.at>
12415
12416 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12417 (sort_overlays, overlay_strings): When an overlay's clone number
12418 matches the window's clone number process the overlay even if
12419 the overlay's window property doesn't match the current window.
12420
d68443dc
MR
12421 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12422 (Fwindow_hchild): Rename to Fwindow_left_child.
12423 (Fwindow_next): Rename to Fwindow_next_sibling.
12424 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
12425 (resize_window_check): Rename to window_resize_check.
12426 (resize_window_apply): Rename to window_resize_apply.
12427 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12428 (Fdelete_other_windows_internal, resize_frame_windows)
12429 (Fsplit_window_internal, Fdelete_window_internal)
12430 (grow_mini_window, shrink_mini_window)
12431 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 12432
c7e73be5
JD
124332011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12434
12435 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12436 (emacs_fixed_set_min_size): Remove.
12437 (emacs_fixed_new): Take frame as argument.
12438
12439 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12440 (_EmacsFixedPrivate): Remove minwidth/height.
12441 Add struct frame *f.
12442 (emacs_fixed_init): Initialize priv->f.
12443 (get_parent_class, emacs_fixed_set_min_size): Remove.
12444 (emacs_fixed_new): Set priv->f to argument.
12445 (emacs_fixed_get_preferred_width)
12446 (emacs_fixed_get_preferred_height): Use min_width/height from
12447 frames size_hint to set minimum and natural (Bug#8919).
12448 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12449 and use min_width/height from frames size_hint to set
12450 min_width/height (Bug#8919).
12451
12452 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
12453 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12454 Fix indentation.
c7e73be5 12455
cf99dcf8
EZ
124562011-06-26 Eli Zaretskii <eliz@gnu.org>
12457
12458 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12459 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12460 called at ZV.
12461
029529ac
CY
124622011-06-26 Chong Yidong <cyd@stupidchicken.com>
12463
12464 * process.c (wait_reading_process_output): Bypass select if
12465 waiting for a cell while ignoring keyboard input, and input is
12466 pending. Suggested by Jan Djärv (Bug#8869).
12467
7a7ef429
PE
124682011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12469
12470 Use gnulib's dup2 module instead of rolling our own.
12471 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12472
11fdef7d 124732011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
12474
12475 * dispnew.c (scrolling_window): Before scrolling, turn off a
12476 mouse-highlight in the window being scrolled.
12477
cd3520a4
JB
124782011-06-24 Juanma Barranquero <lekktu@gmail.com>
12479
12480 Move DEFSYM to lisp.h and use everywhere.
12481
12482 * character.h (DEFSYM): Move declaration...
12483 * lisp.h (DEFSYM): ...here.
12484
12485 * gnutls.c:
12486 * minibuf.c:
12487 * w32menu.c:
12488 * w32proc.c:
12489 * w32select.c: Don't include character.h.
12490
12491 * alloc.c (syms_of_alloc):
12492 * buffer.c (syms_of_buffer):
12493 * bytecode.c (syms_of_bytecode):
12494 * callint.c (syms_of_callint):
12495 * casefiddle.c (syms_of_casefiddle):
12496 * casetab.c (init_casetab_once):
12497 * category.c (init_category_once, syms_of_category):
12498 * ccl.c (syms_of_ccl):
12499 * cmds.c (syms_of_cmds):
12500 * composite.c (syms_of_composite):
12501 * dbusbind.c (syms_of_dbusbind):
12502 * dired.c (syms_of_dired):
12503 * dispnew.c (syms_of_display):
12504 * doc.c (syms_of_doc):
12505 * editfns.c (syms_of_editfns):
12506 * emacs.c (syms_of_emacs):
12507 * eval.c (syms_of_eval):
12508 * fileio.c (syms_of_fileio):
12509 * fns.c (syms_of_fns):
12510 * frame.c (syms_of_frame):
12511 * fringe.c (syms_of_fringe):
12512 * insdel.c (syms_of_insdel):
12513 * keymap.c (syms_of_keymap):
12514 * lread.c (init_obarray, syms_of_lread):
12515 * macros.c (syms_of_macros):
12516 * msdos.c (syms_of_msdos):
12517 * print.c (syms_of_print):
12518 * process.c (syms_of_process):
12519 * search.c (syms_of_search):
12520 * sound.c (syms_of_sound):
12521 * syntax.c (init_syntax_once, syms_of_syntax):
12522 * terminal.c (syms_of_terminal):
12523 * textprop.c (syms_of_textprop):
12524 * undo.c (syms_of_undo):
12525 * w32.c (globals_of_w32):
12526 * window.c (syms_of_window):
12527 * xdisp.c (syms_of_xdisp):
12528 * xfaces.c (syms_of_xfaces):
12529 * xfns.c (syms_of_xfns):
12530 * xmenu.c (syms_of_xmenu):
12531 * xsettings.c (syms_of_xsettings):
12532 * xterm.c (syms_of_xterm): Use DEFSYM.
12533
4228cf16
TZ
125342011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12535
cd3520a4 12536 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 12537
7fcccf1e
PE
125382011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12539
7efb4e0e
PE
12540 Integer and buffer overflow fixes (Bug#8873).
12541
ff5844ad
PE
12542 * print.c (printchar, strout): Check for string overflow.
12543 (PRINTPREPARE, printchar, strout):
12544 Don't set size unless allocation succeeds.
12545
90532f02
PE
12546 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12547 for sizes. Check for string overflow more accurately.
12548 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12549
6d84508d
PE
12550 * macros.c: Integer and buffer overflow fixes.
12551 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12552 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12553 Use ptrdiff_t, not int, for sizes.
12554 Don't increment bufsize until after realloc succeeds.
12555 Check for size-calculation overflow.
12556 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12557
437b2cb4
PE
12558 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12559
8b9ac8b4
PE
12560 * lread.c: Integer overflow fixes.
12561 (read_integer): Radix is now EMACS_INT, not int,
12562 to improve quality of diagnostics for out-of-range radices.
12563 Calculate buffer size correctly for out-of-range radices.
12564 (read1): Check for integer overflow in radices, and in
12565 read-circle numbers.
82cb60d3
PE
12566 (read_escape): Avoid int overflow.
12567 (Fload, openp, read_buffer_size, read1)
12568 (substitute_object_recurse, read_vector, read_list, map_obarray):
12569 Use ptrdiff_t, not int, for sizes.
12570 (read1): Use EMACS_INT, not int, for sizes.
20270765 12571 Check for size overflow.
8b9ac8b4 12572
7fcccf1e
PE
12573 * image.c (cache_image): Check for size arithmetic overflow.
12574
bfbbd7e7
PE
12575 * lread.c: Integer overflow issues.
12576 (saved_doc_string_size, saved_doc_string_length)
12577 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12578 Now ptrdiff_t, not int.
12579 (read1): Don't assume doc string length fits in int. Check for
12580 out-of-range doc string lengths.
12581 (read_list): Don't assume file position fits in int.
39019e54 12582 (read_escape): Check for hex character overflow.
bfbbd7e7 12583
4e323265
LL
125842011-06-22 Leo Liu <sdl.web@gmail.com>
12585
12586 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12587 Move to minibuffer.el.
12588
85fece3e
PE
125892011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12590
20b84ce9 12591 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
12592 The following patches are for when GLYPH_DEBUG && !XASSERT.
12593 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12594 * dispnew.c (flush_stdout):
12595 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12596 Mark as externally visible.
12597 * dispnew.c (check_window_matrix_pointers): Now static.
12598 * dispnew.c (window_to_frame_vpos):
12599 * xfns.c (unwind_create_frame):
12600 * xterm.c (x_check_font): Remove unused local.
12601 * scroll.c (CHECK_BOUNDS):
12602 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12603 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12604 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12605 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12606 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12607 Now static.
12608 (debug_method_add): Use va_list and vsprintf rather than relying
12609 on undefined behavior with wrong number of arguments.
12610 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12611 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12612 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12613 since we're not interested in debugging glyphs with old libraries.
12614 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12615 GCC 4.6.0's static checking.
12616
0766b489
PE
126172011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12618
31fd4b32
PE
12619 Integer overflow and signedness fixes (Bug#8873).
12620 A few related buffer overrun fixes, too.
12621
b79e8648
PE
12622 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12623
0766b489
PE
12624 * dispextern.h (struct face.stipple):
12625 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12626 (x_bitmap_mask, x_allocate_bitmap_record)
12627 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12628 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12629 (x_create_bitmap_from_xpm_data):
12630 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12631 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12632 (.bitmaps_last):
12633 * xfaces.c (load_pixmap):
12634 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12635 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12636 (.bitmaps_last, struct x_output.icon_bitmap):
12637 Use ptrdiff_t, not int, for bitmap indexes.
12638 (x_allocate_bitmap_record): Check for size overflow.
12639 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12640
b081724f
PE
12641 Use ptrdiff_t, not int, for overlay counts.
12642 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12643 * editfns.c (overlays_around, get_pos_property):
12644 * textprop.c (get_char_property_and_overlay):
12645 * xdisp.c (next_overlay_change, note_mouse_highlight):
12646 * xfaces.c (face_at_buffer_position):
21514da7
PE
12647 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12648 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12649 (Fnext_overlay_change, Fprevious_overlay_change)
12650 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 12651 Use ptrdiff_t, not int, for sizes.
21514da7 12652 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 12653
3de73e5e
PE
12654 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12655
2606c57b
PE
12656 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12657 (x_session_initialize): Do not assume string length fits in int.
12658
aaafe47a
PE
12659 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12660 This is unlikely, but can occur if DPI is outlandish.
12661
2674ddc8 12662 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
12663 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12664
28154962
PE
12665 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12666 * xrdb.c (magic_file_p, search_magic_path):
12667 Omit last arg SUFFIX; it was always 0. All callers changed.
12668 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12669
7de51af5
PE
12670 * xfont.c (xfont_match): Avoid need for strlen.
12671
25ed6cc3
PE
12672 * xfns.c: Don't assume strlen fits in int.
12673 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12674
4eab31dd
PE
12675 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12676 not unsigned long, as we prefer signed integers. All callers changed.
12677 Detect integer overflow in repeat count.
12678 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 12679 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 12680
171e2a58
PE
12681 * termcap.c: Don't assume sizes fit in int and never overflow.
12682 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12683 (gobble_line): Check for size-calculation overflow.
12684
ad39faca 12685 * minibuf.c (Fread_buffer):
6e5bb2dc 12686 * lread.c (intern, intern_c_string):
74ca2eb3
PE
12687 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12688 Don't assume string length fits in int.
12689
52c61c22 12690 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
12691 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12692
b5b8c9e5
PE
12693 * font.c: Don't assume string length fits in int.
12694 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12695 Use ptrdiff_t, not int.
ccd6111c
PE
12696 (font_intern_prop): Don't assume string length fits in int.
12697 Don't assume integer property fits in fixnum.
12698 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 12699
882f0d81 12700 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 12701 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
12702 Reformulate so as not to need the command string.
12703 Invoke gzip -cd rather than gunzip, as it's more portable.
12704 (lock_info_type, lock_file_1, lock_file):
12705 Don't assume pid_t and time_t fit in unsigned long.
12706 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12707 (current_lock_owner): Prefer signed type for sizes.
12708 Use memcpy, not strncpy, where memcpy is what is really wanted.
12709 Don't assume (via atoi) that time_t and pid_t fit in int.
12710 Check for time_t and/or pid_t out of range, e.g., via a network share.
12711 Don't alloca where an auto var works fine.
12712
93f4cf88
PE
12713 * fileio.c: Fix some integer overflow issues.
12714 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12715 Don't assume string length fits in int.
12716 (directory_file_name): Don't assume string length fits in long.
12717 (make_temp_name): Don't assume pid fits in int, or that its print
12718 length is less than 20.
12719
f3e92b69
PE
12720 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12721
1bfdaf10
PE
12722 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12723
35016e9a
PE
12724 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12725
3d1e65a1
PE
12726 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12727 We prefer signed integers, even for size calculations.
12728
0b963a93
PE
12729 * emacs.c: Don't assume string length fits in 'int'.
12730 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12731 (main): Don't invoke strlen when not needed.
12732
573f4b54
PE
12733 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12734 (XD_DEBUG_MESSAGE): Don't waste a byte.
12735
989f33ba
PE
12736 * callproc.c (getenv_internal_1, getenv_internal)
12737 (Fgetenv_internal):
965d34eb
PE
12738 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12739
e4d29b33
PE
12740 * lread.c (invalid_syntax): Omit length argument.
12741 All uses changed. This doesn't fix a bug, but it simplifies the
12742 code away from its former Hollerith-constant appearance, and it's
12743 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 12744 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 12745
eb49b136
PE
12746 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12747 This didn't break anything, but it didn't help either.
12748 It's confusing to put a bogus integer in a place where the actual
12749 value does not matter.
9f62aeb1 12750 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 12751 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 12752
15375a22
PE
12753 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12754 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12755 implementation.
b61cc01c
PE
12756 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12757 We prefer signed types, and the value cannot exceed the EMACS_INT
12758 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
12759 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12760 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12761 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 12762
53b2623d
PE
12763 * indent.c (sane_tab_width): New function.
12764 (current_column, scan_for_column, Findent_to, position_indentation)
12765 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 12766 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 12767
51cab52b 12768 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 12769
f2ed8a70
PE
12770 * lisp.h (lint_assume): New macro.
12771 * composite.c (composition_gstring_put_cache):
12772 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12773
abe80cc6
PE
12774 * editfns.c, insdel.c:
12775 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 12776
b02c740e
PE
12777 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12778
ebc96716
PE
12779 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12780
b4e50fa0 12781 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 12782 Use much-faster test for byte-length change.
311d5d7c 12783 Don't assume string byte-length fits in 'int'.
a4cf38e4 12784 Check that character arg fits in 'int'.
85461888 12785 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 12786
c0c1ee9f
PE
12787 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12788
a498d7f4
PE
12789 * fns.c (concat): Catch string overflow earlier.
12790 Do not rely on integer wraparound.
12791
51cab52b
PE
12792 * dispextern.h (struct it.overlay_strings_charpos)
12793 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
12794 * xdisp.c (forward_to_next_line_start)
12795 (back_to_previous_visible_line_start)
12796 (reseat_at_next_visible_line_start, next_element_from_buffer):
12797 Don't arbitrarily truncate the value of 'selective' to int.
12798
76031fad
PE
12799 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12800
5eb55db9
PE
12801 * composite.c: Don't truncate sizes to 'int'.
12802 (composition_gstring_p, composition_reseat_it)
12803 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
12804 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12805 not EMACS_UINT, for indexes.
5eb55db9 12806
0703a717
PE
12807 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12808
d6202519
PE
12809 * buffer.c: Include <verify.h>.
12810 (struct sortvec.priority, struct sortstr.priority):
8961a454 12811 Now EMACS_INT, not int.
c20998a7 12812 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
12813 (struct sortstr.size, record_overlay_string)
12814 (struct sortstrlist.size, struct sortlist.used):
12815 Don't truncate size to int.
12816 (record_overlay_string): Check for size-calculation overflow.
d6202519 12817 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 12818
d5a19415
JM
128192011-06-22 Jim Meyering <meyering@redhat.com>
12820
029529ac 12821 Don't leak an XBM-image-sized buffer
d5a19415
JM
12822 * image.c (xbm_load): Free the image buffer after using it.
12823
a9041e6c
PE
128242011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12825
12826 Port to Sun C.
12827 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12828 that Sun C diagnosed.
12829 * fns.c (secure_hash): Fix pointer signedness issue.
12830 * intervals.c (static_offset_intervals): New function.
12831 (offset_intervals): Use it.
12832
7f3f739f
LL
128332011-06-21 Leo Liu <sdl.web@gmail.com>
12834
12835 * deps.mk (fns.o):
12836 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12837 sha512.h.
12838
12839 * fns.c (secure_hash): Rename from crypto_hash_function and change
12840 the first arg to accept symbols.
5b66d427 12841 (Fsecure_hash): New primitive.
7f3f739f
LL
12842 (syms_of_fns): New symbols.
12843
76147d94
DD
128442011-06-20 Deniz Dogan <deniz@dogan.se>
12845
12846 * process.c (Fset_process_buffer): Clarify return value in
12847 docstring.
12848
7d7d0045
CY
128492011-06-18 Chong Yidong <cyd@stupidchicken.com>
12850
12851 * dispnew.c (add_window_display_history): Use BVAR.
12852
12853 * xdisp.c (debug_method_add): Use BVAR.
12854 (check_window_end, dump_glyph_matrix, dump_glyph)
12855 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12856
12857 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12858 Likewise.
12859
12860 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12861 check till after the cache is created in init_frame_faces.
12862
ff2bc410
SM
128632011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12864
12865 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12866
28177add
PE
128672011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12868
dd3482fe
PE
12869 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12870 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12871 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12872
393d71f3 12873 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
12874 * fileio.c (Finsert_file_contents):
12875 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12876 Remove the old (too-loose) buffer overflow checks.
12877 They weren't needed, since make_gap checks for buffer overflow.
12878 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12879 The old code merely checked for Emacs fixnum overflow, and relied
12880 on undefined (wraparound) behavior. The new code avoids undefined
12881 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12882
2e6813b0 12883 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
12884 Tune. Don't use wider integers than needed. Don't use alloca.
12885 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 12886
599a9e4f
PE
12887 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12888
99561444
PE
12889 * insdel.c, lisp.h (buffer_overflow): New function.
12890 (insert_from_buffer_1, replace_range, replace_range_2):
12891 * insdel.c (make_gap_larger):
12892 * editfns.c (Finsert_char):
12893 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12894
28177add
PE
12895 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12896
e69dafad
PE
128972011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12898
4baa020d 12899 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 12900
b1c46f02
PE
12901 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12902 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12903
e69dafad
PE
12904 * fileio.c: Don't assume EMACS_INT fits in off_t.
12905 (emacs_lseek): New static function.
12906 (Finsert_file_contents, Fwrite_region): Use it.
12907 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12908
566684ea
PE
12909 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12910
e6966cd6
PE
12911 * fns.c: Don't overflow int when computing a list length.
12912 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12913 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12914 truncation on 64-bit hosts. Check for QUIT every
12915 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12916 faster and is responsive enough.
12917 (Flength): Report an error instead of overflowing an integer.
12918 (Fsafe_length): Return a float if the value is not representable
12919 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 12920 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 12921 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 12922
dd0b0efb
PE
12923 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12924 (header_size, word_size): New constants.
12925 (allocate_vectorlike): Don't check size overflow here.
12926 (allocate_vector): Check it here instead, since this is the only
12927 caller of allocate_vectorlike that could cause overflow.
12928 Check that the new vector's length is representable as a fixnum.
12929
86fe5cfe
PE
12930 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12931 The previous code was bogus. For example, next_almost_prime (32)
12932 returned 39, which is undesirable as it is a multiple of 3; and
12933 next_almost_prime (24) returned 25, which is a multiple of 5 so
12934 why was the code bothering to check for multiples of 7?
12935
80e88859
PE
12936 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12937
4a2f0ad6
PE
12938 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12939
f66c7cf8
PE
12940 Variadic C functions now count arguments with ptrdiff_t.
12941 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12942 Back then I didn't know that the Emacs coding style prefers signed int.
12943 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
12944 were being counted with int, which may truncate counts on 64-bit
12945 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
12946 * lisp.h (struct Lisp_Subr.function.aMANY)
12947 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12948 Arg counts are now ptrdiff_t, not size_t.
12949 All variadic functions and their callers changed accordingly.
12950 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12951 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12952 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12953 * callint.c (Fcall_interactively): Check arg count for overflow,
12954 to avoid potential buffer overrun. Use signed char, not 'int',
12955 for 'varies' array, so that we needn't bother to check its size
12956 calculation for overflow.
12957 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12958 * eval.c (apply_lambda):
12959 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12960 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12961 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12962
a1759b76
PE
12963 * callint.c (Fcall_interactively): Don't use index var as event count.
12964
d96be9fc
PE
12965 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12966 * mem-limits.h (SIZE): Remove; no longer used.
12967
a690a978 12968 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 12969
578c21e6
PE
12970 Remove unnecessary casts.
12971 * xterm.c (x_term_init):
12972 * xfns.c (x_set_border_pixel):
12973 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12974 These aren't needed now that we assume ANSI C.
12975
96f53c6c
PE
12976 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12977 It's more likely to cause problems (due to unsigned overflow)
12978 than to cure them.
12979
83c77d31
PE
12980 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12981
ee2079f1
PE
12982 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12983
6da65536
PE
12984 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12985
7147c4a4
PE
12986 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12987
193e32d9
PE
12988 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12989
e5533da6
PE
12990 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12991
9910e595
PE
12992 GLYPH_CODE_FACE returns EMACS_INT, not int.
12993 * dispextern.h (merge_faces):
12994 * xfaces.c (merge_faces):
01103c44
PE
12995 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12996 Don't assume EMACS_INT fits in int.
9910e595 12997
2638320e
PE
12998 * character.h (CHAR_VALID_P): Remove unused parameter.
12999 * fontset.c, lisp.h, xdisp.c: All uses changed.
13000
045eb8d9
PE
13001 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13002
c1f134b5
PE
13003 * fns.c (concat): Minor tuning based on overflow analysis.
13004 This doesn't fix any bugs. Use int to hold character, instead
13005 of constantly refetching from Emacs object. Use XFASTINT, not
13006 XINT, for value known to be a character. Don't bother comparing
13007 a single byte to 0400, as it's always less.
13008
395fcb93 13009 * floatfns.c (Fexpt):
327eeec8
PE
13010 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13011
abbd3d23
PE
13012 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13013 for characters.
13014
684a03ef
PE
13015 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13016
0fed43f3
PE
13017 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13018 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13019 incorrectly succeed when S was a string, because 4294967386 was
13020 truncated before it was used.
13021
8fd02eb7
PE
13022 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13023 Otherwise, an out-of-range integer could cause undefined behavior
13024 on a 64-bit host.
13025
f8c86b69
PE
13026 * composite.c: Use int, not EMACS_INT, for characters.
13027 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13028 EMACS_INT, for values that are known to be in character range.
13029 This doesn't fix any bugs but is the usual style inside Emacs and
13030 may generate better code on 32-bit machines.
13031
34206dd2
PE
13032 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13033 This is for reasons similar to the recent CHAR_STRING fix.
13034 * charset.c (Fencode_char): Check that character arg is actually
13035 a character. Pass an int to ENCODE_CHAR.
13036 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13037 wider than 'int', as a compile-time check to prevent future regressions
13038 in this area.
13039
c5958d4c 13040 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13041
13042 Make sure a 64-bit char is never passed to CHAR_STRING.
13043 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13044 by silently ignoring the top 32 bits, allowing some values
13045 that were far too large to be valid characters.
13046 * character.h: Include <verify.h>.
13047 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13048 arguments are no wider than unsigned, as a compile-time check
13049 to prevent future regressions in this area.
13050 * data.c (Faset):
01103c44 13051 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13052 (Fsubst_char_in_region):
13053 * fns.c (concat):
13054 * xdisp.c (decode_mode_spec_coding):
13055 Adjust to CHAR_STRING's new requirement.
13056 * editfns.c (Finsert_char, Fsubst_char_in_region):
13057 * fns.c (concat): Check that character args are actually
13058 characters. Without this test, these functions did the wrong
13059 thing with wildly out-of-range values on 64-bit hosts.
13060
d37ca623
PE
13061 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13062 These casts should not be needed on 32-bit hosts, either.
13063 * keyboard.c (read_char):
13064 * lread.c (Fload): Remove casts to unsigned.
13065
ea204efb
PE
13066 * lisp.h (UNSIGNED_CMP): New macro.
13067 This fixes comparison bugs on 64-bit hosts.
13068 (ASCII_CHAR_P): Use it.
13069 * casefiddle.c (casify_object):
01103c44 13070 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13071 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13072 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13073 * dispextern.h (FACE_FROM_ID):
13074 * keyboard.c (read_char): Use UNSIGNED_CMP.
13075
41cb286c
PE
13076 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13077 not to EMACS_INT, to avoid GCC warning.
13078
4a1b9832
PE
13079 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13080
55daad71
PE
13081 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13082 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13083 isn't needed on 32-bit machines.
8f95c75c 13084
01103c44
PE
13085 * buffer.c (Fgenerate_new_buffer_name):
13086 Use EMACS_INT for count, not int.
0ceccced 13087 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13088
13089 * data.c (Qcompiled_function): Now static.
13090
c6f072e7
PE
13091 * window.c (window_body_lines): Now static.
13092
20ce5912
PE
13093 * image.c (gif_load): Rename local to avoid shadowing.
13094
9c4c5f81
PE
13095 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13096 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13097 * alloc.c (make_save_value): Integer argument is now of type
13098 ptrdiff_t, not int.
13099 (mark_object): Use ptrdiff_t, not int.
13100 * lisp.h (pD): New macro.
13101 * print.c (print_object): Use it.
13102
c0c5c8ae
PE
13103 * alloc.c: Use EMACS_INT, not int, to count objects.
13104 (total_conses, total_markers, total_symbols, total_vector_size)
13105 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13106 (total_free_floats, total_floats, total_free_intervals)
13107 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13108 Now EMACS_INT, not int. All uses changed.
13109 (Fgarbage_collect): Compute overall total using a double, so that
13110 integer overflow is less likely to be a problem. Check for overflow
13111 when converting back to an integer.
5a25e253
PE
13112 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13113 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13114 These were 'int' variables that could overflow on 64-bit hosts;
13115 they were never used, so remove them instead of repairing them.
211a0b2a 13116 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13117 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13118 Previously, this ceilinged at INT_MAX, but that doesn't work on
13119 64-bit machines.
e46bb31a 13120 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13121
c78baabf 13122 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13123 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13124 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13125 when a (possibly-narrower) signed value would do just as well.
13126 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13127
c9d624c6
PE
13128 * alloc.c: Catch some string size overflows that we were missing.
13129 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13130 for convenience in STRING_BYTES_MAX.
13131 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13132 The definition here is exact; the one in lisp.h was approximate.
13133 (allocate_string_data): Check for string overflow. This catches
13134 some instances we weren't catching before. Also, it catches
13135 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13136 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13137 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13138
c9d624c6
PE
13139 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13140 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13141 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 13142
353032ce
PE
13143 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13144
2bccce07
PE
13145 * alloc.c (Fmake_string): Check for out-of-range init.
13146
0ac30604
SM
131472011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13148
13149 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13150
c195f2de
JD
131512011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13152
13153 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13154 xg_get_default_scrollbar_width.
13155
13156 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13157 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13158 (style_changed_cb): Call update_theme_scrollbar_width and call
13159 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13160 all frames (Bug#8505).
13161 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13162 Call gtk_window_set_resizable if HAVE_GTK3.
13163 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13164 and height if HAVE_GTK3 (Bug#8505).
13165 (scroll_bar_width_for_theme): New variable.
13166 (update_theme_scrollbar_width): New function.
13167 (xg_get_default_scrollbar_width): Move code to
13168 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13169 (xg_initialize): Call update_theme_scrollbar_width.
13170
13171 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13172
13173 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13174
e10ac9f1
MR
131752011-06-12 Martin Rudalics <rudalics@gmx.at>
13176
13177 * frame.c (make_frame): Call other_buffer_safely instead of
13178 other_buffer.
13179
13180 * window.c (temp_output_buffer_show): Call display_buffer with
13181 second argument Vtemp_buffer_show_specifiers and reset latter
13182 immediately after the call.
13183 (Vtemp_buffer_show_specifiers): New variable.
13184 (auto_window_vscroll_p, next_screen_context_lines)
13185 (Vscroll_preserve_screen_position): Remove leading asterisks from
13186 doc-strings.
13187
2d3c217e 131882011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 13189
7b7f97e8 13190 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
13191 * buffer.c (Qclone_number): Remove for now, as it's unused.
13192 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13193 (record_buffer): Remove unused local.
13194 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13195 (set_frame_buffer_list): Remove; unused.
13196 * frame.h (other_visible_frames): Remove decl.
13197 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13198 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13199 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13200 if HAVE_GPM.
13201 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13202 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13203 Define only if HAVE_GPM.
13204 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13205 (update_hints_inhibit): Remove; never set. All uses removed.
13206 * widgetprv.h (emacsFrameClassRec): Remove decl.
13207 * window.c (delete_deletable_window): Now returns void, since it
13208 wasn't returning anything.
13209 (compare_window_configurations): Remove unused locals.
13210 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13211 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
13212 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13213 the same widths as pointers. This follows up on the 2011-05-06 patch.
13214 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13215 * xterm.h: Likewise.
13216 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13217
1384b89e
JB
132182011-06-12 Juanma Barranquero <lekktu@gmail.com>
13219
13220 * makefile.w32-in: Update dependencies.
13221 (LISP_H): Add lib/intprops.h.
13222
1100a63c
CY
132232011-06-11 Chong Yidong <cyd@stupidchicken.com>
13224
13225 * image.c (gif_load): Add animation frame delay to the metadata.
13226 (syms_of_image): Use DEFSYM. New symbol `delay'.
13227
6198ccd0
MR
132282011-06-11 Martin Rudalics <rudalics@gmx.at>
13229
13230 * window.c (delete_deletable_window): Re-add.
13231 (Fset_window_configuration): Rewrite to handle dead buffers and
13232 consequently deletable windows.
13233 (window_tree, Fwindow_tree): Remove. Supply functionality in
13234 window.el.
13235 (compare_window_configurations): Simplify code.
13236
b6e3633c
AS
132372011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13238
1ab0dee5
AS
13239 * image.c (imagemagick_load_image): Fix type mismatch.
13240 (Fimagemagick_types): Likewise.
13241
b6e3633c
AS
13242 * window.h (replace_buffer_in_windows): Declare.
13243
9397e56f
MR
132442011-06-11 Martin Rudalics <rudalics@gmx.at>
13245
13246 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13247 Qclone_number. Remove external declaration of Qdelete_window.
13248 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13249 code.
640c8776
SM
13250 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13251 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
13252 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13253 buffer list implementation.
13254 (other_buffer_safely): New function.
13255 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13256 calls to replace_buffer_in_windows and
13257 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13258 if allowed.
13259 (record_buffer): Inhibit quitting and rewrite using quittable
13260 functions. Run Qbuffer_list_update_hook if allowed.
13261 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
13262 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13263 Move switch-to-buffer to window.el.
9397e56f
MR
13264 (bury-buffer): Move to window.el.
13265 (Vbuffer_list_update_hook): New variable.
13266
13267 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13268 section.
13269
13270 * window.h (resize_frame_windows): Move up in code.
13271 (Fwindow_frame): Remove EXFUN.
13272 (replace_buffer_in_all_windows): Remove prototype.
13273 (replace_buffer_in_windows_safely): Add prototype.
13274
13275 * window.c: Declare Qdelete_window static again. Move down
13276 declaration of select_count.
13277 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13278 (Fother_window): Move to window.el.
13279 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13280 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13281 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13282 window.el.
13283 (replace_buffer_in_windows): Implement by calling
13284 Qreplace_buffer_in_windows.
13285 (replace_buffer_in_all_windows): Remove with some functionality
13286 moved into replace_buffer_in_windows_safely.
13287 (replace_buffer_in_windows_safely): New function.
13288 (select_window_norecord, select_frame_norecord): Move in front
13289 of run_window_configuration_change_hook. Remove now obsolete
13290 declarations.
640c8776
SM
13291 (Fset_window_buffer): Rewrite doc-string.
13292 Call Qrecord_window_buffer.
9397e56f
MR
13293 (keys_of_window): Move binding for other-window to window.el.
13294
b50691aa
CY
132952011-06-11 Chong Yidong <cyd@stupidchicken.com>
13296
13297 * dispextern.h (struct image): Replace data member, whose int_val
13298 and ptr_val fields were not used by anything, with a single
13299 lisp_val object.
13300
13301 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13302 (gif_clear_image, gif_load, imagemagick_load_image)
13303 (gs_clear_image, gs_load): Callers changed.
13304
3f754b86
PE
133052011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13306
cca69397
PE
13307 * buffer.h: Include <time.h>, for time_t.
13308 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13309
109e28d0
PE
13310 Fix minor problems found by static checking.
13311
60737f02
PE
13312 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13313
4b66faf3
PE
13314 Make identifiers static if they are not used in other modules.
13315 * data.c (Qcompiled_function, Qframe, Qvector):
13316 * image.c (QimageMagick, Qsvg):
13317 * minibuf.c (Qmetadata):
13318 * window.c (resize_window_check, resize_root_window): Now static.
13319 * window.h (resize_window_check, resize_root_window): Remove decls.
13320
109e28d0
PE
13321 * window.c (window_deletion_count, delete_deletable_window):
13322 Remove; unused.
46a4ce9e
PE
13323 (window_body_lines): Now static.
13324 (Fdelete_other_windows_internal): Mark vars as initialized.
13325 Make sure 'resize_failed' is initialized.
13326 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13327 (resize_window_apply): Remove unused local.
13328 * window.h (delete_deletable_window): Remove decl.
13329
109e28d0 13330 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
13331 (imagemagick_load_image): Fix pointer signedness problem by changing
13332 last arg from unsigned char * to char *. All uses changed.
13333 Also, fix a local for similar reasons.
13334 Remove unused locals. Remove locals to avoid shadowing.
13335 (fn_rsvg_handle_free): Remove; unused.
13336 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 13337 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 13338
3f754b86
PE
13339 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13340
2547adb1
CY
133412011-06-10 Chong Yidong <cyd@stupidchicken.com>
13342
13343 * image.c (gif_load): Fix omitted cast error introduced by
13344 2011-06-06 change.
13345
2c8e37d4
MR
133462011-06-10 Martin Rudalics <rudalics@gmx.at>
13347
13348 * window.h (resize_proportionally, orig_total_lines)
13349 (orig_top_line): Remove from window structure.
13350 (set_window_height, set_window_width, change_window_heights)
13351 (Fdelete_window): Remove prototypes.
13352 (resize_frame_windows): Remove duplicate declaration.
13353
440a42e3
EZ
133542011-06-10 Eli Zaretskii <eliz@gnu.org>
13355
13356 * window.h (resize_frame_windows, resize_window_check)
13357 (delete_deletable_window, resize_root_window)
13358 (resize_frame_windows): Declare prototypes.
13359
13360 * window.c (resize_window_apply): Make definition be "static" to
13361 match the prototype.
13362
562dd5e9
MR
133632011-06-10 Martin Rudalics <rudalics@gmx.at>
13364
13365 * window.c: Remove declarations of Qwindow_size_fixed,
13366 window_min_size_1, window_min_size_2, window_min_size,
13367 size_window, window_fixed_size_p, enlarge_window, delete_window.
13368 Remove static from declaration of Qdelete_window, it's
13369 temporarily needed by Fbury_buffer.
13370 (replace_window): Don't assign orig_top_line and
13371 orig_total_lines.
13372 (Fdelete_window, delete_window): Remove. Window deletion is
13373 handled by window.el.
640c8776
SM
13374 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13375 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
13376 (Fdelete_other_windows): Remove. Deleting other windows is
13377 handled by window.el.
13378 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13379 handled in window.el.
13380 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13381 Window minimum sizes are handled in window.el.
13382 (shrink_windows, size_window, set_window_height)
13383 (set_window_width, change_window_heights, window_height)
13384 (window_width, CURBEG, CURSIZE, enlarge_window)
13385 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13386 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13387 handled in window.el.
13388 (make_dummy_parent): Rename to make_parent_window and give it a
13389 second argument horflag.
13390 (make_window): Don't set resize_proportionally any more.
13391 (Fsplit_window): Remove. Windows are split in window.el.
13392 (save_restore_action, save_restore_orig_size)
13393 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13394 Resize mini windows in window.el.
13395 (grow_mini_window, shrink_mini_window): Implement by calling
13396 Qresize_root_window_vertically, resize_window_check and
13397 resize_window_apply.
640c8776
SM
13398 (saved_window, Fset_window_configuration, save_window_save):
13399 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
13400 resize_proportionally.
13401 (window_min_height, window_min_width): Move to window.el.
13402 (keys_of_window): Move bindings for delete-other-windows,
13403 split-window, delete-window and enlarge-window to window.el.
13404
13405 * buffer.c: Temporarily extern Qdelete_window.
13406 (Fbury_buffer): Temporarily call Qdelete_window instead of
13407 Fdelete_window (Fbury_buffer will move to window.el soon).
13408
13409 * frame.c (set_menu_bar_lines_1): Remove code handling
13410 orig_top_line and orig_total_lines.
13411
13412 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13413 set_window_height but set heights directly.
13414 (change_frame_size_1): Use resize_frame_windows.
13415
13416 * xdisp.c (init_xdisp): Don't use set_window_height but set
13417 heights directly.
13418
640c8776
SM
13419 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13420 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
13421 run_window_configuration_change_hook.
13422
13423 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13424 instead of change_window_heights and run
13425 run_window_configuration_change_hook.
13426
1a13852e
MR
134272011-06-09 Martin Rudalics <rudalics@gmx.at>
13428
13429 * window.c (replace_window): Rename second argument REPLACEMENT to
13430 NEW. New third argument SETFLAG. Rewrite.
13431 (delete_window, make_dummy_parent): Call replace_window with
13432 third argument 1.
13433 (window_list_1): Move down in code.
13434 (run_window_configuration_change_hook): Move set_buffer part
13435 before select_frame_norecord part in order to unwind correctly.
13436 Rename count1 to count.
13437 (recombine_windows, delete_deletable_window, resize_root_window)
13438 (Fdelete_other_windows_internal)
13439 (Frun_window_configuration_change_hook, make_parent_window)
13440 (resize_window_check, resize_window_apply, Fresize_window_apply)
13441 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
13442 (Fdelete_window_internal, Fresize_mini_window_internal):
13443 New functions.
1a13852e
MR
13444 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13445
f3d1777e
MR
134462011-06-08 Martin Rudalics <rudalics@gmx.at>
13447
496e208e
MR
13448 * window.h (window): Add some new members to window structure -
13449 normal_lines, normal_cols, new_total, new_normal, clone_number,
13450 splits, nest, prev_buffers, next_buffers.
13451 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 13452 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 13453
f3d1777e
MR
13454 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13455 Remove.
496e208e
MR
13456 (make_dummy_parent): Set new members of windows structure.
13457 (make_window): Move down in code. Handle new members of window
13458 structure.
13459 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13460 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13461 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13462 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
13463 (Fset_window_next_buffers, Fset_window_clone_number):
13464 New functions.
496e208e
MR
13465 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13466 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13467 Doc-string fixes.
13468 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13469 Argument WINDOW can be now internal window too.
13470 (Fwindow_use_time): Move up in code.
13471 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13472 Rewrite doc-string.
13473 (Fset_window_configuration, saved_window)
13474 (Fcurrent_window_configuration, save_window_save): Handle new
13475 members of window structure.
b9e809c2
MR
13476 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13477 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13478 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13479 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13480 Qget_mru_window, Qresize_root_window,
13481 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13482 Qauto_buffer_name; staticpro them.
f3d1777e 13483
abde8f8c
MR
134842011-06-07 Martin Rudalics <rudalics@gmx.at>
13485
13486 * window.c (Fwindow_total_size, Fwindow_left_column)
13487 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13488 (Fwindow_list_1): New functions.
13489 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
13490 (Fwindow_width, Fscroll_left, Fscroll_right):
13491 Use window_body_cols instead of window_box_text_cols.
13492 (delete_window, Fset_window_configuration):
13493 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
13494 (delete_all_subwindows): Take a window as argument and not a
13495 structure. Rewrite.
190b47e6
MR
13496 (window_loop): Remove handling of GET_LRU_WINDOW and
13497 GET_LARGEST_WINDOW.
13498 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
13499
13500 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
13501 window_box_text_cols. delete_all_subwindows now takes a
13502 Lisp_Object as argument.
abde8f8c 13503
640c8776
SM
13504 * indent.c (compute_motion, Fcompute_motion):
13505 Use window_body_cols instead of window_box_text_cols.
abde8f8c 13506
fa8a67e6
MR
13507 * frame.c (delete_frame): Call delete_all_subwindows with root
13508 window as argument.
13509
a54e3482
DC
135102011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13511
13512 * fns.c (Fputhash): Document return value.
13513
60002bf5
CY
135142011-06-06 Chong Yidong <cyd@stupidchicken.com>
13515
13516 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13517
0c671da6 135182011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 13519
b862a52a 13520 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 13521
be44ca6c
PE
13522 Check for overflow when converting integer to cons and back.
13523 * charset.c (Fdefine_charset_internal, Fdecode_char):
13524 Use cons_to_unsigned to catch overflow.
13525 (Fencode_char): Use INTEGER_TO_CONS.
13526 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13527 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13528 * data.c (long_to_cons, cons_to_long): Remove.
13529 (cons_to_unsigned, cons_to_signed): New functions.
13530 These signal an error for invalid or out-of-range values.
13531 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13532 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13533 * font.c (Ffont_variation_glyphs):
13534 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13535 * lisp.h: Include <intprops.h>.
13536 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13537 (cons_to_signed, cons_to_unsigned): New decls.
13538 (long_to_cons, cons_to_long): Remove decls.
13539 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13540 (Fprimitive_undo): Use CONS_TO_INTEGER.
13541 * xfns.c (Fx_window_property): Likewise.
13542 * xselect.c: Include <limits.h>.
13543 (x_own_selection, selection_data_to_lisp_data):
13544 Use INTEGER_TO_CONS.
13545 (x_handle_selection_request, x_handle_selection_clear)
13546 (x_get_foreign_selection, Fx_disown_selection_internal)
13547 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13548 (lisp_data_to_selection_data): Use cons_to_unsigned.
13549 (x_fill_property_data): Use cons_to_signed.
13550 Report values out of range.
13551
d1f3d2af
PE
13552 Check for buffer and string overflow more precisely.
13553 * buffer.h (BUF_BYTES_MAX): New macro.
13554 * lisp.h (STRING_BYTES_MAX): New macro.
13555 * alloc.c (Fmake_string):
13556 * character.c (string_escape_byte8):
13557 * coding.c (coding_alloc_by_realloc):
13558 * doprnt.c (doprnt):
13559 * editfns.c (Fformat):
13560 * eval.c (verror):
13561 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13562 since they may not be the same number.
13563 * editfns.c (Finsert_char):
13564 * fileio.c (Finsert_file_contents):
13565 Likewise for BUF_BYTES_MAX.
13566
dd52fcea
PE
13567 * image.c: Use ptrdiff_t, not int, for sizes.
13568 (slurp_file): Switch from int to ptrdiff_t.
13569 All uses changed.
13570 (slurp_file): Check that file size fits in both size_t (for
13571 malloc) and ptrdiff_t (for sanity and safety).
13572
7f9bbdbb
PE
13573 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13574 if b->modtime has its maximal value.
13575
dfe18f82
PE
13576 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13577
84acfcf0
PE
13578 Don't assume time_t can fit into int.
13579 * buffer.h (struct buffer.modtime): Now time_t, not int.
13580 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13581 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13582
ccd9a01a
PE
13583 Minor fixes for signed vs unsigned integers.
13584 * character.h (MAYBE_UNIFY_CHAR):
13585 * charset.c (maybe_unify_char):
13586 * keyboard.c (read_char, reorder_modifiers):
13587 XINT -> XFASTINT, since the integer must be nonnegative.
13588 * ftfont.c (ftfont_spec_pattern):
13589 * keymap.c (access_keymap, silly_event_symbol_error):
13590 XUINT -> XFASTINT, since the integer must be nonnegative.
13591 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13592 since it makes no difference and we prefer signed.
13593 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13594 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13595 nonnegative.
13596
d6d100dd
SM
135972011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13598
13599 * window.h (Fwindow_frame): Declare.
13600
2b6148e4
PE
136012011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13602
13603 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13604 (SPARE_MEMORY): Always define.
13605 (LARGE_REQUEST): Remove.
13606 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13607
f230ecc9
MR
136082011-06-06 Martin Rudalics <rudalics@gmx.at>
13609
727e958e
MR
13610 * lisp.h: Move EXFUNS for Fframe_root_window,
13611 Fframe_first_window and Fset_frame_selected_window to window.h.
13612
13613 * window.h: Move EXFUNS for Fframe_root_window,
13614 Fframe_first_window and Fset_frame_selected_window here from
13615 lisp.h.
13616
13617 * frame.c (Fwindow_frame, Fframe_first_window)
13618 (Fframe_root_window, Fframe_selected_window)
13619 (Fset_frame_selected_window): Move to window.c.
13620 (Factive_minibuffer_window): Move to minibuf.c.
13621 (Fother_visible_frames_p): New function.
13622
13623 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13624
f230ecc9
MR
13625 * window.c (decode_window, decode_any_window): Move up in code.
13626 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13627 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
13628 (Fwindow_buffer): Move up and rewrite doc-string.
13629 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13630 (Fwindow_prev): New functions.
727e958e
MR
13631 (Fwindow_frame): Move here from frame.c. Accept any window as
13632 argument.
13633 (Fframe_root_window, Fframe_first_window)
13634 (Fframe_selected_window): Move here from frame.c. Accept frame
13635 or arbitrary window as argument. Update doc-strings.
13636 (Fminibuffer_window): Move up in code.
13637 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
13638 (Fset_frame_selected_window): Move here from frame.c.
13639 Marginal rewrite.
727e958e
MR
13640 (Fselected_window, select_window, Fselect_window): Move up in
13641 code. Minor doc-string fixes.
f230ecc9 13642
4d09bcf6
PE
136432011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13644
13645 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13646 Do not assume that spare memory exists; that assumption is valid
13647 only if SYSTEM_MALLOC.
13648 (LARGE_REQUEST): New macro, so that the issue of large requests
13649 is separated from the issue of spare memory.
13650
810928a2
AS
136512011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13652
172418ad
AS
13653 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13654 format. (Bug#8806)
13655
43f862f7
AS
13656 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13657
810928a2
AS
13658 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13659 before statements.
13660
a059fe24
JD
136612011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13662
13663 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13664
13665 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13666
13667 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13668 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13669
989bf368
JB
136702011-06-05 Juanma Barranquero <lekktu@gmail.com>
13671
13672 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13673
4b80f674
CY
136742011-06-04 Chong Yidong <cyd@stupidchicken.com>
13675
13676 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13677 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
13678 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13679 New error handlers.
4b80f674
CY
13680 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13681 Obey Vx_select_enable_clipboard_manager. Catch errors in
13682 x_clipboard_manager_save (Bug#8779).
13683 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 13684 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 13685
99a33b77 136862011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
13687
13688 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13689
99a33b77 136902011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
13691
13692 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13693 in the current matrix if keep_current_p is non-zero.
13694
8264569d
EZ
136952011-06-04 Eli Zaretskii <eliz@gnu.org>
13696
13697 * bidi.c (bidi_level_of_next_char): Fix last change.
13698
57f97249
EZ
136992011-06-03 Eli Zaretskii <eliz@gnu.org>
13700
fec2107c 13701 Support bidi reordering of text covered by display properties.
57f97249 13702
fec2107c
EZ
13703 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13704 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13705 (bidi_cache_search, bidi_cache_iterator_state)
13706 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
13707 (bidi_level_of_next_char, bidi_move_to_visually_next):
13708 Support character positions inside a run of characters covered by a
fec2107c
EZ
13709 display string.
13710 (bidi_paragraph_init, bidi_resolve_explicit_1)
13711 (bidi_level_of_next_char): Call bidi_fetch_char and
13712 bidi_fetch_char_advance instead of FETCH_CHAR and
13713 FETCH_CHAR_ADVANCE.
13714 (bidi_init_it): Initialize new members.
13715 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13716 definitions.
13717 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13718 instead of using explicit *_CHAR codes.
d6d100dd
SM
13719 (bidi_resolve_explicit, bidi_resolve_weak):
13720 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
13721 bidirectional text is supported only in multibyte buffers.
13722 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13723 it to initialize the frame_window_p member of struct bidi_it.
13724 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13725 (bidi_resolve_explicit, bidi_resolve_weak)
13726 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13727 bidi_it->nchars is non-positive.
13728 (bidi_level_of_next_char): Don't try to lookup the cache for the
13729 next/previous character if nothing is cached there yet, or if we
13730 were just reseat()'ed to a new position.
c40e2fb2 13731
0e14fe90
EZ
13732 * xdisp.c (set_cursor_from_row): Set start and stop points
13733 according to the row's direction when priming the loop that looks
13734 for the glyph on which to display cursor.
13735 (single_display_spec_intangible_p): Function deleted.
13736 (display_prop_intangible_p): Reimplement to call
13737 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
13738 Accept 3 additional arguments needed by handle_display_spec.
13739 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
13740 values: lists, `(when COND...)' forms, etc.
13741 (single_display_spec_string_p): Support property values that are
13742 lists with the argument STRING its top-level element.
13743 (display_prop_string_p): Fix the condition for processing a
13744 property that is a list to be consistent with handle_display_spec.
fec2107c 13745 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
13746 last portion of handle_display_prop.
13747 (compute_display_string_pos): Accept additional argument
13748 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13749 value of a `display' property is a "replacing spec".
13750 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13751 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13752 the display property, but just return a value indicating whether
13753 the display property will replace the characters it covers.
13754 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13755 frame_window_p members of struct bidi_it.
d6d100dd
SM
13756 (compute_display_string_pos, compute_display_string_end):
13757 New functions.
fec2107c
EZ
13758 (push_it): Accept second argument POSITION, where pop_it should
13759 jump to continue iteration.
13760 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 13761
fec2107c
EZ
13762 * keyboard.c (adjust_point_for_property): Adjust the call to
13763 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
13764
13765 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
13766 (bidi_init_it): Update prototypes.
13767 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
13768 (compute_display_string_pos, compute_display_string_end):
13769 Declare prototypes.
fec2107c
EZ
13770 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13771 EMACS_INT.
fc6f18ce 13772
40087514 137732011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 13774
57f53182
PE
13775 Malloc failure behavior now depends on size of allocation.
13776 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13777 * lisp.h: Change signatures accordingly.
13778 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13779 All callers changed. (Bug#8762)
13780
13781 * gnutls.c: Use Emacs's memory allocators.
13782 Without this change, the gnutls library would invoke malloc etc.
13783 directly, which causes problems on non-SYNC_INPUT hosts, and which
13784 runs afoul of improving memory_full behavior. (Bug#8761)
13785 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13786 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13787 xfree instead of the default malloc, realloc, free.
13788 (Fgnutls_boot): No need to check for memory allocation failure,
13789 since xmalloc does that for us.
13790
ac32cd99 13791 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
13792 * category.c (hash_get_category_set):
13793 * ccl.c (ccl_driver):
13794 * charset.c (Fdefine_charset_internal):
13795 * charset.h (struct charset.hash_index):
13796 * composite.c (get_composition_id, gstring_lookup_cache)
13797 (composition_gstring_put_cache):
13798 * composite.h (struct composition.hash_index):
13799 * dispextern.h (struct image.hash):
13800 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13801 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13802 (hashfn_equal, hashfn_user_defined, make_hash_table)
13803 (maybe_resize_hash_table, hash_lookup, hash_put)
13804 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13805 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13806 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13807 * image.c (make_image, search_image_cache, lookup_image)
13808 (xpm_put_color_table_h):
13809 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 13810 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 13811 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 13812 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
13813 * alloc.c (allocate_vectorlike):
13814 Check for overflow in vector size calculations.
13815 * ccl.c (ccl_driver):
13816 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
13817 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13818 need to be updated by these changes.
40087514
PE
13819 * fns.c (make_hash_table, maybe_resize_hash_table):
13820 Check for integer overflow with large hash tables.
0de4bb68
PE
13821 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13822 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13823 (SXHASH_REDUCE): New macro.
13824 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13825 Use it instead of discarding useful hash info with large hash values.
13826 (sxhash_float): New function.
13827 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13828 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
13829 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13830 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
13831 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13832 Adjust signatures to match updated version of code.
13833 (consing_since_gc): Now EMACS_INT, since a single hash table can
13834 use more than INT_MAX bytes.
13835
698d32e2
DN
138362011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13837
13838 Make it possible to build with GCC-4.6+ -O2 -flto.
13839
13840 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13841
fd6fa53f
SM
138422011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13843
13844 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13845 Call minibuffer-inactive-mode.
13846
864db017
JB
138472011-05-31 Juanma Barranquero <lekktu@gmail.com>
13848
13849 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13850 Update dependencies.
13851
2ad0baf4
DN
138522011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13853
13854 * data.c (init_data): Remove code for UTS, this system is not
13855 supported anymore.
13856
4fcc2638
DN
138572011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13858
13859 Don't force ./temacs to start in terminal mode.
13860
13861 * frame.c (make_initial_frame): Initialize faces in all cases, not
13862 only when CANNOT_DUMP is defined.
13863 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13864
c56e0fd5
DN
138652011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13866
13867 * dispnew.c (add_window_display_history): Use const for the string
13868 pointer. Remove declaration, not needed.
13869
333d54da 138702011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 13871
55d4c1b2 13872 Use 'inline', not 'INLINE'.
333d54da 13873 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
13874 * alloc.c, fontset.c (INLINE): Remove.
13875 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13876 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13877 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13878 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13879 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13880
738db178
DN
138812011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13882
13883 Make it possible to run ./temacs.
13884
13885 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13886 syms_of_callproc does the same thing. Remove test for
13887 "initialized", do it in the caller.
13888 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13889
620c53a6
SM
138902011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13891
13892 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13893 (read_minibuf): Use get_minibuffer.
13894 (syms_of_minibuf): Use DEFSYM.
13895 (Qmetadata): New var.
13896 * data.c (Qbuffer): Don't make it static.
13897 (syms_of_data): Use DEFSYM.
13898
e003a292
PE
138992011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13900
13901 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13902 (CCL_CODE_MIN): New macro.
13903
ed008a6d
PE
139042011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13905
3687c2ef
PE
13906 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13907
ed008a6d
PE
13908 * eval.c (Qdebug): Now static.
13909 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13910 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13911 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13912
d66c4c7c
CY
139132011-05-29 Chong Yidong <cyd@stupidchicken.com>
13914
13915 * image.c: Various fixes to ImageMagick code comments.
13916 (Fimagemagick_types): Doc fix.
13917
5fbc2025
PE
139182011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13919
0196f88a
PE
13920 Minor fixes prompted by GCC 4.6.0 warnings.
13921
13922 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13923
5fbc2025
PE
13924 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13925 (x_clipboard_manager_save_all): Move extern decl to ...
13926 * xterm.h: ... here, so that it can be checked for consistency.
13927
1dd3c2d9
CY
139282011-05-29 Chong Yidong <cyd@stupidchicken.com>
13929
13930 * xselect.c (x_clipboard_manager_save_frame)
13931 (x_clipboard_manager_save_all): New functions.
13932 (Fx_clipboard_manager_save): Lisp function deleted.
13933
13934 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13935 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13936
13937 * xterm.h: Update prototype.
13938
5ba6571d
WX
139392011-05-28 William Xu <william.xwl@gmail.com>
13940
13941 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13942 exiting (Bug#8239).
13943
3eaff834
JM
139442011-05-28 Jim Meyering <meyering@redhat.com>
13945
e1900994 13946 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
13947 * fns.c (to_uchar): Define.
13948 (crypto_hash_function): Use it to convert some newly-signed
13949 variables to unsigned, to avoid sign-extension bugs. For example,
13950 without this change, (md5 "truc") would evaluate to
13951 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13952 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 13953 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 13954
0f6990a7
PE
139552011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13956
13957 Integer overflow fixes.
c8a9ca5a 13958
08686060
PE
13959 * dbusbind.c: Serial number integer overflow fixes.
13960 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
13961 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13962 to hold a serial number that is too large for a fixnum.
13963 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13964 Check for serial numbers out of range. Decode any serial number
59568bf0 13965 that was so large that it became a float. (Bug#8722)
08686060 13966
2d1fc3c7
PE
13967 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13968 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13969 Use XFASTINT rather than XUINT when numbers are nonnegative.
13970 (xd_append_arg, Fdbus_method_return_internal):
13971 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13972 arguments, check that Lisp number is nonnegative, rather than
59568bf0 13973 silently wrapping negative numbers around. (Bug#8722)
30217ff0 13974 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 13975 (Bug#8722)
2d1fc3c7 13976
c8a9ca5a
PE
13977 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13978
519e1d69
PE
13979 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13980
6df6ae42 13981 ccl: Add integer overflow checks.
30569699
PE
13982 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13983 (IN_INT_RANGE): New macros.
13984 (ccl_driver): Use them to check for integer overflow when
13985 decoding a CCL program. Many of the new checks are whether XINT (x)
13986 fits in int; it doesn't always, on 64-bit hosts. The new version
13987 doesn't catch all possible integer overflows, but it's an
847044ea 13988 improvement. (Bug#8719)
30569699 13989
c11285dc
PE
13990 * alloc.c (make_event_array): Use XINT, not XUINT.
13991 There's no need for unsigned here.
13992
fdccd48e
PE
13993 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13994 This follows up to the 2011-05-06 change that substituted uintptr_t
13995 for EMACS_INT. This case wasn't caught back then.
13996
37910ab2
PE
13997 Rework Fformat to avoid integer overflow issues.
13998 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13999 now (part of C89). Include <verify.h>.
14000 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14001 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14002 (Fformat): Avoid the prepass trying to compute sizes; it was only
14003 approximate and thus did not catch overflow reliably. Instead, walk
14004 through the format just once, formatting and computing sizes as we go,
14005 checking for integer overflow at every step, and allocating a larger
14006 buffer as needed. Keep track separately whether the format is
14007 multibyte. Keep only the most-recently calculated precision, rather
14008 than them all. Record whether each argument has been converted to
14009 string. Use EMACS_INT, not int, for byte and char and arg counts.
14010 Support field widths and precisions larger than INT_MAX. Avoid
14011 sprintf's undefined behavior with conversion specifications such as %#d
14012 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14013 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14014 formatting out-of-range floating point numbers with int
9173deec 14015 formats. (Bug#8668)
37910ab2 14016
2e6578fb
PE
14017 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14018
0ae6bdee
PE
14019 * data.c: Avoid integer truncation in expressions involving floats.
14020 * data.c: Include <intprops.h>.
14021 (arith_driver): When there's an integer overflow in an expression
14022 involving floating point, convert the integers to floating point
14023 so that the resulting value does not suffer from catastrophic
14024 integer truncation. For example, on a 64-bit host (* 4
14025 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14026 Do not rely on undefined behavior after integer overflow.
14027
de883a70
PE
14028 merge count_size_as_multibyte, parse_str_to_multibyte
14029 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14030 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14031 Check for integer overflow.
14032 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14033 since it's now a duplicate of the other. This is more of
14034 a character than a buffer op, so better that it's in character.c.
14035 * fns.c, print.c: Adjust to above changes.
14036
2ff916cb
PE
140372011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14038
14039 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14040
f1b54466
PE
140412011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14042
fb1ac845
PE
14043 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14044 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14045 (x_clipboard_manager_save): Now static.
14046 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14047
f1b54466
PE
14048 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14049 (crypto_hash_function): Now static.
14050 Fix pointer signedness problems. Avoid unnecessary initializations.
14051
a9f737ee
CY
140522011-05-27 Chong Yidong <cyd@stupidchicken.com>
14053
14054 * termhooks.h (Vselection_alist): Make it terminal-local.
14055
14056 * terminal.c (create_terminal): Initialize it.
14057
14058 * xselect.c: Support for clipboard managers.
14059 (Vselection_alist): Move to termhooks.h as terminal-local var.
14060 (LOCAL_SELECTION): New macro.
14061 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14062 (symbol_to_x_atom): Remove gratuitous arg.
14063 (x_handle_selection_request, lisp_data_to_selection_data)
14064 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14065 (x_own_selection, x_get_local_selection, x_convert_selection):
14066 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14067 (some_frame_on_display): Delete unused function.
14068 (Fx_own_selection_internal, Fx_get_selection_internal)
14069 (Fx_disown_selection_internal, Fx_selection_owner_p)
14070 (Fx_selection_exists_p): New optional frame arg.
14071 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14072 (x_handle_selection_clear): Don't treat other terminals with the
14073 same keyboard specially. Use the terminal-local Vselection_alist.
14074 (x_clear_frame_selections): Use Frun_hook_with_args.
14075
14076 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14077
14078 * xterm.h: Add support for those atoms.
14079
e067f0c1
CY
140802011-05-26 Chong Yidong <cyd@stupidchicken.com>
14081
14082 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14083 (converted_selections, conversion_fail_tag): New global variables.
14084 (x_selection_request_lisp_error): Free the above.
14085 (x_get_local_selection): Remove unnecessary code.
14086 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14087 of converted selections stored in converted_selections.
14088 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14089 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14090 (x_convert_selection): New function.
14091 (x_handle_selection_event): Simplify.
14092 (x_get_foreign_selection): Don't ignore incoming requests while
14093 waiting for an answer; this will fail when we implement
14094 SAVE_TARGETS, and seems unnecessary anyway.
14095 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14096 (Vx_sent_selection_functions): Doc fix.
14097
0f4aebc0
LL
140982011-05-26 Leo Liu <sdl.web@gmail.com>
14099
14100 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14101
e61124cd
YM
141022011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14103
14104 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14105
14106 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14107 for fringe update if it has periodic bitmap.
ac389d0c 14108 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14109 and fringe_bitmap_periodic_p.
14110
14111 * fringe.c (get_fringe_bitmap_data): New function.
14112 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14113 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14114 row. Mark glyph row for fringe update if periodicity changed.
14115
14116 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14117 for fringe update unless it has periodic bitmap.
14118
f16d9837
KH
141192011-05-25 Kenichi Handa <handa@m17n.org>
14120
14121 * xdisp.c (get_next_display_element): Set correct it->face_id for
14122 a static composition.
14123
e1b90ef6
LL
141242011-05-24 Leo Liu <sdl.web@gmail.com>
14125
14126 * deps.mk (fns.o):
14127 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14128
14129 * fns.c (crypto_hash_function, Fsha1): New function.
14130 (Fmd5): Use crypto_hash_function.
14131 (syms_of_fns): Add Ssha1.
14132
7400048f
PE
141332011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14134
14135 * gnutls.c: Remove unused macros.
14136 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14137 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14138 Remove macros that are defined and never used.
14139 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14140
abb71cf4
CY
141412011-05-22 Chong Yidong <cyd@stupidchicken.com>
14142
14143 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14144 (Fx_get_selection_internal): Minor cleanup.
14145 (Fx_own_selection_internal): Rename arguments for consistency with
14146 select.el.
14147
6307db39
PE
141482011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14149
14150 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14151
f3d4e0a4
CY
141522011-05-22 Chong Yidong <cyd@stupidchicken.com>
14153
14154 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14155
4d8ade89
YM
141562011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14157
14158 * dispnew.c (scrolling_window): Don't exclude the case that the
14159 last enabled row in the desired matrix touches the bottom boundary.
14160
32078c8d
GM
141612011-05-21 Glenn Morris <rgm@gnu.org>
14162
14163 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
14164 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14165 and add some more files.
32078c8d 14166
7285dc67
EZ
141672011-05-20 Eli Zaretskii <eliz@gnu.org>
14168
14169 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14170 report_file_error introduced by the change from 2011-05-07.
14171
89d1bd22
PE
141722011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14173
14174 * systime.h (Time): Define only if emacs is defined.
14175 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14176 where the include path doesn't have X11/X.h by default. See
14177 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14178
cd394be1 141792011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
14180
14181 * composite.c (find_automatic_composition): Fix previous change.
14182
b9704ad9
GM
141832011-05-20 Glenn Morris <rgm@gnu.org>
14184
14185 * lisp.mk: New file, split from Makefile.in.
14186 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14187 (shortlisp): Remove.
14188 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14189
4a720484
GM
141902011-05-19 Glenn Morris <rgm@gnu.org>
14191
14192 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14193 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14194 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14195 (lisp): Set the order to that of loadup.el.
14196 (shortlisp): Make it a copy of $lisp.
14197 (SOME_MACHINE_LISP): Remove.
14198 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14199 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14200
a28d4396
KH
142012011-05-18 Kenichi Handa <handa@m17n.org>
14202
14203 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14204 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14205 (find_automatic_composition): Mostly rewrite for efficiency.
14206
a2b1fa8e
JB
142072011-05-18 Juanma Barranquero <lekktu@gmail.com>
14208
14209 * makefile.w32-in: Update dependencies.
14210
8e1f5610
CS
142112011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14212
14213 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 14214 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 14215
7025ee00 142162011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 14217
cdfa6eab
PE
14218 Fix some integer overflow issues, such as string length overflow.
14219
06d6db33
PE
14220 * insdel.c (count_size_as_multibyte): Check for string overflow.
14221
2b4560a8
PE
14222 * character.c (lisp_string_width): Check for string overflow.
14223 Use EMACS_INT, not int, for string indexes and lengths; in
14224 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14225 the resulting string length overflows an EMACS_INT; instead,
14226 report a string overflow if no precision given. When checking for
14227 precision exhaustion, use a check that cannot possibly have
14228 integer overflow. (Bug#8675)
14229 * character.h (lisp_string_width): Adjust to new signature.
14230
cb93f9be
PE
14231 * alloc.c (string_overflow): New function.
14232 (Fmake_string): Use it. This doesn't change behavior, but saves
14233 a few bytes and will simplify future changes.
14234 * character.c (string_escape_byte8): Likewise.
14235 * lisp.h (string_overflow): New decl.
14236
1a1f3366
PE
14237 Fixups, following up to the user-interface timestamp change.
14238 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14239 for UI timestamps, instead of unsigned long.
9fbd6841
PE
14240 * msdos.c (mouse_get_pos): Likewise.
14241 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
14242 * w32gui.h (Time): Define by including "systime.h" rather than by
14243 declaring it ourselves. (Bug#8664)
14244
d4e3e4d3
PE
14245 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14246 * image.c (clear_image_cache): Likewise.
14247
f6a24d19
PE
14248 * term.c (term_mouse_position): Don't assume time_t wraparound.
14249
08dc5ae6
PE
14250 Be more systematic about user-interface timestamps.
14251 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
14252 and sometimes 'EMACS_UINT', to represent these timestamps.
14253 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
14254 This makes the code easier to follow, and makes it easier to catch
14255 integer overflow bugs such as Bug#8664.
14256 * frame.c (Fmouse_position, Fmouse_pixel_position):
14257 Use Time, not unsigned long, for user-interface timestamps.
14258 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14259 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14260 * keyboard.h (last_event_timestamp): Likewise.
14261 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14262 * menu.h (xmenu_show): Likewise.
14263 * term.c (term_mouse_position): Likewise.
14264 * termhooks.h (struct input_event.timestamp): Likewise.
14265 (struct terminal.mouse_position_hook): Likewise.
14266 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14267 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14268 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14269 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14270 what it was before.
14271 * menu.h, termhooks.h: Include "systime.h", for Time.
14272
8e55734a
PE
14273 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14274 Don't assume that the difference between two unsigned long values
14275 can fit into an integer. At this point, we know button_down_time
14276 <= event->timestamp, so the difference must be nonnegative, so
14277 there's no need to cast the result if double-click-time is
14278 nonnegative, as it should be; check that it's nonnegative, just in
14279 case. This bug is triggered when events are more than 2**31 ms
86db42d2 14280 apart (about 25 days). (Bug#8664)
8e55734a 14281
841f1b75 14282 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 14283 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 14284
3e26f69c
PE
14285 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14286 that always fit in int. Use a sentinel instead of a counter, to
14287 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
14288 * frame.h (struct frame): Use int for menu_bar_items_used
14289 instead of EMACS_INT, since it always fits in int.
3e26f69c 14290
5cc152c0
PE
14291 * menu.c (grow_menu_items): Check for int overflow.
14292
d89eb65e
PE
14293 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14294
5235bd3e
PE
14295 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14296 Before, the code was not consistent. These values cannot exceed
14297 2**31 - 1 so there's no need to make them unsigned.
14298 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14299 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14300 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14301 as modifiers.
14302 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14303
bc827e23
PE
14304 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14305 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14306 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14307 presumably because the widths might not match.
14308
78eb494e
PE
14309 * window.c (size_window): Avoid needless test at loop start.
14310
04f2d78b
CB
143112011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14312
14313 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14314
d2fc7e3d 143152011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
14316
14317 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14318
d2fc7e3d 143192011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
14320
14321 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14322 `width' to `bar_area_x' and `bar_area_width', respectively.
14323 (x_scroll_run): Take account of fringe background extension.
14324
04f2d78b
CB
14325 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14326 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
14327 `bar_area_width', respectively.
14328 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14329 background extension.
14330
79b70037
GM
143312011-05-10 Jim Meyering <meyering@redhat.com>
14332
14333 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14334
2f142cc5
JB
143352011-05-10 Juanma Barranquero <lekktu@gmail.com>
14336
14337 * image.c (Finit_image_library): Return t for built-in image types,
14338 like pbm and xbm. (Bug#8640)
14339
57679c86
AS
143402011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14341
14342 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14343
888c9e86
EZ
143442011-05-07 Eli Zaretskii <eliz@gnu.org>
14345
b0512a1d
EZ
14346 * w32console.c (Fset_screen_color): Doc fix.
14347 (Fget_screen_color): New function.
14348 (syms_of_ntterm): Defsubr it.
14349
7285dc67
EZ
14350 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14351 unlink the temporary file if Fcall_process didn't create it in the
14352 first place.
14353 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14354 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
14355 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14356 cue to call_process_cleanup not to close that handle.
14357
4d3fcc8e
BK
143582011-05-07 Ben Key <bkey76@gmail.com>
14359
14360 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14361 one of two shell specific rules, either bootstrap-temacs-CMD or
14362 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14363 to the previous implementation of the bootstrap-temacs rule.
14364 The bootstrap-temacs-CMD rule is similar to the previous
14365 implementation of the bootstrap-temacs rule except that it
14366 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14367 variable.
14368
14369 These changes, along with some changes to nt/configure.bat,
14370 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14371 earlier fix to add support for --cflags and --ldflags options
14372 that include quotes so that it works whether make uses cmd or
14373 sh as the shell.
14374
b4289b64
MA
143752011-05-06 Michael Albinus <michael.albinus@gmx.de>
14376
14377 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14378 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14379 is a constant.
14380 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14381 a string. Handle both cases.
14382 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14383 (Fdbus_register_method): Use Qinvalid_function.
14384
af4c0e28
JB
143852011-05-06 Juanma Barranquero <lekktu@gmail.com>
14386
14387 * makefile.w32-in: Update dependencies.
14388 (LISP_H): Add inttypes.h and stdin.h.
14389 (PROCESS_H): Add unistd.h.
14390
c51453d9
EZ
143912011-05-06 Eli Zaretskii <eliz@gnu.org>
14392
14393 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14394 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14395
8ff0ac3c 143962011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 14397
4c4b566b
PE
14398 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14399
aab2b9b5
PE
14400 * term.c (vfatal): Remove stray call to va_end.
14401 It's not needed and the C Standard doesn't allow it here anyway.
14402
c378da0b
PE
14403 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14404 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14405
288b08c7
PE
14406 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14407 bytes.
14408
e3601888
PE
14409 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14410
db6c0e74
PE
14411 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14412
dd5963ea
PE
14413 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14414
88c9450f
PE
14415 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14416
2f9442b8
PE
14417 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14418
c032b5f8
PE
14419 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14420 * charset.c (Fdefine_charset_internal): Don't initialize
14421 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 14422 32-bit int (Bug#8600).
a108c10b
PE
14423
14424 * lread.c (read_integer): Be more consistent with string-to-number.
14425 Use string_to_number to do the actual conversion; this avoids
14426 rounding errors and fixes some other screwups. Without this fix,
14427 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14428 (digit_to_number): Move earlier, for benefit of read_integer.
14429 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 14430 not a digit in any supported base. (Bug#8602)
a108c10b 14431
ad5f9eea
PE
14432 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14433
aec1708a
PE
14434 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14435 to match comment at start of function. This also removes a
14436 GCC warning about overflow in a 32+64-bit port.
14437
47be4ab5
PE
14438 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14439
371cac43
PE
14440 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14441 Reported by Stefan Monnier in
14442 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
14443 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14444 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 14445
d01a7826
PE
14446 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14447 (EMACS_UINTPTR): Likewise, with uintptr_t.
14448
7fd47d5c
PE
14449 * lisp.h: Prefer 64-bit EMACS_INT if available.
14450 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14451 on 32-bit hosts that have 64-bit int, so that they can access
14452 large files.
122b0c86
PE
14453 However, temporarily disable this change unless the temporary
14454 symbol WIDE_EMACS_INT is defined.
7fd47d5c 14455
8727937b
PE
14456 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14457
8ac068ac
PE
14458 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14459 This removes an assumption that EMACS_INT and long are the same
14460 width as pointers. The assumption is true for Emacs porting targets
14461 now, but we want to make other targets possible.
14462 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14463 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14464 In the rest of the code, change types of integers that hold casted
14465 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14466 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14467 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14468 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14469 No need to cast type when ORing.
14470 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14471 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14472 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14473 assume EMACS_INT is the same width as char *.
14474 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14475 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14476 Remove no-longer-needed casts.
14477 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14478 (xg_tool_bar_help_callback, xg_make_tool_item):
14479 Use EMACS_INTPTR to hold an integer
14480 that will be cast to void *; this can avoid a GCC warning
14481 if EMACS_INT is not the same width as void *.
14482 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14483 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14484 (current_message_1, set_message_1):
14485 Use a local to convert to proper width without a cast.
14486 * xmenu.c (dialog_selection_callback): Likewise.
14487
ede49d71
PE
14488 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14489 Also, don't assume VALBITS / RAND_BITS is less than 5,
14490 and don't rely on undefined behavior when shifting a 1 left into
14491 the sign bit.
14492 * lisp.h (get_random): Change signature to match.
14493
2f30ecd0
PE
14494 * lread.c (hash_string): Use size_t, not int, for hash computation.
14495 Normally we prefer signed values; but hashing is special, because
14496 it's better to use unsigned division on hash table sizes so that
14497 the remainder is nonnegative. Also, size_t is the natural width
14498 for hashing into memory. The previous code used 'int', which doesn't
14499 retain enough info to hash well into very large tables.
14500 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14501
2a866e7b
PE
14502 * dbusbind.c: Don't possibly lose pointer info when converting.
14503 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14504 Use XPNTR rather than XHASH, so that the high-order bits of
14505 the pointer aren't lost when converting through void *.
14506
51639eac
PE
14507 * eval.c (Fautoload): Don't double-shift a pointer.
14508
92394119
PE
14509 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14510
dbdb9a7c
JB
145112011-05-06 Juanma Barranquero <lekktu@gmail.com>
14512
14513 * gnutls.c (DEF_GNUTLS_FN):
14514 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14515
db7a0b4f
AS
145162011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14517
14518 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14519 marker. (Bug#8610)
14520
cd394be1 145212011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
14522
14523 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14524 New version that can reserve upto 2GB of heap space.
14525
f7ff1b0f 145262011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
14527
14528 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14529
639c109b
TZ
145302011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14531
14532 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14533 `gnutls_certificate_set_x509_key_file'.
14534
d2127135
JB
145352011-05-05 Juanma Barranquero <lekktu@gmail.com>
14536
14537 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14538 Update dependencies.
14539
e968f4f3
JB
145402011-05-04 Juanma Barranquero <lekktu@gmail.com>
14541
14542 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14543 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14544 Remove unused parameter `fildes'.
14545 * process.c (read_process_output, send_process): Don't pass it.
14546
84d358f0
JB
145472011-05-04 Juanma Barranquero <lekktu@gmail.com>
14548
14549 Fix previous change: the library cache is defined in w32.c.
14550 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14551 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14552
0898ca10
JB
145532011-05-04 Juanma Barranquero <lekktu@gmail.com>
14554
14555 Implement dynamic loading of GnuTLS on Windows.
14556
14557 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14558 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14559 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14560 Declare.
14561
14562 * gnutls.c (Qgnutls_dll): Define.
14563 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14564 (gnutls_*): Declare function pointers.
14565 (init_gnutls_functions): New function to initialize function pointers.
14566 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14567 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14568 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14569 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14570 (emacs_gnutls_write, emacs_gnutls_read)
14571 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14572 (Fgnutls_available_p): New function.
14573 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14574 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14575 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14576
14577 * image.c: Include w32.h.
14578 (Vimage_type_cache): Delete.
14579 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14580 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14581 (w32_delayed_load): Move to w32.c.
14582
14583 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14584
14585 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14586 (w32_delayed_load): Move from image.c. When loading a library, record
14587 its filename in the :loaded-from property of the library id.
14588 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14589 Initialize and staticpro them.
14590 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14591
14592 * process.c: Include lisp.h before w32.h, not after.
14593 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14594 instead of gnutls_record_check_pending.
14595
14596 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14597
ff4de4aa
TZ
145982011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14599
14600 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14601 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14602 as passed in.
14603
abe95abb
JD
146042011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14605
14606 * xterm.c (x_set_frame_alpha): Do not set property on anything
14607 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14608
e16e55d4
JB
146092011-05-02 Juanma Barranquero <lekktu@gmail.com>
14610
14611 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14612
bafcf6a5
JB
146132011-05-02 Juanma Barranquero <lekktu@gmail.com>
14614
14615 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14616 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14617 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14618 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14619 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14620 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14621 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14622 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14623 (Qgnutls_bootprop_callbacks_verify): Make static.
14624
e7a6747f
AS
146252011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14626
19ed11ba
AS
14627 * callproc.c: Indentation fixup.
14628
e7a6747f 14629 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
14630 (wait_for_termination, interruptible_wait_for_termination):
14631 Move after wait_for_termination_1.
e7a6747f 14632
1ef14cb4
LMI
146332011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14634
14635 * sysdep.c (interruptible_wait_for_termination): New function
14636 which is like wait_for_termination, but allows keyboard
14637 interruptions.
14638
14639 * callproc.c (Fcall_process): Add (:file "file") as an option for
14640 the STDOUT buffer.
14641 (Fcall_process_region): Ditto.
14642
330d880c
EZ
146432011-04-30 Eli Zaretskii <eliz@gnu.org>
14644
8db90b73
EZ
14645 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14646 rather than `XVECTOR (FOO)->size'.
14647
330d880c
EZ
14648 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14649 inttypes.h, as a gnulib replacement is used if it not available in
14650 system headers.
14651
15cbd324
EZ
146522011-04-21 Eli Zaretskii <eliz@gnu.org>
14653
14654 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14655 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14656 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14657
14658 * coding.c (coding_alloc_by_realloc): Error out if destination
14659 will grow beyond MOST_POSITIVE_FIXNUM.
14660 (decode_coding_emacs_mule): Abort if there isn't enough place in
14661 charbuf for the composition carryover bytes. Reserve an extra
14662 space for up to 2 characters produced in a loop.
14663 (decode_coding_iso_2022): Abort if there isn't enough place in
14664 charbuf for the composition carryover bytes.
14665
146662011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 14667
ae940cca
EZ
14668 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14669 aborting when %lld or %lll format is passed.
14670 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14671 %llo or %llx format is passed. (Bug#8545)
14672
03ab8921
EZ
14673 * window.c (window_scroll_line_based): Use a marker instead of
14674 simple variables to record original value of point. (Bug#7952)
14675
afda1437
EZ
14676 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14677 produced by %s or %c overflows available buffer space. (Bug#8545)
14678
f76dee0c
PE
146792011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14680
14681 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 14682 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 14683
fdc5744d
JB
146842011-04-28 Juanma Barranquero <lekktu@gmail.com>
14685
14686 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14687
638f053a
JB
146882011-04-28 Juanma Barranquero <lekktu@gmail.com>
14689
14690 * keyboard.c (Qdelayed_warnings_hook): Define.
14691 (command_loop_1): Run `delayed-warnings-hook'
14692 if Vdelayed_warnings_list is non-nil.
14693 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14694 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14695
d178f871
EZ
146962011-04-28 Eli Zaretskii <eliz@gnu.org>
14697
14698 * doprnt.c (doprnt): Don't return value smaller than the buffer
14699 size if the message was truncated. (Bug#8545).
14700
b124fd93
JB
147012011-04-28 Juanma Barranquero <lekktu@gmail.com>
14702
14703 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14704 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14705
e810457d
PE
147062011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14707
14708 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14709
ea51cceb
JB
147102011-04-27 Juanma Barranquero <lekktu@gmail.com>
14711
14712 * makefile.w32-in: Update dependencies.
14713
94dcfacf
EZ
147142011-04-27 Eli Zaretskii <eliz@gnu.org>
14715
14716 Improve `doprnt' and its usage. (Bug#8545)
14717 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14718 `format_end'. Remove support for %l as a conversion specifier.
14719 Don't use xrealloc. Improve diagnostics when the %l size modifier
14720 is used. Update the commentary.
14721
14722 * eval.c (verror): Simplify calculation of size_t.
14723
14724 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14725 messages.
14726
f61f41d7
PE
147272011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14728
14729 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14730 change.
14731
96fb4434
PE
147322011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14733
14734 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14735 This makes this file independent of the recent pseudovector change.
14736
671875da 147372011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 14738
69e9b5a3
PE
14739 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14740
b5f869a7 14741 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 14742 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 14743 Remove unused local.
c8926152 14744 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 14745
841a1577 14746 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
14747 GCC 4.6.0 optimizes based on type-based alias analysis.
14748 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
14749 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14750 != &v->size, and therefore "v->size = 1; b->size = 2; return
14751 v->size;" must therefore return 1. This assumption is incorrect
14752 for Emacs, since it type-puns struct Lisp_Vector * with many other
14753 types. To fix this problem, this patch adds a new type struct
f904488f 14754 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
14755 and pseudovectors, and helps optimizing compilers not get fooled
14756 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14757 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
14758 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14759 the size member.
eab3844f
PE
14760 (XSETPVECTYPE): Rewrite in terms of new macro.
14761 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14762 This is a bit clearer, and further avoids the possibility of
14763 undesirable aliasing.
14764 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 14765 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
14766 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14767 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
14768 (ASIZE): Now uses header.size rather than size.
14769 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
14770 to avoid the hassle of writing XVECTOR (foo)->header.size.
14771 (struct vectorlike_header): New type.
eab3844f
PE
14772 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14773 object, to help avoid aliasing.
14774 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14775 (SUBRP): Likewise, since Lisp_Subr is a special case.
14776 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14777 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14778 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 14779 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
14780 changed to be "header.size" and "header.next".
14781 * buffer.h (struct buffer): Likewise.
14782 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14783 * frame.h (struct frame): Likewise.
14784 * process.h (struct Lisp_Process): Likewise.
14785 * termhooks.h (struct terminal): Likewise.
14786 * window.c (struct save_window_data, struct saved_window): Likewise.
14787 * window.h (struct window): Likewise.
14788 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14789 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14790 * buffer.c (init_buffer_once): Likewise.
14791 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14792 special case.
14793 * process.c (Fformat_network_address): Use local var for size,
14794 for brevity.
14795
0df1eac5
PE
14796 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14797
847ab9d1 14798 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
14799 * data.c (atof): Remove decl; no longer used or needed.
14800 (digit_to_number): Move to lread.c.
14801 (Fstring_to_number): Use new string_to_number function, to be
14802 consistent with how the Lisp reader treats infinities and NaNs.
14803 Do not assume that floating-point numbers represent EMACS_INT
14804 without losing information; this is not true on most 64-bit hosts.
14805 Avoid double-rounding errors, by insisting on integers when
14806 parsing non-base-10 numbers, as the documentation specifies.
14807 * lisp.h (string_to_number): New decl, replacing ...
14808 (isfloat_string): Remove.
bc0a5c13 14809 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 14810 (read1): Do not accept +. and -. as integers; this
452f4150
PE
14811 appears to have been a coding error. Similarly, do not accept
14812 strings like +-1e0 as floating point numbers. Do not report
14813 overflow for integer overflows unless the base is not 10 which
14814 means we have no simple and reliable way to continue.
14815 Break out the floating-point parsing into a new
14816 function string_to_number, so that Fstring_to_number parses
14817 floating point numbers consistently with the Lisp reader.
04f2d78b 14818 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
14819 (E_CHAR, EXP_INT): Remove, replacing with ...
14820 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14821 (string_to_number): New function, replacing isfloat_string.
14822 This function checks for valid syntax and produces the resulting
14823 Lisp float number too. Rework it so that string-to-number
bc0a5c13 14824 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
14825 so that overflow for non-base-10 numbers is reported only when
14826 there's no portable and simple way to convert to floating point.
452f4150 14827
67769ffc
PE
14828 * textprop.c (set_text_properties_1): Rewrite for clarity,
14829 and to avoid GCC warning about integer overflow.
14830
c20db43f
PE
14831 * intervals.h (struct interval): Use EMACS_INT for members
14832 where EMACS_UINT might cause problems. See
14833 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14834 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14835 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14836 All uses changed.
37aa2f85
PE
14837 (offset_intervals): Tell GCC not to worry about length overflow
14838 when negating a negative length.
c20db43f 14839
2538aa2f
PE
14840 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14841 (overrun_check_free): Likewise.
14842
f2d3008d
PE
14843 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14844 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14845 word size.
14846
ec8df744
PE
14847 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14848 (gnutls_make_error): Rename local to avoid shadowing.
14849 (gnutls_emacs_global_deinit): ifdef out; not used.
14850 (Fgnutls_boot): Use const for pointer to readonly storage.
14851 Comment out unused local. Fix pointer signedness problems.
14852
640ee02d
PE
14853 * lread.c (openp): Don't stuff size_t into an 'int'.
14854 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14855 about possible signed overflow.
14856
6048fb2a
PE
14857 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14858 (GDK_KEY_g): Don't define if already defined.
14859 (xg_prepare_tooltip): Avoid pointer signedness problem.
14860 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14861
fa3c87e1
PE
14862 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14863 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14864
2172544b
PE
14865 * xfns.c (Fx_window_property): Simplify a bit,
14866 to make a bit faster and to avoid GCC 4.6.0 warning.
14867 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14868
9b821a21
PE
14869 * fns.c (internal_equal): Don't assume size_t fits in int.
14870
3c616cfa
PE
14871 * alloc.c (compact_small_strings): Tighten assertion a little.
14872
c2982e87
PE
14873 Replace pEd with more-general pI, and fix some printf arg casts.
14874 * lisp.h (pI): New macro, generalizing old pEd macro to other
14875 conversion specifiers. For example, use "...%"pI"d..." rather
14876 than "...%"pEd"...".
14877 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 14878 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
14879 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14880 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14881 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14882 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14883 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14884 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14885 64-bit hosts.
14886 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14887 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14888 * print.c (safe_debug_print, print_object): Likewise.
14889 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14890 to int.
6f04d126
PE
14891 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14892 avoiding the 0 flag, which is not portable.
c2982e87
PE
14893 * process.c (Fmake_network_process): Use pI to avoid cast.
14894 * region-cache.c (pp_cache): Likewise.
14895 * xdisp.c (decode_mode_spec): Likewise.
14896 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14897 behavior on 64-bit hosts with printf arg.
6f04d126 14898 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
14899 (x_stop_queuing_selection_requests): Likewise.
14900 (x_get_window_property): Don't truncate byte count to an 'int'
14901 when tracing.
0b432f21 14902
5e073ec7
PE
14903 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14904 here, since it parses constructs like leading '-' and spaces,
14905 which are not wanted; and it overflows with large numbers.
14906 Instead, simply match F[0-9]+, which is what is wanted anyway.
14907
36372bf9
PE
14908 * alloc.c: Remove unportable assumptions about struct layout.
14909 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14910 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14911 (allocate_vectorlike, make_pure_vector): Use the new macros,
14912 plus offsetof, to remove unportable assumptions about struct layout.
14913 These assumptions hold on all porting targets that I know of, but
14914 they are not guaranteed, they're easy to remove, and removing them
14915 makes further changes easier.
14916
0b432f21
PE
14917 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14918 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
14919 (string_overrun_cookie): Now const. Use initializers that
14920 don't formally overflow signed char, to avoid warnings.
000098c1
PE
14921 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14922 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
14923 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14924 multiple of sizeof (EMACS_INT); it need not be, if
14925 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 14926 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 14927
895009e1
JB
149282011-04-26 Juanma Barranquero <lekktu@gmail.com>
14929
14930 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14931
6a7a1b0b
TZ
149322011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14933
14934 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 14935 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
14936 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14937
841a1577 149382011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
14939
14940 * lisp.h (Qdebug): List symbol.
895009e1 14941 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
14942 * keyboard.c (debug-on-event): New variable.
14943 (handle_user_signal): Break into debugger when debug-on-event
14944 matches the current signal symbol.
14945
f2d3ba6f
DN
149462011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14947
14948 * alloc.c (check_sblock, check_string_bytes)
14949 (check_string_free_list): Convert to standard C.
14950
42ce4c63
TZ
149512011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14952
14953 * w32.c (emacs_gnutls_push): Fix typo.
14954
825cd63c
EZ
149552011-04-25 Eli Zaretskii <eliz@gnu.org>
14956
fb11d64d
EZ
14957 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14958 "cast to pointer from integer of different size".
14959
825cd63c
EZ
14960 Improve doprnt and its use in verror. (Bug#8545)
14961 * doprnt.c (doprnt): Document the set of format control sequences
14962 supported by the function. Use SAFE_ALLOCA instead of always
14963 using `alloca'.
14964
14965 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14966 is one byte too soon. Don't use xrealloc; instead xfree and
14967 xmalloc anew.
14968
e061a11b
TZ
149692011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14970
14971 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14972 callbacks stage.
14973
14974 * gnutls.c: Renamed global_initialized to
14975 gnutls_global_initialized. Added internals for the
14976 :verify-hostname-error, :verify-error, and :verify-flags
14977 parameters of `gnutls-boot' and documented those parameters in the
14978 docstring. Start callback support.
9173deec
JB
14979 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14980 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14981 on error. Return error code.
e061a11b
TZ
14982 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14983 (emacs_gnutls_read): Likewise.
14984 (Fgnutls_boot): Return handshake error code.
14985 (emacs_gnutls_handle_error): New function.
14986 (wsaerror_to_errno): Likewise.
14987
14988 * w32.h (emacs_gnutls_pull): Add prototype.
14989 (emacs_gnutls_push): Likewise.
14990
14991 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14992 (emacs_gnutls_push): Likewise.
14993
149942011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14995
14996 * process.c (wait_reading_process_output): Check if GnuTLS
14997 buffered some data internally if no FDs are set for TLS
14998 connections.
14999
15000 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15001 (LIBS): Link to USER_LIBS.
15002 ($(BLD)/gnutls.$(0)): New target.
15003
fa6996bc
EZ
150042011-04-24 Eli Zaretskii <eliz@gnu.org>
15005
eb35682e
EZ
15006 * xdisp.c (handle_single_display_spec): Rename the
15007 display_replaced_before_p argument into display_replaced_p, to
15008 make it consistent with the commentary. Fix typos in the
15009 commentary.
15010
e2ad650c
EZ
15011 * textprop.c (syms_of_textprop): Remove dead code.
15012 (copy_text_properties): Delete obsolete commentary about an
15013 interface that was deleted long ago. Fix typos in the description
15014 of arguments.
15015
1b2de274
EZ
15016 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15017 to changes in oldXMenu/XMenu.h from 2011-04-16.
15018 <menu_help_message, prev_menu_help_message>: Constify.
15019 (IT_menu_make_room): menu->help_text is now `const char **';
15020 adjust.
15021
15022 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15023 to changes in oldXMenu/XMenu.h from 2011-04-16.
15024 (struct XMenu): Declare `help_text' `const char **'.
15025
15026 * xfaces.c <Qunspecified>: Make extern again.
15027
15028 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15029 required by POSIX.
1b2de274 15030
762b15be
EZ
15031 * doc.c (get_doc_string): Improve the format passed to `error'.
15032
15033 * doprnt.c (doprnt): Improve commentary.
15034
15035 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15036
15037 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15038 them with etags.
15039
f1052e5d
EZ
15040 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15041 changes in globals.h immediately force recompilation.
762b15be
EZ
15042 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15043 $(CURDIR)/s/ms-w32.h.
15044 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15045
fa6996bc
EZ
15046 * character.c (Fchar_direction): Function deleted.
15047 (syms_of_character): Don't defsubr it.
15048 <char-direction-table>: Deleted.
15049
e6c3da20
EZ
150502011-04-23 Eli Zaretskii <eliz@gnu.org>
15051
15052 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15053 * doprnt.c: Include limits.h.
15054 (SIZE_MAX): New macro.
04f2d78b
CB
15055 (doprnt): Return a size_t value. 2nd arg is now size_t.
15056 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15057 Improve overflow protection. Support `l' modifier for integer
15058 conversions. Support %l conversion. Don't assume an EMACS_INT
15059 argument for integer conversions and for %c.
15060
15061 * lisp.h (doprnt): Restore prototype.
15062
15063 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15064 $(SRC)/character.h.
15065
15066 * Makefile.in (base_obj): Add back doprnt.o.
15067
15068 * deps.mk (doprnt.o): Add back prerequisites.
15069 (callint.o): Depend on character.h.
15070
15071 * eval.c (internal_lisp_condition_case): Include the handler
15072 representation in the error message.
15073 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15074 when breaking from the loop.
15075
15076 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15077
15078 * callint.c (Fcall_interactively): When displaying error message
15079 about invalid control letter, pass the character's codepoint, not
15080 a pointer to its multibyte form. Improve display of the character
15081 in octal and display also its hex code.
15082
15083 * character.c (char_string): Use %x to display the (unsigned)
15084 codepoint of an invalid character, to avoid displaying a bogus
15085 negative value.
15086
15087 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15088 `error', not SYMBOL_NAME itself.
15089
15090 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15091 character arguments to `error'.
15092
15093 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15094 to `error' in error message about FINAL_CHAR argument. Make sure
15095 FINAL_CHAR is a character, and use %c when it is passed as
15096 argument to `error'.
15097
4ffd0d6b 150982011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15099
15100 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15101
15102 * w32.c: Include <time.h>.
15103 (sys_localtime): New function.
15104
4ffd0d6b 151052011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15106
15107 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15108
4ffd0d6b 15109 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15110
4ffd0d6b 151112011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15112
4ffd0d6b
GM
15113 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15114 zombies (Bug#8467).
aac0c6e3 15115
04c56954
EZ
151162011-04-19 Eli Zaretskii <eliz@gnu.org>
15117
15118 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15119 gl_state.e_property when gl_state.object is Qt.
15120
15121 * insdel.c (make_gap_larger): Remove limitation of buffer size
15122 to <= INT_MAX.
15123
16a43933
CY
151242011-04-18 Chong Yidong <cyd@stupidchicken.com>
15125
15126 * xdisp.c (lookup_glyphless_char_display)
15127 (produce_glyphless_glyph): Handle cons cell entry in
15128 glyphless-char-display.
15129 (Vglyphless_char_display): Document it.
15130
15131 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15132 glyphless-char-display.
15133
4581706e
CY
151342011-04-17 Chong Yidong <cyd@stupidchicken.com>
15135
15136 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15137
15138 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15139
15140 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15141 definition for no-X builds.
15142
4887c6e2 151432011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 15144
fd35b6f9
PE
15145 Static checks with GCC 4.6.0 and non-default toolkits.
15146
5c1ccb01
PE
15147 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15148
006c5daa
PE
15149 * process.c (keyboard_bit_set): Define only if SIGIO.
15150 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15151 (send_process): Repair possible setjmp clobbering.
15152
efc736d3
PE
15153 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15154
4e2fe2e6
PE
15155 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15156
f97334a2
PE
15157 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15158
4e75f29d
PE
15159 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15160 Define only if needed.
15161
90efadd1
PE
15162 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15163 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 15164 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 15165
3c647824
PE
15166 * dispextern.h (struct redisplay_interface): Rename param
15167 to avoid shadowing.
e264f262 15168 * termhooks.h (struct terminal): Likewise.
761383f4 15169 * xterm.c (xembed_send_message): Likewise.
3c647824 15170
b58c5c4a
PE
15171 * insdel.c (make_gap_smaller): Define only if
15172 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15173
cad59032
PE
15174 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15175 it.
15176
c339dc2e
PE
15177 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15178 so that we aren't warned about unused symbols.
15179
91a3e27b
PE
15180 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15181
399c71d3 15182 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 15183
8ffc96f5
PE
15184 * xfns.c (x_real_positions): Mark locals as initialized.
15185
eef9bc79
PE
15186 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15187
098db9dd
PE
15188 * xterm.c: Fix problems found by static analysis with other toolkits.
15189 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
15190 (x_dispatch_event): Declare static if USE_GTK, and
15191 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 15192 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 15193 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
15194 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15195 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 15196
eb18f6cc
PE
15197 * xmenu.c (menu_help_callback): Pointer type fixes.
15198 Use const pointers when pointing at readonly data. Avoid pointer
15199 signedness clashes.
15200 (FALSE): Remove unused macro.
15201 (update_frame_menubar): Remove unused decl.
15202
1fe72bf8
PE
15203 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15204
60d9e1db
PE
15205 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15206 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15207 (single_menu_item): Rename local to avoid shadowing.
15208
39261c26
PE
15209 * keyboard.c (make_lispy_event): Remove unused local var.
15210
018c5e19
PE
15211 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15212 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15213
63d2b86e
PE
15214 * bitmaps: Change bitmaps from unsigned char back to the X11
15215 compatible char. Avoid the old compiler warnings about
15216 out-of-range initializers by using, for example, '\xab' rather
15217 than 0xab.
15218
aefd87e1
PE
15219 * xgselect.c (xgselect_initialize): Check vs interface
15220 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15221
bf501fb9
PE
15222 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15223
e9829fdf
PE
15224 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15225 to read-only memory.
15226
1086c095
PE
15227 * fns.c (vector): Remove; this old hack is no longer needed.
15228
2baccd04 15229 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 15230 Remove unused var.
dde42981 15231 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 15232
72391843 15233 * xrdb.c (x_load_resources): Omit unused local.
3565b346 15234
436c16df 15235 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 15236 (x_window): Rename locals to avoid shadowing.
dc5ddd85 15237 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 15238
92bb796d 15239 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 15240 (x_term_init): Remove local to avoid shadowing.
92bb796d 15241
764430a3 15242 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
15243
15244 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15245 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15246
d1dfb56c
EZ
152472011-04-16 Eli Zaretskii <eliz@gnu.org>
15248
c4354cb4
EZ
15249 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15250
d1dfb56c
EZ
15251 Fix regex.c, syntax.c and friends for buffers > 2GB.
15252 * syntax.h (struct gl_state_s): Declare character position members
15253 EMACS_INT.
15254
15255 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15256
04f2d78b
CB
15257 * textprop.c (verify_interval_modification, interval_of):
15258 Declare arguments EMACS_INT.
d1dfb56c
EZ
15259
15260 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15261 EMACS_INT.
15262
15263 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15264
15265 * indent.c (Fvertical_motion): Local variable it_start is now
15266 EMACS_INT.
15267
15268 * regex.c (re_match, re_match_2, re_match_2_internal)
15269 (bcmp_translate, regcomp, regexec, print_double_string)
15270 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15271 (re_compile_pattern, re_exec): Declare arguments and local
15272 variables `size_t' and `ssize_t' and return values `regoff_t', as
15273 appropriate.
15274 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15275 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15276 <compile_stack_type>: `size' and `avail' are now `size_t'.
15277
15278 * regex.h <regoff_t>: Use ssize_t, not int.
15279 (re_search, re_search_2, re_match, re_match_2): Arguments that
15280 specify buffer/string position and length are now ssize_t and
15281 size_t. Return type is regoff_t.
15282
613052cd
BK
152832011-04-16 Ben Key <bkey76@gmail.com>
15284
15285 * nsfont.m: Fixed bugs in ns_get_family and
15286 ns_descriptor_to_entity that were caused by using free to
15287 deallocate memory blocks that were allocated by xmalloc (via
15288 xstrdup). This caused Emacs to crash when compiled with
15289 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15290 --enable-checking=xmallocoverrun). xfree is now used to
15291 deallocate these memory blocks.
15292
4170f62f 152932011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 15294
71b41406
PE
15295 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15296
9587a89d
PE
15297 emacs_write: Accept and return EMACS_INT for sizes.
15298 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15299 et seq.
15300 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15301 Accept and return EMACS_INT.
15302 (emacs_gnutls_write): Return the number of bytes written on
15303 partial writes.
15304 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
15305 (emacs_read, emacs_write): Remove check for negative size, as the
15306 Emacs source code has been audited now.
9587a89d
PE
15307 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15308 (emacs_read, emacs_write): Use it.
273a5f82
PE
15309 * process.c (send_process): Adjust to the new signatures of
15310 emacs_write and emacs_gnutls_write. Do not attempt to store
15311 a byte offset into an 'int'; it might overflow.
9587a89d 15312 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 15313
3e047f51
PE
15314 * sound.c: Don't assume sizes fit in 'int'.
15315 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 15316 Return EMACS_INT, not int.
3e047f51 15317 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
15318 Accept EMACS_INT, not int.
15319 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
15320 record read return values.
15321
cc39a9db
BK
153222011-04-15 Ben Key <bkey76@gmail.com>
15323
c9d0ec6d
JB
15324 * keyboard.c (Qundefined): Don't declare static since it is used
15325 in nsfns.m.
15326 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15327 static since they are used in nsfont.m.
cc39a9db 15328
6c60eb9f
SM
153292011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15330
15331 * process.c (Qprocessp): Don't declare static.
15332 * lisp.h (Qprocessp): Declare again.
15333
7990b61a
JB
153342011-04-15 Juanma Barranquero <lekktu@gmail.com>
15335
15336 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15337
5d4cb038
PE
153382011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15339
8bd7b830 15340 Improve C-level modularity by making more things 'static'.
cd64ea1d 15341
e3b27b31
PE
15342 Don't publish debugger-only interfaces to other modules.
15343 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15344 (verify_bytepos, count_markers): Move decls to the only modules
15345 that need them.
15346 * region-cache.h (pp_cache): Likewise.
15347 * window.h (check_all_windows): Likewise.
15348 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15349
5d4cb038
PE
15350 * sysdep.c (croak): Now static, if
15351 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15352 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
15353
15354 * alloc.c (refill_memory_reserve): Now static if
15355 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15356 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 15357
e87b6180
PE
15358 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15359 Define only if USE_LUCID.
15360
ac64929e
PE
15361 * xrdb.c (x_customization_string, x_rm_string): Now static.
15362
6f37259d
PE
15363 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15364 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15365
1683e3ab
PE
15366 * xdisp.c (draw_row_with_mouse_face): Now static.
15367 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15368
de9c2632
PE
15369 * window.h (check_all_windows): Mark externally visible.
15370
2b96acb7
PE
15371 * window.c (window_deletion_count): Now static.
15372
15373 * undo.c: Make symbols static if they're not exported.
15374 (last_undo_buffer, last_boundary_position, pending_boundary):
15375 Now static.
15376
50436f33
PE
15377 * textprop.c (interval_insert_behind_hooks): Now static.
15378 (interval_insert_in_front_hooks): Likewise.
15379
64520e5c
PE
15380 * term.c: Make symbols static if they're not exported.
15381 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15382 (max_frame_lines, tty_set_terminal_modes):
15383 (tty_reset_terminal_modes, tty_turn_off_highlight):
15384 (get_tty_terminal): Now static.
15385 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15386 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 15387 HAVE_WINDOW_SYSTEM.
64520e5c
PE
15388 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15389 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15390
1fa53021
PE
15391 * sysdep.c: Make symbols static if they're not exported.
15392 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15393 Now static.
15394 (sigprocmask_set, full_mask): Remove; unused.
15395 (wait_debugging): Mark as visible.
15396 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15397 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15398
d4b43b22
PE
15399 * syntax.c (syntax_temp): Define only if !__GNUC__.
15400
b7c513d0
PE
15401 * sound.c (current_sound_device, current_sound): Now static.
15402
989b29ad
PE
15403 * search.c (searchbufs, searchbuf_head): Now static.
15404
13a55a78
PE
15405 * scroll.c (scroll_cost): Remove; unused.
15406 * dispextern.h (scroll_cost): Remove decl.
15407
de68a1fc
PE
15408 * region-cache.h (pp_cache): Mark as externally visible.
15409
40ccffa6
PE
15410 * process.c: Make symbols static if they're not exported.
15411 (process_tick, update_tick, create_process, chan_process):
15412 (Vprocess_alist, proc_buffered_char, datagram_access):
15413 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15414 (deactivate_process): Mark defn as static, as well as decl.
15415 * lisp.h (create_process): Remove decl.
15416 * process.h (chan_process, Vprocess_alist): Remove decls.
15417
ad64fc97
PE
15418 * print.c: Make symbols static if they're not exported.
15419 (print_depth, new_backquote_output, being_printed, print_buffer):
15420 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15421 (print_interval, print_number_index, initial_stderr_stream):
15422 Now static.
15423 * lisp.h (Fprinc): Remove decl.
15424 (debug_output_compilation_hack): Mark as externally visible.
15425
adddb265
PE
15426 * sysdep.c (croak): Move decl from here to syssignal.h.
15427 * syssignal.h (croak): Put it here, so the API can be checked when
15428 'croak' is called from dissociate_if_controlling_tty.
15429
1717ede2
PE
15430 * minibuf.c: Make symbols static if they're not exported.
15431 (minibuf_save_list, choose_minibuf_frame): Now static.
15432 * lisp.h (choose_minibuf_frame): Remove decl.
15433
fa5fb2bc
PE
15434 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15435
1e3890d1
PE
15436 * lread.c: Make symbols static if they're not exported.
15437 (read_objects, initial_obarray, oblookup_last_bucket_number):
15438 Now static.
15439 (make_symbol): Remove; unused.
15440 * lisp.h (initial_obarray, make_symbol): Remove decls.
15441
8a1414fa
PE
15442 * keyboard.c: Make symbols static if they're not exported.
15443 (single_kboard, recent_keys_index, total_keys, recent_keys):
15444 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15445 (this_single_command_key_start, echoing, last_auto_save):
15446 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15447 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15448 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15449 (Vlispy_mouse_stem, double_click_count):
15450 Now static.
15451 (force_auto_save_soon): Define only if SIGDANGER.
15452 (ignore_mouse_drag_p): Now static if
15453 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15454 (print_help): Remove; unused.
15455 (stop_character, last_timer_event): Mark as externally visible.
15456 * keyboard.h (ignore_mouse_drag_p): Declare only if
15457 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15458 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15459 * lisp.h (echoing): Remove decl.
15460 (force_auto_save_soon): Declare only if SIGDANGER.
15461 * xdisp.c (redisplay_window): Simplify code, to make it more
15462 obvious that ignore_mouse_drag_p is not accessed if !defined
15463 USE_GTK && !defined HAVE_NS.
15464
93ea6e8f
PE
15465 * intervals.c: Make symbols static if they're not exported.
15466 (merge_properties_sticky, merge_interval_right, delete_interval):
15467 Now static.
15468 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15469
77382fcc
PE
15470 * insdel.c: Make symbols static if they're not exported.
15471 However, leave prepare_to_modify_buffer alone. It's never
15472 called from outside this function, but that appears to be a bug.
15473 (combine_after_change_list, combine_after_change_buffer):
4889fc82 15474 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
15475 (adjust_after_replace_noundo): Remove; unused.
15476 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 15477 (signal_before_change): Remove decls.
77382fcc 15478
9306c32e
PE
15479 * indent.c (val_compute_motion, val_vmotion): Now static.
15480
cd44d2eb
PE
15481 * image.c: Make symbols static if they're not exported.
15482 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15483 if USE_GTK.
15484 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15485 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15486
ad9a7a06
PE
15487 * fringe.c (standard_bitmaps): Now static.
15488 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15489
81626931
PE
15490 * frame.c: Make symbols static if they're not exported.
15491 (x_report_frame_params, make_terminal_frame): Now static.
15492 (get_frame_param): Now static, unless HAVE_NS.
15493 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15494 (x_get_resource_string): Remove; not used.
15495 * frame.h (make_terminal_frame, x_report_frame_params):
15496 (x_get_resource_string); Remove decls.
15497 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15498 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15499
239f9db9
PE
15500 * font.c, fontset.c: Make symbols static if they're not exported.
15501 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15502 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15503 * font.c (font_close_object): Now static.
15504 * font.h (font_close_object): Remove.
15505 * fontset.c (FONTSET_OBJLIST): Remove.
15506 (free_realized_fontset) #if-0 the body, which does nothing.
15507 (face_suitable_for_char_p): #if-0, as it's never called.
15508 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
15509 * xfaces.c (face_at_string_position):
15510 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
15511 since 0 is always ASCII.
15512
dfcf3579
PE
15513 * fns.c (weak_hash_tables): Now static.
15514
5045092b
PE
15515 * fileio.c: Make symbols static if they're not exported.
15516 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15517 (Vwrite_region_annotation_buffers): Now static.
15518
57a96f5c
PE
15519 * eval.c: Make symbols static if they're not exported.
15520 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15521 * lisp.h (backtrace_list): Remove decl.
15522
35f08c38
PE
15523 * emacs.c: Make symbols static if they're not exported.
15524 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15525 (fatal_error_code, fatal_error_signal_hook, standard_args):
15526 Now static.
15527 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15528 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15529 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15530 * lisp.h (fatal_error_signal_hook): Remove decl.
15531 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15532
f44bd759
PE
15533 * editfns.c: Move a (normally-unused) function to its only use.
15534 * editfns.c, lisp.h (get_operating_system_release): Remove.
15535 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15536 worth the hassle of breaking this out.
15537
b532497d
PE
15538 * xterm.c: Make symbols static if they're not exported.
15539 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15540 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15541 (x_destroy_window, x_delete_display):
15542 Now static.
15543 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15544 (x_mouse_leave): Remove; unused.
15545 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15546 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15547 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15548 Remove decls.
15549 (x_mouse_leave): Declare only if WINDOWSNT.
15550 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15551 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15552 USE_X_TOOLKIT.
15553
1675728f
PE
15554 * ftxfont.c: Make symbols static if they're not exported.
15555 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15556 HAVE_FREETYPE.
15557 * font.h (ftxfont_driver): Likewise.
15558
e4cebfca
PE
15559 * xfns.c: Make symbols static if they're not exported.
15560 (x_last_font_name, x_display_info_for_name):
15561 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15562 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15563 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15564 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15565 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15566 (last_show_tip_args): Now static.
15567 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15568 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15569 (x_screen_planes): Remove; unused.
15570 * dispextern.h (x_screen_planes): Remove decl.
15571
5bf46f05
PE
15572 * dispnew.c: Make symbols static if they're not exported.
15573 * dispextern.h (redraw_garbaged_frames, scrolling):
15574 (increment_row_positions): Remove.
15575 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15576 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15577 Now static.
15578 (redraw_garbaged_frames): Remove; unused.
15579
435f4c28
PE
15580 * xfaces.c: Make symbols static if they're not exported.
15581 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15582 Remove decls.
15583 * xterm.h (defined_color): Remove decls.
15584 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15585 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15586 (menu_face_changed_default, defined_color, free_realized_face):
15587 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15588 (ascii_face_of_lisp_face): Remove; unused.
15589
8524aef3
PE
15590 * xdisp.c: Make symbols static if they're not exported.
15591 * dispextern.h (scratch_glyph_row, window_box_edges):
15592 (glyph_to_pixel_coords, set_cursor_from_row):
15593 (get_next_display_element, set_iterator_to_next):
15594 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15595 (show_mouse_face): Remove decls
15596 * frame.h (message_buf_print): Likewise.
15597 * lisp.h (pop_message, set_message, check_point_in_composition):
15598 Likewise.
15599 * xterm.h (set_vertical_scroll_bar): Likewise.
15600 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15601 (message_buf_print, scratch_glyph_row, displayed_buffer):
15602 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15603 (get_next_display_element, show_mouse_face, window_box_edges):
15604 (frame_to_window_pixel_xy, check_point_in_composition):
15605 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15606 (glyph_to_pixel_coords): Remove; unused.
15607
16390cd2
PE
15608 * dired.c (file_name_completion): Now static.
15609
15610 * dbusbind.c (xd_in_read_queued_messages): Now static.
15611
a25f4dfa
PE
15612 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15613 * data.c (circular_list_error): Remove.
15614
14a9c8df
PE
15615 * commands.h (last_point_position, last_point_position_buffer):
15616 (last_point_position_window): Remove decls.
15617 * keyboard.c: Make these variables static.
15618
04f2d78b
CB
15619 * coding.h (coding, code_convert_region, encode_coding_gap):
15620 Remove decls.
74ab6df5
PE
15621 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15622 (iso_code_class, detect_coding, code_convert_region): Now static.
15623 (encode_coding_gap): Remove; unused.
15624
38dfbee1
PE
15625 * chartab.c (chartab_chars, chartab_bits): Now static.
15626
a2cb4e63
PE
15627 * charset.h (charset_iso_8859_1): Remove decl.
15628 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15629 Now static.
15630
127198fd
PE
15631 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15632 * ccl.c (Vccl_program_table): Now static.
15633 (check_ccl_update): Remove; unused.
15634
d85b608f
PE
15635 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15636 * category.h: ... from here.
15637 * category.c (check_category_table, set_category_set): Now static.
15638
31cd66f3
PE
15639 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15640 * lisp.h: Remove these decls.
15641
c358e587
PE
15642 * buffer.c (buffer_count): Remove unused var.
15643
e78aecca
PE
15644 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15645 so that it's not optimized away.
15646 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15647 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15648 exported only to the debugger.
15649
e192d7d3 15650 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 15651 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 15652
92470028
PE
15653 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15654 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15655 was inaccessible from Lisp.
15656 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15657 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15658
244ed907
PE
15659 alloc.c: Import and export fewer symbols, and remove unused items.
15660 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15661 is defined.
15662 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15663 it's not optimized away by whole-program optimization.
15664 (message_enable_multibyte, free_misc): Remove.
15665 (catchlist, handlerlist, mark_backtrace):
15666 Declare only if BYTE_MARK_STACK.
15667 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15668 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15669 (message_enable_multibyte): Remove decl.
15670 (free_misc, interval_free_list, float_block, float_block_index):
15671 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15672 (cons_free_list, last_marked_index):
15673 Now static.
15674 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15675 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15676 (mark_backtrace): Define only if BYTE_MARK_STACK.
15677 * xdisp.c (message_enable_multibyte): Now static.
15678
61c2b50e 15679 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
15680 This makes it easier for human readers (and static analyzers)
15681 to see whether these variables are used from other modules.
15682 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15683 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15684 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15685 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15686 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15687 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15688 * xmenu.c, xselect.c:
15689 Declare Q* vars static if they are not used in other modules.
15690 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15691 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15692 Remove decls of unexported vars.
15693 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15694
95c82688
PE
15695 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15696
16a97296
PE
15697 Make Emacs functions such as Fatom 'static' by default.
15698 This makes it easier for human readers (and static analyzers)
15699 to see whether these functions can be called from other modules.
15700 DEFUN now defines a static function. To make the function external
15701 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
15702 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15703 (Finit_image_library):
16a97296
PE
15704 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15705 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15706 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15707 Remove decls, since these functions are now static.
15708 (Funintern, Fget_internal_run_time): New decls, since these functions
15709 were already external.
95c82688 15710
16a97296
PE
15711 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15712 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15713 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15714 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15715 * keyboard.c, keymap.c, lread.c:
15716 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15717 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15718 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15719 Mark functions with DEFUE instead of DEFUN,
15720 if they are used in other modules.
15721 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15722 decls for now-static functions.
15723 * buffer.h (Fdelete_overlay): Remove decl.
15724 * callproc.c (Fgetenv_internal): Mark as internal.
15725 * composite.c (Fremove_list_of_text_properties): Remove decl.
15726 (Fcomposition_get_gstring): New forward static decl.
15727 * composite.h (Fcomposite_get_gstring): Remove decl.
15728 * dired.c (Ffile_attributes): New forward static decl.
15729 * doc.c (Fdocumntation_property): New forward static decl.
15730 * eval.c (Ffetch_bytecode): New forward static decl.
15731 (Funintern): Remove extern decl; now in .h file where it belongs.
15732 * fileio.c (Fmake_symbolic_link): New forward static decl.
15733 * image.c (Finit_image_library): New forward static decl.
15734 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15735 * intervals.h (Fprevious_property_change):
15736 (Fremove_list_of_text_properties): Remove decls.
15737 * keyboard.c (Fthis_command_keys): Remove decl.
15738 (Fcommand_execute): New forward static decl.
15739 * keymap.c (Flookup_key): New forward static decl.
15740 (Fcopy_keymap): Now static.
15741 * keymap.h (Flookup_key): Remove decl.
15742 * process.c (Fget_process): New forward static decl.
15743 (Fprocess_datagram_address): Mark as internal.
15744 * syntax.c (Fsyntax_table_p): New forward static decl.
15745 (skip_chars): Remove duplicate decl.
15746 * textprop.c (Fprevious_property_change): New forward static decl.
15747 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15748 Now internal.
15749 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15750 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15751
785bbd42
PE
15752 * editfns.c (Fformat): Remove unreachable code.
15753
8b913b57
AS
157542011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15755
15756 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15757 change. (Bug#8496)
15758
a6744a35
EZ
157592011-04-13 Eli Zaretskii <eliz@gnu.org>
15760
15761 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15762 when at ZV. (Bug#8487)
15763
e7974947
AS
157642011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15765
baad03f0
AS
15766 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15767 (Bug#8437)
15768 * keyboard.c (parse_tool_bar_item): Likewise.
15769 * sound.c (sound_cleanup, alsa_close): Likewise.
15770 * termcap.c (tgetent): Likewise.
15771 * xfns.c (x_default_font_parameter): Likewise.
15772 * xsettings.c (read_and_apply_settings): Likewise.
15773
e7974947
AS
15774 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15775 (overrun_check_free): Protoize.
15776
28272684
PE
157772011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15778
15779 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15780 since callers should never pass a negative size.
15781 Change the signature to match that of plain 'read' and 'write'; see
15782 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15783 * lisp.h: Update prototypes of emacs_write and emacs_read.
15784
11997c76
EZ
157852011-04-11 Eli Zaretskii <eliz@gnu.org>
15786
15787 * xdisp.c (redisplay_window): Don't try to determine the character
15788 position of the scroll margin if the window start point w->startp
e896f03c 15789 is outside the buffer's accessible region. (Bug#8468)
11997c76 15790
8a2cbd72
EZ
157912011-04-10 Eli Zaretskii <eliz@gnu.org>
15792
15793 Fix write-region and its subroutines for buffers > 2GB.
15794 * fileio.c (a_write, e_write): Modify declaration of arguments and
15795 local variables to support buffers larger than 2GB.
15796 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15797
15798 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15799 argument, local variables, and return value.
15800
15801 * lisp.h: Update prototypes of emacs_write and emacs_read.
15802
15803 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15804
4073e537 158052011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 15806
1ebfdcb6
PE
15807 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15808
b2ded58d
PE
15809 Fix more problems found by GCC 4.6.0's static checks.
15810
7d66342c
PE
15811 * xdisp.c (vmessage): Use a better test for character truncation.
15812
bbf47d44
PE
15813 * charset.c (load_charset_map): <, not <=, for optimization,
15814 and to avoid potential problems with integer overflow.
9248994d 15815 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 15816 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 15817 * editfns.c (Fformat): Likewise.
1e69125e 15818 * syntax.c (skip_chars): Likewise.
3befa583 15819
e3019616
PE
15820 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15821 This also lets GCC 4.6.0 generate slightly better loop code.
15822
becfa255
PE
15823 * callint.c (Fcall_interactively): <, not <=, for optimization.
15824 (Fcall_interactively): Count the number of arguments produced,
15825 not the number of arguments given. This is simpler and lets GCC
15826 4.6.0 generate slightly better code.
15827
dae0cd48
PE
15828 * ftfont.c: Distingish more carefully between FcChar8 and char.
15829 The previous code passed unsigned char * to a functions like
15830 strlen and xstrcasecmp that expect char *, which does not
15831 conform to the C standard.
15832 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15833 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15834 char * when the C standard requires it.
15835
76032d70
PE
15836 * keyboard.c (read_char): Remove unused var.
15837
eb3f1cc8
PE
15838 * eval.c: Port to Windows vsnprintf (Bug#8435).
15839 Include <limits.h>.
15840 (SIZE_MAX): Define if the headers do not.
15841 (verror): Do not give up if vsnprintf returns a negative count.
15842 Instead, grow the buffer. This ports to Windows vsnprintf, which
15843 does not conform to C99. Problem reported by Eli Zaretskii.
15844 Also, simplify the allocation scheme, by avoiding the need for
15845 calling realloc, and removing the ALLOCATED variable.
15846
70476b54
PE
15847 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15848
12020a9e
PE
15849 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15850 But keep the doprint source code for now, as we might revamp it
15851 and use it again (Bug#8435).
ea6c7ae6
PE
15852 * lisp.h (doprnt): Remove.
15853 * Makefile.in (base_obj): Remove doprnt.o.
15854 * deps.mk (doprnt.o): Remove.
15855
5fdb398c
PE
15856 error: Print 32- and 64-bit integers portably (Bug#8435).
15857 Without this change, on typical 64-bit hosts error ("...%d...", N)
15858 was used to print both 32- and 64-bit integers N, which relied on
15859 undefined behavior.
61bdb816 15860 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
15861 * lisp.h (error, verror): Mark as printf-like functions.
15862 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15863 Report overflow in size calculations when allocating printf buffer.
15864 Do not truncate output string at its first null byte.
15865 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15866 Truncate the output at a character boundary, since vsnprintf does not
15867 do that.
15868 * charset.c (check_iso_charset_parameter): Convert internal
15869 character to string before calling 'error', since %c now has the
15870 printf meaning.
15871 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15872 overflow when computing char to be passed to 'error'. Do not
15873 pass Lisp_Object to 'error'; pass the integer instead.
15874 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15875 formatted with plain %d.
15876
b189fa66
PE
15877 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15878
bff87ef0
PE
15879 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15880
7e2cac20
PE
15881 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15882
ce4d90b5
PE
15883 * xterm.c (x_catch_errors): Remove duplicate declaration.
15884
266c9547
PE
15885 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15886
79c49ad2
PE
15887 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15888
368f4090
JM
158892011-04-10 Jim Meyering <meyering@redhat.com>
15890
15891 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15892 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15893 return ssize_t not "int", and use size_t as the buffer length.
15894 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15895 * gnutls.h: Update declarations.
15896 * process.c (read_process_output): Use ssize_t, to match.
15897 (send_process): Likewise.
15898
a32d4040
CY
158992011-04-09 Chong Yidong <cyd@stupidchicken.com>
15900
15901 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15902
8546720e 159032011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 15904
04f2d78b
CB
15905 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15906 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 15907
8546720e
GM
15908 * xterm.c (handle_one_xevent):
15909 * xmenu.c (create_and_show_popup_menu):
15910 * xselect.c (x_decline_selection_request)
15911 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 15912
0a2f5c1a 159132011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
15914
15915 Fix some uses of `int' instead of EMACS_INT.
15916 * search.c (string_match_1, fast_string_match)
15917 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15918 (scan_buffer, find_next_newline_no_quit)
15919 (find_before_next_newline, search_command, Freplace_match)
15920 (Fmatch_data): Make some `int' variables be EMACS_INT.
15921
15922 * xdisp.c (display_count_lines): 3rd argument and return value now
15923 EMACS_INT. All callers changed.
15924 (pint2hrstr): Last argument is now EMACS_INT.
15925
15926 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15927 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15928 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15929 (decode_coding_utf_16, decode_coding_emacs_mule)
15930 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15931 (decode_coding_ccl, decode_coding_charset)
15932 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15933 (decode_coding_iso_2022, decode_coding_emacs_mule)
15934 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15935 <char_offset, last_offset>: Declare EMACS_INT.
15936 (encode_coding_utf_8, encode_coding_utf_16)
15937 (encode_coding_emacs_mule, encode_invocation_designation)
15938 (encode_designation_at_bol, encode_coding_iso_2022)
15939 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15940 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15941 Declare EMACS_INT.
15942 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15943 (encode_invocation_designation): Last argument P_NCHARS is now
15944 EMACS_INT.
15945 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15946 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15947
15948 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15949 All users changed.
15950
15951 * ccl.c (Fccl_execute_on_string): Declare some variables
15952 EMACS_INT.
15953
8546720e 159542011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
15955
15956 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15957
4e19a977
CS
159582011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15959
15960 * process.c (Fformat_network_address): Doc fix.
15961
87302331
R
159622011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15963
ee7683eb 15964 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 15965
cbb59342
CY
159662011-04-08 Chong Yidong <cyd@stupidchicken.com>
15967
15968 * keyboard.c (read_char): Call Lisp function help-form-show,
15969 instead of using internal_with_output_to_temp_buffer.
15970 (Qhelp_form_show): New var.
e0d38eeb 15971 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
15972
15973 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15974
15975 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15976
e67a13ab
CY
159772011-04-06 Chong Yidong <cyd@stupidchicken.com>
15978
04f2d78b
CB
15979 * process.c (Flist_processes): Remove to Lisp.
15980 (list_processes_1): Delete.
e67a13ab 15981
973f782d
EZ
159822011-04-06 Eli Zaretskii <eliz@gnu.org>
15983
7c106b1e
EZ
15984 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15985
973f782d
EZ
15986 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15987
41cf7d1a 159882011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 15989
ca23cc88
PE
15990 Fix more problems found by GCC 4.6.0's static checks.
15991
f390e2d5
PE
15992 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15993
42eea0d0
PE
15994 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15995
b69769da 15996 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 15997
f9541e84
PE
15998 * xdisp.c (vmessage): Mark as a printf-like function.
15999
13841b55
PE
16000 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16001
c136c10f
PE
16002 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16003
5e2d4a30
PE
16004 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16005 printf-like functions.
16006 (tiff_load): Add casts to remove these marks before passing them
16007 to system-supplied API.
16008
583f48b9
PE
16009 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16010
b25d760e
PE
16011 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16012 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16013 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16014 directly, rather than having caller test rule sign. This avoids
16015 some unnecessary tests.
16016 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16017 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16018 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16019
bc7b6697 16020 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16021 (xfont_open): Avoid unnecessary tests.
bc7b6697 16022
27ccc379
PE
16023 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16024
dcd5c89a
PE
16025 * composite.h, composite.c (composition_gstring_put_cache):
16026 Use EMACS_INT, not int, for length.
16027
b13a45c6
PE
16028 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16029 breaking out part of COMPOSITION_DECODE_RULE.
16030 (COMPOSITION_DECODE_RULE): Use it.
16031 * composite.c (get_composition_id): Remove unused local vars,
16032 by using the new macro.
16033
1e792e4d
PE
16034 * textprop.c (set_text_properties_1): Change while to do-while,
16035 since the condition is always true at first.
16036
dc6c6455 16037 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16038 (interval_deletion_adjustment): Return unsigned value.
16039 All uses changed.
dc6c6455 16040
aba7731a
PE
16041 * process.c (list_processes_1, create_pty, read_process_output):
16042 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16043 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16044 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16045 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16046 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16047
fdfc4bf3
PE
16048 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16049
fca8fe46 16050 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16051 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16052
06a0259a 16053 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16054 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16055 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16056
e7b9e80f
PE
16057 * print.c (print_error_message): Avoid int overflow.
16058
56201685
PE
16059 * font.c (font_list_entities): Redo for clarity,
16060 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16061
78834453 16062 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16063 (font_score): Avoid potential overflow in diff calculation.
78834453 16064
0bc0b309 16065 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16066 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16067
e610eaca
PE
16068 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16069
b895abce
PE
16070 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16071 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16072 can always succeed if overflow has undefined behavior.
16073
1f1d9321 16074 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16075 (wordify): Omit three unnecessary tests.
1f1d9321 16076
c59478bc
PE
16077 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16078 All callers changed. This avoids the need for an unused var.
16079
79b73827
PE
16080 * casefiddle.c (casify_region): Remove var that is set but not used.
16081
a4db5dfe
PE
16082 * dired.c (file_name_completion): Remove var that is set but not used.
16083
43aae36e
PE
16084 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16085
2a47c44d 16086 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16087 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16088
a37c69bf
PE
16089 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16090 Check for integer overflow on size calculations.
16091
328ab8e7
PE
16092 * buffer.c (Fprevious_overlay_change): Remove var that is set
16093 but not used.
16094
e5a2a5cb
PE
16095 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16096 Remove vars that are set but not used.
8d84a6eb 16097 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16098 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16099
a60e5f68
PE
16100 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16101
f661cb61 16102 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16103 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16104
f0397f5a
PE
16105 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16106 that are set but not used.
16107
8664db06 16108 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16109 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16110
6abdaa4a
PE
16111 * xselect.c (x_get_local_selection, x_handle_property_notify):
16112 Remove vars that are set but not used.
16113
0ce7538d 16114 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16115 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16116
9ae848fc
PE
16117 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16118 Remove var that is set but not used.
0b918413
PE
16119 (scroll_bar_windows_size): Now size_t, not int.
16120 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16121 Check for overflow.
9ae848fc 16122
a5a62657
PE
16123 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16124 (map_tty_color) [!defined MSDOS]: Likewise.
16125
5c5cdd39
PE
16126 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16127
66ebf983
PE
16128 * coding.c: Remove vars that are set but not used.
16129 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16130 All callers changed.
16131 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16132 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16133 (decode_coding_charset): Remove vars that are set but not used.
16134
1be4d761
PE
16135 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16136 that is set but not used.
16137
47553fa8
PE
16138 * print.c (print_object): Remove var that is set but not used.
16139
1f7196bf 16140 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16141 The gnulib version avoids calling malloc in the usual case,
16142 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16143 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16144 * filelock.c (current_lock_owner): Likewise.
16145 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16146 * sysdep.c: Include allocator.h, careadlinkat.h.
16147 (emacs_no_realloc_allocator): New static constant.
16148 (emacs_readlink): New function.
fdb61804
PE
16149 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16150 ../lib/careadlinkat.h.
d1fdcab7 16151
f84c17c7
SM
161522011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16153
16154 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16155 first non-nil return value).
16156
ef3862ad
JD
161572011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16158
16159 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16160 if not defined (Bug#8403).
16161
376a7006
JB
161622011-04-02 Juanma Barranquero <lekktu@gmail.com>
16163
16164 * xdisp.c (display_count_lines): Remove parameter `start',
16165 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16166 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16167 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16168 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16169 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16170 and thereabouts. All callers changed.
16171 (get_per_char_metric): Remove parameter `f', unused since
16172 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16173
6ca3801d
JM
161742011-04-02 Jim Meyering <meyering@redhat.com>
16175
16176 do not dereference NULL upon failed strdup
16177 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16178 (ns_get_family): Likewise.
16179
d8e2b5ba
JB
161802011-04-02 Juanma Barranquero <lekktu@gmail.com>
16181
16182 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16183
8c74fcbd
JD
161842011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16185
16186 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16187 later (Bug#8403).
16188
7200d79c
SM
161892011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16190
03408648 16191 Add lexical binding.
7200d79c 16192
03408648
SM
16193 * window.c (Ftemp_output_buffer_show): New fun.
16194 (Fsave_window_excursion):
16195 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16196
16197 * lread.c (lisp_file_lexically_bound_p): New function.
16198 (Fload): Bind Qlexical_binding.
16199 (readevalloop): Remove `evalfun' arg.
16200 Bind Qinternal_interpreter_environment.
16201 (Feval_buffer): Bind Qlexical_binding.
16202 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16203 Mark as dynamic.
16204 (syms_of_lread): Declare `lexical-binding'.
16205
16206 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16207
16208 * keyboard.c (eval_dyn): New fun.
16209 (menu_item_eval_property): Use it.
ca105506
SM
16210
16211 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 16212
03408648
SM
16213 * fns.c (concat, mapcar1): Accept byte-code-functions.
16214
16215 * eval.c (Fsetq): Handle lexical vars.
16216 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16217 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16218 (FletX, Flet): Obey lexical binding.
16219 (Fcommandp): Handle closures.
16220 (Feval): New `lexical' arg.
16221 (eval_sub): New function extracted from Feval. Use it almost
16222 everywhere where Feval was used. Look up vars in lexical env.
16223 Handle closures.
16224 (Ffunctionp): Move from subr.el.
16225 (Ffuncall): Handle closures.
16226 (apply_lambda): Remove `eval_flags'.
16227 (funcall_lambda): Handle closures and new byte-code-functions.
16228 (Fspecial_variable_p): New function.
16229 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16230 but without exporting it to Lisp.
23aba0ea 16231
23aba0ea 16232 * doc.c (Fdocumentation, store_function_docstring):
03408648 16233 * data.c (Finteractive_form): Handle closures.
23aba0ea 16234
03408648
SM
16235 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16236 interactive spec.
ba83908c 16237
04f2d78b
CB
16238 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16239 New byte-codes.
03408648
SM
16240 (exec_byte_code): New function extracted from Fbyte_code to handle new
16241 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 16242
03408648 16243 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 16244
03408648 16245 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 16246
e2abce01
JB
162472011-03-31 Juanma Barranquero <lekktu@gmail.com>
16248
16249 * xdisp.c (redisplay_internal): Fix prototype.
16250
63696a73 162512011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 16252
63696a73 16253 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
16254 (try_scrolling): Use it when setting scroll_limit.
16255 Limit scrolling to 100 screen lines.
63696a73
EZ
16256 (redisplay_window): Even when falling back on "recentering",
16257 position point in the window according to scroll-conservatively,
16258 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16259
16260 (try_scrolling): When point is above the window, allow searching
16261 as far as scroll_max, or one screenful, to compute vertical
16262 distance from PT to the scroll margin position. This prevents
16263 try_scrolling from unnecessarily failing when
16264 scroll-conservatively is set to a value slightly larger than the
16265 window height. Clean up the case of PT below the margin at bottom
16266 of window: scroll_max can no longer be INT_MAX. When aggressive
16267 scrolling is in use, don't let point enter the opposite scroll
16268 margin as result of the scroll.
16269 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
16270 threshold of 100 lines for never-recentering scrolling.
16271
e4cc2dfc
JB
162722011-03-31 Juanma Barranquero <lekktu@gmail.com>
16273
16274 * dispextern.h (move_it_by_lines):
16275 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16276 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16277 (message_log_check_duplicate): Remove parameters `prev_bol' and
16278 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16279 (redisplay_internal): Remove parameter `preserve_echo_area',
16280 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16281
16282 * indent.c (Fvertical_motion):
16283 * window.c (window_scroll_pixel_based, Frecenter):
16284 Don't pass `need_y_p' to `move_it_by_lines'.
16285
1c470562
SM
162862011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16287
44f230aa
SM
16288 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16289 steal a few bits to be more compact.
16290 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16291 Remove unneeded casts.
16292
1c470562
SM
16293 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16294
888adce9
ZK
162952011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16296
16297 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16298 binding" message (bug#7967).
16299
f838ed7b
PE
163002011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16301
77861b95
PE
16302 Fix more problems found by GCC 4.6.0's static checks.
16303
de6dbc14
PE
16304 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16305 Remove unused local var.
16306
f838ed7b
PE
16307 * editfns.c (Fmessage_box): Remove unused local var.
16308
792c7b2b
PE
16309 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16310 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16311 Omit unused local vars.
c499e557 16312 * window.c (shrink_windows): Omit unused local var.
b01a1c29 16313 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
16314 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16315 Omit unused local var.
16316
ba0165e1
PE
16317 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16318 Don't assume string length fits in int.
32ad8845 16319 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 16320 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 16321
3c59b4c9
PE
16322 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16323 instead of alloca (Bug#8344).
16324
a3eed478 16325 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 16326 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 16327
eb4d412d
PE
16328 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16329
1658b401
PE
16330 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16331 concerns.
16332
16333 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16334
16335 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 16336
9a2c6e05
PE
16337 * keyboard.c (syms_of_keyboard): Use the same style as later
16338 in this function when indexing through an array. This also
16339 works around GCC bug 48267.
16340
03d0a109
PE
16341 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16342
44f730c8
PE
16343 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16344
fe75f926
PE
16345 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16346 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16347
ffa8c828
PE
16348 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16349 This avoids undefined behavior on integer overflow, and is a bit
16350 more convenient anyway since it is compared to a size_t variable.
16351
c5101a77
PE
16352 Variadic C functions now count arguments with size_t, not int.
16353 This avoids an unnecessary limitation on 64-bit machines, which
16354 caused (substring ...) to crash on large vectors (Bug#8344).
16355 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16356 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 16357 All variadic functions and their callers changed accordingly.
c5101a77
PE
16358 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16359 * data.c (arith_driver, float_arith_driver): Likewise.
16360 * editfns.c (general_insert_function): Likewise.
16361 * eval.c (struct backtrace.nargs, interactive_p)
16362 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16363 (funcall_lambda, mark_backtrace): Likewise.
16364 * fns.c (concat): Likewise.
16365 * frame.c (x_set_frame_parameters): Likewise.
16366 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16367 0 if not found, not -1. All callers changed.
16368
dd3f25f7
PE
16369 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16370 (stack_copy_size): Now size_t, not int.
16371 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16372
461c2ab9
JB
163732011-03-28 Juanma Barranquero <lekktu@gmail.com>
16374
16375 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16376 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16377 All callers changed.
16378
16379 * lisp.h (multibyte_char_to_unibyte):
16380 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16381 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16382 * character.h (CHAR_TO_BYTE8):
16383 * cmds.c (internal_self_insert):
16384 * editfns.c (general_insert_function):
16385 * keymap.c (push_key_description):
16386 * search.c (Freplace_match):
16387 * xdisp.c (message_dolog, set_message_1): All callers changed.
16388
f6d62986
SM
163892011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16390
16391 * keyboard.c (safe_run_hook_funcall): New function.
16392 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16393 don't set the hook to nil, but remove the offending function instead.
16394 (Qcommand_hook_internal): Remove, unused.
16395 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16396 Vcommand_hook_internal.
16397
16398 * eval.c (enum run_hooks_condition): Remove.
16399 (funcall_nil, funcall_not): New functions.
16400 (run_hook_with_args): Call each function through a `funcall' argument.
16401 Remove `cond' argument, now redundant.
16402 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16403 (Frun_hook_with_args_until_failure): Adjust accordingly.
16404 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16405
1db5b1ad
JB
164062011-03-28 Juanma Barranquero <lekktu@gmail.com>
16407
16408 * dispextern.h (string_buffer_position): Remove declaration.
16409
16410 * print.c (strout): Remove parameter `multibyte', unused since
16411 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16412
16413 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16414 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16415 All callers changed.
16416
16417 * w32.c (_wsa_errlist): Use braces for struct initializers.
16418
16419 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16420 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16421 All callers changed.
16422 (string_buffer_position): Likewise. Also, make static (it's never
16423 used outside xdisp.c).
16424 (cursor_row_p): Remove parameter `w', unused since
16425 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16426 (decode_mode_spec): Remove parameter `precision', introduced during
16427 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16428 All callers changed.
16429
5ffb62aa
JD
164302011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16431
16432 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16433
461c2ab9 164342011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
16435
16436 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16437 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16438 (ns_update_auto_hide_menu_bar): New functions.
16439 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16440 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16441 ns_constrain_all_frames.
16442 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16443 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16444
5c380ffb
JD
164452011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16446
16447 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16448
9af30bdf
GM
164492011-03-27 Glenn Morris <rgm@gnu.org>
16450
16451 * syssignal.h: Replace RETSIGTYPE with void.
16452 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16453 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16454 Replace SIGTYPE with void everywhere.
16455 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16456 * s/template.h (SIGTYPE): Remove commented out definition.
16457
e2abce01
JB
164582011-03-26 Eli Zaretskii <eliz@gnu.org>
16459
16460 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16461 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16462
f868cd8a
JB
164632011-03-26 Juanma Barranquero <lekktu@gmail.com>
16464
59eb0929
JB
16465 * w32.c (read_unc_volume): Use parameter `henum', instead of
16466 global variable `wget_enum_handle'.
16467
16468 * keymap.c (describe_vector): Remove parameters `indices' and
16469 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16470 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16471
f868cd8a
JB
16472 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16473
16474 * keyboard.c (timer_check): Remove parameter `do_it_now',
16475 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16476 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16477 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16478
16479 * keyboard.c (read_char):
16480 * w32menu.c (w32_menu_display_help):
16481 * xmenu.c (show_help_event, menu_help_callback):
16482 Adjust calls to `show_help_echo'.
16483
16484 * gtkutil.c (xg_maybe_add_timer):
16485 * keyboard.c (readable_events):
16486 * process.c (wait_reading_process_output):
16487 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16488
16489 * insdel.c (adjust_markers_gap_motion):
16490 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16491 (gap_left, gap_right): Don't call it.
16492
2ecf6fdb
CY
164932011-03-25 Chong Yidong <cyd@stupidchicken.com>
16494
16495 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16496 incurred during fontification.
16497
6b1f9ba4
JB
164982011-03-25 Juanma Barranquero <lekktu@gmail.com>
16499
16500 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16501 (DEFVAR_PER_BUFFER): Don't pass it.
16502
16503 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16504 (scrolling_window): Don't pass it.
16505
0f4a96b5
JB
165062011-03-25 Juanma Barranquero <lekktu@gmail.com>
16507
16508 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16509
16510 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16511 and `suffix'.
16512 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16513 of variables specific to SELinux and computation of `encoded_absname'.
16514
16515 * image.c (XPutPixel): Remove unused variable `height'.
16516
16517 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16518
16519 * unexw32.c (get_section_info): Remove unused variable `section'.
16520
16521 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16522 (system_process_attributes): Remove unused variable `sess'.
16523 (sys_read): Remove unused variable `err'.
16524
16525 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16526 (w32_wnd_proc): Remove unused variable `isdead'.
16527 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16528 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16529 (x_create_tip_frame): Remove unused variable `tem'.
16530
16531 * w32inevt.c (w32_console_read_socket):
16532 Remove unused variable `no_events'.
16533
16534 * w32term.c (x_draw_composite_glyph_string_foreground):
16535 Remove unused variable `width'.
16536
1149507c
JB
165372011-03-24 Juanma Barranquero <lekktu@gmail.com>
16538
16539 * w32term.c (x_set_glyph_string_clipping):
16540 Don't pass uninitialized region to CombineRgn.
16541
9c88f339
JB
165422011-03-23 Juanma Barranquero <lekktu@gmail.com>
16543
16544 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16545 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16546 (Fx_close_connection): Remove unused variable `i'.
16547
16548 * w32font.c (w32font_draw): Return number of glyphs.
16549 (w32font_open_internal): Remove unused variable `i'.
16550 (w32font_driver): Add missing initializer.
16551
16552 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16553 (fill_in_menu): Remove unused variable `items_added'.
16554
16555 * w32term.c (last_mouse_press_frame): Remove static global variable.
16556 (w32_clip_to_row): Remove unused variable `f'.
16557 (x_delete_terminal): Remove unused variable `i'.
16558
16559 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16560 (NOTHING): Remove unused static global variable.
16561 (uniscribe_check_otf): Remove unused variable `table'.
16562 (uniscribe_font_driver): Add missing initializers.
16563
dee091a3
JD
165642011-03-23 Julien Danjou <julien@danjou.info>
16565
16566 * term.c (Fsuspend_tty, Fresume_tty):
16567 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16568 * window.c (temp_output_buffer_show):
16569 * insdel.c (signal_before_change):
16570 * frame.c (Fhandle_switch_frame):
16571 * fileio.c (Fdo_auto_save):
16572 * emacs.c (Fkill_emacs):
16573 * editfns.c (save_excursion_restore):
16574 * cmds.c (internal_self_insert):
16575 * callint.c (Fcall_interactively):
16576 * buffer.c (Fkill_all_local_variables):
16577 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16578 Use Frun_hooks.
0f4a96b5 16579 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 16580 unconditionally since it does the check itself.
dee091a3 16581
2c520ab5 165822011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 16583
c9c49752
PE
16584 Fix more problems found by GCC 4.5.2's static checks.
16585
8abc3f12
PE
16586 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16587 the first time through the loop, since we know p0 < p1 then.
16588 This also avoids a gcc -Wstrict-overflow warning.
16589
a2d26660
PE
16590 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16591 leading to a memory leak, possible in functions like
16592 load_charset_map_from_file that can allocate an unbounded number
b12ef411 16593 of objects (Bug#8318).
a2d26660 16594
916c72e9
PE
16595 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16596 that could (at least in theory) be that large.
16597
19ab8a18
PE
16598 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16599 This is less likely to overflow, and avoids undefined behavior if
16600 overflow does occur. All callers changed. Use strtoul to scan
16601 for the unsigned long integer.
b7cbbd6f
PE
16602 (pint2hrstr): Simplify and tune code slightly.
16603 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 16604
f0641eff
PE
16605 * scroll.c (do_scrolling): Work around GCC bug 48228.
16606 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16607
7f650bb9
PE
16608 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16609 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
16610 (validate_x_resource_name): Simplify count usage.
16611 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 16612
37dd57d1
PE
16613 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16614 fail (Bug#8306).
81e56e61 16615
699979fc 16616 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 16617
401bf9b4
PE
16618 * process.c (Fmake_network_process): Use socklen_t, not int,
16619 where POSIX says socklen_t is required in portable programs.
16620 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 16621 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
16622 (Fmake_network_process, server_accept_connection):
16623 (wait_reading_process_output, read_process_output):
16624 Likewise.
16625
b93aacde
PE
16626 * process.c: Rename or move locals to avoid shadowing.
16627 (list_processes_1, Fmake_network_process):
16628 (read_process_output_error_handler, exec_sentinel_error_handler):
16629 Rename or move locals.
4dc343ee 16630 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 16631 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 16632 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 16633 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 16634 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 16635
af8a867c 16636 Make tparam.h and terminfo.c consistent.
44f230aa
SM
16637 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16638 Include tparam.h instead, since it declares them.
af8a867c
PE
16639 * cm.h (PC): Remove extern decl; tparam.h now does this.
16640 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16641 * terminfo.c: Include tparam.h, to check interfaces.
16642 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16643 (tparam): Adjust signature to match interface in tparam.h;
16644 this removes some undefined behavior. Check that outstring and len
16645 are zero, which they always are with Emacs.
16646 * tparam.h (PC, BC, UP): New extern decls.
16647
0248044d 16648 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 16649 (xftfont_open): Rename locals to avoid shadowing.
0248044d 16650
8ff096c1 16651 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
16652 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16653 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 16654 (ftfont_list): Remove unused local.
49eaafba
PE
16655 (get_adstyle_property, ftfont_pattern_entity):
16656 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16657 Rename locals to avoid shadowing.
8ff096c1 16658
e2be39f6
PE
16659 * xfont.c (xfont_list_family): Mark var as initialized.
16660
c9735e30
PE
16661 * xml.c (make_dom): Now static.
16662
8f5201ae
PE
16663 * composite.c (composition_compute_stop_pos): Rename local to
16664 avoid shadowing.
b246f932
PE
16665 (composition_reseat_it): Remove unused locals.
16666 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 16667 (composition_update_it): Mark var as initialized.
11b61122
PE
16668 (find_automatic_composition): Mark vars as initialized,
16669 with a FIXME (Bug#8290).
8f5201ae 16670
760fbc2c
PE
16671 character.h: Rename locals to avoid shadowing.
16672 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16673 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16674 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16675 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16676 to avoid shadowing.
16677
ff08eb85
PE
16678 * textprop.c (property_change_between_p): Remove; unused.
16679
fc7bf025
PE
16680 * intervals.c (interval_start_pos): Now static.
16681
235d7abc
PE
16682 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16683
44f230aa
SM
16684 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16685 Rename locals to avoid shadowing.
3e7d6594 16686
50060332
PE
16687 * sound.c (wav_play, au_play, Fplay_sound_internal):
16688 Fix pointer signedness.
d01f234b 16689 (alsa_choose_format): Remove unused local var.
c83b8872
PE
16690 (wav_play): Initialize a variable to 0, to prevent undefined
16691 behavior (Bug#8278).
50060332 16692
c4fc4e30
PE
16693 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16694
918436ed
PE
16695 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16696
c939f91b
PE
16697 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16698 clobbering (Bug#8298).
b9c7f648
PE
16699 * sysdep.c (sys_subshell): Likewise.
16700 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 16701
6bd8c144
PE
16702 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16703 This should get cleaned up, so that child_setup has the
16704 same signature on all platforms.
16705
7710357c 16706 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 16707 (relocate_fd): Rename locals to avoid shadowing.
7710357c 16708
c59da222
CY
167092011-03-22 Chong Yidong <cyd@stupidchicken.com>
16710
16711 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16712 not to be necessary, and produces flickering.
16713
66b87493
GM
167142011-03-20 Glenn Morris <rgm@gnu.org>
16715
16716 * config.in: Remove file.
16717
45b6f6d5
JB
167182011-03-20 Juanma Barranquero <lekktu@gmail.com>
16719
16720 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16721 are now in src/globals.h.
16722 (syms_of_minibuf): Remove spurious & from previous change.
16723
cd394be1 167242011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
16725
16726 * minibuf.c (completing-read-function): New variable.
16727 (completing-read-default): Rename from completing-read.
16728 (completing-read): Call completing-read-function.
16729
b14e3e21
CY
167302011-03-19 Juanma Barranquero <lekktu@gmail.com>
16731
16732 * xfaces.c (Fx_load_color_file):
16733 Read color file from absolute filename (bug#8250).
16734
f2b726e6
JB
167352011-03-19 Juanma Barranquero <lekktu@gmail.com>
16736
16737 * makefile.w32-in: Update dependencies.
16738
09f6ff02
EZ
167392011-03-17 Eli Zaretskii <eliz@gnu.org>
16740
16741 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16742
29a6015a
PE
167432011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16744
a3a6c54e
PE
16745 Fix more problems found by GCC 4.5.2's static checks.
16746
b766f867
PE
16747 * process.c (make_serial_process_unwind, send_process_trap):
16748 (sigchld_handler): Now static.
16749
be02381c
PE
16750 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16751 That way, the code declares only the vars that it needs.
16752 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16753 * s/cygwin.h (PTY_ITERATION): Likewise.
16754 * s/darwin.h (PTY_ITERATION): Likewise.
16755 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16756
57048744
PE
16757 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16758 * process.c (allocate_pty): Don't declare stb unless it's needed.
16759
7914961c 16760 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
16761 (CONSTANTLIM): Remove; unused.
16762 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16763 Define only if needed.
7914961c 16764
b3967b18
PE
16765 * unexelf.c (unexec): Name an expression,
16766 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
16767 Use a different way to cause a compilation error if anyone uses
16768 n rather than nn, a way that does not involve shadowing.
73366a00 16769 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 16770
29a6015a
PE
16771 * deps.mk (unexalpha.o): Remove; unused.
16772
43cfc33e 16773 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 16774 * unexec.h: New file.
ce701a33
PE
16775 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16776 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16777 Depend on unexec.h.
16778 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16779 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16780 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 16781 Change as necessary to match prototype in unexec.h.
ce701a33 16782
01f44d5a
PE
16783 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16784 shadowing.
4f63c6bb 16785 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 16786
a6670b0b
PE
16787 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16788 Rename locals to avoid shadowing.
16789
cef2010d 16790 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 16791 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 16792
d4d7173a
PE
16793 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16794
f08b802a
PE
16795 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16796 warning when compiling print.c.
16797
3ddb0639
PE
16798 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16799 instead of using an uninitialized var.
5ad03b97 16800 (font_sort_entities): Mark var as initialized.
3ddb0639 16801
170a2692
PE
16802 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16803
e663c700
PE
16804 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16805 pointers to constants.
89bc529a 16806 (font_parse_fcname): Remove unused vars.
7b81e2d0 16807 (font_delete_unmatched): Now static.
ea838e10 16808 (font_get_spec): Remove; unused.
13a547c6
PE
16809 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16810 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16811 Rename or move locals to avoid shadowing.
e663c700 16812
2a80c887 16813 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 16814 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 16815
1384fa33 16816 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 16817 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 16818
8b2c52e9
PE
16819 * alloc.c (mark_backtrace): Move decl from here ...
16820 * lisp.h: ... to here, so that it can be checked.
16821
475545b5 16822 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 16823 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
16824 (lisp_indirect_variable): Name an expression,
16825 to avoid gcc -Wbad-function-cast warning.
1faed8ae 16826 (Fdefvar): Rename locals to avoid shadowing.
475545b5 16827
b1349114 16828 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 16829 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 16830 Use const pointer when appropriate.
b1349114 16831
a2928364
PE
16832 * lisp.h (get_system_name, get_operating_system_release):
16833 Move decls here, to check interfaces.
16834 * process.c (get_operating_system_release): Move decl to lisp.h.
16835 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
16836 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16837 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16838 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
16839 (Fformat_time_string, Fencode_time, Finsert_char):
16840 (Ftranslate_region_internal, Fformat):
16841 Rename or remove local vars to avoid shadowing.
9710023e 16842 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 16843
a415e694
PE
16844 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16845 avoid shadowing.
16846
8ef4622d
PE
16847 * lisp.h (eassert): Check that the argument compiles, even if
16848 ENABLE_CHECKING is not defined.
16849
946f9a5b
PE
16850 * data.c (Findirect_variable): Name an expression, to avoid
16851 gcc -Wbad-function-cast warning.
112396d6 16852 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 16853 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
16854 (Fmake_variable_buffer_local, Fmake_local_variable):
16855 Mark variables as initialized.
52746918 16856 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 16857
e5aab7e7 16858 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
16859 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16860 Rename locals to avoid shadowing.
dff45157
PE
16861 (mark_stack): Move local variables into the #ifdef region where
16862 they're used.
7bc26fdb
PE
16863 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16864 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16865 needed otherwise.
16866 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16867 (GC_STRING_CHARS): Remove; not used.
d40d4be1 16868 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 16869
e5aab7e7
PE
16870 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16871 avoids undefined behavior in theory.
16872
4da60324
PE
16873 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16874
88043301
PE
16875 Use functions, not macros, for up- and down-casing (Bug#8254).
16876 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16877 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16878 to use the following functions instead of these macros.
16879 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16880 EMACS_INT, since callers assume the returned value fits in int.
16881 (upcase1): Likewise, for UPCASE_TABLE.
16882 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 16883 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 16884 the race-condition problem in the old DOWNCASE.
88043301 16885
19ed5445
PE
16886 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16887 Rename locals to avoid shadowing.
16888 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
16889 (regex_compile, re_search_2, re_match_2_internal):
16890 Remove unused local vars.
952db0d7
PE
16891 (FREE_VAR): Rewrite so as not to use empty "else",
16892 which gcc can warn about.
da053e48 16893 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
16894 (RETALLOC_IF): Define only if needed.
16895 (WORDCHAR_P): Likewise. This one is never needed, but is used
16896 only in a comment talking about a compiler bug, so put inside
16897 the #if 0 of that comment.
16898 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16899 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16900 Remove; unused.
19ed5445 16901
1f3561e4 16902 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
16903 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16904 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 16905
ded6f8f7
PE
16906 * search.c (simple_search): Remove unused var.
16907
dbd37a95
PE
16908 * dired.c (compile_pattern): Move decl from here ...
16909 * lisp.h: ... to here, so that it can be checked.
16910 (struct re_registers): New forward decl.
16911
7e47afad
PE
16912 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16913
85f24f61
PE
16914 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16915 All uses changed.
16916 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16917 Rename locals to avoid shadowing.
5671df8f 16918 (Fvertical_motion): Mark locals as initialized.
85f24f61 16919
181aa2be 16920 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 16921 (casify_region): Mark local as initialized.
181aa2be 16922
930d429c
PE
16923 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16924
7082eac6
PE
16925 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16926 New macros, so that the caller can use some names other than
16927 gcpro1, gcpro2, etc.
16928 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16929 of the new macros.
16930 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16931 argument, for consistency with GCPRO2_VAR, etc: it is now the
16932 prefix of the variable, not the variable itself. All uses
16933 changed.
38b2c076
PE
16934 * dired.c (directory_files_internal, file_name_completion):
16935 Rename locals to avoid shadowing.
16936
15206ed9
PE
16937 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16938 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16939 dired.c's scmp function, had undefined behavior.
16940 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16941 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16942 * buffer.h: ... to here, because these macros use current_buffer,
16943 and the new implementation with inline functions needs to have
16944 current_buffer in scope now, rather than later when the macros
16945 are used.
16946 (downcase, upcase1): New static inline functions.
16947 (DOWNCASE, UPCASE1): Reimplement using these functions.
16948 This avoids undefined behavior in expressions like
16949 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16950 from race conditions in accessing the global variables
16951 case_temp1 and case_temp2.
16952 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16953 * lisp.h (case_temp1, case_temp2): Remove their decls.
16954 * character.h (ASCII_CHAR_P): Move from here ...
16955 * lisp.h: ... to here, so that the inline functions mentioned
16956 above can use them.
16957
4a6bea26
PE
16958 * dired.c (directory_files_internal_unwind): Now static.
16959
f14b7e14
PE
16960 * fileio.c (file_name_as_directory, directory_file_name):
16961 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16962 Now static.
2893f146
PE
16963 (file_name_as_directory): Use const pointers when appropriate.
16964 (Fexpand_file_name): Likewise. In particular, newdir might
16965 point at constant storage, so make it a const pointer.
fd4ead52 16966 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
16967 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16968 signedness issues.
f839df0c
PE
16969 (Fset_file_times, Finsert_file_contents, auto_save_error):
16970 Rename locals to avoid shadowing.
f14b7e14 16971
5716756e 16972 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
16973 (Ftry_completion, Fall_completions): Rename or remove locals
16974 to avoid shadowing.
5716756e 16975
b4c3046a
PE
16976 * marker.c (bytepos_to_charpos): Remove; unused.
16977
b45db522
PE
16978 * lisp.h (verify_bytepos, count_markers): New decls,
16979 so that gcc does not warn that these functions aren't declared.
16980
85876d07
PE
16981 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16982 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 16983 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 16984 (copy_text): Remove unused local var.
85876d07 16985
03d78a21 16986 * filelock.c (within_one_second): Now static.
b3dd38ab 16987 (lock_file_1): Rename local to avoid shadowing.
03d78a21 16988
5df8f01b
PE
16989 * buffer.c (fix_overlays_before): Mark locals as initialized.
16990 (fix_start_end_in_overlays): Likewise. This function should be
16991 simplified by using pointers-to-pointers, but that's a different
16992 matter.
b1d876f1 16993 (switch_to_buffer_1): Now static.
8f54f30a
PE
16994 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16995 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 16996
a70072c9 16997 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 16998 Fix pointer signedness issue.
edced198
PE
16999 (sys_subshell): Mark local as volatile if checking for lint,
17000 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17001 (MAXPATHLEN): Define only if needed.
a70072c9 17002
a0977c44
PE
17003 * process.c (serial_open, serial_configure): Move decls from here ...
17004 * systty.h: ... to here, so that they can be checked.
17005
a884fdcc
PE
17006 * fns.c (get_random, seed_random): Move extern decls from here ...
17007 * lisp.h: ... to here, so that they can be checked.
17008
604efe86 17009 * sysdep.c (reset_io): Now static.
b8950c94 17010 (wait_for_termination_signal): Remove; unused.
604efe86 17011
38fc62d9
PE
17012 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17013 (copy_keymap_item, append_key, push_text_char_description):
17014 Now static.
1004a21a 17015 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17016 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17017 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17018 (describe_map_tree):
17019 Rename locals to avoid shadowing.
38fc62d9 17020
2f2650da
PE
17021 * keyboard.c: Declare functions static if they are not used elsewhere.
17022 (echo_char, echo_dash, cmd_error, top_level_2):
17023 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17024 (read_char, kbd_buffer_get_event, make_lispy_position):
17025 (make_lispy_event, make_lispy_movement, apply_modifiers):
17026 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17027 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17028 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17029 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17030 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17031
a053e86c 17032 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17033 (mark_kboards): Move decl here ...
17034 * alloc.c (mark_kboards): ... from here.
a053e86c 17035
4752793e
PE
17036 * lisp.h (force_auto_save_soon): New decl.
17037
74f10ca7 17038 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17039 (DEFINE_DUMMY_FUNCTION): New macro.
17040 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17041 Use it.
c03cd23f
PE
17042 (main): Add casts to avoid warnings
17043 if GCC considers string literals to be constants.
74f10ca7 17044
022e70d4
PE
17045 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17046
59d6fe83
PE
17047 * dbusbind.c: Pointer signedness fixes.
17048 (xd_signature, xd_append_arg, xd_initialize):
17049 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17050 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17051 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17052 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17053
78320123
PE
17054 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17055 if GCC considers string literals to be constants.
49cebcca 17056 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17057
35ac2a97
SM
170582011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17059
fb103ca9
SM
17060 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17061 (print_preprocess, print_object): New macro to fix last change.
17062
35ac2a97
SM
17063 * print.c (print_preprocess): Don't forget font objects.
17064
62973b41
JB
170652011-03-16 Juanma Barranquero <lekktu@gmail.com>
17066
17067 * emacs.c (USAGE3): Doc fixes.
17068
0e48bb22
AS
170692011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17070
17071 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17072 structure.
17073
7684e57b
JB
170742011-03-14 Juanma Barranquero <lekktu@gmail.com>
17075
17076 * lisp.h (VWindow_system, Qfile_name_history):
17077 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17078 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17079 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17080
17081 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17082 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17083
17084 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17085 * w32console.c (detect_input_pending, read_input_pending)
17086 (encode_terminal_code):
17087 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17088 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17089 (w32_system_caret_y, Qfile_name_history):
17090 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17091 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17092 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17093 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17094 * w32proc.c (Qlocal, report_file_error):
17095 * w32term.c (Vwindow_system, updating_frame):
17096 * w32uniscribe.c (initialized, uniscribe_font_driver):
17097 Remove unneeded extern declarations.
17098
2aa46d6c
CY
170992011-03-14 Chong Yidong <cyd@stupidchicken.com>
17100
c96bbc66 17101 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17102
cffc6f3b
CY
171032011-03-13 Chong Yidong <cyd@stupidchicken.com>
17104
17105 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17106 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17107 These macros can no longer be used for assignment.
17108
44f230aa
SM
17109 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17110 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17111 (record_buffer_markers, fetch_buffer_markers): New functions for
17112 recording and fetching special buffer markers.
17113 (set_buffer_internal_1, set_buffer_temp): Use them.
17114
17115 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17116
17117 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17118
17119 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17120 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17121
17122 * xdisp.c (hscroll_window_tree):
17123 (reconsider_clip_changes): Use PT instead of BUF_PT.
17124
d251f04b
EZ
171252011-03-13 Eli Zaretskii <eliz@gnu.org>
17126
17127 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17128 $(EMACS_ROOT)/lib/intprops.h.
17129
f0c77cd1
PE
171302011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17131
3eca4629
PE
17132 Fix more problems found by GCC 4.5.2's static checks.
17133
7c86ee98
PE
17134 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17135 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17136 (xg_free_frame_widgets): Make it clear that a local variable is
17137 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17138 (gdk_window_get_screen): Make it clear that this macro is needed
17139 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17140 (int_gtk_range_get_value): New function, which avoids a diagnostic
17141 from gcc -Wbad-function-cast.
17142 (xg_set_toolkit_scroll_bar_thumb): Use it.
17143 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17144 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
17145 (get_utf8_string, xg_get_file_with_chooser):
17146 Rename locals to avoid shadowing.
17147 (create_dialog): Move locals to avoid shadowing.
7c86ee98 17148
41729b81
PE
17149 * xgselect.c (xg_select): Remove unused var.
17150
f0c77cd1
PE
17151 * image.c (four_corners_best): Mark locals as initialized.
17152 (gif_load): Initialize transparent_p to zero (Bug#8238).
17153 Mark another local as initialized.
ec6cf4c6 17154 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 17155
ce0ad53d 17156 * image.c (clear_image_cache): Now static.
d5d5a617 17157 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 17158 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
17159 (x_edge_detection): Remove unnecessary cast that
17160 gcc -Wbad-function-cast diagnoses.
2037898d 17161 (gif_load): Fix pointer signedness.
6ae141d6
PE
17162 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17163 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 17164
33383987 171652011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 17166
d32df629
PE
17167 Improve quality of tests for time stamp overflow.
17168 For example, without this patch (encode-time 0 0 0 1 1
17169 1152921504606846976) returns the obviously-bogus value (-948597
17170 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17171 reports time overflow. See
17172 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
17173 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17174 * editfns.c: Include limits.h and intprops.h.
17175 (TIME_T_MIN, TIME_T_MAX): New macros.
17176 (time_overflow): Move earlier, to before first use.
17177 (hi_time, lo_time): New functions, for an accurate test for
17178 out-of-range times.
17179 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17180 (Fget_internal_run_time): Don't assume time_t fits in int.
17181 (make_time): Use list2 instead of Fcons twice.
17182 (Fdecode_time): More accurate test for out-of-range times.
17183 (check_tm_member): New function.
17184 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
17185 (lisp_time_argument): Don't rely on undefined left-shift and
17186 right-shift behavior when checking for time stamp overflow.
8be6f318 17187
fe31d94c
PE
17188 * editfns.c (time_overflow): New function, refactoring common code.
17189 (Fformat_time_string, Fdecode_time, Fencode_time):
17190 (Fcurrent_time_string): Use it.
17191
8be6f318
PE
17192 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17193 * dired.c (make_time): Move to ...
17194 * editfns.c (make_time): ... here.
17195 * systime.h: Note the move.
17196
09d9db2c 171972011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 17198
126bc0dc
YM
17199 * fringe.c (update_window_fringes): Remove unused variables.
17200
c47cbdfd
YM
17201 * unexmacosx.c (copy_data_segment): Also copy __got section.
17202 (Bug#8223)
17203
7ac80be9
EZ
172042011-03-12 Eli Zaretskii <eliz@gnu.org>
17205
c96bbc66 17206 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
17207 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17208 Constify `char *' arguments and their references according to
17209 prototypes in tparam.h.
17210
ecb0f94d 17211 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 17212
7ac80be9
EZ
17213 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17214 Adapt all references accordingly.
17215
17216 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17217
ef1fd07e
TT
172182011-03-11 Tom Tromey <tromey@redhat.com>
17219
17220 * buffer.c (syms_of_buffer): Remove obsolete comment.
17221
7ef4b50c
EZ
172222011-03-11 Eli Zaretskii <eliz@gnu.org>
17223
17224 * termhooks.h (encode_terminal_code): Declare prototype.
17225
17226 * msdos.c (encode_terminal_code): Don't declare prototype.
17227
17228 * term.c (encode_terminal_code): Now external again, used by
17229 w32console.c and msdos.c.
17230
44f230aa
SM
17231 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17232 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 17233
4b1ec863 172342011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 17235
1714f52b 17236 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 17237
4b1ec863
PE
17238 * fringe.c (update_window_fringes): Mark locals as initialized
17239 (Bug#8227).
17240 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 17241
524c7aa6
PE
17242 * alloc.c (mark_fringe_data): Move decl from here ...
17243 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17244 to check its interface.
17245 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17246
a5c0af81 17247 * fontset.c (free_realized_fontset): Now static.
7519b8cd 17248 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 17249 (fontset_font): Mark local as initialized.
a9a06e0b 17250 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 17251
b4716021
PE
17252 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17253
811e9bac 17254 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 17255 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
17256 (x_own_selection, Fx_disown_selection_internal): Rename locals
17257 to avoid shadowing.
17258 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 17259
7e3ab302
PE
17260 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17261 so that the caller can use some name other than gcpro1.
17262 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
17263 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17264 (Fx_backspace_delete_keys_p):
17265 Use them to avoid shadowing, and rename vars to avoid shadowing.
17266 (x_decode_color, x_set_name, x_window): Now static.
6b437900 17267 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 17268 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
17269 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17270 Remove unused locals.
7e3ab302
PE
17271 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17272 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17273 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17274 macros.
f78faa98 17275
e2b13473
PE
17276 * xterm.h (x_mouse_leave): New decl.
17277
77f23912
PE
17278 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17279 Remove unused functions.
cdf4ba58
PE
17280 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17281 (x_calc_absolute_position): Now static.
7411c686 17282 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 17283 Don't declare local "event" unless it's used.
ed7bf3a5
PE
17284 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17285 unless they are used.
38d0b34a
PE
17286 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17287 (x_fatal_error_signal): Remove; not used.
a6067996
PE
17288 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17289 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17290 (x_error_catcher, x_connection_closed, x_error_handler):
17291 (x_error_quitter, xembed_send_message, x_iconify_frame):
17292 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 17293 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 17294 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 17295
44f230aa
SM
17296 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17297 Rename or move locals to avoid shadowing.
6b463e58 17298 (tty_defined_color, merge_face_heights): Now static.
5967d051 17299 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
17300 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17301 does not deduce is never used uninitialized.
73719eba
PE
17302 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17303 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 17304
426994c3 17305 * terminal.c (store_terminal_param): Now static.
5489860b 17306
032f1620 17307 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 17308 (set_frame_menubar): Remove unused local.
d4323972 17309 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
17310 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17311 since they might point to immutable storage.
281585b0
PE
17312 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17313 since it's unused otherwise.
032f1620 17314
367c19e5 17315 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 17316 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
17317 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17318 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 17319 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
17320 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17321 does not deduce are never used uninitialized.
70739cbe 17322
07b48fa9
PE
17323 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17324
8868a238 17325 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
17326 * window.c (window_loop, size_window):
17327 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 17328
7e5cf297 17329 * window.c (display_buffer): Now static.
d6550a9f
PE
17330 (size_window): Mark variables that gcc -Wuninitialized
17331 does not deduce are never used uninitialized.
a586633d
PE
17332 * window.h (check_all_windows): New decl, to forestall
17333 gcc -Wmissing-prototypes diagnostic.
5b555da1 17334 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 17335
f6095868
PE
17336 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17337 shadowing.
17338 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
17339 Include <limits.h>.
17340 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17341 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
17342 (load_charset_map): Mark variables that gcc -Wuninitialized
17343 does not deduce are never used uninitialized.
53df7c11 17344 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 17345
f38b440c
PE
17346 * coding.c (coding_set_source, coding_set_destination):
17347 Use "else { /* comment */ }" rather than "else /* comment */;"
17348 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
17349 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17350 a block, when the outer 'i' will do.
17351 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17352 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17353 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17354 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17355 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17356 Rename locals to avoid shadowing.
17357 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
17358 * coding.c (emacs_mule_char, encode_invocation_designation):
17359 Now static, since they're not used elsewhere.
413bb2db 17360 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 17361 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
17362 (decode_coding_emacs_mule): Mark variables that gcc
17363 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
17364 (detect_coding_iso_2022): Initialize a local variable that might
17365 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 17366 this initialization is needed. (Bug#8211)
5f58e762
PE
17367 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17368 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17369 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17370 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17371 Remove unused macros.
f38b440c 17372
232b38b9 17373 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 17374 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 17375 * character.c (string_count_byte8): Likewise.
232b38b9 17376
fb90da1b
PE
17377 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17378 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17379
fb93dbc2
PE
17380 * chartab.c (copy_sub_char_table): Now static, since it's not used
17381 elsewhere.
5c156ace
PE
17382 (sub_char_table_ref_and_range, char_table_ref_and_range):
17383 Rename locals to avoid shadowing.
bbcd0949 17384 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 17385
7d3b3862 17386 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 17387 (BIDI_BOB): Remove unused macro.
7d3b3862 17388
6be7d3da
PE
17389 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17390 deduce are never used uninitialized.
c2ed9c8b 17391 * term.c (encode_terminal_code): Likewise.
6be7d3da 17392
75f8807f 17393 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 17394
50938595
PE
17395 * tparam.h: New file.
17396 * term.c, tparam.h: Include it.
17397 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17398 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17399 Move these decls to tparam.h, and make them agree with what
17400 is actually in tparam.c. The previous trick of using incompatible
17401 decls in different modules does not conform to the C standard.
17402 All callers of tparam changed to use tparam's actual API.
17403 * tparam.c (tparam1, tparam, tgoto):
17404 Use const pointers where appropriate.
17405
fbceeba2
PE
17406 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17407 * cm.h (struct cm): Likewise.
17408 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17409 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17410 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17411 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17412 (turn_on_face, init_tty): Likewise.
17413 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 17414
7f3f1250
PE
17415 * term.c (term_mouse_position): Rename local to avoid shadowing.
17416
e6ca6543
PE
17417 * alloc.c (mark_ttys): Move decl from here ...
17418 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17419
c40f8d15
AS
174202011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17421
17422 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17423
cfe0661d
JB
174242011-03-09 Juanma Barranquero <lekktu@gmail.com>
17425
17426 * search.c (compile_pattern_1): Remove argument regp, unused since
17427 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17428 (compile_pattern): Don't pass it.
17429
0afb4571
J
174302011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17431
17432 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17433 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17434 for ! HAVE_GTK3.
17435 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17436
17437 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17438
17439 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17440 gdk_window_get_screen, gdk_window_get_geometry,
17441 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17442 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17443 (xg_get_pixbuf_from_pixmap): New function.
17444 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17445 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17446 Call xg_get_pixbuf_from_pixmap instead of
17447 gdk_pixbuf_get_from_drawable.
17448 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17449 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17450 (xg_check_special_colors): Use GtkStyleContext and its functions
17451 for HAVE_GTK3.
17452 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17453 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17454 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
17455 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17456 Call gtk_widget_get_preferred_size.
0afb4571
J
17457 (xg_frame_resized): gdk_window_get_geometry only takes 5
17458 parameters.
44f230aa
SM
17459 (xg_win_to_widget, xg_event_is_for_menubar):
17460 Call gdk_x11_window_lookup_for_display.
0afb4571
J
17461 (xg_set_widget_bg): New function.
17462 (delete_cb): New function.
895009e1 17463 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 17464 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
17465 (xg_set_background_color): Call xg_set_widget_bg.
17466 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17467 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17468 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17469 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17470 if ! HAVE_GTK3.
17471 (update_frame_tool_bar): Call gtk_widget_hide.
17472 (xg_initialize): Use GDK_KEY_g.
17473
17474 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17475 if ! HAVE_GTK3
17476 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17477
17478 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17479 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17480 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17481
1c2cc4ef
JB
174822011-03-08 Juanma Barranquero <lekktu@gmail.com>
17483
17484 * w32xfns.c (select_palette): Check success of RealizePalette against
17485 GDI_ERROR, not zero.
17486
33383987 17487See ChangeLog.11 for earlier changes.
aac0c6e3
MR
17488
17489;; Local Variables:
17490;; coding: utf-8
aac0c6e3
MR
17491;; End:
17492
2f097256 17493 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
17494
17495 This file is part of GNU Emacs.
17496
17497 GNU Emacs is free software: you can redistribute it and/or modify
17498 it under the terms of the GNU General Public License as published by
17499 the Free Software Foundation, either version 3 of the License, or
17500 (at your option) any later version.
17501
17502 GNU Emacs is distributed in the hope that it will be useful,
17503 but WITHOUT ANY WARRANTY; without even the implied warranty of
17504 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17505 GNU General Public License for more details.
17506
17507 You should have received a copy of the GNU General Public License
17508 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.