Merge from emacs-24; up to 2012-05-01T00:16:02Z!rgm@gnu.org
[bpt/emacs.git] / src / ChangeLog
CommitLineData
7dca65a4
PE
12012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2
3 Port to OpenBSD 5.1 amd64.
4 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5 This is needed for OpenBSD, and should be harmless on all BSD systems.
6 Also, include <sys/sysctl.h>, as it should be available on all
7 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
8 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9 use p_pid member, not kp_proc.pid.
10
8eb876e2
GM
112012-07-06 Glenn Morris <rgm@gnu.org>
12
13 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
14
38182d90
PE
152012-07-05 Paul Eggert <eggert@cs.ucla.edu>
16
17 More xmalloc and related cleanup.
18 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
19 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
20 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
21 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
22 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
23 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
24 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
25 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
26 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
27 * xterm.c:
28 Omit needless casts involving void * pointers and allocation.
29 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
30 as the former is more robust if P's type is changed.
31 Prefer xzalloc to xmalloc + memset 0.
32 Simplify malloc-or-realloc to realloc.
33 Don't worry about xmalloc returning a null pointer.
34 Prefer xstrdup to xmalloc + strcpy.
35 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
36 growing it.
37 * keyboard.c (apply_modifiers_uncached): Prefer local array to
38 alloca of a constant.
39
6dd5a677
EZ
402012-07-05 Eli Zaretskii <eliz@gnu.org>
41
42 * xdisp.c (display_line): Fix horizontal pixel coordinates when
43 hscroll is larger than the line width. Fixes long and futile
44 looping inside extend_face_to_end_of_line (on a TTY) producing
45 glyphs that are not needed and thrown away.
46
6b312f0f
DA
472012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
48
49 * marker.c (set_marker_restricted_both): Simplify by using
50 clip_to_bounds.
51
f520ef9b
PE
522012-07-05 Paul Eggert <eggert@cs.ucla.edu>
53
54 * editfns.c (region_limit): Simplify by using clip_to_bounds.
55
383b7c95
JD
562012-07-05 Jan Djärv <jan.h.d@swipnet.se>
57
58 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
59 not defined (Bug#11768).
60 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
61 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
62 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
63 followed by gtk_box_set_homogeneous (Bug#11768).
64 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
65 (update_theme_scrollbar_width, xg_create_scroll_bar): Use
66 gtk_scrollbar_new (Bug#11768).
67 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
68 (is_box_type): New function (Bug#11768).
69 (xg_tool_item_stale_p): Call is_box_type.
70 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
71 with default display (Bug#11768).
72
d6e7bf45
EZ
732012-07-05 Eli Zaretskii <eliz@gnu.org>
74
75 * xdisp.c (window_hscroll_limited): New function.
76 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
77 coordinates when window's hscroll is set to insanely large
78 values. (Bug#11857)
79
431391ec
JB
802012-07-05 Juanma Barranquero <lekktu@gmail.com>
81
82 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
83 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
84
23f86fce
DA
852012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
86
87 Cleanup xmalloc.
88 * lisp.h (xzalloc): New prototype. Omit needless casts.
89 * alloc.c (xzalloc): New function. Omit needless casts.
90 * charset.c: Omit needless casts. Convert all calls to
91 xmalloc with following memset to xzalloc.
92 * dispnew.c: Likewise.
93 * fringe.c: Likewise.
94 * image.c: Likewise.
95 * sound.c: Likewise.
96 * term.c: Likewise.
97 * w32fns.c: Likewise.
98 * w32font.c: Likewise.
99 * w32term.c: Likewise.
100 * xfaces.c: Likewise.
101 * xfns.c: Likewise.
102 * xterm.c: Likewise.
103 * atimer.c: Omit needless casts.
104 * buffer.c: Likewise.
105 * callproc.c: Likewise.
106 * ccl.c: Likewise.
107 * coding.c: Likewise.
108 * composite.c: Likewise.
109 * doc.c: Likewise.
110 * doprnt.c: Likewise.
111 * editfns.c: Likewise.
112 * emacs.c: Likewise.
113 * eval.c: Likewise.
114 * filelock.c: Likewise.
115 * fns.c: Likewise.
116 * gtkutil.c: Likewise.
117 * keyboard.c: Likewise.
118 * lisp.h: Likewise.
119 * lread.c: Likewise.
120 * minibuf.c: Likewise.
121 * msdos.c: Likewise.
122 * print.c: Likewise.
123 * process.c: Likewise.
124 * region-cache.c: Likewise.
125 * search.c: Likewise.
126 * sysdep.c: Likewise.
127 * termcap.c: Likewise.
128 * terminal.c: Likewise.
129 * tparam.c: Likewise.
130 * w16select.c: Likewise.
131 * w32.c: Likewise.
132 * w32reg.c: Likewise.
133 * w32select.c: Likewise.
134 * w32uniscribe.c: Likewise.
135 * widget.c: Likewise.
136 * xdisp.c: Likewise.
137 * xmenu.c: Likewise.
138 * xrdb.c: Likewise.
139 * xselect.c: Likewise.
140
0497dc44
PE
1412012-07-05 Paul Eggert <eggert@cs.ucla.edu>
142
143 * fileio.c (time_error_value): Check the right error number.
144 Problem reported by Troels Nielsen in
145 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
146
356e7178
PE
1472012-07-04 Paul Eggert <eggert@cs.ucla.edu>
148
4e71fd89
PE
149 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
150 This should be fixed in a better way; see Eli Zaretskii in
151 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
152 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
153
f0941253
PE
154 * fileio.c (time_error_value): Rename from special_mtime.
155 The old name's problems were noted by Eli Zaretskii in
156 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
157
065c9eb4
PE
158 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
159 This variable's comment says Emacs needs at least one GDB-visible
160 symbol of type enum pvec_type, to work around GDB problems.
161 The symbol's value doesn't matter.
162
356e7178
PE
163 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
164 that causes compilation to fail on pre-C99 compilers.
165
95f61aa2
JB
1662012-07-04 Juanma Barranquero <lekktu@gmail.com>
167
168 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
169 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
170
3884d954
DA
1712012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
172
d209e2fb 173 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
174 headers for buffer_defaults and buffer_local_symbols.
175 Reported by Juanma Barranquero <lekktu@gmail.com>.
176
ee28be33
SM
1772012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
178
179 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
180 * lisp.h (enum pvec_type): Use fewer bits.
181 (PSEUDOVECTOR_SIZE_BITS): New constant.
182 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
183 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
184 change in pvec_type.
185 (PSEUDOVECTOR_TYPEP): New macro.
186 (TYPED_PSEUDOVECTORP): Use it.
187 * fns.c (internal_equal): Adapt code to extract pvectype.
188 * emacs.c (gdb_pvec_type): Update type.
189 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
190 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
191 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
192 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
193 (sweep_vectors): Use it. Use local var `total_bytes' instead of
194 abusing vector->header.next.nbytes.
195 (live_vector_p): Use PVEC_TYPE.
196 (mark_object): Adapt code to extract pvectype. Use switch.
197
c7f2cd7f
PE
1982012-07-04 Paul Eggert <eggert@cs.ucla.edu>
199
200 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
201 Tighten new eassert a bit.
202
8ce70ed2
DA
2032012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
204
205 Fix compilation with --enable-gcc-warnings and -O1
206 optimization level.
207 * doprnt.c (doprnt): Change type of tem to int, initialize
208 to avoid compiler warning. Add eassert.
209 * search.c (simple_search): Initialize match_byte to avoid
210 compiler warning. Add eassert.
211
dea7f1e5
PE
2122012-07-04 Paul Eggert <eggert@cs.ucla.edu>
213
24a212eb
PE
214 Avoid weird behavior with large horizontal scrolls.
215 Without this change, for example, large hscroll values would
216 mess up Emacs's display on Fedora 15 x86, presumably due to
217 overflows in int calculations in the display code.
218 Also, if buffers had long lines, Emacs would freeze.
219 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
220 (set_window_hscroll): New function, containing the old guts of
221 Fset_window_hscroll. Return the clipped value.
222 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
223 This avoids the need to check against PTRDIFF_MAX.
224
dea7f1e5
PE
225 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
226
76046526
DA
2272012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
228
229 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
230
39adff0d
PE
2312012-07-04 Paul Eggert <eggert@cs.ucla.edu>
232
63807d47
PE
233 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
234 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
235 since GCC 4.4.6 issues a bogus warning for them.
236
39adff0d
PE
237 Fix bugs in file timestamp newness comparisons.
238 * fileio.c (Ffile_newer_than_file_p):
239 * lread.c (Fload): Use full timestamp resolution of files,
240 not just the 1-second resolution, so that files that are only
241 slightly newer still count as newer.
242 * fileio.c (Ffile_newer_than_file_p): Don't assume file
243 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
244
dbeed9a6
PE
2452012-07-03 Paul Eggert <eggert@cs.ucla.edu>
246
247 * fileio.c: Improve handling of file time marker. (Bug#11852)
248 (special_mtime): New function.
249 (Finsert_file_contents, Fverify_visited_file_modtime):
250 Use it to set special mtime values consistently.
251
636334d6
AS
2522012-07-03 Andreas Schwab <schwab@linux-m68k.org>
253
254 * fileio.c (Finsert_file_contents): Properly handle st_mtime
255 marker for non-existing file. (Bug#11852)
256
e2017fe2
GM
2572012-07-03 Glenn Morris <rgm@gnu.org>
258
259 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
260 and did not make it into globals.h).
261
404dbd37
TT
2622012-07-03 Tom Tromey <tromey@redhat.com>
263
264 * window.c (Fset_window_margins, Fset_window_fringes)
265 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
266 * textprop.c (Fprevious_property_change): No longer static.
267 * syntax.c (Fsyntax_table_p): No longer static.
268 * process.c (Fget_process, Fprocess_datagram_address): No longer
269 static.
270 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
271 * keyboard.c (Fcommand_execute): No longer static.
272 Remove EXFUN.
273 * insdel.c (Fcombine_after_change_execute): No longer static.
274 * image.c (Finit_image_library): No longer static.
275 * fileio.c (Fmake_symbolic_link): No longer static.
276 * eval.c (Ffetch_bytecode): No longer static.
277 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
278 * doc.c (Fdocumentation_property, Fsnarf_documentation):
279 No longer static.
404dbd37
TT
280 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
281 static.
282 * dired.c (Ffile_attributes): No longer static.
283 * composite.c (Fcomposition_get_gstring): No longer static.
284 * callproc.c (Fgetenv_internal): No longer static.
285
286 * ccl.h: Remove EXFUNs.
287 * buffer.h: Remove EXFUNs.
288 * dispextern.h: Remove EXFUNs.
289 * intervals.h: Remove EXFUNs.
290 * fontset.h: Remove EXFUN.
291 * font.h: Remove EXFUNs.
292 * dosfns.c (system_process_attributes): Remove EXFUN.
293 * keymap.h: Remove EXFUNs.
294 * lisp.h: Remove EXFUNs.
295 * w32term.h: Remove EXFUNs.
296 * window.h: Remove EXFUNs.
297 * xsettings.h: Remove EXFUN.
298 * xterm.h: Remove EXFUN.
299
8e4fd1e1
GM
3002012-07-03 Glenn Morris <rgm@gnu.org>
301
302 * lisp.h (Frandom): Make it visible to C.
303 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
304 buffer for invisible buffers. (Bug#1229)
305
ca95b3eb
DA
3062012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
307
308 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
309 values which aren't power of 2.
310 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
311 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
312 accordingly.
313
7555c33f
SM
3142012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
315
316 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
317
318 * alloc.c (mark_object): Revert part of last patch to use `switch'.
319
d12e8f5a
DA
3202012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
321
322 * alloc.c (allocate_vector_block): Remove redundant
323 calls to mallopt if DOUG_LEA_MALLOC is defined.
324 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
325 avoid calls to mallopt if zero_vector is returned.
326
296094c3
DA
3272012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
328
329 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
330 is enabled, avoid dereferencing NULL current_sblock if
331 running undumped.
332
36429c89
DA
3332012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
334
335 Cleanup basic buffer management.
336 * buffer.h (struct buffer): Change layout to use generic vector
337 marking code. Fix some comments. Change type of 'clip_changed'
338 to bitfield. Remove unused #ifndef old.
339 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
340 (GET_OVERLAYS_AT): Fix indentation.
341 (for_each_per_buffer_object_at): New macro.
342 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
343 (Fbuffer_local_variables): Use it.
344 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
345 * alloc.c (allocate_buffer): Adjust to match new layout of
346 struct buffer. Fix comment.
347 (mark_overlay): New function.
348 (mark_buffer): Use it. Use mark_vectorlike to mark normal
349 Lisp area of struct buffer.
350 (mark_object): Use it. Adjust marking of misc objects
351 and related comments.
352
3b3e4cac
PE
3532012-07-02 Paul Eggert <eggert@cs.ucla.edu>
354
355 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
356 wrapper that is not needed because the wrapped code is a no-op (zero
357 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
358 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
359
cf5c0175
DA
3602012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
361
362 * alloc.c (mark_buffer): Simplify. Remove prototype.
363 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 364 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
365 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
366 redundant calls to mark_vectorlike for bool vectors.
367
ca26824c
GM
3682012-06-30 Glenn Morris <rgm@gnu.org>
369
2e4c5312
GM
370 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
371
ca26824c
GM
372 * epaths.in (PATH_SITELOADSEARCH): New.
373 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
374 This is rather than relying on --enable-locallisppath elements
375 having "site-lisp" in their names. (Bug#10208#25, 11658)
376
0d23c240
EZ
3772012-06-30 Eli Zaretskii <eliz@gnu.org>
378
c9240d7a
EZ
379 * w32proc.c (sys_select): Accept and ignore one more argument.
380
381 * w32.c (emacs_gnutls_pull): Call select with one more argument.
382
0d23c240 383 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 384 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
385
386 * sysdep.c: Don't include dos.h and dosfns.h.
387
388 * process.c (sys_select):
389 * msdos.c (sys_select): Accept one more argument and ignore it.
390
391 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
392 adapt data types and code to that.
393
394 * dosfns.c:
395 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
396 which clashes with the gnulib function of the same name.
397
af5a5a98
AS
3982012-06-30 Andreas Schwab <schwab@linux-m68k.org>
399
c5e4379c
AS
400 * font.c (font_style_to_value, font_style_symbolic)
401 (font_prop_validate_style): Add type checks for values in
402 font_style_table.
403
af5a5a98
AS
404 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
405 argument.
406 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
407 uses.
408
8d38f461
EZ
4092012-06-29 Eli Zaretskii <eliz@gnu.org>
410
2e5a6631
EZ
411 * xdisp.c (try_window_id): Undo last change.
412
8d38f461
EZ
413 * w32.c (getwd): Adjust commentary about startup_dir.
414 (init_environment): Always call sys_access, even in non-MSVC
415 builds. Don't chdir to the directory of the Emacs executable.
416 This undoes code from 1997 which was justified by the need to
417 "avoid conflicts when removing and renaming directories". But its
418 downside was that every relative file name was being interpreted
419 relative to the directory of the Emacs executable, which can never
420 be TRT. In particular, it broke sys_access when called with
421 relative file names.
422 (sys_access): Map GetLastError to errno.
423
2af3565e
DA
4242012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
425
426 * window.h (struct window): Change type of 'fringes_outside_margins'
427 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 428 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
429 Adjust comment.
430 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
431 to ptrdiff_t.
432
c8d3a25c 4332012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 434
c8d3a25c
GM
435 * gnutls.c (emacs_gnutls_handshake):
436 Add QUIT to make the loop interruptible.
57570cd3 437
c8d3a25c 4382012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 439
c8d3a25c
GM
440 * charset.c (init_charset): Make lack of etc/charsets fatal.
441
3e984ee8
DA
4422012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
443
444 * editfns.c (region_limit): Fix type mismatch.
445
ef884f23
DA
4462012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
447
448 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
449 undefined. Convert from xassert to eassert.
450 * nsmenu.m: Convert from xassert to eassert.
451 * nsterm.m: Likewise.
452
7d7e0027
SM
4532012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
454
455 * editfns.c (region_limit): Clip to narrowing (bug#11770).
456
aa754e6a
PE
4572012-06-28 Paul Eggert <eggert@cs.ucla.edu>
458
459 Avoid integer overflow on scroll-left and scroll-right.
460 * window.c (HSCROLL_MAX): New macro.
461 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
462 overflow when requested scroll falls outside ptrdiff_t range.
463
80b00b08
DA
4642012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
465
466 * window.h (struct window): Change type of 'hscroll',
467 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
468 'last_modified' and 'last_overlay_modified' to EMACS_INT.
469 Adjust users accordingly.
470 * xdisp.c (try_cursor_movement): Replace type check with eassert.
471 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
472 from EMACS_INT to ptrdiff_t.
473 (make_window): Omit redundant initialization.
474
62b2bcf6
JB
4752012-06-28 Juanma Barranquero <lekktu@gmail.com>
476
477 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
478
45942c7d
DA
4792012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
480
481 * window.h (struct window): Change type of 'use_time' and
482 'sequence_number' from Lisp_Object to int.
483 * frame.c (make_frame): Adjust users accordingly.
484 * print.c (print_object): Likewise.
485 * window.c (select_window, Fwindow_use_time, make_parent_window)
486 (make_window): Likewise.
487
e509cfa6
DA
4882012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
489
490 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
491 enabled with --enable-checking=[all,glyphs] configure option.
492 Fix GLYPH_DEBUG usage assuming that it may be undefined,
493 adjust comments accordingly.
494 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
495 undefined, adjust comments accordingly.
496 * image.c: Likewise.
497 * scroll.c: Likewise.
498 * w32fns.c: Likewise.
499 * w32term.c: Likewise.
500 * xdisp.c: Likewise.
501 * xfaces.c: Likewise.
502 * xfns.c: Likewise.
503 * xterm.c: Likewise.
504
a54e2c05
DA
5052012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
506
507 Generalize run-time debugging checks.
508 * dispextern.h (XASSERTS): Remove.
509 * fontset.c (xassert): Remove.
510 Convert from xassert to eassert.
511 * alloc.c: Convert from xassert to eassert.
512 * bidi.c: Likewise.
513 * dispnew.c: Likewise.
514 * fns.c: Likewise.
515 * fringe.c: Likewise.
516 * ftfont.c: Likewise.
517 * gtkutil.c: Likewise.
518 * image.c: Likewise.
519 * keyboard.c: Likewise.
520 * menu.c: Likewise.
521 * process.c: Likewise.
522 * scroll.c: Likewise.
523 * sound.c: Likewise.
524 * term.c: Likewise.
525 * w32console.c: Likewise.
526 * w32fns.c: Likewise.
527 * w32term.c: Likewise.
528 * window.c: Likewise.
529 * xdisp.c: Likewise.
530 * xfaces.c: Likewise.
531 * xfns.c: Likewise.
532 * xselect.c: Likewise.
533 * xterm.c: Likewise.
534
1ec4b7b2
SM
5352012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
536
537 * fns.c (maybe_resize_hash_table): Output message when growing the
538 purify-hashtable.
539
2014308a
DA
5402012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
541
542 * alloc.c (allocate_string_data): Remove dead code.
543 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
544 avoid GCC warning about unused macro.
545
246155eb
DA
5462012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
547
548 * alloc.c (allocate_string): Omit intervals initialization.
549 * alloc.c (make_uninit_multibyte_string): Initialize intervals
550 as in make_pure_string and make_pure_c_string.
551
43184b7b
DA
5522012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
553
d209e2fb 554 * alloc.c (allocate_string): Fix last change.
43184b7b 555
3fe6dd74
DA
5562012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
557
d209e2fb 558 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
559 to memset, add explicit initialization where appropriate.
560
1ba6038a
GM
5612012-06-27 Glenn Morris <rgm@gnu.org>
562
563 * lisp.mk (lisp): Remove paths.elc.
564
c89926a5
CY
5652012-06-27 Chong Yidong <cyd@gnu.org>
566
567 * doc.c (Fsubstitute_command_keys): Fix punctuation.
568
ed6b3510
JW
5692012-06-26 John Wiegley <johnw@newartisans.com>
570
1ec4b7b2 571 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
572 on Mac OS X Lion: __mod_init_func and __mod_term_func.
573
ed6b3510
JW
574 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
575 when building with Clang.
576
8edd4a2b
SM
5772012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
578
579 * eval.c (Fapply): Allow calling it with a single argument.
580
f6f62d1b
EZ
5812012-06-26 Eli Zaretskii <eliz@gnu.org>
582
583 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
584 _stricmp and _strnicmp.
585 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
586
62efea5e
DA
5872012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
588
589 * alloc.c (allocate_window): Zero out non-Lisp part of newly
590 allocated window.
591 (allocate_process): Likewise for new process.
8edd4a2b 592 (allocate_terminal): Change to use offsetof.
62efea5e
DA
593 (allocate_frame): Likewise.
594 * frame.c (make_frame): Omit redundant initialization.
595 * window.c (make_parent_window): Use memset.
596 (make_window): Omit redundant initialization.
597 * process.c (make_process): Omit redundant initialization.
598 * terminal.c (create_terminal): Likewise.
599
42997f4d
DA
6002012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
601
602 * term.c (delete_tty): Remove redundant call to memset.
603
1130ecfc
DA
6042012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
605
606 * alloc.c: Remove build_string.
607 * lisp.h: Define build_string as static inline. This provides
608 a better opportunity to optimize away calls to strlen when the
609 function is called with compile-time constant argument.
610 * image.c (imagemagick_error): Convert to build_string.
611 * w32proc.c (sys_spawnve): Likewise.
612 * xterm.c (x_term_init): Likewise.
613
cf38a720
PE
6142012-06-26 Paul Eggert <eggert@cs.ucla.edu>
615
99027bdd
PE
616 Use sprintf return value instead of invoking strlen on result.
617 In the old days this wasn't portable, since some sprintf
618 implementations returned char *. But they died out years ago and
619 Emacs already assumes sprintf returns int.
620 Similarly for float_to_string.
621 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
622 * ccl.c (ccl_driver):
623 * character.c (string_escape_byte8):
624 * data.c (Fnumber_to_string):
625 * doprnt.c (doprnt):
626 * print.c (print_object):
627 * xdisp.c (message_dolog):
628 * xfns.c (syms_of_xfns):
629 Use sprintf or float_to_string result to avoid need to call strlen.
630 * data.c (Fnumber_to_string):
631 Use make_unibyte_string, since the string must be ASCII.
632 * lisp.h, print.c (float_to_string): Now returns int length.
633 * term.c (produce_glyphless_glyph):
634 Use sprintf result rather than recomputing it.
635
cf38a720
PE
636 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
637 * Makefile.in (ALL_CFLAGS):
638 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
639 * gmalloc.c, regex.c: Include <config.h> unconditionally.
640
3511c784
DA
6412012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
642
0a08eb21 643 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
644 strcasecmp if available.
645 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
646
fb7da12e
AS
6472012-06-25 Andreas Schwab <schwab@linux-m68k.org>
648
649 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
650 Avoid comma operator.
651 * menu.c (push_submenu_start, push_submenu_end)
652 (push_left_right_boundary, push_menu_pane): Likewise.
653 * msdos.c (dos_rawgetc): Likewise.
654
afa2ffd8
DA
6552012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
656
657 * xfns.c (xic_create_fontsetname): Remove redundant calls
658 to memset.
659
b3b4476b
PE
6602012-06-25 Paul Eggert <eggert@cs.ucla.edu>
661
4495ff38
PE
662 * gtkutil.c (get_utf8_string): Remove redundant assignment.
663 sprintf already null-terminates its output.
664
b3b4476b
PE
665 * xfns.c (x_window): Remove redundant cast.
666
b00876c9
DA
6672012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
668
669 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
670 `const char *' to `char *' to avoid compiler warning.
671
d188e26b
PE
6722012-06-24 Paul Eggert <eggert@cs.ucla.edu>
673
885d1d74
PE
674 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
675 instead of truncating it to 63 (admittedly a generous limit).
676
d188e26b
PE
677 * process.c: Fix spelling and caps in comments.
678
e2f560b1
DN
6792012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
680
e86db54b 681 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
682 * sysdep.c (setpgrp): Remove definition, not used in this file.
683
7583a3a1
JB
6842012-06-24 Juanma Barranquero <lekktu@gmail.com>
685
686 * makefile.w32-in: Update dependencies.
687
696056c2
EZ
6882012-06-24 Eli Zaretskii <eliz@gnu.org>
689
690 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
691 (SYSTIME_H): Add nt/inc/sys/time.h.
692
693 * systime.h [WINDOWSNT]: Include sys/time.h.
694
695 * s/ms-w32.h (struct timespec): Definition moved from
696 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
697
845ca893
PE
6982012-06-24 Paul Eggert <eggert@cs.ucla.edu>
699
700 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
701 * buffer.h (buffer_slot_type_mismatch):
702 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
703 * eval.c (unwind_to_catch):
704 * image.c (my_png_error, my_error_exit):
705 * keyboard.c (quit_throw_to_read_char, user_error)
706 (Fexit_recursive_edit, Fabort_recursive_edit):
707 * lisp.h (die, args_out_of_range, args_out_of_range_3)
708 (wrong_type_argument, buffer_overflow, __executable_start)
709 (memory_full, buffer_memory_full, string_overflow, Fthrow)
710 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
711 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
712 (fatal):
713 (child_setup) [!DOS_NT]:
714 * lread.c (end_of_file_error, invalid_syntax):
715 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
716 * puresize.h (pure_write_error):
717 * search.c (matcher_overflow):
718 * sound.c (sound_perror, alsa_sound_perror):
719 * sysdep.c, syssignal.h (croak):
720 * term.c (maybe_fatal, vfatal):
721 * textprop.c (text_read_only):
722 * undo.c (user_error):
723 * unexmacosx.c (unexec_error):
724 * xterm.c (x_ins_del_lines, x_delete_glyphs):
725 Use _Noreturn rather than NO_RETURN.
726 No need for separate decl merely because of _Noreturn.
727 * sound.c (sound_warning, parse_sound):
728 Remove unnecessary forward decls.
729
f1dd8073
PE
7302012-06-24 Paul Eggert <eggert@cs.ucla.edu>
731
732 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
733 * lisp.h (WAIT_READING_MAX): New macro.
734 * dispnew.c (Fsleep_for, sit_for):
735 * keyboard.c (kbd_buffer_get_event):
736 * process.c (Faccept_process_output):
737 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
738 This improves on the previous patch, which introduced a bug
739 when time_t is unsigned and as wide as intmax_t.
740 See <http://bugs.gnu.org/9000#51>.
741
b82c1755
EZ
7422012-06-23 Eli Zaretskii <eliz@gnu.org>
743
744 * dispnew.c (sit_for, Fsleep_for):
745 * keyboard.c (kbd_buffer_get_event):
746 * process.c (Faccept_process_output): Avoid compiler warnings when
747 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
748
ca300656
JB
7492012-06-23 Juanma Barranquero <lekktu@gmail.com>
750
049ec95b
JB
751 * makefile.w32-in: Update dependencies.
752
ca300656
JB
753 * w32.c (ltime): Add return type and declare static.
754 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
755
db7b8d06
PE
7562012-06-23 Paul Eggert <eggert@cs.ucla.edu>
757
758 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
759 Privately reported by Herbert J. Skuhra.
760 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
761 All uses changed.
762 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
763 not make_lisp_timeval, when the argument is of type EMACS_TIME.
764
0bd8297f
EZ
7652012-06-23 Eli Zaretskii <eliz@gnu.org>
766
96512555
EZ
767 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
768 last argument of make_unibyte_string.
769
0bd8297f
EZ
770 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
771 language ID in the event parameters.
772
773 * w32term.c (w32_read_socket): Put the new keyboard codepage into
774 event.code, not the obscure "character set ID".
775
63def6b6
CY
7762012-06-23 Chong Yidong <cyd@gnu.org>
777
778 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
779
e8a02204
EZ
7802012-06-23 Eli Zaretskii <eliz@gnu.org>
781
388cdec0
EZ
782 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
783 * w32.c (fdutimens): New function.
784
785 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
786
787 * s/ms-w32.h (pselect): Redirect to sys_select.
788
789 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
790
e8a02204
EZ
791 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
792 in the logic of incrementing and decrementing the value of
793 use_relocatable_buffers.
794
d054f3fb
PE
7952012-06-23 Paul Eggert <eggert@cs.ucla.edu>
796
797 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
798 Privately reported by Herbert J. Skuhra.
799 [__FreeBSD__]: Remove "*/" typo after "#include".
800 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
801 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
802 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
803 Don't assume EMACS_TIME and struct timeval are the same type.
804
d35af63c
PE
8052012-06-22 Paul Eggert <eggert@cs.ucla.edu>
806
807 Support higher-resolution time stamps (Bug#9000).
808 The time stamps are only nanosecond-resolution at the C level,
809 since that's the best that any real-world system supports now.
810 But they are picosecond-resolution at the Lisp level, as that's
811 easy, and leaves room for future OS improvements.
812
813 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
814 (LIBES): Use it.
815
816 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
817 Don't get current time unless it's needed.
818
819 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
820 now provides it if it's absent.
821 (start_atimer): Port to higher-res time stamps.
822 Check for time stamp overflow. Don't get current time more
823 often than is needed.
824
825 * buffer.h (struct buffer): Buffer modtime now has high resolution.
826 Include systime.h, not time.h.
827 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
828
829 * dired.c: Include stat-time.h.
830 (Ffile-attributes): File times now have higher resolution.
831
832 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
833 (struct image): Timestamp now has higher resolution.
834
835 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
836 has at least microseconds now. All uses removed.
837 (update_frame, update_single_window, update_window, update_frame_1)
838 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
839
840 * editfns.c (time_overflow): Now extern.
841 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
842 (float-time, Fformat_time_string, Fcurrent_time_string)
843 (Fcurrent_time_zone): Accept and generate higher-resolution
844 time stamps.
845 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
846 (decode_time_components, lisp_seconds_argument): New functions.
847 (make_time): Now static.
848 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
849 Report an error if the time is invalid, rather than having the caller
850 do that.
851
852 * fileio.c: Include <stat-time.h>
853 (Fcopy_file): Copy higher-resolution time stamps.
854 Prefer to set the time stamp via a file descriptor if that works.
855 (Fset_file_times, Finsert_file_contents, Fwrite_region)
856 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
857 (Fvisited_file_modtime, Fset_visited_file_modtime):
858 Support higher-resolution time stamps.
859
860 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
861
862 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
863
864 * image.c (prepare_image_for_display, clear_image_cache)
865 (lookup_image): Port to higer-resolution time stamps.
866
867 * keyboard.c (start_polling, bind_polling_period):
868 Check for time stamp overflow.
869 (read_char, kbd_buffer_get_event, timer_start_idle)
870 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
871 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
872 Port to higher-resolution time stamps. Do not assume time_t is signed.
873 (decode_timer): New function. Timers are now vectors of length 9,
874 not 8, to accommodate the picosecond component.
875 (timer_check_2): Use it.
876
877 * nsterm.m (select_timeout, timeval_subtract): Remove.
878 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
879 as they're a bit more accurate and handle overflow better.
880 (ns_select): Change prototype to be compatible with pselect.
881 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
882 * nsterm.h (ns_select): Adjust prototype.
883
884 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
885 us-resolution time stamps.
886 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
887
888 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
889
890 * lisp.h (time_overflow): New decl.
891 (wait_reading_process_output): First arg is now intmax_t, not int,
892 to accommodate larger waits.
893
894 * process.h (struct Lisp_Process.read_output_delay):
895 Now counts nanoseconds, not microseconds.
896 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
897 EMACS_HAS_USECS.
898 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
899 (wait_reading_process_output):
900 Port to ns-resolution time stamps.
901 (Faccept_process_output, wait_reading_process_output):
902 Check for time stamp overflow. Do not assume time_t is signed.
903 (select_wrapper): Remove; we now use pselect.
904 (Fprocess_attributes): Now generates ns-resolution time stamps.
905
906 * sysdep.c: Include utimens.h. Don't include utime.h
907 or worry about struct utimbuf; gnulib does that for us now.
908 (gettimeofday): Remove; gnulib provides a substitute.
909 (make_timeval): New function.
910 (set_file_times): Now sets ns-resolution time stamps.
911 New arg FD; all uses changed.
912 (time_from_jiffies, ltime_from_jiffies, get_up_time)
913 (system_process_attributes):
914 Now returns ns-resolution time stamp. All uses changed.
915 Check for time stamp overflow.
916
917 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
918 provides a substitute now.
919
920 * systime.h: Include timespec.h rather than sys/time.h and time.h,
921 since it guarantees struct timespec.
922 (EMACS_TIME): Now struct timespec, so that we can support
923 ns-resolution time stamps.
924 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
925 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
926 (EMACS_USECS): Remove.
927 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
928 so multiply the arg by 1000 before storing it.
929 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
930 New macros.
931 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
932 Port to ns-resolution time stamps.
933 (EMACS_TIME_NEG_P): Remove; replaced by....
934 (EMACS_TIME_SIGN): New macro.
935 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
936 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
937 (set_file_times, make_time, lisp_time_argument): Adjust signature.
938 (make_timeval, make_lisp_time, decode_time_components): New decls.
939 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
940 that it mishandled time_t overflow. You can't compare by subtracting!
941 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
942 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
943
944 * term.c: Include <sys/time.h>.
945 (timeval_to_Time): New function, for proper overflow wraparound.
946 (term_mouse_position, term_mouse_click): Use it.
947
948 * undo.c (record_first_change): Support higher-resolution time stamps
949 in the undo buffer.
950 (Fprimitive_undo): Use them when restoring time stamps.
951
952 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
953 (w32_get_internal_run_time):
954 Port to higher-resolution Emacs time stamps.
955 (ltime): Now accepts single 64-bit integer, as that's more convenient
956 for callers.
957
958 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
959
960 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
961 for compatibility with pselect. Support ns-resolution time stamps.
962
963 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
964
965 * xselect.c (wait_for_property_change, x_get_foreign_selection):
966 Check for time stamp overflow, and support ns-resolution time stamps.
967
968 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
969 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
970 (timeval_subtract): Remove; no longer needed.
971 (XTflash, XTring_bell, x_wait_for_event):
972 Port to ns-resolution time stamps. Don't assume time_t is signed.
973
b6a92dfe
CY
9742012-06-22 Chong Yidong <cyd@gnu.org>
975
976 * xdisp.c (x_consider_frame_title): Revert last change.
977
d251c37c
EZ
9782012-06-22 Eli Zaretskii <eliz@gnu.org>
979
980 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
981 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
982 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
983 staticidx goes up to 1597 out of 1600 = 0x640.)
984
f10deafb
PE
9852012-06-20 Paul Eggert <eggert@cs.ucla.edu>
986
987 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
988 Otherwise, the umask might be mistakenly 0 while handling input signals.
989
ec6de1e2
SM
9902012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
991
992 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
993
28be1ada
DA
9942012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
995
996 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
997 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
998 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
999 access to `contents' member of Lisp_Vector objects with AREF and ASET
1000 where appropriate.
1001
c6bf3022
CY
10022012-06-19 Chong Yidong <cyd@gnu.org>
1003
1004 * frame.c (delete_frame): When selecting a frame on a different
1005 text terminal, do not alter the terminal's top-frame.
1006
1007 * xdisp.c (format_mode_line_unwind_data): Record the target
1008 frame's selected window and its terminal's top-frame.
1009 (unwind_format_mode_line): Restore them.
1010 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
1011 Callers changed.
1012 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
1013 since tty frames can be explicitly named.
1014 (prepare_menu_bars): Likewise.
1015
1016 * term.c (Ftty_top_frame): New function.
1017
defd4196
PE
10182012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1019
1020 Port byte-code-meter to modern targets.
1021 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
1022 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 1023 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
1024 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
1025 (METER_1, METER_2): Simplify.
1026
1053a871
SM
10272012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
1028
1029 * data.c (Fdefalias): Return `symbol' (bug#11686).
1030
b7e8d081
MR
10312012-06-18 Martin Rudalics <rudalics@gmx.at>
1032
1033 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
1034 gets killed during executing of this function (Bug#11665).
1035 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
1036 (Vkill_buffer_query_functions): In doc-string say that functions
1037 run by this hook should not change the current buffer.
1038
7ea2b339
PE
10392012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1040
1041 Fix recently-introduced process.c problems found by static checking.
1042 * process.c (write_queue_push, write_queue_pop, send_process):
1043 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
1044 (write_queue_pop): Fix pointer signedness problem.
1045 (send_process): Remove unused local.
1046
96a313a1
CY
10472012-06-17 Chong Yidong <cyd@gnu.org>
1048
1049 * xdisp.c (redisplay_internal): No need to redisplay terminal
1050 frames that are not on top.
1051
20ca2e94
TN
10522012-06-17 Troels Nielsen <bn.troels@gmail.com>
1053
1054 * process.c (make_process): Initialize write_queue.
1055 (write_queue_push, write_queue_pop): New functions.
1056 (send_process): Use them to maintain correct ordering of process
1057 writes (Bug#10815).
1058
9a900ca9
PE
10592012-06-17 Paul Eggert <eggert@cs.ucla.edu>
1060
310fbfa8
PE
1061 * lisp.h (eassert): Assume C89 or later.
1062 This removes the need for CHECK.
1063 (CHECK): Remove. Its comments about always evaluating its
1064 argument were confusing, as 'eassert' typically does not evaluate
1065 its argument.
1066
27bb1ca4
PE
1067 * coding.c (produce_chars): Use ptrdiff_t, not int.
1068
9a900ca9
PE
1069 * xterm.c (x_draw_underwave): Check for integer overflow.
1070 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
1071
41b7f8bc 10722012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
1073
1074 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
1075 referenced (Bug#11583).
1076
9b0e3eba
AA
10772012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
1078
1079 Implement wave-style variant of underlining.
1080 * dispextern.h (face_underline_type): New enum.
1081 (face): Add field for underline type.
1082 * nsterm.m (ns_draw_underwave): New function.
1083 (ns_draw_text_decoration): Use it.
1084 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
1085 New functions.
1086 (x_draw_glyph_string): Use them.
1087 * xfaces.c (Qline, Qwave): New Lisp objects.
1088 (check_lface_attrs, merge_face_ref)
1053a871
SM
1089 (Finternal_set_lisp_face_attribute, realize_x_face):
1090 Handle wave-style underline face attributes.
9b0e3eba
AA
1091 * xterm.c (x_draw_underwave): New function.
1092 (x_draw_glyph_string): Use it.
1093
0fb52f11
JB
10942012-06-16 Juanma Barranquero <lekktu@gmail.com>
1095
1096 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
1097 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
1098 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
1099 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
1100 ($(BLD)/w32select.$(O)): Update dependencies.
1101
e5560ff7
AS
11022012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1103
1104 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
1105 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
1106 * character.c (_fetch_multibyte_char_p): Remove.
1107 * alloc.c: Include "character.h" before "buffer.h".
1108 * bidi.c: Likewise.
1109 * buffer.c: Likewise.
1110 * bytecode.c: Likewise.
1111 * callint.c: Likewise.
1112 * callproc.c: Likewise.
1113 * casefiddle.c: Likewise.
1114 * casetab.c: Likewise.
1115 * category.c: Likewise.
1116 * cmds.c: Likewise.
1117 * coding.c: Likewise.
1118 * composite.c: Likewise.
1119 * dired.c: Likewise.
1120 * dispnew.c: Likewise.
1121 * doc.c: Likewise.
1122 * dosfns.c: Likewise.
1123 * editfns.c: Likewise.
1124 * emacs.c: Likewise.
1125 * fileio.c: Likewise.
1126 * filelock.c: Likewise.
1127 * font.c: Likewise.
1128 * fontset.c: Likewise.
1129 * fringe.c: Likewise.
1130 * indent.c: Likewise.
1131 * insdel.c: Likewise.
1132 * intervals.c: Likewise.
1133 * keyboard.c: Likewise.
1134 * keymap.c: Likewise.
1135 * lread.c: Likewise.
1136 * macros.c: Likewise.
1137 * marker.c: Likewise.
1138 * minibuf.c: Likewise.
1139 * nsfns.m: Likewise.
1140 * nsmenu.m: Likewise.
1141 * print.c: Likewise.
1142 * process.c: Likewise.
1143 * regex.c: Likewise.
1144 * region-cache.c: Likewise.
1145 * search.c: Likewise.
1146 * syntax.c: Likewise.
1147 * term.c: Likewise.
1148 * textprop.c: Likewise.
1149 * undo.c: Likewise.
1150 * unexsol.c: Likewise.
1151 * w16select.c: Likewise.
1152 * w32fns.c: Likewise.
1153 * w32menu.c: Likewise.
1154 * window.c: Likewise.
1155 * xdisp.c: Likewise.
1156 * xfns.c: Likewise.
1157 * xmenu.c: Likewise.
1158 * xml.c: Likewise.
1159 * xselect.c: Likewise.
1160
2f07e6af
EZ
11612012-06-16 Eli Zaretskii <eliz@gnu.org>
1162
1053a871
SM
1163 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
1164 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 1165 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
1166 row.
1167 (handle_face_prop): Use chunk-relative overlay string index when
1168 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
1169 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
1170 the rightmost. (Bug#11720)
2f07e6af 1171
29b83cec
AS
11722012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1173
1174 * category.h (CHAR_HAS_CATEGORY): Define as inline.
1175 (CATEGORY_MEMBER): Enforce 1/0 value.
1176 * category.c (_temp_category_set): Remove.
1177
4c5501e9
EZ
11782012-06-16 Eli Zaretskii <eliz@gnu.org>
1179
1180 * window.c (Fdelete_other_windows_internal)
1181 (Fdelete_window_internal): Don't access frame's mouse highlight
1182 info of the initial frame. (Bug#11677)
1183
2b570124
PE
11842012-06-14 Paul Eggert <eggert@cs.ucla.edu>
1185
e93864f9
PE
1186 * .gdbinit (xgetint): Fix recently-introduced paren typo.
1187 Assume USE_2_TAGS_FOR_INTS.
1188 (xreload): Adjust $tagmask width to match recent lisp.h change.
1189
2b570124
PE
1190 Simplify lisp.h in minor ways that should not affect code.
1191 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
1192 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
1193 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
1194 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
1195 (INTTYPEBITS): New macro, for clarity.
1196 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
1197 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
1198 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
1199 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
1200 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
1201
81755f69
JB
12022012-06-13 Juanma Barranquero <lekktu@gmail.com>
1203
1204 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
1205
16192a57
GM
12062012-06-13 Glenn Morris <rgm@gnu.org>
1207
1208 * s/bsd-common.h (BSD4_3):
1209 * s/usg5-4-common.h (USG5_4): No longer define; unused.
1210
646b5f55
AS
12112012-06-13 Andreas Schwab <schwab@linux-m68k.org>
1212
1213 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
1214 instead of union.
1215 (XLI, XIL): Define.
1053a871
SM
1216 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
1217 Use them.
1218 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 1219 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 1220 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
1221 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
1222 * frame.c (delete_frame): Remove outdated comment.
1223 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
1224 USE_LISP_UNION_TYPE.
1225 (Fw32_unregister_hot_key): Likewise.
1226 (Fw32_toggle_lock_key): Likewise.
1227 * w32menu.c (add_menu_item): Likewise.
1228 (w32_menu_display_help): Use XIL instead of checking
1229 USE_LISP_UNION_TYPE.
1230 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
1231 (init_heap): Likewise.
1232 * w32term.c (w32_read_socket): Update comment.
1233
1d3823c9
GM
12342012-06-13 Glenn Morris <rgm@gnu.org>
1235
c62ff706
GM
1236 * s/usg5-4-common.h, src/s/unixware.h:
1237 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
1238
1d3823c9
GM
1239 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
1240
bfe3e0a2
PE
12412012-06-13 Paul Eggert <eggert@cs.ucla.edu>
1242
1243 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
1244 * alloc.c (make_number) [!defined make_number]:
1245 Remove, as lisp.h always defines this now.
1246 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
1247 (roundup_size): Verify that it is a power of 2.
1248 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
1249 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
1250 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
1251 -DUSE_LSB_TAG=0, to override the automatically-selected default.
1252 USE_LSB_TAG now is always defined to be either 0 or 1.
1253 All uses changed.
1254 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
1255 code works fine either way, and efficiency is not a concern here,
1256 as the union type is for debugging, not for production.
1257 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
1258 Use an inline function on all platforms when using the union type,
1259 since this is simpler and 'static inline' can be used portably
1260 within Emacs now.
1261 (LISP_INITIALLY_ZERO): New macro.
1262 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
1263 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
1264
45fa9c0f
GM
12652012-06-12 Glenn Morris <rgm@gnu.org>
1266
b4492cba
GM
1267 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
1268
1269 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 1270
45fa9c0f
GM
1271 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
1272 Move BROKEN_SIGIO to configure.
1273
1274 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
1275 Move NO_TERMIO to configure.
1276
0e25d334
CY
12772012-06-12 Chong Yidong <cyd@gnu.org>
1278
1279 * image.c (imagemagick_load_image): Use MagickFlattenImage if
1280 MagickMergeImageLayers is undefined. Use pixel pusher loop if
1281 MagickExportImagePixels is undefined.
1282
43682bb6
PE
12832012-06-12 Paul Eggert <eggert@cs.ucla.edu>
1284
1285 * image.c (imagemagick_load_image): Remove unused label.
1286
a9be7d2b
GM
12872012-06-11 Glenn Morris <rgm@gnu.org>
1288
1289 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1290 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
1291 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
1292 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
1293
3017f87f
SM
12942012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
1295
1296 * alloc.c (make_byte_code): New function.
1297 (Fmake_byte_code): Use it. Don't purify here.
1298 * lread.c (read1): Use it as well to avoid extra allocation.
1299
1b9b4cf4
CY
13002012-06-11 Chong Yidong <cyd@gnu.org>
1301
1302 * image.c (imagemagick_load_image): Implement transparency.
1303
95988fcf
AS
13042012-06-10 Andreas Schwab <schwab@linux-m68k.org>
1305
1306 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
1307 account for preceding backslashes. (Bug#11663)
1308
cd4eb164
CY
13092012-06-09 Chong Yidong <cyd@gnu.org>
1310
1311 * term.c: Support italics in capable terminals (Bug#9652).
1312 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
1313 (turn_on_face): Output using TS_enter_italic_mode if available.
1314 Don't handle unused blinking and alt-charset cases.
1315 (turn_off_face): Handle italic case; discard unused tty_blinking_p
1316 and tty_alt_charset_p cases.
1317 (tty_capable_p, init_tty): Support italics.
1318
1319 * termchar.h (struct tty_display_info): Add field for italics.
1320 Remove unused blink field.
1321
1322 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
1323 Handle slant.
1324
1325 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
1326 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
1327 tty_alt_charset_p. Add tty_italic_p.
1328
ff88beb8
MA
13292012-06-09 Michael Albinus <michael.albinus@gmx.de>
1330
1331 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
1332 dbus_type_is_basic if available.
1333 (xd_extract_signed, xd_extract_unsigned): Rename from
1334 extract_signed and extract_unsigned, respectively. Adapt callers.
1335
44286096
CY
13362012-06-09 Chong Yidong <cyd@gnu.org>
1337
1682701f
CY
1338 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
1339
44286096
CY
1340 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
1341 case (Bug#9752).
1342
d86feb17
PE
13432012-06-08 Paul Eggert <eggert@cs.ucla.edu>
1344
1345 * xdisp.c (vmessage): Treat frame message as multibyte.
1346 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
1347 would generate the diagnostic "Making \302\247 buffer-local while
1348 let-bound!".
1349
d5c20fe8
EZ
13502012-06-08 Eli Zaretskii <eliz@gnu.org>
1351
1352 * dispnew.c (showing_window_margins_p): Undo last change, which
1353 was done due to an inadvertent commit.
1354 (adjust_frame_glyphs_for_frame_redisplay): Do call
1355 showing_window_margins_p.
1356
513749ee
SM
13572012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
1358
1359 * eval.c (Fmake_var_non_special): New primitive.
1360 (syms_of_eval): Defsubr it.
1361 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
1362
d4a8f5c1
JB
13632012-06-08 Juanma Barranquero <lekktu@gmail.com>
1364
1365 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
1366 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
1367
8bbbc977
EZ
13682012-06-08 Eli Zaretskii <eliz@gnu.org>
1369
1370 * alloc.c (allocate_vectorlike): Fix last change.
1371
f3372c87
DA
13722012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
1373
1374 Block-based vector allocation of small vectors.
1375 * lisp.h (struct vectorlike_header): New field `nbytes',
1376 adjust comment accordingly.
1377 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
1378 to denote vector blocks. Adjust users (live_vector_p,
1379 mark_maybe_pointer, valid_lisp_object_p) accordingly.
1380 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
1381 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
1382 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
1383 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
1384 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
1385 (roundup_size): New constant.
1386 (struct vector_block): New data type.
1387 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 1388 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
1389 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
1390 (sweep_vectors): New functions.
1391 (allocate_vectorlike): Return `zero_vector' as the only vector of
1392 0 items. Allocate new vector from block if vector size is less than
1393 or equal to VBLOCK_BYTES_MAX.
1394 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
1395 (init_alloc_once): Add call to init_vectors.
1396
4f18a4ed
SM
13972012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
1398
1399 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
1400
86f158bc
PE
14012012-06-07 Paul Eggert <eggert@cs.ucla.edu>
1402
1403 * doprnt.c (doprnt): Truncate multibyte char correctly.
1404 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
1405 would mishandle a string argument "Xc" if X was a multibyte
1406 character of length 2: it would truncate after X's first byte
1407 rather than including all of X.
1408
c5cfcbe0
CY
14092012-06-06 Chong Yidong <cyd@gnu.org>
1410
1411 * buffer.c (word_wrap): Doc fix.
1412
c05cf390
PE
14132012-06-04 Paul Eggert <eggert@cs.ucla.edu>
1414
1415 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
1416
0c3461de
GM
14172012-06-03 Glenn Morris <rgm@gnu.org>
1418
1419 * xdisp.c (tool-bar-style): Doc fix.
1420
c71232db
UM
14212012-06-03 Ulrich Müller <ulm@gentoo.org>
1422
1423 * Makefile.in (PAXCTL): Define.
1424 (temacs$(EXEEXT)): Disable memory randomization for the temacs
1425 binary via PaX flags if the paxctl utility is available.
1426 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1427 Restore PaX flags to their default. (Bug#11398)
1428
383f7350
CY
14292012-06-03 Chong Yidong <cyd@gnu.org>
1430
1431 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
1432 buffer (Bug#11226).
1433
5f2c76c6
CY
14342012-06-03 Chong Yidong <cyd@gnu.org>
1435
1436 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
1437 (note_mode_line_or_margin_highlight): If there is no help echo,
1438 use mode-line-default-help-echo. Handle the case where the mouse
1439 position is past the end of the mode line string.
1440
1441 * buffer.c (buffer_local_value_1): New function, split from
1442 Fbuffer_local_value; can return Qunbound.
1443 (Fbuffer_local_value): Use it.
1444 (Vmode_line_format): Docstring tweaks.
1445
773d47f6
PE
14462012-06-02 Paul Eggert <eggert@cs.ucla.edu>
1447
1448 * sysdep.c (system_process_attributes): Improve comment.
1449
f2d6a3df
SM
14502012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
1451
1452 * keyboard.c: Export real-this-command to Elisp.
1453 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
1454 and DEFVAR it. Update all users.
1455
63810350
PE
14562012-06-02 Paul Eggert <eggert@cs.ucla.edu>
1457
7bd5c1f4
PE
1458 * minibuf.c (Fassoc_string): Remove duplicate declaration.
1459
63810350
PE
1460 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
1461 Convert pctcpu and pctmem to Lisp float properly.
1462 Let the compiler fold better, as 100.0/0x8000 is exact.
1463
a2821611
AS
14642012-06-02 Andreas Schwab <schwab@linux-m68k.org>
1465
1466 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
1467 cons_block.
1468
5fceba1d
PE
14692012-06-01 Paul Eggert <eggert@cs.ucla.edu>
1470
1471 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
1472
c98ff5dd
DA
14732012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
1474
1475 For a 'struct window', replace some Lisp_Object fields to
1476 bitfields where appropriate, remove unused fields.
1477 * window.h (struct window): Remove unused 'last_mark_x' and
1478 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1479 change it's type from Lisp_Object to bitfield.
1480 Change type of 'force_start', 'optional_new_start',
1481 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
1482 fields from Lisp_Object to bitfield. Adjust users accordingly.
1483
ca34e0be
PE
14842012-05-31 Paul Eggert <eggert@cs.ucla.edu>
1485
1486 Pacify gcc -Wdouble-precision when using Xaw.
1487 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
1488 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
1489 Use 'float' consistently, rather than 'float' in most places
1490 and 'double' in a couple of places.
1491
efc00ab1 14922012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
1493
1494 * xdisp.c (handle_stop): Detect whether we have overlay strings
1495 loaded by testing it->current.overlay_string_index to be
1496 non-negative, instead of checking whether n_overlay_strings is
1497 positive. (Bug#11587)
1498
efc00ab1 14992012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
1500
1501 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
1502
1503 * doc.c (Fsubstitute_command_keys): Doc fix.
1504
efc00ab1 15052012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
1506
1507 * search.c (search_buffer): Remove calls to
1508 r_alloc_inhibit_buffer_relocation, as it is now called by
1509 maybe_unify_char, which was the cause of relocation of buffer text
1510 in bug#11519.
1511
efc00ab1 15122012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
1513
1514 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
1515 for the duration of call to load_charset, to avoid problems with
1516 callers of maybe_unify_char that access buffer text through C
1517 pointers.
1518
1519 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
1520 decrement the inhibition flag, instead of just setting or
1521 resetting it.
1522
ba93a187
PE
15232012-05-31 Paul Eggert <eggert@cs.ucla.edu>
1524
1525 Remove obsolete '#define static' cruft.
1526 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
1527 This #undef was "temporary" in 2000; it is no longer needed
1528 now that '#define static' has gone away.
1529 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
1530 (gray_bitmap_bits): Remove; no longer needed.
1531 All uses replaced with definiens.
1532 * xterm.c: Include "bitmaps/gray.xbm".
1533
9e4bf381
PE
15342012-05-30 Paul Eggert <eggert@cs.ucla.edu>
1535
1536 Clean up __executable_start, monstartup when --enable-profiling.
1537 The following changes affect the code only when profiling.
1538 * dispnew.c (__executable_start): Rename from safe_bcopy.
1539 Define only on platforms that need it.
1540 * emacs.c: Include <sys/gmon.h> when profiling.
1541 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
1542 (__executable_start): Remove decl, since lisp.h does it now.
1543 (safe_bcopy): Remove decl; no longer has that name.
1544 (main): Coalesce #if into single bit of code, for simplicity.
1545 Cast pointers to uintptr_t, since standard libraries want integers
1546 and not pointers.
1547 * lisp.h (__executable_start): New decl.
1548
32d72c2f
GM
15492012-05-31 Glenn Morris <rgm@gnu.org>
1550
1551 * image.c (Fimagemagick_types): Doc fix.
1552
baac5bc7
JM
15532012-05-30 Jim Meyering <meyering@redhat.com>
1554
1555 * callproc.c (Fcall_process_region): Include directory component
1556 in mkstemp error message (Bug#11586).
1557
72cb32cf
PE
15582012-05-30 Paul Eggert <eggert@cs.ucla.edu>
1559
1560 * alloc.c, lisp.h (make_pure_vector): Now static.
1561
61b108cc
SM
15622012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
1563
1564 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
1565 Move to byte-run.el.
1566 (Fautoload): Do the hash-doc more carefully.
1567 * data.c (Fdefalias): Purify definition, except for keymaps.
1568 (Qdefun): Move from eval.c.
1569 * lisp.h (Qdefun): Remove.
1570 * lread.c (read1): Tiny simplification.
1571
471fe23d
TN
15722012-05-29 Troels Nielsen <bn.troels@gmail.com>
1573
934f3f58 1574 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
1575 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
1576 Bug#9642, but explicitly check that the buffer the overlay would
1577 be moved to is live and rearrange lines to make sure that errors
1578 will not put the overlay in an inconsistent state.
1579 (Fdelete_overlay): Cosmetics.
1580
85d0efd1
EZ
15812012-05-28 Eli Zaretskii <eliz@gnu.org>
1582
1583 * w32term.c (my_bring_window_to_top): New function.
1584 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
1585 could be different from the original one.
1586 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
1587 (Bug#11513)
1588
1589 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
1590 by calling BringWindowToTop.
1591
1592 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
1593 (WM_EMACS_END): Increase by one.
1594
da92a98c
PE
15952012-05-28 Paul Eggert <eggert@cs.ucla.edu>
1596
1597 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
1598 This avoids undefined behavior that might cause the eassert
1599 to not catch an out-of-range value.
1600
74d1f848
JB
16012012-05-28 Juanma Barranquero <lekktu@gmail.com>
1602
1603 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
1604 Update dependencies.
1605
9e1a06fc
EZ
16062012-05-27 Eli Zaretskii <eliz@gnu.org>
1607
1608 * bidi.c (bidi_mirror_char): Fix last change.
1609
f3dd7312
AS
16102012-05-27 Andreas Schwab <schwab@linux-m68k.org>
1611
1612 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
1613 when referring to sectname field in printf format.
1614
81899c91
PE
16152012-05-27 Paul Eggert <eggert@cs.ucla.edu>
1616
57b81a9f
PE
1617 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
1618 Only r_alloc_inhibit_buffer_relocation needed to be added;
1619 the others were already declared.
1620
81899c91
PE
1621 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
1622 before checking whether it's out of range. Put the check inside
1623 eassert. See
1624 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
1625
33017faf 16262012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
1627
1628 * callproc.c (Fcall_process): Restore a line that was accidentally
1629 commented out in the 2011-02-13 change (bug#11547).
1630
33017faf 16312012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
1632
1633 * lisp.h [REL_ALLOC]: Add prototypes for external functions
1634 defined on ralloc.c.
1635
1636 * buffer.c [REL_ALLOC]: Remove prototypes of
1637 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
1638 they are now on lisp.h.
1639
1640 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
1641
1642 * search.c (search_buffer): Use it to inhibit relocation of buffer
1643 text while re_search_2 is doing its job, because re_search_2 is
1644 passed C pointers to buffer text. (Bug#11519)
1645
23415acf
EZ
1646 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
1647 Update value to 24.
1648
44e27368
EZ
1649 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
1650 state after an additional call to move_it_in_display_line_to, keep
1651 the values of it->max_ascent and it->max_descent found for the
1652 entire line.
1653 (pos_visible_p): Revert the comparison against bottom_y to what it
1654 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
1655 (Bug#11464)
1656
c1892f11
PE
16572012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1658
1659 Fix coding-related core dumps with gcc -ftrapv.
1660 The code was computing A - B, where A and B are pointers, and B is
1661 random garbage. This can lead to core dumps on platforms that
1662 have special pointer registers, and it also leads to core dumps on
1663 x86-64 when compiled with gcc -ftrapv. The fix is to compute
1664 A - B only when B is initialized properly.
1665 * coding.c (coding_set_source, coding_set_destination): Return void.
1666 (coding_change_source, coding_change_destinations): New functions,
1667 with the old behaviors of coding_set_source and coding_set_destination.
1668 All callers that need an offset changed to use these new functions.
1669
eb7afdad
GM
16702012-05-26 Glenn Morris <rgm@gnu.org>
1671
1672 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
1673
f12fdf02
EZ
16742012-05-26 Eli Zaretskii <eliz@gnu.org>
1675
53a63be6 1676 Extend mouse support on W32 text-mode console.
61b108cc
SM
1677 * xdisp.c (draw_row_with_mouse_face):
1678 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 1679
eb3f6f01 1680 * w32console.c: Include window.h.
61b108cc
SM
1681 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
1682 New functions.
eb3f6f01
EZ
1683 (initialize_w32_display): Initialize mouse-highlight data.
1684
53a63be6
EZ
1685 * w32inevt.c: Include termchar.h and window.h.
1686 (do_mouse_event): Support mouse-autoselect-window. When the mouse
1687 moves, call note_mouse_highlight. If help_echo changed, call
1688 gen_help_event to produce help-echo message in the echo area.
1689 Call clear_mouse_face if mouse_face_hidden is set in the mouse
1690 highlight info.
1691
4cfd81f6
PE
16922012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1693
1694 * lread.c (read1): Simplify slightly to avoid an overflow warning
1695 with GCC 4.7.0 on x86-64.
1696
4446092a
EZ
16972012-05-26 Eli Zaretskii <eliz@gnu.org>
1698
1699 * bidi.c (bidi_mirror_char): Revert last change: an int is
1700 definitely wide enough here.
1701
42b2a986 17022012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 1703
42b2a986 1704 Fix integer width and related bugs (Bug#9874).
eb106a49 1705 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
1706 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
1707 (string_bytes, check_sblock, allocate_string_data):
1708 (compact_small_strings, Fmake_bool_vector, make_string)
1709 (make_unibyte_string, make_multibyte_string)
1710 (make_string_from_bytes, make_specified_string)
1711 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
1712 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
1713 (mark_vectorlike):
1714 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1715 (allocate_pseudovector):
1716 Use int, not EMACS_INT, where int is wide enough.
1717 (inhibit_garbage_collection, Fgarbage_collect):
1718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1719 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
1720 int might not be wide enough.
1721 (bidi_cache_search, bidi_cache_find, bidi_init_it)
1722 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1723 (bidi_at_paragraph_end, bidi_find_paragraph_start)
1724 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
1725 (bidi_level_of_next_char, bidi_move_to_visually_next):
1726 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1727 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
1728 (Fkill_buffer, Fset_buffer_major_mode)
1729 (advance_to_char_boundary, Fbuffer_swap_text)
1730 (Fset_buffer_multibyte, overlays_at, overlays_in)
1731 (overlay_touches_p, struct sortvec, record_overlay_string)
1732 (overlay_strings, recenter_overlay_lists)
1733 (adjust_overlays_for_insert, adjust_overlays_for_delete)
1734 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
1735 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
1736 (Foverlay_recenter, last_overlay_modification_hooks_used)
1737 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
1738 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
1739 (validate_region): Omit unnecessary test for b <= e,
1740 since that's guaranteed by the previous test.
d311d28c
PE
1741 (adjust_overlays_for_delete): Avoid pos + length overflow.
1742 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
1743 (report_overlay_modification):
1744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1745 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
1746 Omit pointer cast, which isn't needed anyway, and doesn't work
1747 after the EMACS_INT -> ptrdiff_t change.
02481186 1748 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
1749 * buffer.h: Adjust decls to match defn changes elsewhere.
1750 (struct buffer_text, struct buffer):
1751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1752 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
1753 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
1754 not int, to avoid needless 32-bit limit on 64-bit hosts.
1755 (exec_byte_code): Use tighter memory-full test, one that checks
1756 for alloca overflow. Don't compute the address of the object just
1757 before an array, as that's not portable. Use EMACS_INT, not
1758 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
1759 * callint.c (Fcall_interactively):
1760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1761 * callproc.c (call_process_kill, Fcall_process):
1762 Don't assume pid_t fits into an Emacs fixnum.
1763 (call_process_cleanup, Fcall_process, child_setup):
1764 Don't assume pid_t fits into int.
1765 (call_process_cleanup, Fcall_process, delete_temp_file)
1766 (Fcall_process_region):
1767 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1768 (Fcall_process): Simplify handling of volatile integers.
1769 Use int, not EMACS_INT, where int will do.
1770 * casefiddle.c (casify_object, casify_region, operate_on_word)
1771 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
1772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1773 (casify_object): Avoid integer overflow when overallocating buffer.
1774 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 1775 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
1776 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
1777 * category.h (CATEGORYP): Don't assume arg is nonnegative.
1778 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
1779 integers are now checked earlier. All uses replaced with XINT.
1780 (ccl_driver):
1781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1782 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
1783 (ccl_driver, Fregister_code_conversion_map):
1784 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
1785 (resolve_symbol_ccl_program): Check that vector header is in range.
1786 Always copy the vector, so that we can check its contents reliably
1787 now rather than having to recheck each instruction as it's being
1788 executed. Check that vector words fit in 'int'.
1789 (ccl_get_compiled_code, Fregister_ccl_program)
1790 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
1791 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
1792 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
1793 contents are in range.
1794 (Fccl_execute_on_string): Check that status is in range.
1795 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
1796 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
1797 Accept and return EMACS_INT, not int, because callers can pass values
1798 out of 'int' range.
1799 (c_string_width, strwidth, lisp_string_width, chars_in_text)
1800 (multibyte_chars_in_text, parse_str_as_multibyte)
1801 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
1802 (str_as_unibyte, str_to_unibyte, string_count_byte8)
1803 (string_escape_byte8, Fget_byte):
1804 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 1805 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
1806 avoid mishandling large integers.
1807 * character.h: Adjust decls to match defn changes elsewhere.
1808 * charset.c (load_charset_map_from_file, find_charsets_in_text)
1809 (Ffind_charset_region):
1810 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1811 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
1812 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 1813 Don't assume fixnum fits in int.
d311d28c
PE
1814 (load_charset_map_from_vector, Fmap_charset_chars):
1815 Remove now-unnecessary CHECK_NATNUMs.
1816 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
1817 Don't rely on undefined behavior with signed left shift overflow.
1818 Don't assume unsigned int fits into fixnum, or that fixnum fits
1819 into unsigned int. Don't require max_code to be a valid fixnum;
1820 that's not true for gb10830 4-byte on a 32-bit host. Allow
1821 invalid_code to be a cons, for the same reason. Require code_offset
1822 to be a character. Avoid int overflow if max_char is close
1823 to INT_MAX.
1824 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
1825 this is intended anyway and avoids some undefined behavior.
1826 (load_charset_map): Pass unsigned, not int, as 2nd arg of
1827 INDEX_TO_CODE_POINT, as that's what it expects.
1828 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
1829 * charset.h (DECODE_CHAR): Return int, not unsigned;
1830 this is what was intended anyway, and it avoids undefined behavior.
1831 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
1832 integer-overflow issues.
1833 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
1834 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
1835 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
1836 * chartab.c (Fmake_char_table, Fset_char_table_range)
1837 (uniprop_get_decoder, uniprop_get_encoder):
1838 Don't assume fixnum fits in int.
1839 * cmds.c (move_point): New function, that does the gist of
1840 Fforward_char and Fbackward_char, but does so while checking
1841 for integer overflow more accurately.
c96e5d6a 1842 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
1843 (Fforward_line, Fend_of_line, internal_self_insert)
1844 (internal_self_insert):
1845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1846 Fix a FIXME, by checking for integer overflow when calculating
1847 target_clm and actual_clm.
1848 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 1849 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
1850 (ASSURE_DESTINATION, coding_alloc_by_realloc)
1851 (coding_alloc_by_making_gap, alloc_destination)
1852 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
1853 (encode_coding_utf_16, detect_coding_emacs_mule)
1854 (decode_coding_emacs_mule, encode_coding_emacs_mule)
1855 (detect_coding_iso_2022, decode_coding_iso_2022)
1856 (encode_invocation_designation, encode_designation_at_bol)
1857 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
1858 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
1859 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
1860 (encode_coding_ccl, encode_coding_raw_text)
1861 (detect_coding_charset, decode_coding_charset)
1862 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
1863 (produce_composition, produce_charset, produce_annotation)
1864 (decode_coding, handle_composition_annotation)
1865 (handle_charset_annotation, consume_chars, decode_coding_gap)
1866 (decode_coding_object, encode_coding_object, detect_coding_system)
1867 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
1868 (code_convert_region, code_convert_string)
8f50130c
PE
1869 (Fdefine_coding_system_internal)
1870 (coding_set_source, coding_set_destination):
d311d28c
PE
1871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1872 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
1873 (Fdefine_coding_system_internal):
1874 Don't assume fixnums fit in int.
1875 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 1876 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
1877 (Funencodable_char_position, Fcheck_coding_systems_region)
1878 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 1879 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 1880 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 1881 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 1882 Don't access memory outside of the args array.
d311d28c 1883 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
1884 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
1885 result of ENCODE_CHAR.
d311d28c
PE
1886 * coding.h: Adjust decls to match defn changes elsewhere.
1887 (struct coding_system):
1888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1889 * composite.c (get_composition_id, find_composition)
1890 (run_composition_function, update_compositions)
1891 (compose_text, composition_gstring_put_cache)
1892 (composition_gstring_p, composition_gstring_width)
1893 (fill_gstring_header, fill_gstring_body, autocmp_chars)
1894 (composition_compute_stop_pos, composition_reseat_it)
1895 (composition_update_it, struct position_record)
1896 (find_automatic_composition, composition_adjust_point)
1897 (Fcomposition_get_gstring, Ffind_composition_internal):
1898 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1899 (update_compositions):
1900 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1901 * composite.h: Adjust decls to match defn changes elsewhere.
1902 (struct composition):
1903 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1904 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
1905 Do not attempt to compute the address of the object just before a
1906 buffer; this is not portable.
1907 (Faref, Faset):
1908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1909 (Faset): Use int, not EMACS_INT, where int is wide enough.
1910 (Fstring_to_number): Don't assume fixnums fit in int.
1911 (Frem): Don't assume arg is nonnegative.
1912 * dbusbind.c (xd_append_arg): Check for integers out of range.
1913 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 1914 (extract_signed, extract_unsigned): New functions.
243e0530
PE
1915 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
1916 (xd_get_connection_references): Return ptrdiff_t, not int.
1917 All uses changed.
1918 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
1919 (xd_read_message_1):
1920 Use int, not unsigned, where the dbus API uses int.
1921 (Fdbus_message_internal): Don't overflow mtype.
1922 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
1923 * dired.c (directory_files_internal, file_name_completion, scmp)
1924 (file_name_completion_stat):
1925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1926 (file_name_completion): Don't overflow matchcount.
1927 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
1928 * dispextern.h: Adjust decls to match defn changes elsewhere.
1929 (struct text_pos, struct glyph, struct bidi_saved_info)
1930 (struct bidi_string_data, struct bidi_it, struct composition_it)
1931 (struct it):
1932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1933 (struct display_pos, struct composition_it, struct it):
1934 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1935 * dispnew.c (increment_matrix_positions)
1936 (increment_row_positions, mode_line_string)
1937 (marginal_area_string):
1938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 1939 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
1940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1941 (duration_to_sec_usec): New function, to check for overflow better.
1942 (Fsleep_for, sit_for): Use it.
1943 * doc.c (get_doc_string, store_function_docstring):
1944 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1945 (get_doc_string, Fsnarf_documentation):
1946 Use int, not EMACS_INT, where int is wide enough.
1947 (get_doc_string):
1948 Use SAFE_ALLOCA, not alloca.
1949 Check for overflow when converting EMACS_INT to off_t.
1950 * doprnt.c (doprnt):
1951 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1952 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
1953 Don't assume uid_t fits into fixnum.
1954 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
1955 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
1956 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
1957 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
1958 (general_insert_function)
1959 (Finsert_char, make_buffer_string, make_buffer_string_both)
1960 (update_buffer_properties, Fbuffer_substring)
1961 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
1962 (Fsubst_char_in_region, check_translation)
1963 (Ftranslate_region_internal, save_restriction_restore, Fformat)
1964 (transpose_markers, Ftranspose_regions):
1965 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1966 (clip_to_bounds): Move to lisp.h as an inline function).
1967 (Fconstrain_to_field): Don't assume integers are nonnegative.
1968 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
1969 (Fsubst_char_in_region, Fsave_restriction):
1970 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1971 (Femacs_pid): Don't assume pid_t fits into fixnum.
1972 (lo_time): Use int, not EMACS_INT, when int suffices.
1973 (lisp_time_argument): Check for usec out of range.
1974 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
1975 (Fuser_login_name, Fuser_full_name): Signal an error
1976 if a uid argument is out of range, rather than relying on
1977 undefined behavior.
c8d5c857
PE
1978 (Fformat_time_string): Remove now-unnecessary check.
1979 lisp_time_argument checks for out-of-range usec now.
243e0530 1980 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
1981 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
1982 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
1983 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
1984 (init_cmdargs, Fdump_emacs):
1985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1986 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
1987 the bottom (typically) 32 bits of the fixnum.
1988 * eval.c (specpdl_size, call_debugger):
1989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1990 (when_entered_debugger, Fbacktrace_debug):
1991 Don't assume fixnum can fit in int.
1992 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
1993 the object just before a buffer; this is not portable.
1994 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
1995 (grow_specpdl, unbind_to):
1996 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1997 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
1998 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 1999 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
2000 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
2001 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
2002 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2003 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
2004 (a_write, e_write):
2005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2006 (Fcopy_file, non_regular_nbytes, read_non_regular)
2007 (Finsert_file_contents):
2008 Use int, not EMACS_INT, where int is wide enough.
2009 (READ_BUF_SIZE): Verify that it fits in int.
2010 (Finsert_file_contents): Check that counts are in proper range,
2011 rather than assuming fixnums fit into ptrdiff_t etc.
2012 Don't assume fixnums fit into int.
125b3835 2013 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
2014 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
2015 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
2016 (string_char_to_byte, string_byte_to_char)
2017 (string_make_multibyte, string_to_multibyte)
2018 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
2019 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
2020 (substring_both, Fdelete, internal_equal, Ffillarray)
2021 (Fclear_string, mapcar1)
2022 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
2023 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
2024 (larger_vector, make_hash_table, maybe_resize_hash_table)
2025 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
2026 (Fmaphash, secure_hash):
2027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2028 (concat): Check for string index and length overflow.
2029 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
2030 (Frequire):
2031 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2032 (larger_vector): New API (vec, incr_min, size_max) replaces old
2033 one (vec, new_size, init). This catches size overflow.
2034 INIT was removed because it was always Qnil.
2035 All callers changed.
2036 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
2037 the upper bound on a hash table index size.
2038 (make_hash_table, maybe_resize_hash_table): Use it.
2039 (secure_hash): Computer start_byte and end_byte only after
2040 they're known to be in ptrdiff_t range.
2041 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
2042 (Ffont_get_glyphs, Ffont_at):
2043 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2044 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
2045 (Flist_fonts, Fopen_font):
2046 Don't assume fixnum can fit in int.
2047 (check_gstring): Don't assume index can fit in int.
2048 (font_match_p): Check that fixnum is a character, not a nonnegative
2049 fixnum, since the later code needs to stuff it into an int.
2050 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
2051 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
2052 conversion overflow issues.
2053 (Fopen_font): Check for integer out of range.
2054 (Ffont_get_glyphs): Don't assume index can fit in int.
2055 * font.h: Adjust decls to match defn changes elsewhere.
2056 * fontset.c (reorder_font_vector): Redo score calculation to avoid
2057 integer overflow.
2058 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
2059 printmax_t, where ptrdiff_t is wide enough.
2060 (Finternal_char_font):
2061 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2062 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
2063 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
2064 (Fset_frame_position, x_set_frame_parameters)
2065 (x_set_line_spacing, x_set_border_width)
2066 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
2067 Check that fixnums are in proper range for system types.
2068 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
2069 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2070 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
2071 Use SAFE_ALLOCA_LISP, not alloca.
2072 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
2073 intptr_t is wide enough.
2074 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
2075 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
2076 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
2077 Check for fixnum out of range.
2078 * ftfont.c (ftfont_list): Don't assume index fits in int.
2079 Check that fixnums are in proper range for system types.
2080 (ftfont_shape_by_flt):
2081 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
2082 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2083 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2084 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
2085 Check that fixnums are in proper range for system types.
2086 * gnutls.h: Adjust decls to match defn changes elsewhere.
2087 * gtkutil.c (xg_dialog_run):
2088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2089 (update_frame_tool_bar):
2090 Check that fixnums are in proper range for system types.
2091 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 2092 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
2093 * indent.c (last_known_column, last_known_column_point):
2094 (current_column_bol_cache):
2095 (skip_invisible, current_column, check_display_width):
2096 (check_display_width, scan_for_column, current_column_1)
2097 (Findent_to, Fcurrent_indentation, position_indentation)
2098 (indented_beyond_p, Fmove_to_column, compute_motion):
2099 (Fcompute_motion, Fvertical_motion):
2100 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2101 (last_known_column_modified): Use EMACS_INT, not int.
2102 (check_display_width):
2103 (Fcompute_motion):
2104 Check that fixnums and floats are in proper range for system types.
2105 (compute_motion): Don't assume index or fixnum fits in int.
2106 (compute_motion, Fcompute_motion):
2107 Use int, not EMACS_INT, when it is wide enough.
2108 (vmotion): Omit local var start_hpos that is always 0; that way
2109 we don't need to worry about overflow in expressions involving it.
2110 * indent.h: Adjust decls to match defn changes elsewhere.
2111 (struct position):
2112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2113 Use int, not EMACS_INT, where int is wide enough.
2114 Remove unused members ovstring_chars_done and tab_offset;
2115 all uses removed.
2116 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
2117 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
2118 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
2119 (make_gap, copy_text, insert, insert_and_inherit)
2120 (insert_before_markers, insert_before_markers_and_inherit)
2121 (insert_1, count_combining_before, count_combining_after)
2122 (insert_1_both, insert_from_string)
2123 (insert_from_string_before_markers, insert_from_string_1)
2124 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
2125 (adjust_after_replace, adjust_after_insert, replace_range)
2126 (replace_range_2, del_range, del_range_1, del_range_byte)
2127 (del_range_both, del_range_2, modify_region)
2128 (prepare_to_modify_buffer, signal_before_change)
2129 (signal_after_change, Fcombine_after_change_execute):
2130 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2131 * intervals.c (traverse_intervals, rotate_right, rotate_left)
2132 (balance_an_interval, split_interval_right, split_interval_left)
2133 (find_interval, next_interval, update_interval)
2134 (adjust_intervals_for_insertion, delete_node, delete_interval)
2135 (interval_deletion_adjustment, adjust_intervals_for_deletion)
2136 (static_offset_intervals, offset_intervals)
2137 (merge_interval_right, merge_interval_left, make_new_interval)
2138 (graft_intervals_into_buffer, temp_set_point_both)
2139 (temp_set_point, set_point, adjust_for_invis_intang)
2140 (set_point_both, move_if_not_intangible, get_property_and_range)
2141 (get_local_map, copy_intervals, copy_intervals_to_string)
2142 (compare_string_intervals, set_intervals_multibyte_1):
2143 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2144 * intervals.h: Adjust decls to match defn changes elsewhere.
2145 (struct interval):
2146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2147 * keyboard.c (this_command_key_count, this_single_command_key_start)
2148 (before_command_key_count, before_command_echo_length, echo_now)
2149 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
2150 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
2151 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
2152 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
2153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2154 (last_non_minibuf_size, last_point_position, echo_truncate)
2155 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
2156 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
2157 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
2158 (stuff_buffered_input):
2159 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2160 (last_auto_save, command_loop_1, read_char):
2161 Use EMACS_INT, not int, to avoid integer overflow.
2162 (record_char): Avoid overflow in total_keys computation.
2163 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
2164 * keyboard.h: Adjust decls to match defn changes elsewhere.
2165 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
2166 (Fkey_description, Fdescribe_vector, Flookup_key):
2167 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2168 (click_position): New function, to check that positions are in range.
2169 (Fcurrent_active_maps):
2170 (describe_command):
2171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2172 (Faccessible_keymaps, Fkey_description):
2173 (preferred_sequence_p):
2174 Don't assume fixnum can fit into int.
2175 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
2176 Check for integer overflow in size calculations.
2177 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
2178 avoid mishandling large integers.
2179 * lisp.h: Adjust decls to match defn changes elsewhere.
2180 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
2181 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
2182 (struct Lisp_Marker):
2183 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2184 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
2185 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
2186 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
2187 All callers changed.
2188 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
2189 Assume the arg has valid form, since it always does.
2190 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
2191 unsigned integer system type.
2192 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
2193 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
2194 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2195 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
2196 (duration_to_sec_usec): New decl.
2197 * lread.c (read_from_string_index, read_from_string_index_byte)
2198 (read_from_string_limit, readchar, unreadchar, openp)
2199 (read_internal_start, read1, oblookup):
2200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2201 (Fload, readevalloop, Feval_buffer, Feval_region):
2202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2203 (openp): Check for out-of-range argument to 'access'.
2204 (read1): Use int, not EMACS_INT, where int is wide enough.
2205 Don't assume fixnum fits into int.
6efdadfd 2206 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
2207 (read_filtered_event): Use duration_to_sec_usec
2208 to do proper overflow checking on durations.
d311d28c
PE
2209 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
2210 in size calculation.
2211 (Fexecute_kbd_macro):
2212 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2213 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
2214 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
2215 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
2216 (set_marker_both, set_marker_restricted_both, marker_position)
2217 (marker_byte_position, Fbuffer_has_markers_at):
2218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2219 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 2220 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
2221 It now merely ensures that the menu is large enough, without
2222 necessarily growing it, as this avoids some integer overflow issues.
2223 All callers changed.
2224 (keymap_panes, parse_single_submenu, Fx_popup_menu):
2225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2226 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
2227 Use SAFE_ALLOCA_LISP, not alloca.
2228 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
2229 to EMACS_INT. Check that fixnums are in proper range for system types.
2230 * minibuf.c (minibuf_prompt_width, string_to_object)
2231 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
2232 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
2233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2234 (get_minibuffer, read_minibuf_unwind):
2235 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2236 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
2237 this simplifies overflow checking. All callers changed.
2238 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
2239 (Ftest_completion):
2240 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2241 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
2242 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
2243 Check that fixnums are in proper range for system types.
2244 (Fx_create_frame, Fx_show_tip):
2245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2246 * nsfont.m (ns_findfonts, nsfont_list_family):
2247 Don't assume fixnum fits in long.
2248 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
2249 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2250 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
2251 wide enough.
17fdb222 2252 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
2253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2254 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
2255 (PRINTDECLARE, PRINTPREPARE):
2256 (strout, print_string):
2257 (print, print_preprocess, print_check_string_charset_prop)
2258 (print_object):
2259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2260 (PRINTDECLARE):
2261 (temp_output_buffer_setup, Fprin1_to_string, print_object):
2262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2263 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 2264 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 2265 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
2266 (print_error_message): Use SAFE_ALLOCA, not alloca.
2267 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
2268 (print_depth, new_backquote_output, print_number_index):
2269 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
2270 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
2271 (Fset_process_window_size, Fformat_network_address)
2272 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 2273 (sigchld_handler):
d311d28c 2274 Check that fixnums are in proper range for system types.
d44287d4 2275 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
2276 Check for process-ids out of pid_t range rather than relying on
2277 undefined behavior.
e4d81efc 2278 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
2279 (Fformat_network_address, read_process_output, send_process)
2280 (Fprocess_send_region, status_notify):
2281 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2282 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
2283 (wait_reading_process_output, read_process_output, exec_sentinel):
2284 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2285 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
2286 (Faccept_process_output): Use duration_to_sec_usec to do proper
2287 overflow checking on durations.
dde14581
PE
2288 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
2289 Don't assume pid_t fits in int.
02481186
PE
2290 * process.h (struct Lisp_Process): Members tick and update_tick
2291 are now of type EMACS_INT, not int.
b62b53e8
PE
2292 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
2293 configured --with-wide-int.
d311d28c
PE
2294 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
2295 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
2296 * search.c (looking_at_1, string_match_1):
2297 (fast_string_match, fast_c_string_match_ignore_case)
2298 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
2299 (scan_newline, find_before_next_newline, search_command)
2300 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
2301 (set_search_regs, wordify):
2302 (Freplace_match):
2303 (Fmatch_data):
2304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2305 (string_match_1, search_buffer, set_search_regs):
2306 (Fmatch_data):
2307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2308 (wordify): Check for overflow in size calculation.
2309 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
2310 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
2311 Check that fixnums are in proper range for system types.
2312 * sound.c (struct sound_device)
2313 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
2314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2315 (Fplay_sound_internal):
2316 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 2317 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
2318 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
2319 (Fparse_partial_sexp):
2320 Don't assume fixnums can fit in int.
2321 (struct lisp_parse_state, find_start_pos, find_start_value)
2322 (find_start_value_byte, find_start_begv)
2323 (update_syntax_table, char_quoted, dec_bytepos)
2324 (find_defun_start, prev_char_comend_first, back_comment):
2325 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
2326 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
2327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2328 (Finternal_describe_syntax_value): Check that match_lisp is a
2329 character, not an integer, since the code stuffs it into int.
2330 (scan_words, scan_sexps_forward):
2331 Check that fixnums are in proper range for system types.
2332 (Fforward_word):
2333 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2334 (scan_sexps_forward):
2335 Use CHARACTERP, not INTEGERP, since the value must fit into int.
2336 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
2337 * syntax.h: Adjust decls to match defn changes elsewhere.
2338 (struct gl_state_s):
2339 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
2340 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
2341 MOST_POSITIVE_FIXNUM.
d311d28c
PE
2342 * sysdep.c (wait_for_termination_1, wait_for_termination)
2343 (interruptible_wait_for_termination, mkdir):
2344 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
2345 (emacs_read, emacs_write):
2346 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
2347 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
2348 and double all fit in int.
d311d28c
PE
2349 * term.c (set_tty_color_mode):
2350 Check that fixnums are in proper range for system types.
2351 * termhooks.h (struct input_event):
2352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2353 * textprop.c (validate_interval_range, interval_of)
2354 (Fadd_text_properties, set_text_properties_1)
2355 (Fremove_text_properties, Fremove_list_of_text_properties)
2356 (Ftext_property_any, Ftext_property_not_all)
2357 (copy_text_properties, text_property_list, extend_property_ranges)
2358 (verify_interval_modification):
2359 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2360 (Fnext_single_char_property_change)
2361 (Fprevious_single_char_property_change):
2362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
2363 (copy_text_properties):
2364 Check for integer overflow in index calculation.
d311d28c
PE
2365 * undo.c (last_boundary_position, record_point, record_insert)
2366 (record_delete, record_marker_adjustment, record_change)
2367 (record_property_change):
2368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2369 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
2370 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2371 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
2372 (Fx_hide_tip, Fx_file_dialog):
2373 * w32menu.c (set_frame_menubar):
2374 Use ptrdiff_t, not int, for consistency with rest of code.
2375 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
2376 (select_window, Fdelete_other_windows_internal)
2377 (window_scroll_pixel_based, window_scroll_line_based)
2378 (Frecenter, Fset_window_configuration):
2379 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2380 (Fset_window_hscroll, run_window_configuration_change_hook)
2381 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 2382 (Fscroll_other_window, Frecenter):
d311d28c
PE
2383 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2384 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
2385 Don't assume fixnum fits in int.
2386 (Fset_window_scroll_bars):
2387 Check that fixnums are in proper range for system types.
2388 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
2389 (string_pos, c_string_pos, number_of_chars, init_iterator)
2390 (in_ellipses_for_invisible_text_p, init_from_display_pos)
2391 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
2392 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
2393 (face_before_or_after_it_pos, handle_invisible_prop)
2394 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
2395 (display_prop_intangible_p, string_buffer_position_lim)
2396 (string_buffer_position, handle_composition_prop, load_overlay_strings)
2397 (get_overlay_strings_1, get_overlay_strings)
2398 (iterate_out_of_display_property, forward_to_next_line_start)
2399 (back_to_previous_visible_line_start, reseat, reseat_to_string)
2400 (get_next_display_element, set_iterator_to_next)
2401 (get_visually_first_element, compute_stop_pos_backwards)
2402 (handle_stop_backwards, next_element_from_buffer)
2403 (move_it_in_display_line_to, move_it_in_display_line)
2404 (move_it_to, move_it_vertically_backward, move_it_by_lines)
2405 (add_to_log, message_dolog, message_log_check_duplicate)
2406 (message2, message2_nolog, message3, message3_nolog
2407 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
2408 (current_message_1, truncate_echo_area, truncate_message_1)
2409 (set_message, set_message_1, store_mode_line_noprop)
2410 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
2411 (text_outside_line_unchanged_p, check_point_in_composition)
2412 (reconsider_clip_changes)
2413 (redisplay_internal, set_cursor_from_row, try_scrolling)
2414 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
2415 (redisplay_window, find_last_unchanged_at_beg_row)
2416 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
2417 (trailing_whitespace_p, find_row_edges, display_line)
2418 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
2419 (display_mode_element, store_mode_line_string)
2420 (pint2str, pint2hrstr, decode_mode_spec)
2421 (display_count_lines, display_string, draw_glyphs)
2422 (x_produce_glyphs, x_insert_glyphs)
2423 (rows_from_pos_range, mouse_face_from_buffer_pos)
2424 (fast_find_string_pos, mouse_face_from_string_pos)
2425 (note_mode_line_or_margin_highlight, note_mouse_highlight):
2426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2427 (safe_call, init_from_display_pos, handle_fontified_prop)
2428 (handle_single_display_spec, load_overlay_strings)
2429 (with_echo_area_buffer, setup_echo_area_for_printing)
2430 (display_echo_area, echo_area_display)
2431 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
2432 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
2433 (redisplay_window, dump_glyph_row, display_mode_line)
2434 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 2435 (handle_display_spec, display_prop_string_p):
d311d28c
PE
2436 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2437 (handle_single_display_spec, build_desired_tool_bar_string)
2438 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
2439 (get_specified_cursor_type):
2440 Check that fixnums are in proper range for system types.
2441 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
2442 (Flookup_image_map):
2443 Don't assume fixnums fit in int.
2444 (compare_overlay_entries):
2445 Avoid mishandling comparisons due to subtraction overflow.
2446 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
2447 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
2448 (handle_tool_bar_click):
2449 Use int, not unsigned, since we prefer signed and the signedness
2450 doesn't matter here.
2451 (get_next_display_element, next_element_from_display_vector):
2452 Use int, not EMACS_INT, when int is wide enough.
2453 (start_hourglass): Use duration_to_sec_usec to do proper
2454 overflow checking on durations.
2455 * xfaces.c (Fbitmap_spec_p):
2456 Check that fixnums are in proper range for system types.
2457 (compare_fonts_by_sort_order):
2458 Avoid mishandling comparisons due to subtraction overflow.
2459 (Fx_family_fonts, realize_basic_faces):
2460 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2461 (Fx_family_fonts):
2462 Don't assume fixnum fits in int.
2463 Use SAFE_ALLOCA_LISP, not alloca.
2464 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
2465 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
2466 (face_at_buffer_position, face_for_overlay_string)
2467 (face_at_string_position):
2468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2469 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
2470 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
2471 (Fx_show_tip):
2472 Check that fixnums are in proper range for system types.
2473 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
2474 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
2475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2476 (Fx_change_window_property): Don't assume fixnums fit in int.
2477 * xfont.c (xfont_chars_supported):
2478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2479 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
2480 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
2481 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2482 * xml.c (parse_region):
2483 * xrdb.c (magic_file_p):
2484 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2485 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
2486 (x_get_local_selection, x_reply_selection_request)
2487 (x_handle_selection_request, wait_for_property_change):
2488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2489 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
2490 short is wide enough.
2491 (x_send_client_event): Don't assume fixnum fits in int.
2492 * xterm.c (x_x_to_emacs_modifiers):
2493 Don't assume EMACS_INT overflows nicely into int.
2494 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
2495 may come from Lisp.
2496 (handle_one_xevent): NATNUMP can eval its arg twice.
2497 (x_connection_closed):
2498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2499 * xterm.h: Adjust decls to match defn changes elsewhere.
2500 (struct scroll_bar): Use struct vectorlike_header
2501 rather than rolling our own approximation.
2502 (SCROLL_BAR_VEC_SIZE): Remove; not used.
2503
c6574eb5
GM
25042012-05-25 Glenn Morris <rgm@gnu.org>
2505
2506 * lisp.mk (lisp): Update for more files being compiled now.
2507
e8d32c7e
SM
25082012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
2509
48def666
SM
2510 * lread.c: Remove `read_pure' which makes no difference.
2511 (read_pure): Remove var.
2512 (unreadpure): Remove function.
2513 (readevalloop): Don't call read_list with -1 flag.
2514 (read1, read_vector): Don't test read_pure any more.
2515 (read_list): Simplify.
2516
e8d32c7e
SM
2517 * fileio.c, character.h: Minor style tweaks.
2518
4b2addb7
DA
25192012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
2520
2521 * window.h (clip_changed): Remove useless declaration.
2522
584461b2
JB
25232012-05-22 Juanma Barranquero <lekktu@gmail.com>
2524
2525 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
2526 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
2527
34374650
PE
25282012-05-22 Paul Eggert <eggert@cs.ucla.edu>
2529
2530 Remove src/m/*.
2531 This directory predates autoconf and is no longer needed nowadays.
2532 Move its few remaining bits of functionality to where they're needed.
2533 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
2534 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
2535 * m/template.h: Remove.
2536 * Makefile.in (M_FILE): Remove. All uses removed.
2537 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
2538 * lisp.h (USE_LSB_TAG):
2539 * mem-limits.h (EXCEEDS_LISP_PTR):
2540 Use VAL_MAX, not VALBITS, in #if.
2541 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
2542 (EMACS_UINT): Define unconditionally now.
2543 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
2544 (BITS_PER_EMACS_INT): New constants, replacing
2545 what used to be in config.h, but not useful in #if.
2546 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
2547 define them any more.
2548 (VAL_MAX): New macro.
2549 (VALMASK): Use it.
2550 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
2551 BITS_PER_EMACS_INT, in #if.
2552 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
2553 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
2554 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
2555 * s/ms-w32.h (DATA_START):
2556 Move here from removed file m/intel386.h.
2557 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
2558 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
2559
261cb4bb
PE
25602012-05-21 Paul Eggert <eggert@cs.ucla.edu>
2561
2562 Assume C89 or later.
2563 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
2564 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
2565 (xrealloc):
2566 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
2567 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
2568 * textprop.c, tparam.c (NULL): Remove.
2569 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
2570 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
2571 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
2572 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
2573 * xterm.c (input_signal_count): Assume volatile works.
2574
ff23cd9f
KB
25752012-05-21 Ken Brown <kbrown@cornell.edu>
2576
2577 * xgselect.c (xg_select): Fix first argument in call to 'select'
2578 (bug#11508).
2579
1b170bc6
KB
25802012-05-20 Ken Brown <kbrown@cornell.edu>
2581
2582 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 2583 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 2584
b2f4d39f
KB
25852012-05-19 Ken Brown <kbrown@cornell.edu>
2586
2587 * xfns.c (x_in_use): Remove `static' qualifier.
2588 * xterm.h (x_in_use): Declare.
2589 * xgselect.c: Include xterm.h.
2590 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
2591 and `display_arg' (bug#9754).
2592
003fdae2
PE
25932012-05-19 Paul Eggert <eggert@cs.ucla.edu>
2594
9232a6d9
PE
2595 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
2596
003fdae2
PE
2597 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
2598 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
2599
784b56e2
EZ
26002012-05-18 Eli Zaretskii <eliz@gnu.org>
2601
2602 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
2603
2604 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
2605 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
2606
2607 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
2608 reference to image_cache->refcount.
2609 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
2610
a0a79cde
JL
26112012-05-17 Juri Linkov <juri@jurta.org>
2612
2613 * search.c (Fword_search_regexp, Fword_search_backward)
2614 (Fword_search_forward, Fword_search_backward_lax)
2615 (Fword_search_forward_lax): Move functions to isearch.el
2616 (bug#10145, bug#11381).
2617
b0572523
PE
26182012-05-16 Paul Eggert <eggert@cs.ucla.edu>
2619
2620 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
2621
9660f5fc
SM
26222012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2623
2624 * lread.c (init_obarray): Declare Qt and Qnil as special.
2625
4374de83
GM
26262012-05-14 Glenn Morris <rgm@gnu.org>
2627
2628 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 2629 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 2630
dc44c39a
PE
26312012-05-14 Paul Eggert <eggert@cs.ucla.edu>
2632
078c97cb
PE
2633 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
2634
dc44c39a
PE
2635 * unexaix.c: Port to more-recent AIX compilers.
2636 (report_error, report_error_1, make_hdr, copy_sym)
2637 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
2638 Make arguments const char *, not char *, to avoid violations of C
2639 standard and to fix some AIX warnings reported by Gilles Pion.
2640
e18afed7 26412012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
2642
2643 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
2644 already have overlays loaded.
2645 (handle_single_display_spec): Before returning without displaying
2646 fringe bitmap, synchronize the bidi iterator with the main display
2647 iterator, by calling iterate_out_of_display_property.
2648 (iterate_out_of_display_property): Detect buffer iteration by
2649 testing that it->string is a Lisp string.
2650 (get_next_display_element): When the current object is exhausted,
2651 and there's something on it->stack, call set_iterator_to_next to
2652 proceed with what's on the stack, instead of returning zero.
2653 (set_iterator_to_next): If called at the end of a Lisp string,
2654 proceed to consider_string_end without incrementing string
2655 position. Don't increment display vector index past the end of
2656 the display vector. (Bug#11417)
c8fb9dc6
EZ
2657 (pos_visible_p): Don't report a position visible when move_it_to
2658 stopped at the last line of window, which happens to be scanned
2659 backwards by the bidi iteration. (Bug#11464)
ac268e67 2660
e18afed7 26612012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
2662
2663 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
2664 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
2665 are on a TTY, and thus unable to display on the fringes.
2666 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
2667 so we need to signal to the caller that this is a "replacing"
2668 display spec. This fixes display when the spec is invalid or we
2669 are on a TTY.
2670
e18afed7 26712012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
2672
2673 * unexaix.c (make_hdr): Fix typo in prototype.
2674 This bug broke the build on AIX. Problem reported by Gilles Pion.
2675
9d0a235a
MA
26762012-05-14 Michael Albinus <michael.albinus@gmx.de>
2677
2678 * keyboard.c (kbd_buffer_get_event): Read special events also in
2679 batch mode. (Bug#11415)
2680
9e6b06ed
GM
26812012-05-12 Glenn Morris <rgm@gnu.org>
2682
2683 * ns.mk: Update for ns_appbindir no longer having trailing "/".
2684
c1a1d7a3
EZ
26852012-05-12 Eli Zaretskii <eliz@gnu.org>
2686
2687 * lisp.mk (lisp): Add newcomment.elc.
2688
3fe7cdc8
GM
26892012-05-12 Glenn Morris <rgm@gnu.org>
2690
2691 * Makefile.in (MKDIR_P): New, set by configure.
2692 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
2693
53f7d2c0
PE
26942012-05-11 Paul Eggert <eggert@cs.ucla.edu>
2695
2696 Remove unused function hourglass_started.
2697 * dispextern.h (hourglass_started):
2698 * w32fns.c (hourglass_started):
2699 * xdisp.c (hourglass_started): Remove.
2700
75aafb17
JB
27012012-05-10 Juanma Barranquero <lekktu@gmail.com>
2702
2703 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
2704 Update dependencies.
2705
12959e8e
PE
27062012-05-10 Paul Eggert <eggert@cs.ucla.edu>
2707
97107e2e
PE
2708 * xgselect.c (xg_select): Put maxfds+1 into a var.
2709 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
2710
12959e8e
PE
2711 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
2712
836d29b3
DA
27132012-05-10 Dave Abrahams <dave@boostpro.com>
2714
2715 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
2716 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
2717
5cb67954
MA
27182012-05-09 Michael Albinus <michael.albinus@gmx.de>
2719
2720 * dbusbind.c (xd_registered_buses): New internal Lisp object.
2721 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
2722 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
2723 Initialize xd_registered_buses.
2724
3478ec45
PE
27252012-05-09 Paul Eggert <eggert@cs.ucla.edu>
2726
b263a6b0
PE
2727 Untag more efficiently if USE_LSB_TAG.
2728 This is based on a proposal by YAMAMOTO Mitsuharu in
2729 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
2730 For an admittedly artificial (nth 8000 longlist) benchmark on
2731 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
2732 Emacs's overall text size by 1%.
2733 * lisp.h (XUNTAG): New macro.
2734 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
2735 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
2736 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
2737 * eval.c (Fautoload):
2738 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
2739 * frame.h (XFRAME): Use XUNTAG.
2740
3478ec45
PE
2741 Port recent dbusbind.c changes to 32-bit --with-wide-int.
2742 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
2743 Remove unportable assumptions about print widths of types like
2744 dbus_uint32_t.
2745 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
2746 intptr_t when converting between pointer and integer, to avoid GCC
2747 warnings about wrong width.
2748
666b903b 27492012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
2750
2751 * w32proc.c (new_child): Force Windows to reserve only 64KB of
2752 stack for each reader_thread, instead of defaulting to 8MB
2753 determined by the linker. This avoids failures in creating
2754 subprocesses on Windows 7, see the discussion in this thread:
2755 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
2756
b120cc17
JC
27572012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
2758
2759 Fix up display of the *Minibuf-0* buffer in the mini window.
2760 * keyboard.c (read_char): Don't clear the echo area if there's no
2761 message to clear.
2762 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 2763 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 2764
9a4b36f8
MA
27652012-05-07 Michael Albinus <michael.albinus@gmx.de>
2766
2767 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
2768 batch mode.
2769
e5f9458f
CY
27702012-05-06 Chong Yidong <cyd@gnu.org>
2771
2772 * lisp.mk (lisp): Update.
2773
eceeb5fc 27742012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
2775
2776 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
2777
71873e2b
SM
27782012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
2779
2780 * data.c (PUT_ERROR): New macro.
2781 (syms_of_data): Use it. Add new error type `user-error'.
2782 * undo.c (user_error): New function.
2783 (Fprimitive_undo): Use it.
2784 * print.c (print_error_message): Adjust print style for `user-error'.
2785 * keyboard.c (user_error): New function.
2786 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2787
ab0fa4e4
PE
27882012-05-03 Paul Eggert <eggert@cs.ucla.edu>
2789
2790 Do not limit current-time-string to years 1000..9999.
2791 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
2792 (Fcurrent_time_string): Support any year that is supported by the
2793 underlying localtime representation. Don't use asctime, as it
2794 has undefined behavior for years outside the range -999..9999.
2795
7ed806a7
PE
27962012-05-02 Paul Eggert <eggert@cs.ucla.edu>
2797
2798 Fix race conditions involving setenv, gmtime, localtime, asctime.
2799 Without this fix, interrupts could mess up code that uses these
2800 nonreentrant functions, since setting TZ invalidates existing
2801 tm_zone or tzname values, and since most of these functions return
2802 pointers to static storage.
2803 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
2804 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
2805 Grow the critical sections to include not just invoking
2806 localtime/gmtime, but also accessing these functions' results
2807 including their tm_zone values if any, and any related TZ setting.
2808 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
2809 so that the struct tm is saved in the critical section.
2810 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
2811 motivated by the fact that memory allocation needs to be outside
2812 the critical section.
2813
0c16dfed
DA
28142012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
2815
2816 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
2817 with RESET_INTERVAL.
2818
2819 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2820 Remove duplicated buffer name initialization.
2821
3f83ace8
JM
28222012-05-02 Jim Meyering <jim@meyering.net>
2823
2824 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
2825
c7b8541e
JM
2826 * xfns.c (x_window): Use xstrdup (Bug#11375).
2827
90207a15 28282012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
2829
2830 * xdisp.c (pos_visible_p): If already at a newline from the
2831 display string before the 'while' loop, don't walk back the glyphs
2832 from it3.glyph_row. Solves assertion violation when the display
2833 string begins with a newline (egg.el). (Bug#11367)
2834
b593d6a9
AH
28352012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
2836
2837 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
2838 Move to simple.el.
2839
4737362e
GM
28402012-05-01 Glenn Morris <rgm@gnu.org>
2841
99cf43f9
GM
2842 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
2843 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
2844 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
2845 All were removed before 23.1.
2846
9311dcff
GM
2847 * dispnew.c: Remove HAVE_LIBNCURSES test;
2848 it is always true on relevant platforms.
2849
4d5c6349
GM
2850 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
2851 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
2852
4737362e
GM
2853 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
2854
74dd3a6b
AS
28552012-04-30 Andreas Schwab <schwab@linux-m68k.org>
2856
2857 * .gdbinit (xpr): Remove checks for no longer existing misc types.
2858 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
2859 Remove.
2860
13c379ee
PE
28612012-04-28 Paul Eggert <eggert@cs.ucla.edu>
2862
2863 Do not avoid creating empty evaporating overlays (Bug#9642).
2864 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
2865 That is, do not delete an evaporating overlay if it becomes
2866 empty after its bounds are adjusted to fit within its buffer.
2867 This fix caused other problems, and I'm reverting it until we get
2868 to the bottom of them.
2869
a8e7d6d7 28702012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
2871
2872 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
2873
a8e7d6d7 28742012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
2875
2876 * xdisp.c (pos_visible_p): If the window start position is beyond
2877 ZV, start the display from buffer beginning. Prevents assertion
2878 violation in init_iterator when the minibuffer window is scrolled
2879 via the scroll bar.
2880
2881 * window.c (window_scroll_pixel_based): Likewise.
2882
a8e7d6d7 28832012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
2884
2885 * keymap.c (where_is_internal): Doc fix (Bug#10872).
2886
a8e7d6d7 28872012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
2888
2889 * fileio.c (Fcopy_file, Fset_file_selinux_context):
2890 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
2891
a8e7d6d7 28922012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 2893
b593d6a9
AH
2894 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
2895 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 2896
1c6900d9
EZ
28972012-04-26 Eli Zaretskii <eliz@gnu.org>
2898
4c3fa1d9
EZ
2899 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
2900 display element, check also the underlying string or buffer
2901 character. (Bug#11341)
2902
1c6900d9
EZ
2903 * w32menu.c: Include w32heap.h.
2904 (add_menu_item): If the call to AppendMenuW (via
2905 unicode_append_menu) fails, disable Unicode menus only if we are
2906 running on Windows 9X/Me.
2907
42bf8205
AS
29082012-04-24 Andreas Schwab <schwab@linux-m68k.org>
2909
2910 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
2911 (xgetint): Add missing shift for LSB tags.
2912
b1bac16e
MR
29132012-04-24 Martin Rudalics <rudalics@gmx.at>
2914
2915 * keyboard.c (read_char): Don't wipe echo area for select window
2916 events: These might get delayed via `mouse-autoselect-window'
2917 (Bug#11304).
2918
d69621cc
JB
29192012-04-24 Juanma Barranquero <lekktu@gmail.com>
2920
2921 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
2922 manipulation of :loaded-from data.
2923
02fd101b
JB
29242012-04-23 Juanma Barranquero <lekktu@gmail.com>
2925
2926 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
2927 now a cons (bug#11311).
2928
888bec30
PE
29292012-04-23 Paul Eggert <eggert@cs.ucla.edu>
2930
89a438bd
PE
2931 Do not create empty overlays with the evaporate property (Bug#9642).
2932 * buffer.c (Fmove_overlay): Delete an evaporating overlay
2933 if it becomes empty after its bounds are adjusted to fit within
2934 its buffer. Without this fix, in a nonempty buffer (let ((o
2935 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
2936 yields an empty overlay that has the evaporate property, which is
2937 not supposed to happen.
2938
1068fe4d
PE
2939 Fix minor GTK3 problems found by static checking.
2940 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2941 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2942 (struct _EmacsFixedClass, emacs_fixed_get_type):
2943 Move decls here from emacsgtkfixed.h, since they needn't be public.
2944 (emacs_fixed_get_type): Now static.
2945 (emacs_fixed_class_init): Omit unused local.
2946 (emacs_fixed_child_type): Remove; unused.
2947 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2948 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2949 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
2950 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
2951 (EMACS_FIXED_GET_CLASS): Remove; unused.
2952 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
2953
888bec30
PE
2954 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
2955 Problem reported by Juanma Barranquero for Windows -Wunused-function.
2956
de85e130
PE
29572012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2958
d0baac98 2959 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 2960 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
2961 (__malloc_size_t, __malloc_ptrdiff_t):
2962 Remove. All uses removed, replaced by the definiens if needed,
2963 since we can assume C89 or better now.
2964 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
2965 (protect_malloc_state, align, get_contiguous_space)
2966 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
2967 (malloc_atfork_handler_child, malloc_enable_thread)
2968 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
2969 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
2970 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
2971 (special_realloc, _realloc_internal_nolock, _realloc_internal)
2972 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
2973 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
2974 Define using prototypes, not old style.
2975 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
2976 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
2977 (align): Don't assume that signed integer overflow wraps around.
2978 Omit unused local var.
2979 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
2980 (_free_internal_nolock, memalign, mallochook, reallochook):
2981 Omit no-longer-needed casts.
2982 (valloc): Use getpagesize, not __getpagesize.
2983 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
2984 (struct hdr): The 'magic' member is now size_t, not unsigned long.
2985
de85e130
PE
2986 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
2987
dcbf5805
MA
29882012-04-22 Michael Albinus <michael.albinus@gmx.de>
2989
2990 Move functions from C to Lisp. Make non-blocking method calls
2991 the default. Implement further D-Bus standard interfaces.
2992
2993 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
2994 (QCdbus_request_name_allow_replacement)
2995 (QCdbus_request_name_replace_existing)
2996 (QCdbus_request_name_do_not_queue)
2997 (QCdbus_request_name_reply_primary_owner)
2998 (QCdbus_request_name_reply_in_queue)
2999 (QCdbus_request_name_reply_exists)
3000 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
3001 (QCdbus_registered_serial, QCdbus_registered_method)
3002 (QCdbus_registered_signal): New Lisp objects.
3003 (XD_DEBUG_MESSAGE): Use sizeof.
3004 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
3005 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
3006 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
3007 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
3008 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
3009 (xd_signature, xd_append_arg): Allow float for integer types.
3010 (xd_get_connection_references): New function.
b593d6a9
AH
3011 (xd_get_connection_address): Rename from xd_initialize.
3012 Return cached address.
dcbf5805
MA
3013 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
3014 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
3015 level.
3016 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 3017 Return number of refcounts.
dcbf5805
MA
3018 (Fdbus_get_unique_name): Make stronger parameter check.
3019 (Fdbus_message_internal): New defun.
3020 (Fdbus_call_method, Fdbus_call_method_asynchronously)
3021 (Fdbus_method_return_internal, Fdbus_method_error_internal)
3022 (Fdbus_send_signal, Fdbus_register_service)
3023 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
3024 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
3025 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
3026 (Vdbus_compiled_version, Vdbus_runtime_version)
3027 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
3028 (Vdbus_message_type_method_return, Vdbus_message_type_error)
3029 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
3030 (Vdbus_registered_buses, Vdbus_registered_objects_table):
3031 Adapt docstring.
dcbf5805 3032
52828e02
PE
30332012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3034
da05bc4c
PE
3035 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
3036 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
3037 Do not assume ptrdiff_t is the same width as 'int'.
3038
52828e02
PE
3039 * alloc.c: Handle unusual debugging option combinations.
3040 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
3041 since the two debugging options are incompatible.
3042 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
3043 is defined.
3044 (mem_init, mem_insert, mem_insert_fixup):
3045 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
3046 (NEED_MEM_INSERT): Remove; no longer needed.
3047
f01769f9
LL
30482012-04-22 Leo Liu <sdl.web@gmail.com>
3049
3050 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
3051
5790543d
PE
30522012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3053
3054 * sysdep.c [__FreeBSD__]: Minor cleanups.
3055 (list_system_processes, system_process_attributes) [__FreeBSD__]:
3056 Use Emacs indenting style more consistently. Avoid some casts.
3057 Use 'double' consistently rather than mixing 'float' and 'double'.
3058
b91b7e4d
EW
30592012-04-21 Eduard Wiebe <usenet@pusto.de>
3060
b593d6a9
AH
3061 * sysdep.c (list_system_processes, system_process_attributes):
3062 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 3063
6114eb15
AS
30642012-04-21 Andreas Schwab <schwab@linux-m68k.org>
3065
3066 * lisp.mk (lisp): Update.
3067
2f38dff7
PE
30682012-04-20 Paul Eggert <eggert@cs.ucla.edu>
3069
3070 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
3071 It is never used otherwise.
3072
4ae29f89
SM
30732012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
3074
3075 * print.c (print_preprocess): Only check print_depth if print-circle
3076 is nil.
3077 (print_object): Check for cycles even when print-circle is nil and
3078 print-gensym is t, but only check print_depth if print-circle is nil.
3079
f30d612a
CY
30802012-04-20 Chong Yidong <cyd@gnu.org>
3081
3082 * process.c (wait_reading_process_output): If EIO occurs on a pty,
3083 set the status to "failed" and ensure that sentinel is run.
3084
c07a4c0b 30852012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
3086
3087 * process.c (Fset_process_inherit_coding_system_flag)
3088 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 3089 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 3090
c07a4c0b 30912012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
3092
3093 * xdisp.c (string_buffer_position_lim): Limit starting position to
3094 BEGV.
3095 (set_cursor_from_row): If called for a mode-line or header-line
3096 row, return zero immediately.
3097 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
3098 farther than the first row after the header line, if any.
3099 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
3100 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
3101
c07a4c0b 31022012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3103
4ae29f89
SM
3104 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
3105 (bug#11238).
ad3a2b41 3106
c07a4c0b 31072012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 31082012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
3109
3110 configure: new option --enable-gcc-warnings (Bug#11207)
3111 * Makefile.in (C_WARNINGS_SWITCH): Remove.
3112 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
3113 (ALL_CFLAGS): Use new macros rather than old.
3114 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
3115 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
3116 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
3117 -Wunused-result, -Wunused-variable. This should go away once
3118 the Emacs and Gnulib regex code is merged.
3119 (xmalloc, xrealloc): Now static.
3120
aba027e8
PE
31212012-04-17 Paul Eggert <eggert@cs.ucla.edu>
3122
3123 * dired.c (Fsystem_groups): Remove unused local.
3124
e5a36063
GM
31252012-04-17 Glenn Morris <rgm@gnu.org>
3126
3127 * dired.c (Fsystem_users): Doc fix.
3128
316411f0
DA
31292012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
3130
3131 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
3132 (syms_of_dired): Add them.
3133
9426aba4
PE
31342012-04-16 Paul Eggert <eggert@cs.ucla.edu>
3135
b62a57be
PE
3136 Fix minor alloc.c problems found by static checking.
3137 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
3138 New extern decls, to avoid calling undeclared functions.
3139 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
3140 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
3141 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
3142 (NEED_MEM_INSERT): New macro.
3143 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 3144 Remove one incorrect comment and fix another.
b62a57be 3145
3539f31f
PE
3146 Fix minor ralloc.c problems found by static checking.
3147 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3148 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
3149 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
3150 (r_alloc_sbrk): Now static.
3151
a041960a
PE
3152 Improve ralloc.c interface checking.
3153 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3154 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
3155 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
3156 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
3157 [REL_ALLOC]: ... to here, to check interface.
3158 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
3159 Remove decls. This fixes an "It stinks!".
3160
9426aba4
PE
3161 * alloc.c (which_symbols): Fix alignment issue / type clash.
3162
d55c12ed
AS
31632012-04-15 Andreas Schwab <schwab@linux-m68k.org>
3164
3165 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
3166 (struct Lisp_Misc_Any): Likewise.
3167 (struct Lisp_Free): Likewise.
3168 * alloc.c (union aligned_Lisp_Symbol): Define.
3169 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
3170 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
3171 (union aligned_Lisp_Misc): Define.
3172 (MARKER_BLOCK_SIZE, struct marker_block): Use union
3173 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 3174 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 3175
b948ce8b
PE
31762012-04-14 Paul Eggert <eggert@cs.ucla.edu>
3177
3178 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
3179 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
3180 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
3181 * s/netbsd.h, s/sol2-6.h:
3182 Remove definition of GC_MARK_STACK, since the default now works.
3183 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
3184 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
3185 no longer the default.
3186 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
3187
35dc09a1 31882012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3189
35dc09a1
GM
3190 * lread.c (lisp_file_lexically_bound_p):
3191 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 3192
35dc09a1
GM
31932012-04-14 Eli Zaretskii <eliz@gnu.org>
3194
3195 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
3196 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
3197
31982012-04-14 Jan Djärv <jan.h.d@swipnet.se>
3199
3200 * nsterm.m (constrainFrameRect): Always constrain when there is only
3201 one screen (Bug#10962).
3202
bcd86815
KB
32032012-04-13 Ken Brown <kbrown@cornell.edu>
3204
3205 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
3206
c25df26e
RT
32072012-04-13 Reuben Thomas <rrt@sc3d.org>
3208
3209 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
3210
0fc59f1e
DC
32112012-04-11 Daniel Colascione <dancol@dancol.org>
3212
3213 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
3214 against is gone. It's better to use vfork now so that when Cygwin
3215 gains a new, working vfork, we use it automatically (bug#10398).
3216
de8c03dc
SM
32172012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3218
3219 * window.c (save_window_save): Obey window-point-insertion-type.
3220
2f097256
GM
32212012-04-11 Glenn Morris <rgm@gnu.org>
3222
3223 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
3224
453b951e
SM
32252012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3226
3227 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
3228
75f1671a 32292012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
3230
3231 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
3232 (force_quit_count): New var.
3233 (handle_interrupt): Use it.
3234
2a8ce227
JB
32352012-04-10 Juanma Barranquero <lekktu@gmail.com>
3236
3237 * w32.c (w32_delayed_load): Record the full path of the library
3238 being loaded (bug#10424).
3239
935396c0
GM
32402012-04-09 Glenn Morris <rgm@gnu.org>
3241
05920a43
GM
3242 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
3243 not just in the obarray, before snarfing them. (Bug#11036)
3244
935396c0
GM
3245 * Makefile.in ($(leimdir)/leim-list.el):
3246 Pass EMACS rather than BUILT_EMACS.
3247
a18ecafa
TZ
32482012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
3249
3250 * process.c (make_process):
3251 * process.h: Add integer `gnutls_handshakes_tried' member to
3252 process struct.
3253
6bbef4e5
JC
3254 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
3255 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
3256
3257 * gnutls.c (gnutls_log_function2i): Convenience log function.
3258 (emacs_gnutls_read): Use new log functions,
3259 `gnutls_handshakes_tried' process member, and
3260 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
3261 attempts per process (connection).
3262
b4d3bc10
CY
32632012-04-09 Chong Yidong <cyd@gnu.org>
3264
3265 * eval.c (Fuser_variable_p, user_variable_p_eh)
3266 (lisp_indirect_variable): Functions deleted.
3267 (Fdefvar): Caller changed.
3268
3269 * callint.c (Finteractive, Fcall_interactively):
3270 * minibuf.c (Fread_variable): Callers changed.
3271
70f4d973
EZ
32722012-04-09 Eli Zaretskii <eliz@gnu.org>
3273
3274 * xdisp.c (set_cursor_from_row): If the display string appears in
3275 the buffer at position that is closer to point than the position
3276 after the display string, display the cursor on the first glyph of
3277 the display string. Fixes cursor display when a 'display' text
3278 property immediately follows invisible text. (Bug#11094)
3279
cb3c2e3e
PE
32802012-04-09 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 composite.c: use 'double' consistently
3283 * composite.c (get_composition_id): Use 'double' consistently
3284 instead of converting 'float' to 'double' and vice versa; this is
3285 easier to understand and avoids a GCC warning.
3286
fd06db5d
GM
32872012-04-09 Glenn Morris <rgm@gnu.org>
3288
50fe702a
GM
3289 * Makefile.in: Generate leim-list with bootstrap-emacs, in
3290 preparation for dumping it with emacs. (Bug#4789)
3291 (leimdir): New variable.
3292 ($(leimdir)/leim-list.el): New rule.
3293 (emacs$(EXEEXT)): Depend on leim-list.el.
3294
fd06db5d
GM
3295 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
3296 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
3297 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
3298
55c131ee
AS
32992012-04-08 Andreas Schwab <schwab@linux-m68k.org>
3300
3301 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
3302 proper alignment.
3303
9209588f
JB
33042012-04-07 Juanma Barranquero <lekktu@gmail.com>
3305
3306 * xml.c (init_libxml2_functions) [WINDOWSNT]:
3307 Remove unused local variable.
3308
e3fb2efb
PE
33092012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3310
3311 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
3312 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
3313 (mark_memory): Mark Lisp_Objects only if pointers might hide in
3314 objects, as mark_maybe_pointer will catch them otherwise.
3315 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
3316 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
3317
b5385551
PE
33182012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3319
3320 Fix typo that broke non-Windows builds.
3321 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
3322
9078ead6
EZ
33232012-04-07 Eli Zaretskii <eliz@gnu.org>
3324
3325 Support building on MS-Windows with libxml2.
3326
3327 * makefile.w32-in (OBJ2): Add xml.$(O).
3328 (GLOBAL_SOURCES): Add xml.c.
3329 ($(BLD)/xml.$(O)): New dependency list.
3330
3331 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
3332 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
3333 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
3334 [!WINDOWSNT]: New macros.
3335 (init_libxml2_functions, libxml2_loaded_p): New functions.
3336 (parse_region): Call fn_xmlCheckVersion instead of using the macro
3337 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
3338 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
3339 Calls xmlCleanupParser only if libxml2 was loaded (or statically
3340 linked in).
6bbef4e5
JC
3341 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
3342 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
3343 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
3344
3345 * emacs.c: Don't include libxml/parser.h.
3346 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
3347 xmlCleanupParser directly.
3348
3349 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
3350
3811fdf3
EZ
33512012-04-07 Eli Zaretskii <eliz@gnu.org>
3352
3353 * indent.c (Fvertical_motion): If there is a display string at
3354 point, use it.vpos to compute how many lines to backtrack after
3355 move_it_to point. (Bug#11133)
3356
2f8e16b2
EZ
33572012-04-06 Eli Zaretskii <eliz@gnu.org>
3358
3359 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
3360 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
3361 about subtle differences between FETCH_CHAR* and STRING_CHAR*
3362 macros related to unification of CJK characters. For the details,
3363 see the discussion following the message here:
3364 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
3365
3d439cd1
CY
33662012-04-04 Chong Yidong <cyd@gnu.org>
3367
3368 * keyboard.c (Vdelayed_warnings_list): Doc fix.
3369
8bc53d00
EZ
33702012-04-01 Eli Zaretskii <eliz@gnu.org>
3371
3372 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
3373 instead of alloca. (Bug#11138)
3374
3b0512a3
AS
33752012-04-01 Andreas Schwab <schwab@linux-m68k.org>
3376
3377 * w32menu.c (is_simple_dialog): Properly check lisp types.
3378 (Bug#11141)
3379
8427ddd2
EZ
33802012-03-31 Eli Zaretskii <eliz@gnu.org>
3381
979022ef
EZ
3382 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
3383 position we get to after a call to move_it_to fails the
3384 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
3385 only if we wind up in a string from display property. (Bug#11063)
3386
a6b1c7cc
EZ
3387 * window.c (Fdelete_other_windows_internal): Invalidate the row
3388 and column information about mouse highlight, so that redisplay
3389 restores it after reallocating the glyph matrices. (Bug#7464)
3390
8427ddd2
EZ
3391 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
3392 string comes from a `display' text property, use the buffer
3393 position of that property as if we actually saw that position in
3394 the row's glyphs.
697ba24b
EZ
3395 (move_it_by_lines): Remove the assertion that
3396 "it->current_x == 0 && it->hpos == 0" which can be legitimately
3397 violated when there's a before-string at the beginning of a line.
3398 (Bug#11063)
8427ddd2 3399
65a0a738
EZ
34002012-03-30 Eli Zaretskii <eliz@gnu.org>
3401
3402 * xdisp.c (append_space_for_newline): If the default face was
3403 remapped, use the remapped face for the appended newline.
3404 (extend_face_to_end_of_line): Use the remapped default face for
3405 extending the face to the end of the line.
3406 (display_line): Call extend_face_to_end_of_line when the default
3407 face was remapped. (Bug#11068)
3408
581355cc
EZ
34092012-03-29 Eli Zaretskii <eliz@gnu.org>
3410
3411 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
3412
e8fc049f
SM
34132012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
3414
3415 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
3416
4fb9a543
GM
34172012-03-27 Glenn Morris <rgm@gnu.org>
3418
3419 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
3420 Doc fixes.
3421
679910f1
KH
34222012-03-26 Kenichi Handa <handa@m17n.org>
3423
3424 * dispextern.h (struct glyph): Fix previous change. Change the
3425 bit length of glyphless.ch to 25 (Bug#11082).
3426
90d49b7f
CY
34272012-03-26 Chong Yidong <cyd@gnu.org>
3428
3429 * keyboard.c (Vselection_inhibit_update_commands): New variable.
3430 (command_loop_1): Use it; inhibit selection update for
3431 handle-select-window too (Bug#8996).
3432
f514f6f0
FP
34332012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
3434
e8fc049f 3435 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 3436
bf43fa51
KH
34372012-03-25 Kenichi Handa <handa@m17n.org>
3438
3439 * dispextern.h (struct glyph): Change the bit length of
3440 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
3441
8a0c01dd
EZ
34422012-03-24 Eli Zaretskii <eliz@gnu.org>
3443
3444 * s/ms-w32.h (tzname): Include time.h before redirecting to
3445 _tzname. Fixes the MSVC build. (Bug#9960)
3446
7d1c3a76
AS
34472012-03-24 Andreas Schwab <schwab@linux-m68k.org>
3448
8ed79523
AS
3449 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
3450 characters.
3451
7d1c3a76
AS
3452 * xterm.c (XTread_socket): Only modify handling_signal if
3453 !SYNC_INPUT. (Bug#11080)
3454
e99a9b8b
EZ
34552012-03-23 Eli Zaretskii <eliz@gnu.org>
3456
3457 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
3458 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
3459 when fetching a multibyte character consumes more bytes than
3460 CHAR_BYTES returns, due to unification of CJK characters in
3461 string_char. (Bug#11073)
3462
5063c0e1
TN
34632012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
3464
3465 * process.c (wait_reading_process_output): Handle pty disconnect
3466 by refraining from sending oneself a SIGCHLD (bug#10933).
3467
9f851fbd
CY
34682012-03-22 Chong Yidong <cyd@gnu.org>
3469
3470 * dispextern.h (struct it): New member string_from_prefix_prop_p.
3471
5063c0e1 3472 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
3473 Mark string as coming from a prefix property.
3474 (handle_face_prop): Use default face for prefix strings (Bug#4281).
3475 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
3476
fb5b8aca
CY
34772012-03-21 Chong Yidong <cyd@gnu.org>
3478
3479 * xfaces.c (Vface_remapping_alist): Doc fix.
3480
62356a1b
EZ
34812012-03-20 Eli Zaretskii <eliz@gnu.org>
3482
3483 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
3484 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
3485 Doc fixes.
62356a1b 3486
025de85b
CY
34872012-03-20 Chong Yidong <cyd@gnu.org>
3488
3489 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
3490 to reflect default non-nil value of redisplay-dont-pause.
3491
4827f94e
KH
34922012-03-19 Kenichi Handa <handa@m17n.org>
3493
3494 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
3495 it fit in a valid range (Bug#11003).
3496
e50a24a2
EZ
34972012-03-18 Eli Zaretskii <eliz@gnu.org>
3498
3499 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
3500 that is not from display property, accept the row as a "cursor
3501 row" if one of the string's character has a non-nil `cursor'
3502 property. Fixes cursor positioning when there are newlines in
3503 overlay strings, e.g. in icomplete.el. (Bug#11035)
3504
9af5ed87
PE
35052012-03-12 Paul Eggert <eggert@cs.ucla.edu>
3506
3507 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
3508
d1f55f16
CY
35092012-03-12 Chong Yidong <cyd@gnu.org>
3510
3511 * eval.c (inhibit_lisp_code): Rename from
3512 inhibit_window_configuration_change_hook; move from window.c.
3513
3514 * xfns.c (unwind_create_frame_1, Fx_create_frame):
3515 * window.c (run_window_configuration_change_hook)
3516 (syms_of_window): Callers changed.
3517
66c5eebd
CY
35182012-03-11 Chong Yidong <cyd@gnu.org>
3519
413df973
CY
3520 * keymap.c (Fkey_description): Doc fix (Bug#9700).
3521
66c5eebd
CY
3522 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
3523
1de11f56
CY
35242012-03-10 Chong Yidong <cyd@gnu.org>
3525
3526 * frame.c (other_visible_frames): Don't assume the selected frame
3527 is visible (Bug#10955).
3528
cae07000
SM
35292012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
3530
3531 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
3532
89c94350
JD
35332012-03-08 Jan Djärv <jan.h.d@swipnet.se>
3534
3535 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
3536 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
3537 zero (Bug#10954).
3538
999dd333
GM
35392012-03-03 Glenn Morris <rgm@gnu.org>
3540
01a6dcc8 3541 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 3542
de0100f2
EZ
35432012-03-02 Eli Zaretskii <eliz@gnu.org>
3544
3545 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
3546 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
3547 (redisplay_window, next_element_from_string): Fix typos in
3548 comments.
3e441275
EZ
3549 (redisplay_window): Pass to move_it_vertically the margin in
3550 pixels, not in screen lines.
de0100f2 3551
96a72ee9
GM
35522012-03-02 Glenn Morris <rgm@gnu.org>
3553
3554 * buffer.c (buffer-list-update-hook): Doc fix.
3555
312508d7
EZ
35562012-02-29 Eli Zaretskii <eliz@gnu.org>
3557
3558 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
3559 push_it before setting up the iterator for the first overlay
3560 string, even if we have an empty string loaded.
3561 (next_overlay_string): If there's an empty string on the iterator
3562 stack, pop the stack. (Bug#10903)
3563
27f3c637
PE
35642012-02-25 Paul Eggert <eggert@cs.ucla.edu>
3565
3566 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
3567 Suggested by Stefan Monnier in
3568 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
3569 * alloc.c (widen_to_Lisp_Object): New static function.
3570 (mark_memory): Also mark Lisp_Objects by fetching pointer words
3571 and widening them to Lisp_Objects. This would work even if
3572 USE_LSB_TAG is defined and wide integers are used, which might
3573 happen in a future version of Emacs.
3574
3c9dfce6
CY
35752012-02-25 Chong Yidong <cyd@gnu.org>
3576
fa74b241
CY
3577 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
3578 Doc fix.
3579
3c9dfce6
CY
3580 * xselect.c (Fx_selection_exists_p): Doc fix.
3581 (x_clipboard_manager_save_all): Print an informative message
3582 before saving to clipboard manager.
3583
9486df08
CY
35842012-02-24 Chong Yidong <cyd@gnu.org>
3585
3586 * keyboard.c (process_special_events): Handle all X selection
3587 requests in kbd_buffer, not just the next one (Bug#8869).
3588
f01d3321
CY
35892012-02-23 Chong Yidong <cyd@gnu.org>
3590
3591 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
3592 call when setting menu-bar-lines and tool-bar-lines parameters.
3593 (unwind_create_frame_1): New helper function.
3594
3595 * window.c (inhibit_window_configuration_change_hook): New var.
3596 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 3597 (syms_of_window): Initialize it.
f01d3321 3598
86b847b6
CY
35992012-02-22 Chong Yidong <cyd@gnu.org>
3600
3601 * xterm.c (x_draw_image_relief): Add missing type check for
3602 Vtool_bar_button_margin (Bug#10743).
3603
a59225b1
CY
36042012-02-21 Chong Yidong <cyd@gnu.org>
3605
3606 * fileio.c (Vfile_name_handler_alist): Doc fix.
3607
3608 * buffer.c (Fget_file_buffer): Protect against invalid file
3609 handler return value.
3610
310f5bd4
PE
36112012-02-20 Paul Eggert <eggert@cs.ucla.edu>
3612
cb3a28cc
PE
3613 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
3614 when computing $valmask.
3615
310f5bd4
PE
3616 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
3617 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
3618 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
3619 It's useless in that case, and it can cause problems on hosts
3620 that allocate halves of EMACS_INT values separately.
3621 Reported by Dan Horák. Diagnosed by Andreas Schwab in
3622 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
3623 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
3624 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
3625 it avoids undefined behavior on hosts where shifting right by more
3626 than the word width has undefined behavior.
3627
2375c96a
CY
36282012-02-19 Chong Yidong <cyd@gnu.org>
3629
3630 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
3631 (Funhandled_file_name_directory, Ffile_name_as_directory)
3632 (Fdirectory_file_name, Fexpand_file_name)
3633 (Fsubstitute_in_file_name): Protect against invalid file handler
3634 return values (Bug#10845).
3635
3eb49e71
EZ
36362012-02-18 Eli Zaretskii <eliz@gnu.org>
3637
3638 * .gdbinit (pitx): Fix incorrect references to fields of the
3639 iterator stack.
3640
7b926f3f
CY
36412012-02-17 Chong Yidong <cyd@gnu.org>
3642
3643 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
3644
11273115
PE
36452012-02-15 Paul Eggert <eggert@cs.ucla.edu>
3646
3647 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
3648 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
3649
c3a70e2b
CY
36502012-02-15 Chong Yidong <cyd@gnu.org>
3651
3652 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
3653 marked as special. Also, starting docstrings with * is obsolete.
3654
0ca43699
AS
36552012-02-13 Andreas Schwab <schwab@linux-m68k.org>
3656
3657 * gnutls.c (emacs_gnutls_write): Fix last change.
3658
2e8f3c56
LI
36592012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
3660
3661 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
3662 send_process.
3663
af70074f
SM
36642012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
3665
3666 * keymap.c (Fsingle_key_description): Handle char ranges.
3667
95986d52
CY
36682012-02-12 Chong Yidong <cyd@gnu.org>
3669
afd83bd1
CY
3670 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
3671 as that creates a dangerous corner case.
3672
95986d52
CY
3673 * window.c (Fdelete_window_internal): Invalidate the mouse
3674 highlight (Bug#9904).
3675
bd7da63e
GM
36762012-02-12 Glenn Morris <rgm@gnu.org>
3677
3678 * xselect.c (Fx_own_selection_internal)
3679 (Fx_get_selection_internal, Fx_disown_selection_internal)
3680 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
3681 * nsselect.m (Fx_own_selection_internal)
3682 (Fx_disown_selection_internal, Fx_selection_exists_p)
3683 (Fx_selection_owner_p, Fx_get_selection_internal):
3684 Sync docs and argument specs with the xselect.c versions.
3685
77abcbc2
LI
36862012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
3687
3688 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
3689
90b671e2
EZ
36902012-02-11 Eli Zaretskii <eliz@gnu.org>
3691
1c0ca0b7
EZ
3692 * w32select.c (Fx_selection_exists_p): Sync doc string and
3693 argument list with xselect.c. (Bug#10783)
3694
3695 * w16select.c (Fx_selection_exists_p): Sync doc string and
3696 argument list with xselect.c. (Bug#10783)
90b671e2 3697
49241268
GM
36982012-02-10 Glenn Morris <rgm@gnu.org>
3699
3700 * fns.c (Fsecure_hash): Doc fix.
3701
f998bbe7 37022012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
3703
3704 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
3705
0992bd9c
CY
37062012-02-07 Chong Yidong <cyd@gnu.org>
3707
3708 * buffer.c (Fbuffer_local_variables)
3709 (buffer_lisp_local_variables): Handle unbound vars correctly;
3710 don't let Qunbound leak into Lisp.
3711
af008560
GM
37122012-02-07 Glenn Morris <rgm@gnu.org>
3713
dd605cc4
GM
3714 * image.c (Fimagemagick_types): Doc fix.
3715
af008560
GM
3716 * image.c (imagemagick-render-type): Change it from a lisp object
3717 to an integer. Move the doc here from the lisp manual.
3718 Treat all values not equal to 0 the same.
3719
1449fa1d
CY
37202012-02-06 Chong Yidong <cyd@gnu.org>
3721
3722 * doc.c (store_function_docstring): Avoid applying docstring of
3723 alias to base function (Bug#2603).
3724
3723ec07
AS
37252012-02-04 Andreas Schwab <schwab@linux-m68k.org>
3726
3727 * .gdbinit (pp1, pv1): Remove redundant defines.
3728 (pr): Use pp.
3729
79c1cc1e
CY
37302012-02-04 Chong Yidong <cyd@gnu.org>
3731
3732 * nsterm.m: Declare a global (Bug#10694).
3733
d7f29f8e
EZ
37342012-02-04 Eli Zaretskii <eliz@gnu.org>
3735
cae07000
SM
3736 * w32.c (get_emacs_configuration_options):
3737 Include --enable-checking, if specified, in the return value.
d7f29f8e 3738
3b95a6f9
MR
37392012-02-04 Martin Rudalics <rudalics@gmx.at>
3740
3741 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
3742 after rounding frame sizes. (Bug#9723)
3743
d6fa96a6
EZ
37442012-02-04 Eli Zaretskii <eliz@gnu.org>
3745
3746 * keyboard.c (adjust_point_for_property): Don't position point
3747 before BEGV. (Bug#10696)
3748
df0b2940
PE
37492012-02-03 Paul Eggert <eggert@cs.ucla.edu>
3750
3751 Handle overflow when computing char display width (Bug#9496).
3752 * character.c (char_width): Return EMACS_INT, not int.
3753 (char_width, c_string_width): Check for overflow when
3754 computing the width; this is possible now that individual
3755 characters can have unbounded width. Problem introduced
3756 by merge from Emacs 23 on 2012-01-19.
3757
6bee44d6
MA
37582012-02-02 Michael Albinus <michael.albinus@gmx.de>
3759
3760 * dbusbind.c (Fdbus_register_method): Mention the return value
3761 :ignore in the docstring.
3762
44f92739
GM
37632012-02-02 Glenn Morris <rgm@gnu.org>
3764
1b9f60cc
GM
3765 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
3766
44f92739
GM
3767 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3768 Unconditionally set to t. (Bug#10673)
3769 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3770 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3771 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
3772
c5d3843c
KH
37732012-02-02 Kenichi Handa <handa@m17n.org>
3774
3775 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
3776 0, do not call append_composite_glyph.
3777
159462d4 37782012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
3779
3780 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
3781 NULL (Bug#6988).
3782 (x_produce_glyphs): If the component of a composition is a null
3783 string, set it->pixel_width to 1 to avoid zero-width glyph.
3784
78cef877
EZ
37852012-02-01 Eli Zaretskii <eliz@gnu.org>
3786
3787 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
3788 first 2 arguments are identical. This makes inserting large
3789 output from a subprocess an order of magnitude faster on
3790 MS-Windows, where all sbrk'ed memory is always contiguous.
3791
97897668
GM
37922012-01-31 Glenn Morris <rgm@gnu.org>
3793
3794 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 3795 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
3796 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
3797
31fd3586
GM
37982012-01-29 Glenn Morris <rgm@gnu.org>
3799
3800 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
3801
0e24a8b2
CY
38022012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
3803
3804 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
3805
cc0adcb0
CY
38062012-01-28 Chong Yidong <cyd@gnu.org>
3807
3808 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
3809
acc28cb9
CY
38102012-01-26 Chong Yidong <cyd@gnu.org>
3811
9c69cfb7
CY
3812 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
3813
acc28cb9
CY
3814 * search.c (Fsearch_forward, Fsearch_backward): Document negative
3815 repeat counts (Bug#10507).
3816
48da7392
GM
38172012-01-26 Glenn Morris <rgm@gnu.org>
3818
3819 * lread.c (syms_of_lread): Doc fix.
3820
14af5f7f
CY
38212012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
3822
3823 * coding.c (encode_designation_at_bol): Change return value to
3824 EMACS_INT.
3825
0b21c100
CY
38262012-01-25 Chong Yidong <cyd@gnu.org>
3827
3828 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
3829
3c2907f7
CY
38302012-01-21 Chong Yidong <cyd@gnu.org>
3831
3832 * floatfns.c (Fcopysign): Make the second argument non-optional,
3833 since nil is not allowed anyway.
3834
959ad23f
AS
38352012-01-21 Andreas Schwab <schwab@linux-m68k.org>
3836
3837 * process.c (read_process_output): Use p instead of XPROCESS (proc).
3838 (send_process): Likewise.
3839
34a02f46
MR
38402012-01-19 Martin Rudalics <rudalics@gmx.at>
3841
3842 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
3843 (Vwindow_persistent_parameters): Do not use Qstate.
3844 Rewrite doc-strings.
34a02f46 3845
1259009a 38462012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
3847
3848 * character.c (char_width): New function.
70d4fdf6
GM
3849 (Fchar_width, c_string_width, lisp_string_width):
3850 Use char_width (Bug#9496).
25ed9e61 3851
6a6ee00d
MR
38522012-01-16 Martin Rudalics <rudalics@gmx.at>
3853
3854 * window.c (Vwindow_persistent_parameters): New variable.
3855 (Fset_window_configuration, save_window_save): Handle persistent
3856 window parameters.
3857
c85efaf7
EZ
38582012-01-14 Eli Zaretskii <eliz@gnu.org>
3859
3860 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
3861 thrashing the stack of the thread. (Bug#9087)
3862
5944709e
PE
38632012-01-12 Paul Eggert <eggert@cs.ucla.edu>
3864
3865 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
3866
e71f5d99
EZ
38672012-01-11 Eli Zaretskii <eliz@gnu.org>
3868
3869 * xdisp.c (rows_from_pos_range): Handle the case where the
3870 highlight ends on a newline. (Bug#10464)
3871 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
3872 he end column for display of highlight that ends on a newline
3873 before a R2L line.
3874
ce316182
GM
38752012-01-11 Glenn Morris <rgm@gnu.org>
3876
3877 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
3878 from load-path also when installation-directory is nil. (Bug#10208)
3879
5b43da69
GM
38802012-01-10 Glenn Morris <rgm@gnu.org>
3881
74cc8ff9
GM
3882 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
3883
7d8d6e4e
GM
3884 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
3885 Update template values to be closer to their typical values these days.
5b43da69 3886
a0db8d43
EZ
38872012-01-09 Eli Zaretskii <eliz@gnu.org>
3888
3889 * xdisp.c (rows_from_pos_range): Accept additional argument
3890 DISP_STRING, and accept any glyph in a row whose object is that
3891 string as eligible for mouse highlight. Fixes mouse highlight of
3892 display strings from overlays. (Bug#10464)
3893
9a0115ab 38942012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 3895
b9110d6a 3896 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
3897 * fileio.c (auto_saving_dir_umask): New static var.
3898 (Fmake_directory_internal): Use it.
3899 (do_auto_save_make_dir): Set it, instead of invoking chmod after
3900 creating the directory. The old code temporarily assigns
3901 too-generous permissions to the directory.
3902 (do_auto_save_eh): Clear it.
b9110d6a 3903 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
3904 that the var is always cleared.
3905
6c1bd3f3
EZ
39062012-01-07 Eli Zaretskii <eliz@gnu.org>
3907
3908 * search.c (scan_buffer): Pass character positions to
3909 know_region_cache, not byte positions. (Bug#6540)
3910
069d2b50
L
39112012-01-07 LynX <_LynX@bk.ru> (tiny change)
3912
3913 * w32.c (sys_rename): Report EXDEV when rename of a directory
3914 fails because the target is on another logical disk. (Bug#10284)
3915
75bf0d33
DB
39162012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
3917
3918 * xterm.c (x_embed_request_focus): New function.
3919
3920 * xterm.h: Add prototype.
3921
3922 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
3923
1c6e5a32
GM
39242012-01-05 Glenn Morris <rgm@gnu.org>
3925
3926 * emacs.c (emacs_copyright): Update short copyright year to 2012.
3927
651e947e
EZ
39282012-01-01 Eli Zaretskii <eliz@gnu.org>
3929
3930 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
3931 Load gnutls_transport_set_lowat only if GnuTLS version is below
3932 2.11.1.
3933 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
3934 GnuTLS versions below 2.11.1.
3935
3778cdd8
AL
39362011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
3937
3938 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
3939 to the doc string advising against its use for altering the way
3940 windows are scrolled.
3941
0e5317f7
KH
39422011-12-28 Kenichi Handa <handa@m17n.org>
3943
3944 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
3945 coding-system ASCII compatible only when it does not produce BOM
3946 on encoding (Bug#10383).
3947
93d5ca1f
JD
39482011-12-26 Jan Djärv <jan.h.d@swipnet.se>
3949
3950 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
3951 can scroll.
3952 (create_and_show_popup_menu): Always use menu_position_func for
3953 Gtk3 (Bug#10361).
3954
ca22b785
AS
39552011-12-24 Andreas Schwab <schwab@linux-m68k.org>
3956
3957 * callint.c (Fcall_interactively): Don't truncate prompt string.
3958
d048e1e6
EZ
39592011-12-23 Eli Zaretskii <eliz@gnu.org>
3960
3961 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
3962 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 3963 resumed from there (after widening). (Bug#10360)
d048e1e6 3964
5ccaba1f
JD
39652011-12-22 Jan Djärv <jan.h.d@swipnet.se>
3966
3967 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
3968
204ee57f
JD
39692011-12-21 Jan Djärv <jan.h.d@swipnet.se>
3970
b81d40f0
JB
3971 * nsterm.m (x_free_frame_resources):
3972 Release f->output_data.ns->miniimage.
204ee57f
JD
3973 (ns_index_color): Fix indentation. Do not retain
3974 color_table->colors[i].
3975
3976 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
3977 before returning.
3978
3979 * nsfns.m (x_set_background_color): Assign return value from
3980 ns_index_color to face-background instead of NSColor*.
3981 (ns_implicitly_set_icon_type): Fix indentation.
3982 Change assignment in for loop to comparison.
3983
3984 * emacs.c (ns_pool): New variable.
3985 (main): Assign ns_pool.
3986 (Fkill_emacs): Call ns_release_autorelease_pool.
3987
3988 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
3989 autorelease fdesc, release fdAttrs and tdict.
3990 (ns_get_covering_families): Release charset.
3991 (ns_findfonts): Release NSFontDescriptor created with new.
3992 (ns_uni_to_glyphs): Fix indentation.
3993 (setString): Release attrStr before assigning new value.
3994
c803b2b7
JD
39952011-12-18 Jan Djärv <jan.h.d@swipnet.se>
3996
678f4426
JD
3997 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
3998 and NS_IMPL_COCOA.
3999 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
4000 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
4001
cd394be1 40022011-12-18 David Reitter <reitter@cmu.edu>
678f4426 4003
5fecd5fc
JD
4004 * nsterm.m (ns_term_init): Subscribe for notifications
4005 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
4006 to method trackingNotification in EmacsMenu.
4007
4008 * nsmenu.m (trackingMenu): New variable.
3771cb17 4009 (trackingNotification): New method (from Aquamacs).
5fecd5fc 4010 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 4011 from Aquamacs (Bug#7030).
678f4426
JD
4012
40132011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 4014
c803b2b7
JD
4015 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
4016 (symbol_to_nsstring): Fix indentation.
4017 (ns_symbol_to_pb): New function.
cae07000
SM
4018 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
4019 (Fns_rotate_cut_buffers_internal): Remove.
4020 (Fns_store_selection_internal): Rename from
c803b2b7
JD
4021 Fns_store_cut_buffer_internal.
4022 (ns_get_foreign_selection, Fx_own_selection_internal)
4023 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
4024 (Fns_get_selection_internal, Fns_store_selection_internal):
4025 Use ns_symbol_to_pb and check if return value is nil.
4026 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
4027 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
4028 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
4029 renamed to Sns_store_selection_internal.
4030 (ns_handle_selection_request): Move code to Fx_own_selection_internal
4031 and remove this function.
4032 (ns_handle_selection_clear): Remove, never used.
4033 (Fx_own_selection_internal): Move code from ns_handle_selection_request
4034 here.
4035
e1b01a3a
KB
40362011-12-17 Ken Brown <kbrown@cornell.edu>
4037
4038 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
4039 GID is unknown (Bug#10257).
4040
2adb6e85
PE
40412011-12-17 Paul Eggert <eggert@cs.ucla.edu>
4042
4043 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
4044 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
4045 which caused a build failure on GNU/Linux IA-64. This problem was
4046 introduced by my 2011-10-07 patch.
4047
d1d7b339
JL
40482011-12-15 Juri Linkov <juri@jurta.org>
4049
4050 * image.c (imagemagick_error): New function. (Bug#10112)
4051 (imagemagick_load_image): Comment out `MagickSetResolution' call.
4052 Use `imagemagick_error' where ImageMagick functions return
4053 `MagickFalse'.
4054 (Fimagemagick_types): Add `Fnreverse' to return the list in the
4055 proper order.
4056
100d5755
KH
40572011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4058
4059 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
4060 fill background (Bug#8992).
4061
454592a6
MR
40622011-12-13 Martin Rudalics <rudalics@gmx.at>
4063
4064 * window.c (Vwindow_combination_resize)
4065 (Vwindow_combination_limit): Use t instead of non-nil in
4066 doc-strings.
61d4b438
MR
4067 (Vrecenter_redisplay): Add first sentence of doc-string on
4068 separate line.
53524d93 4069 (Frecenter): Fix doc-string typo.
454592a6 4070
3633e3aa
KH
40712011-12-11 Kenichi Handa <handa@m17n.org>
4072
4073 * coding.c (Funencodable_char_position): Pay attention to the
4074 buffer text relocation (Bug#9389).
4075
7b9d523a 40762011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 4077
7b9d523a
JD
4078 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
4079 gtk_init (Bug#10100).
4080
b73189c6
EZ
40812011-12-10 Eli Zaretskii <eliz@gnu.org>
4082
4083 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
4084 IT->string is nil. (Bug#10263)
4085
f7dfe5d6
JD
40862011-12-10 Jan Djärv <jan.h.d@swipnet.se>
4087
83faebb4
JD
4088 * nsterm.h (x_free_frame_resources): Declare.
4089
f7dfe5d6
JD
4090 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
4091 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
4092
4093 * nsterm.h (ns_get_defaults_value): Declare.
4094
4095 * nsterm.m (ns_default): Call ns_get_defaults_value.
4096
7cd4e72c
EZ
40972011-12-09 Eli Zaretskii <eliz@gnu.org>
4098
4099 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
4100 (Bug#10170)
4101
b34d7317
YM
41022011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4103
4104 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
4105 that where the value of an _OBJC_* symbol points to is in the .bss
4106 section (Bug#10240).
4107
76470ad1
KH
41082011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4109
4110 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 4111 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 4112
745fff94
KH
41132011-12-08 Kenichi Handa <handa@m17n.org>
4114
4115 * ftfont.c (get_adstyle_property): Fix previous change
4116 (Bug#10233).
4117
6e44397c
JB
41182011-12-07 Juanma Barranquero <lekktu@gmail.com>
4119
4120 * w32.c (init_environment): If no_site_lisp, remove site-lisp
4121 dirs from the default value of EMACSLOADPATH (bug#10208).
4122
7efa6272
GM
41232011-12-07 Glenn Morris <rgm@gnu.org>
4124
4125 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
4126 installation and source directories as well. (Bug#10208)
4127
f6fc4d87
CY
41282011-12-06 Chong Yidong <cyd@gnu.org>
4129
4130 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
4131
2bf26180
GM
41322011-12-06 Glenn Morris <rgm@gnu.org>
4133
4134 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
4135 as an error, not just -1. (Bug#10217)
4136
3a6ad4f0
CY
41372011-12-05 Chong Yidong <cyd@gnu.org>
4138
4139 * keyboard.c (process_special_events): New function.
4140 (swallow_events, Finput_pending_p): Use it (Bug#10195).
4141
75a3b399
PE
41422011-12-05 Paul Eggert <eggert@cs.ucla.edu>
4143
4144 * coding.c (encode_designation_at_bol): Don't use uninitialized
4145 local variable (Bug#9318).
4146
c3c9e25e
KH
41472011-12-05 Kenichi Handa <handa@m17n.org>
4148
4149 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
4150 return Qnil (Bug#8046, Bug#10193).
4151
5eb05ea3
KH
41522011-12-05 Kenichi Handa <handa@m17n.org>
4153
4154 * coding.c (encode_designation_at_bol): New args charbuf_end and
4155 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
4156 (coding_set_source): Return how many bytes coding->source was
4157 relocated.
4158 (coding_set_destination): Return how many bytes
4159 coding->destination was relocated.
4160 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 4161 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
4162
41632011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4164
4165 * coding.c (CODING_CHAR_CHARSET_P): New macro.
4166 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
4167 macro (Bug#9318).
4168
41692011-12-05 Andreas Schwab <schwab@linux-m68k.org>
4170
4171 The following changes are to fix Bug#9318.
4172
a79703f5 4173 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
4174 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
4175 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 4176 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 4177
7dbda6df
JB
41782011-12-05 Juanma Barranquero <lekktu@gmail.com>
4179
4180 * lisp.h (process_quit_flag): Fix external declaration.
4181
6d5eb5b0
SM
41822011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
4183
4184 Don't macro-inline non-performance-critical code.
4185 * eval.c (process_quit_flag): New function.
4186 * lisp.h (QUIT): Use it.
4187
a0c3fad0
JD
41882011-12-04 Jan Djärv <jan.h.d@swipnet.se>
4189
4190 * nsfns.m (get_geometry_from_preferences): New function.
4191 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
4192
6c07aac2
AS
41932011-12-04 Andreas Schwab <schwab@linux-m68k.org>
4194
4195 * emacs.c (Qkill_emacs): Define.
4196 (syms_of_emacs): Initialize it.
4197 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
4198 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
4199 (quit_throw_to_read_char): Add parameter `from_signal'.
4200 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
4201 * lisp.h (QUIT): Call Fkill_emacs if requested.
4202
c052ead4
JD
42032011-12-03 Jan Djärv <jan.h.d@swipnet.se>
4204
4205 * widget.c (update_wm_hints): Return if wmshell is null.
4206 (widget_update_wm_size_hints): New function.
4207
4208 * widget.h (widget_update_wm_size_hints): Declare.
4209
4210 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
4211 widget_update_wm_size_hints (Bug#10104).
4212
9e49252b
EZ
42132011-12-03 Eli Zaretskii <eliz@gnu.org>
4214
4215 * xdisp.c (handle_invisible_prop): If the invisible text ends just
4216 before a newline, prepare the bidi iterator for consuming the
4217 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 4218 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 4219
02b16839
JL
42202011-12-02 Juri Linkov <juri@jurta.org>
4221
4222 * search.c (Fword_search_regexp): New Lisp function created from
4223 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
4224 (Fword_search_backward, Fword_search_forward)
4225 (Fword_search_backward_lax, Fword_search_forward_lax):
4226 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
4227 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
4228
0068070e
SM
42292011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
4230
4231 * fileio.c (Finsert_file_contents): Move after-change-function call
4232 to before the "handled:" label, since all "goto handled" appear in
4233 cases where the *-change-functions have already been properly called
4234 (bug#10117).
4235
3360a3fc
AS
42362011-12-01 Andreas Schwab <schwab@linux-m68k.org>
4237
4238 * keyboard.c (interrupt_signal): Don't call kill-emacs when
4239 waiting for input. (Bug#10169)
4240
73d6c093
EZ
42412011-11-30 Eli Zaretskii <eliz@gnu.org>
4242
4243 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
4244 verifies glyph row's hash code--we have just reallocated the
4245 glyphs, so their contents can be complete garbage. (Bug#10164)
4246
febe6bea
JB
42472011-11-30 Juanma Barranquero <lekktu@gmail.com>
4248
4249 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
4250
801a4313
EZ
42512011-11-30 Eli Zaretskii <eliz@gnu.org>
4252
4253 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
4254 attributes are tested _before_ calling verify_row_hash, to protect
4255 against GCC re-ordering of the tests. (Bug#10164)
4256
2b56b87e
JD
42572011-11-29 Jan Djärv <jan.h.d@swipnet.se>
4258
4259 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
4260
4261 * xterm.c (handle_one_xevent): Only set async_visible and friends
4262 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 4263 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
4264 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
4265
dbf31225
PE
42662011-11-28 Paul Eggert <eggert@cs.ucla.edu>
4267
4268 Remove GCPRO-related macros that exist only to avoid shadowing locals.
4269 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
4270 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
4271 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4272 All uses changed to use GCPRO1 etc.
4273 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
4274 Revert to old implementation (i.e., before 2011-03-11).
4275
1305621b
YM
42762011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4277
4278 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
4279 of scroll runs so as to avoid assigning disabled bogus rows and
4280 unnecessary graphics copy operations.
4281
8c9afb46
EZ
42822011-11-27 Eli Zaretskii <eliz@gnu.org>
4283
4284 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
4285 (snprintf) [_MSC_VER]: Redirect to _snprintf.
4286 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
4287 (malloc, free, realloc, calloc): Redirect to e_* only when
4288 compiling Emacs.
4289
4290 * lisp.h (GCTYPEBITS): Move before first use.
4291 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
4292 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
4293 this macro definition.
4294
4295 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
4296 _MSC_VER.
4297
54e9e3bf
JD
42982011-11-27 Jan Djärv <jan.h.d@swipnet.se>
4299
6d5eb5b0
SM
4300 * gtkutil.c (xg_create_frame_widgets):
4301 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
4302 present with Gtk+ 2.0.
4303
83aca1cb
PE
43042011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4305
4306 * fileio.c (Finsert_file_contents): Undo previous change; see
4307 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4308
5b76caa4
PE
43092011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4310
4311 Rename locals to avoid shadowing.
4312 * fileio.c (Finsert_file_contents):
4313 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
4314 * process.c (wait_reading_process_output):
4315 Rename inner 'proc' to 'p' to avoid shadowing.
4316 Indent for consistency with usual Emacs style.
4317
8c535114
EZ
43182011-11-25 Eli Zaretskii <eliz@gnu.org>
4319
4320 * xdisp.c (redisplay_window): If cursor row is not fully visible
4321 after recentering, and scroll-conservatively is set to a large
4322 number, scroll window by a few more lines to make the cursor fully
4323 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
4324 (start_display): Don't move to the next line if the display should
4325 start at a newline that is part of a display vector or an overlay
4326 string. (Bug#10119)
8c535114 4327
fa4fdb5c
JL
43282011-11-24 Juri Linkov <juri@jurta.org>
4329
4330 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
4331 after the `MagickPingImage' call. (Bug#10112)
4332
90ec88df
CY
43332011-11-23 Chong Yidong <cyd@gnu.org>
4334
4335 * window.c (Fcoordinates_in_window_p): Accept only live windows.
4336
56e2e794
MR
43372011-11-23 Martin Rudalics <rudalics@gmx.at>
4338
4339 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
4340 making another buffer current. (Bug#10114)
4341
b6e64c41
GM
43422011-11-23 Glenn Morris <rgm@gnu.org>
4343
4344 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
4345
6b21de18
CY
43462011-11-23 Chong Yidong <cyd@gnu.org>
4347
4348 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
4349 using it (Bug#5984).
4350
b12cd789
EZ
43512011-11-22 Eli Zaretskii <eliz@gnu.org>
4352
4353 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
4354 and header-lines, as they don't have one computed for them.
4355 (Bug#10098)
4356
4357 * .gdbinit (prow): Make displayed values more self-explaining.
4358 Add row's hash code.
4359
261b6fd4
LMI
43602011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
4361
4362 * process.c (wait_reading_process_output): Fix asynchrounous
4363 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 4364 (wait_reading_process_output): Add comment and URL.
261b6fd4 4365
e7cfd277
JD
43662011-11-21 Jan Djärv <jan.h.d@swipnet.se>
4367
4368 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
4369
a9b9b7f5
CY
43702011-11-21 Chong Yidong <cyd@gnu.org>
4371
4372 * window.c (Fnext_window, Fprevious_window): Doc fix.
4373
b0d15b4f
SM
43742011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4375
4376 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
4377
fe7a3057
JB
43782011-11-20 Juanma Barranquero <lekktu@gmail.com>
4379
4380 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
4381
d2999b1a
MR
43822011-11-20 Martin Rudalics <rudalics@gmx.at>
4383
4384 * window.c (Fset_window_combination_limit): Rename argument
4385 STATUS to LIMIT.
4386 (Vwindow_combination_limit): Remove "status" from doc-string.
4387
d5ff9cd0
AS
43882011-11-20 Andreas Schwab <schwab@linux-m68k.org>
4389
4390 * m/ibms390.h: Remove.
4391 * m/ibms390x.h: Don't include "ibms390.h".
4392
a5bb9bd3
SM
43932011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4394
4395 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
4396 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
4397
cd1181db
JB
43982011-11-20 Juanma Barranquero <lekktu@gmail.com>
4399
4400 * casetab.c (Fset_case_table):
4401 * charset.c (Fcharset_after): Fix typos.
4402
615a3b8d 44032011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 4404
17e845af
PE
4405 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
4406 Otherwise, valgrind does not work on some platforms.
4407 Problem reported by Andreas Schwab in
6a0bf43d
PE
4408 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
4409 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
4410 is set, removing the need for VIRT_ADDRESS_VARIES.
4411 (PURE_P): Use a more-efficient implementation that needs just one
4412 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
4413 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
4414 to 4 (xorl, subq, cmpq, setbe).
4415 * alloc.c (pure): Always extern now, since that's the
4416 VIRT_ADDR_VARIES behavior.
4417 (PURE_POINTER_P): Use a single comparison, not two, for
4418 consistency with the new puresize.h.
4419 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
4420 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
4421 Remove VIRT_ADDR_VARIES no longer needed.
4422
f8fe6f96
EZ
44232011-11-19 Eli Zaretskii <eliz@gnu.org>
4424
4425 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
4426 (erase_phys_cursor, update_window_cursor, show_mouse_face)
4427 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
4428 behave as if the cursor position were at the window margin.
4429
4430 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
4431 and the cursor position is out of bounds, behave as if the cursor
4432 position were at the window margin. (Bug#10075)
4433
df05a53c
CY
44342011-11-18 Chong Yidong <cyd@gnu.org>
4435
4436 * window.c (Fwindow_combination_limit): Make first argument
4437 non-optional, since it is meaningless for live windows like the
4438 selected window.
61ccba97 4439
2071918e
DA
44402011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
4441
4442 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
4443
b50a28de
SM
44442011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
4445
4446 * intervals.c: Fix grafting over the whole buffer (bug#10071).
4447 (graft_intervals_into_buffer): Simplify.
4448
015137db
EZ
44492011-11-18 Eli Zaretskii <eliz@gnu.org>
4450
4451 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
4452 hash values of the two rows.
4453 (copy_row_except_pointers): Preserve the used[] arrays and the
4454 hash values of the two rows. (Bug#10035)
68c95424 4455 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
4456
4457 * xdisp.c (row_hash): New function, body extracted from
4458 compute_line_metrics.
4459 (compute_line_metrics): Call row_hash, instead of computing the
4460 hash code inline.
4461
4462 * dispnew.c (verify_row_hash): Call row_hash for computing the
4463 hash code of a row, instead of duplicating code from xdisp.c.
4464
4465 * dispextern.h (row_hash): Add prototype.
4466
a2addb04
TH
44672011-11-18 Tassilo Horn <tassilo@member.fsf.org>
4468
4469 * frame.c (delete_frame): Don't delete the terminal when the last
4470 X frame is closed if emacs is built with GTK toolkit.
4471
df85d315
JB
44722011-11-17 Juanma Barranquero <lekktu@gmail.com>
4473
4474 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
4475
a0c2d0ae
MR
44762011-11-17 Martin Rudalics <rudalics@gmx.at>
4477
4478 * window.c (Vwindow_splits): Rename to
4479 Vwindow_combination_resize. Suggested by Juri Linkov.
4480 (Fsplit_window_internal): Use Vwindow_combination_resize instead
4481 of Vwindow_splits.
4482
58179cce
JB
44832011-11-16 Juanma Barranquero <lekktu@gmail.com>
4484
7877f373
JB
4485 * nsfns.m (Fns_font_name):
4486 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 4487
b6f67890
MR
44882011-11-16 Martin Rudalics <rudalics@gmx.at>
4489
4490 * window.h (window): Rename slot "nest" to "combination_limit".
4491 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
4492 (Fset_window_nest): Rename to Fset_window_combination_limit.
4493 (Vwindow_nest): Rename to Vwindow_combination_limit.
4494 (recombine_windows, make_parent_window, make_window)
4495 (Fsplit_window_internal, saved_window)
4496 (Fset_window_configuration, save_window_save): Rename all
4497 occurrences of window_nest to window_combination_limit.
4498
c7015153
JB
44992011-11-15 Juanma Barranquero <lekktu@gmail.com>
4500
4501 * image.c (imagemagick_load_image): Fix typo.
4502
322ad6ec
EZ
45032011-11-14 Eli Zaretskii <eliz@gnu.org>
4504
4505 * xdisp.c (display_line): Move the call to
4506 highlight_trailing_whitespace before the call to
4507 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
4508 faces of all the glyphs to compute ROW's hash value.
4509 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 4510
f067b8ec
JB
45112011-11-14 Juanma Barranquero <lekktu@gmail.com>
4512
4513 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
4514 just return (bug#10044).
4515
1e5b2111
EZ
45162011-11-12 Eli Zaretskii <eliz@gnu.org>
4517
7ef3cbd5
EZ
4518 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
4519 with user-defined heap size. Bump the default size of the temacs
4520 heap to 27MB, to avoid memory warning when running temacs.
4521 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
4522
1e5b2111
EZ
4523 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
4524 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
4525 (verify_row_hash) [XASSERTS]: New function.
4526 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
4527 that the hash value of glyph rows is correct.
1e5b2111 4528
89d61221
MR
45292011-11-12 Martin Rudalics <rudalics@gmx.at>
4530
4531 * window.h (window): Remove splits slot.
4532 * window.c (Fwindow_splits, Fset_window_splits): Remove.
4533 (Fdelete_other_windows_internal, make_parent_window)
4534 (make_window, Fsplit_window_internal, Fdelete_window_internal)
4535 (Fset_window_configuration, save_window_save): Don't deal with
4536 split status of windows.
4537 (saved_window): Remove splits slot.
4538 (Vwindow_splits): Rewrite doc-string.
4539
97f18cc8
JD
45402011-11-11 Jan Djärv <jan.h.d@swipnet.se>
4541
4542 * xfns.c (unwind_create_frame):
4543 * nsfns.m (unwind_create_frame):
4544 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
4545 Vframe_list (Bug#9999).
4546
22a648b4
DA
45472011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
4548
0b381c7e 4549 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 4550
659afede
KH
45512011-11-11 Kenichi Handa <handa@m17n.org>
4552
4553 * callproc.c (Fcall_process): Set the member dst_multibyte of
4554 process_coding.
4555
9ac0394b
KH
45562011-11-11 Johan Bockgård <bojohan@gnu.org>
4557
4558 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
4559 avoid a crash (bug#9496).
4560
2fbdc249
CY
45612011-11-09 Chong Yidong <cyd@gnu.org>
4562
4563 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4564 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
4565
ac6b1f81
PE
45662011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4567
4568 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
4569
09db192c
PE
45702011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4571
4572 Avoid some portability problems by eschewing 'extern inline' functions.
4573 The trivial performance wins aren't worth the portability hassles; see
4574 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
4575 et seq.
4576 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4577 (window_box_width, window_box_left, window_box_left_offset)
4578 (window_box_right, window_box_right_offset): Undo previous change,
4579 by removing the "extern"s.
4580 * intervals.c (adjust_intervals_for_insertion)
4581 (adjust_intervals_for_deletion): Undo previous change,
4582 making these static again.
4583 (offset_intervals, temp_set_point_both, temp_set_point)
4584 (copy_intervals_to_string): No longer inline.
4585 * xdisp.c (window_text_bottom_y, window_box_width)
4586 (window_box_height, window_box_left_offset)
4587 (window_box_right_offset, window_box_left, window_box_right)
4588 (window_box): No longer inline.
4589
105216ed
CY
45902011-11-08 Chong Yidong <cyd@gnu.org>
4591
4592 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
4593 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
4594 Signal an error if not a live window.
105216ed
CY
4595 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
4596 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
4597
ae9e237f
JB
45982011-11-07 Juanma Barranquero <lekktu@gmail.com>
4599
4600 * lisp.h (syms_of_abbrev): Remove declaration.
4601 Reported by CHENG Gao <chenggao@royau.me>.
4602
c7aa8333
EZ
46032011-11-07 Eli Zaretskii <eliz@gnu.org>
4604
4605 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
4606 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
4607 of temacs in GUI mode.
4608
be7f5545
MR
46092011-11-07 Martin Rudalics <rudalics@gmx.at>
4610
4611 * window.h: Declare delete_all_child_windows instead of
4612 delete_all_subwindows.
4613 * window.c (Fwindow_nest, Fset_window_nest)
4614 (Fset_window_new_total, Fset_window_new_normal)
4615 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
4616 (delete_all_subwindows): Rename to delete_all_child_windows.
4617 (Fdelete_other_windows_internal, Fset_window_configuration):
4618 Call delete_all_child_windows instead of delete_all_subwindows.
4619 * frame.c (delete_frame): Call delete_all_child_windows instead
4620 of delete_all_subwindows.
4621
ca78dc43
PE
46222011-11-07 Paul Eggert <eggert@cs.ucla.edu>
4623
4624 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
4625 This is also needed for porting to any host where GC_MARK_STACK is
4626 not GC_MAKE_GCPROS_NOOPS.
4627 (which_symbols): Use it.
4628
a0241d01
KH
46292011-11-07 Kenichi Handa <handa@m17n.org>
4630
4631 * coding.c (coding_set_destination): Check coding->src_pos only
4632 when coding->src_object is a buffer (bug#9910).
4633
4634 * process.c (send_process): Set the member src_multibyte of coding
4635 to 0 (bug#9911) when sending a unibyte text.
4636
4637 * callproc.c (Fcall_process): Set the member src_multibyte of
4638 process_coding to 0 (bug#9912).
4639
a64bfdfa 46402011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
4641
4642 * xmenu.c (cleanup_widget_value_tree): New function.
4643 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
4644 calling free_menubar_widget_value_tree directly (Bug#9830).
4645
cb41b32a
PE
46462011-11-06 Paul Eggert <eggert@cs.ucla.edu>
4647
4648 Fix some portability problems with 'inline'.
4649 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4650 (window_box_width, window_box_left, window_box_left_offset)
4651 (window_box_right, window_box_right_offset): Declare extern.
4652 Otherwise, these inline functions do not conform to C99 and
4653 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
4654 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
4655 * intervals.c (adjust_intervals_for_insertion)
4656 (adjust_intervals_for_deletion): Now extern, because otherwise the
4657 extern inline functions 'offset_intervals' couldn't refer to it.
4658 (static_offset_intervals): Remove.
4659 (offset_intervals): Rewrite using the old contents of
4660 static_offset_intervals. The old version didn't conform to C99
4661 because an extern inline function contained a reference to an
4662 identifier with static linkage.
4663
b7041366
AS
46642011-11-06 Andreas Schwab <schwab@linux-m68k.org>
4665
4666 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
4667 GC.
4668
88a37c4d
EZ
46692011-11-06 Eli Zaretskii <eliz@gnu.org>
4670
4671 * xdisp.c (init_iterator, reseat_to_string): Don't set the
4672 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
4673 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
4674 return Qleft_to_right.
4675
49745b39
CY
46762011-11-06 Chong Yidong <cyd@gnu.org>
4677
4678 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
4679 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
4680 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
4681 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
4682 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
4683 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
4684 (Fwindow_vscroll): Doc fix.
4685 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
4686 argument, since it makes no sense to pass a live window and for
4687 consistency with window-child.
4688
1f05cd82
CS
46892011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
4690
4691 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
4692 support MSVC.
4693
22610910
JR
46942011-11-05 Jason Rumney <jasonr@gnu.org>
4695
4696 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
4697 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
4698 fonts (Bug#6029).
4699 (add_font_entity_to_list): Fix logic errors in mixed boolean and
4700 bitwise arithmetic preventing use of unicode-sip and non-truetype
4701 opentype fonts.
4702
a06776b2
EZ
47032011-11-05 Eli Zaretskii <eliz@gnu.org>
4704
3ad924ba
EZ
4705 * s/ms-w32.h (fstat, stat, utime): Move redirections to
4706 "emacs"-only part.
4707
a06776b2
EZ
4708 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
4709 initialization code to keep similarity to xfns.c after changes
4710 from 2011-11-05.
4711
c9e7db78
JD
47122011-11-05 Jan Djärv <jan.h.d@swipnet.se>
4713
a97f8f3f
JD
4714 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
4715 (unwind_create_frame): New function (Bug#9943).
4716 (Fx_create_frame): Restructure code to be more similar to the one in
4717 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
4718 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
4719 Move terminal->reference_count++ just before making the frame official
4720 (Bug#9943).
4721
4722 * nsterm.m (x_free_frame_resources): New function.
4723 (x_destroy_window): Move code to x_free_frame_resources.
4724
c9e7db78 4725 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
4726 (Fx_create_frame, x_create_tip_frame):
4727 Move terminal->reference_count++ just before making the frame
75f1671a 4728 official. Move initialization of image_cache_refcount and
c9e7db78
JD
4729 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
4730
a6fc3b5c
EZ
47312011-11-05 Eli Zaretskii <eliz@gnu.org>
4732
4733 Support MSVC build with newer versions of Visual Studio.
4734 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
4735 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
4736 nt/gmake.defs.
4737
4738 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
4739 which are not supported by MSVC.
4740 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
4741 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
4742 bitfields.
4743 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
4744 types in bitfields.
4745 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
4746
4747 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
4748
58179cce 47492011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
4750
4751 Support MSVC build with newer versions of Visual Studio.
4752 * w32.c: Don't include w32api.h for MSVC.
4753 (init_environment) [_MSC_VER]: Call sys_access, not _access.
4754
4755 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
4756 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
4757 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
4758 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
4759 e_* cousins.
4760 (alloca) [_MSC_VER]: Define to _alloca.
4761
4762 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
4763
4764 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
4765
a58c13ed
EZ
47662011-11-04 Eli Zaretskii <eliz@gnu.org>
4767
4768 * xdisp.c (note_mouse_highlight): If either of
4769 previous/next-single-property-change returns nil, treat that as
4770 the beginning or the end of the buffer. (Bug#9955)
4771
fe0b6370
JD
47722011-11-04 Jan Djärv <jan.h.d@swipnet.se>
4773
a58c13ed 4774 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
4775 label is not null (Bug#9951).
4776 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
4777 may be NULL.
4778
89bd5ee1
EZ
47792011-11-04 Eli Zaretskii <eliz@gnu.org>
4780
4781 * window.c (Fwindow_body_size): Mention in the doc string that the
4782 return value is in frame's canonical units. (Bug#9949)
4783
84c3edb9
EZ
47842011-11-03 Eli Zaretskii <eliz@gnu.org>
4785
4e2fb5c7
EZ
4786 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
4787
84c3edb9 4788 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 4789 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 4790 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 4791
bc17a887
EZ
47922011-11-01 Eli Zaretskii <eliz@gnu.org>
4793
4794 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
4795 Don't stop backward scan on the continuation glyph, even though
4796 its CHARPOS is positive.
6d5eb5b0
SM
4797 (mouse_face_from_buffer_pos, note_mouse_highlight):
4798 Rename cover_string to disp_string.
bc17a887 4799
4ee88440
MR
48002011-11-01 Martin Rudalics <rudalics@gmx.at>
4801
4802 * window.c (temp_output_buffer_show): Don't use
4803 Vtemp_buffer_show_specifiers.
4804 (Vtemp_buffer_show_specifiers): Remove unused variable.
4805
c2ff3c02
EZ
48062011-10-30 Eli Zaretskii <eliz@gnu.org>
4807
4808 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
4809 past the beginning of the current glyph matrix.
4810
58179cce 48112011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
4812
4813 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
4814 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
4815 HAVE_GTK3 (Bug#9869).
b77a6a7f 4816
3b574623
JD
4817 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
4818 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
4819
b77a6a7f
JD
4820 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
4821
4822 * xterm.c: Declare x_handle_net_wm_state to return int.
4823 (handle_one_xevent): Check if we are iconified but don't have
4824 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
4825 (get_current_wm_state): Return non-zero if not hidden,
4826 check for _NET_WM_STATE_HIDDEN (Bug#9893).
4827 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
4828 (x_handle_net_wm_state): Return what get_current_wm_state returns.
4829 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
4830
196e41e4
PE
48312011-10-29 Paul Eggert <eggert@cs.ucla.edu>
4832
4833 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
4834 so that this new function doesn't get optimized away by a
4835 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
4836
021f2e1a
AS
48372011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4838
4839 * frame.h (MOUSE_HL_INFO): Remove excess parens.
4840
8b058d44
EZ
48412011-10-29 Eli Zaretskii <eliz@gnu.org>
4842
4843 Fix the `xbytecode' command.
4844 * .gdbinit (xprintbytestr): New command.
b50a28de 4845 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
4846 (xbytecode): Print the byte-code string as well.
4847
4452fb80
EZ
48482011-10-29 Kim Storm <storm@cua.dk>
4849
8b058d44
EZ
4850 * alloc.c (which_symbols): New function.
4851
21b72067
AS
48522011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4853
4854 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
4855 line. (Bug#9903)
4856
83ed7b5c
GM
48572011-10-29 Glenn Morris <rgm@gnu.org>
4858
4859 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
4860 Not clear what it was for, and it causes various bugs. (Bug#9839)
4861
5a7a728b
EZ
48622011-10-28 Eli Zaretskii <eliz@gnu.org>
4863
4864 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
4865 possible random value that matches one of those tested as
4866 condition to clear the mouse face.
4867
d3d0842f
CY
48682011-10-28 Chong Yidong <cyd@gnu.org>
4869
4870 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
4871
31b39d13
DN
48722011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
4873
4874 * window.c (make_window): Initialize phys_cursor_on_p.
4875
9aba6043
SM
48762011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4877
4878 * lisp.h (struct Lisp_Symbol): Update comments.
4879
c20992f4
JB
48802011-10-28 Juanma Barranquero <lekktu@gmail.com>
4881
4882 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
4883
db4f02f2
EZ
48842011-10-28 Eli Zaretskii <eliz@gnu.org>
4885
4886 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
4887 <oslsachem@gmail.com> for helping to debug this.
4888
4889 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
4890 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
4891 (g_b_init_get_glyph_outline_w): New static variables.
4892 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
4893 (GetGlyphOutlineW_Proc): New typedefs.
4894 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
4895 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
4896 New functions.
4897 (w32font_open_internal, compute_metrics):
4898 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
4899 instead of calling the "wide" APIs directly.
4900
4901 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
4902
4903 * w32.h (syms_of_w32font): Add prototype.
4904
87e68db4
JB
49052011-10-27 Juanma Barranquero <lekktu@gmail.com>
4906
4907 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
4908 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
4909 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
4910 (Fmove_to_window_line): Doc fix.
4911
435c1d67
CY
49122011-10-27 Chong Yidong <cyd@gnu.org>
4913
4914 * process.c (make_process): Set gnutls_state to NULL.
4915
4916 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
4917 non-NULL, regardless of GNUTLS_INITSTAGE.
4918 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
4919 an error. Set process slots as soon as we allocate them.
4920
4921 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
4922
9c6c6f49
CY
49232011-10-27 Chong Yidong <cyd@gnu.org>
4924
9aba6043
SM
4925 * gnutls.c (emacs_gnutls_deinit): New function.
4926 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
4927 (Fgnutls_deinit, Fgnutls_boot): Use it.
4928
4929 * process.c (make_process): Initialize GnuTLS credentials to NULL.
4930 (deactivate_process): Call emacs_gnutls_deinit.
4931
657d08d3
JB
49322011-10-27 Juanma Barranquero <lekktu@gmail.com>
4933
4934 * image.c (x_create_x_image_and_pixmap):
4935 * w32.c (sys_rename, w32_delayed_load):
4936 * w32font.c (fill_in_logfont):
4937 * w32reg.c (x_get_string_resource): Silence compiler warnings.
4938
5430d399
JB
49392011-10-26 Juanma Barranquero <lekktu@gmail.com>
4940
4941 * w32fns.c (w32_default_color_map): New function,
4942 extracted from Fw32_default_color_map.
a7ef684b 4943 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 4944
fe0055fa
PE
49452011-10-25 Paul Eggert <eggert@cs.ucla.edu>
4946
4947 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
4948
e6346438
SM
49492011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
4950
4951 * keyboard.c (test_undefined): New function (bug#9751).
4952 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
4953
e112cc37
ET
49542011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
4955
4956 * sysdep.c (init_sys_modes): Fix the check for the controlling
4957 terminal (Bug#6649).
4958
7b5d6677
EZ
49592011-10-20 Eli Zaretskii <eliz@gnu.org>
4960
4961 * dispextern.h (struct bidi_it): New member next_en_type.
4962
4963 * bidi.c (bidi_line_init): Initialize the next_en_type member.
4964 (bidi_resolve_explicit_1): When next_en_pos is valid for the
4965 current character, check also for next_en_type being WEAK_EN.
4966 (bidi_resolve_weak): Don't enter the expensive loop if the current
4967 position is before next_en_pos. Record the bidi type of the first
4968 non-ET, non-BN character we find, in addition to its position.
4969 (bidi_level_of_next_char): Invalidate next_en_type when
4970 next_en_pos is over-stepped.
4971
7da0b018
PE
49722011-10-20 Paul Eggert <eggert@cs.ucla.edu>
4973
4974 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
4975 * editfns.c: Rewrite current-time-zone so that it invokes
4976 the equivalent of (format-time-string "%Z") to get the time zone name.
4977 This fixes a bug when the time zone name contains characters that
4978 need converting from the system time locale to Emacs internal format.
4979 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
4980 that patch fixed format-time-string to do the conversion, but
4981 I forgot to fix current-time-zone.
4982 (format_time_string): New function, containing most of
4983 what Fformat_time_string used to contain.
4984 (Fformat_time_string): Rewrite in terms of format_time_string.
4985 This doesn't change this function's behavior.
4986 (current-time-zone): Rewrite to use format_time_string.
4987 This fixes the bug reported by Michael Schierl in
4988 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
4989 Jason Rumney's 2007-06-07 change worked around this bug, but
4990 didn't fix it.
4991 * systime.h (tzname, timezone): Remove no-longer-used declarations.
4992
8547b010
EZ
49932011-10-19 Eli Zaretskii <eliz@gnu.org>
4994
4995 * xdisp.c (start_display): If the character at POS is displayed
4996 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
4997 (try_window_reusing_current_matrix): If a line ends in a display
4998 vector or the next line starts in a display vector, continue
4999 redrawing the window even though the character position of
5000 start_row was reached.
8547b010
EZ
5001 (Bug#9771, part 2)
5002
4e948d15
CY
50032011-10-18 Chong Yidong <cyd@gnu.org>
5004
5005 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
5006 with nobreak-char-display too.
5007
4787455f
EZ
50082011-10-18 Eli Zaretskii <eliz@gnu.org>
5009
5010 Fix part 3 of bug#9771.
5011 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
5012 (bidi_resolve_neutral): Don't enter the expensive loop looking for
5013 non-neutral characters if the current character is a paragraph
5014 separator (a.k.a. Newline). This avoids running the same
5015 expensive loop twice, once when we consume the preceding newline
5016 and the other time when the line actually needs to be displayed.
5017 Avoid the loop when we see neutrals on the base embedding level
5018 following a character whose directionality is the same as the
5019 paragraph's. This avoids running the expensive loop when a line
5020 ends in a long sequence of neutrals, like control characters.
5021 Add assertion against STRONG_AL type. Slightly rearrange code
5022 that determines the type of a neutral given the first non-neutral
5023 that follows it.
5024 (bidi_level_of_next_char): Set next_en_pos to zero when
5025 invalidating its info.
5026
2c91f553
EZ
50272011-10-17 Eli Zaretskii <eliz@gnu.org>
5028
5029 * xdisp.c (push_display_prop): Determine whether to record string
5030 or buffer position by IT->string, not by IT->method. Allow
5031 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
5032 (move_it_vertically_backward): Don't look for character position
5033 immediately after the newline when in a continuation line.
5034 (Bug#9771, part 1)
2c91f553 5035
c7b08b0d
MR
50362011-10-15 Martin Rudalics <rudalics@gmx.at>
5037
5038 * window.c (coordinates_in_window): Rewrite and delabelize
5039 vertical border check. (Bug#5357) (Bug#9618)
5040
6b02f655
SM
50412011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
5042
5043 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
5044 errors in XSetWindowBorder (bug#9310).
5045
81d40c92
DA
50462011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
5047
5048 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
5049 avoid crash when xmalloc overrun checking is enabled.
5050
d4172c3b
EZ
50512011-10-13 Eli Zaretskii <eliz@gnu.org>
5052
5053 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
5054 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
5055 cursor motion with <left> and <right> arrow keys.
5056
5057 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
5058 some callers set that themselves.
5059
b00eea75
EZ
50602011-10-12 Eli Zaretskii <eliz@gnu.org>
5061
5062 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
5063 display string and the previous row comes from the same string and
5064 is empty. (Bug#9739) (Bug#9738)
5065
8fe012c4
SM
50662011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5067
5068 * doc.c (get_doc_string): Encode file name (bug#9735).
5069
0074aef2
EZ
50702011-10-12 Eli Zaretskii <eliz@gnu.org>
5071
79beb178
EZ
5072 * bidi.c (bidi_level_of_next_char):
5073 * xdisp.c (get_visually_first_element): Remove old incorrect
5074 comments regarding the Unicode Line Separator character.
5075
0074aef2
EZ
5076 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
5077
6e4b3fbe
DA
50782011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
5079
5080 * alloc.c (Fgc_status): Do not access beyond zombies array
5081 boundary if nzombies > MAX_ZOMBIES.
5082 * alloc.c (dump_zombies): Add missing format specifier.
5083
0324f3af
PE
50842011-10-12 Paul Eggert <eggert@cs.ucla.edu>
5085
b5525cac
PE
5086 * xdisp.c (set_cursor_from_row): Simplify conditionals,
5087 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
5088
0324f3af
PE
5089 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
5090 Some packages use them to denote characters with modifiers.
5091
e9b5f888
AS
50922011-10-11 Andreas Schwab <schwab@linux-m68k.org>
5093
5094 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
5095 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
5096 matching a pp-number. Rename parameter var to var1.
5097
127827c0
SM
50982011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5099
5100 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
5101
c8fd3bd0
GM
51022011-10-08 Glenn Morris <rgm@gnu.org>
5103
5104 * callint.c (Fcall_interactively): Give a more explicit error for the
5105 'c' case with a non-character input. (Bug#8479)
5106
352ec8ff
EZ
51072011-10-08 Eli Zaretskii <eliz@gnu.org>
5108
03669ccb
EZ
5109 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
5110 lines.
7061c986
EZ
5111 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
5112 lines that are hscrolled on the left.
03669ccb 5113
352ec8ff
EZ
5114 * dispnew.c (buffer_posn_from_coords): Account for a possible
5115 presence of header-line. (Bug#4426)
5116
a66cfb1c
SM
51172011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
5118
6b02f655
SM
5119 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
5120 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 5121
7c5ee88e
PE
51222011-10-07 Paul Eggert <eggert@cs.ucla.edu>
5123
5124 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
5125 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
5126 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
5127 this makes Emacs dump core during garbage collection on rare
5128 occasions. sizeof is obviously inferior to offsetof here, so
5129 stick with offsetof.
5130 (GC_POINTER_ALIGNMENT): New macro.
5131 (mark_memory): Omit 3rd (offset) arg; caller changed.
5132 Don't assume EMACS_INT alignment is the same as pointer alignment.
5133
df1bbe5b
SM
51342011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
5135
5136 * keyboard.c (read_key_sequence_remapped): New var.
5137 (read_key_sequence): Compute remapping in the right buffer.
5138 (command_loop_1): Use read_key_sequence's remapping directly.
5139
51553db6
SM
51402011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5141
32c1fffd
SM
5142 * dired.c (file_name_completion): Don't expand file name.
5143 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
5144 before checking file name handler.
5145
51553db6
SM
5146 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
5147 they've been requested explicitly (bug#9591).
5148
b6bd1599 51492011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
5150
5151 * keymap.c (Fsingle_key_description): Use make_specified_string
5152 instead of build_string to build string from push_key_description.
5153 (Bug#5193)
5154
f701dc2a
PE
51552011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5156
4222c55d
PE
5157 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
5158 This fixes a Y2038 bug on 64-bit hosts.
5159 * buffer.c (reset_buffer):
5160 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
5161 (Fclear_buffer_auto_save_failure):
5162 Use 0, not -1, to represent an unset failure time, since time_t
5163 might not be signed.
5164
f701dc2a
PE
5165 Remove dependency on glibc malloc internals.
5166 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5167 Move back here from lisp.h, but with their new implementations.
5168 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5169 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
5170 * charset.c (charset_table_init): New static var.
5171 (syms_of_charset): Use it instead of xmalloc. This removes a
5172 dependency on glibc malloc internals. See Eli Zaretskii's comment in
5173 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
5174 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5175 Move back to alloc.c.
5176 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5177 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
5178
9ceebf39
JD
51792011-09-30 Jan Djärv <jan.h.d@swipnet.se>
5180
5181 * nsterm.m (windowDidResize): Call x_set_window_size only when
5182 ns_in_resize is true. Otherwise set pixelwidth/height and
5183 call change_frame_size (Bug#9628).
5184
cb993c58
PE
51852011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5186
3930c88b
PE
5187 Port --enable-checking=all to Fedora 14 x86-64.
5188 * charset.c (syms_of_charset): Also account for glibc malloc's
5189 internal overhead when calculating the initial malloc maximum.
5190
cb993c58
PE
5191 Port --enable-checking=all to Fedora 14 x86.
5192 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5193 Move to lisp.h.
5194 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
5195 (overrun_check_realloc, overrun_check_free):
5196 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
5197 That way, xmalloc returns a properly-aligned pointer even if
5198 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
5199 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
5200 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
5201 into account when calculating the initial malloc maximum.
5202 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5203 Move here from alloc.c, so that charset.c can use it too.
5204 Properly align; the old code wasn't right for common 32-bit hosts
5205 when configured with --enable-checking=all.
5206 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5207 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
5208
31bed486
EZ
52092011-09-29 Eli Zaretskii <eliz@gnu.org>
5210
04c70788 5211 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
5212 use EDOM.
5213
fbcaa2f3
EZ
52142011-09-28 Eli Zaretskii <eliz@gnu.org>
5215
5216 * xdisp.c (compute_display_string_end): If there's no display
5217 string at CHARPOS, return -1.
5218
5219 * bidi.c (bidi_fetch_char): When compute_display_string_end
5220 returns a negative value, treat the character as a normal
5221 character not covered by a display string. (Bug#9624)
5222
a239d4e9
JB
52232011-09-28 Juanma Barranquero <lekktu@gmail.com>
5224
5225 * lread.c (Fread_from_string): Fix typo in docstring.
5226
88652fd5
EZ
52272011-09-27 Eli Zaretskii <eliz@gnu.org>
5228
5229 * xdisp.c (handle_invisible_prop): If invisible text ends on a
5230 newline, reseat the iterator instead of bidi-iterating there one
5231 character at a time. (Bug#9610)
32c1fffd
SM
5232 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
5233 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 5234
ed497dd4
AS
52352011-09-27 Andreas Schwab <schwab@linux-m68k.org>
5236
5237 * lread.c (readevalloop): Use correct code for NBSP.
5238 (read1): Likewise. (Bug#9608)
5239
b2bf61aa
MA
52402011-09-25 Michael Albinus <michael.albinus@gmx.de>
5241
5242 * dbusbind.c (Fdbus_register_signal): When service is not
5243 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
5244
32bbb17c
GM
52452011-09-25 Glenn Morris <rgm@gnu.org>
5246
5247 * buffer.c (truncate-lines): Doc fix.
5248
94e0933e
CY
52492011-09-24 Chong Yidong <cyd@stupidchicken.com>
5250
5251 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
5252 (Fset_window_next_buffers): Doc fix.
5253
cddde921
GM
52542011-09-24 Glenn Morris <rgm@gnu.org>
5255
5256 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
5257
1260aef1
PE
52582011-09-24 Paul Eggert <eggert@cs.ucla.edu>
5259
25b4bfa0
PE
5260 Fix minor problems found by static checking.
5261 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
5262 * indent.c (Fvertical_motion): Fix == vs = typo.
5263
e3cbd34b
EZ
52642011-09-24 Eli Zaretskii <eliz@gnu.org>
5265
a66cfb1c
SM
5266 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
5267 Default value is now t. Doc fix.
6bf7006f 5268
e3cbd34b 5269 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 5270 logic when moving up, not only when moving down. Fix the
e3cbd34b 5271 confusing name and values of the it_overshoot_expected variable;
32c1fffd 5272 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
5273
5274 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
5275 CHARPOS is covered by a display string which includes newlines.
5276 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
5277 is covered by a display string with embedded newlines.
5278
a3de0cbd
MA
52792011-09-24 Michael Albinus <michael.albinus@gmx.de>
5280
5281 * dbusbind.c (Fdbus_register_signal): Add match rule to
5282 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
5283 (Fdbus_register_method, Vdbus_registered_objects_table):
5284 Fix docstring.
a3de0cbd 5285
b260039d
JM
52862011-09-24 Jim Meyering <meyering@redhat.com>
5287
32c1fffd 5288 do not ignore write error for any output size
b260039d
JM
5289 The previous change was incomplete.
5290 While it makes emacs --batch detect the vast majority of stdout
5291 write failures, errors were still ignored whenever the output size is
5292 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
5293 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
5294 && echo FAIL: ignored write error
5295 FAIL: ignored write error
5296 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
5297 && echo FAIL: ignored write error
5298 FAIL: ignored write error
5299 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
5300
8eca8a7c
AS
53012011-09-23 Andreas Schwab <schwab@linux-m68k.org>
5302
5303 * emacs.c (Fkill_emacs): In noninteractive mode exit
5304 non-successfully if a write error occurred on stdout. (Bug#9574)
5305
3341db62
EZ
53062011-09-21 Eli Zaretskii <eliz@gnu.org>
5307
5308 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
5309 the xassert test.
5310
5311 * dispextern.h (struct it): Update the comment documenting what
5312 can it->OBJECT be.
5313
8c203dbf
EZ
53142011-09-20 Eli Zaretskii <eliz@gnu.org>
5315
5316 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
5317 a display string, extend search for cursor position to end of row.
5318 (find_row_edges): If the row ends in a newline from a display
5319 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
5320 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
5321 (Fcurrent_bidi_paragraph_direction): Fix search for previous
5322 non-empty line. Fixes confusing cursor motion with arrow keys at
5323 the beginning of a line that starts with whitespace.
8c203dbf 5324
a4824228
LMI
53252011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5326
5327 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
5328 (bug#9493).
5329
33ed493b
CY
53302011-09-18 Chong Yidong <cyd@stupidchicken.com>
5331
5332 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
5333 boolean (Bug#9154).
5334
56cd55c8
EZ
53352011-09-18 Eli Zaretskii <eliz@gnu.org>
5336
5337 * xdisp.c (display_line): Record maximum and minimum buffer
5338 positions even if no glyphs were produced (e.g., by a zero-width
5339 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
5340 buffer positions that will be removed from the glyph row because
5341 they don't fit.
c02dcedf
EZ
5342 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
5343 column is beyond frame width: don't subtract 1 "pixel" when
5344 computing width of the stretch.
3e62b7e0
EZ
5345 (reseat_at_next_visible_line_start): Undo the change made on
5346 2011-09-17 that saved paragraph information and restored it after
5347 the call to `reseat'. (Bug#9545)
56cd55c8 5348
5ed99d36 53492011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
5350
5351 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
5352 and turn window cursor on if cleared (Bug#9415).
5353
5ed99d36 53542011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
5355
5356 * search.c (boyer_moore): Take unibyte characters from pattern
5357 literally. (Bug#9458)
5358
9bade7b2
EZ
53592011-09-18 Eli Zaretskii <eliz@gnu.org>
5360
5361 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
5362
e5e9d610
PE
53632011-09-18 Paul Eggert <eggert@cs.ucla.edu>
5364
87e4427a
PE
5365 Fix minor problem found by static checking.
5366 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
5367 initialized, to pacify gcc -Wuninitialized.
5368
e5e9d610
PE
5369 * fileio.c: Report proper errno when syscall falls.
5370 (Finsert_file_contents): Save and restore errno,
5371 so that report_file_error outputs the correct diagnostic.
5372 (Fwrite_region) [CLASH_DETECTION]: Likewise.
5373
a1674f0b
EZ
53742011-09-18 Eli Zaretskii <eliz@gnu.org>
5375
5376 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
5377
fbfb6dd4
EZ
53782011-09-17 Eli Zaretskii <eliz@gnu.org>
5379
5380 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
5381 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
5382
bb187662
EZ
53832011-09-17 Eli Zaretskii <eliz@gnu.org>
5384
1137e8b8 5385 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 5386 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
5387
5388 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
5389 (bidi_find_paragraph_start): Search back for paragraph beginning
5390 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
5391 (bidi_move_to_visually_next): Only trigger paragraph-related
5392 computations when the last character is a newline or at EOB, not
5393 just any NEUTRAL_B. (Bug#9470)
5394
bb187662
EZ
5395 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
5396 truncated lines if point is covered by a display string. (Bug#9524)
5397
2e621251
PE
53982011-09-16 Paul Eggert <eggert@cs.ucla.edu>
5399
5400 * xselect.c: Relax test for outgoing X longs (Bug#9498).
5401 (cons_to_x_long): New function.
5402 (lisp_data_to_selection_data): Use it. Correct the test for
5403 short-versus-long data; it was negated. Break out of vector
5404 loop, for efficiency, when a long datum is discovered.
5405
91a15bc6
SM
54062011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
5407
5408 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
5409
b41c3a35
EZ
54102011-09-16 Eli Zaretskii <eliz@gnu.org>
5411
5412 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
5413 GCC PR/17406) by declaring this function with external scope.
5414
7812ba2d
PE
54152011-09-15 Paul Eggert <eggert@cs.ucla.edu>
5416
5417 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
5418 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
5419
cf7edc2a
AS
54202011-09-15 Andreas Schwab <schwab@linux-m68k.org>
5421
5422 * editfns.c (Fformat): Correctly handle text properties on "%%".
5423
bd01620e
EZ
54242011-09-15 Eli Zaretskii <eliz@gnu.org>
5425
5426 * xterm.c (x_draw_composite_glyph_string_foreground):
5427 * w32term.c (x_draw_composite_glyph_string_foreground):
5428 * term.c (encode_terminal_code):
5429 * composite.c (composition_update_it, get_composition_id):
5430 * xdisp.c (get_next_display_element)
5431 (fill_composite_glyph_string): Add comments about special meaning
5432 of TAB characters in a composition.
5433
a02719a3
PE
54342011-09-15 Paul Eggert <eggert@cs.ucla.edu>
5435
5436 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
5437 This occurs when processing a multibyte format.
5438 Problem reported by Wolfgang Jenker.
a02719a3 5439
72589a3c
JB
54402011-09-15 Johan Bockgård <bojohan@gnu.org>
5441
5442 * xdisp.c (try_cursor_movement): Only check for exact match if
5443 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
5444
1c14176c
PE
54452011-09-14 Paul Eggert <eggert@cs.ucla.edu>
5446
5447 Remove unused external symbols.
5448 * dispextern.h (calc_pixel_width_or_height): Remove decl.
5449 * xdisp.c (calc_pixel_width_or_height): Now static.
5450 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
5451 * indent.c (check_display_width):
5452 * w32term.c: Fix comment to match code.
5453 * xterm.c, xterm.h (x_catching_errors): Remove.
5454
d2eea5b5
PE
54552011-09-14 Paul Eggert <eggert@cs.ucla.edu>
5456
5457 * xselect.c: Use signed conversions more consistently (Bug#9498).
5458 (selection_data_to_lisp_data): Assume incoming selection data are
5459 signed integers, not unsigned. This is to be consistent with
5460 outgoing selection data, which was modified to use signed integers
5461 in as part of the fix to Bug#9196 in response to Jan D.'s comment
5462 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
5463 expects long, not unsigned long.
5464
46888499
EZ
54652011-09-14 Eli Zaretskii <eliz@gnu.org>
5466
5467 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
5468 computation of loop end. Reported by Johan Bockgård
5469 <bojohan@gnu.org>.
5470
ef8ef9fb
CY
54712011-09-13 Chong Yidong <cyd@stupidchicken.com>
5472
5473 * frame.c (Fother_visible_frames_p): Function deleted.
5474
fa819fed
EZ
54752011-09-12 Eli Zaretskii <eliz@gnu.org>
5476
5477 * indent.c (compute_motion): Process display vector front to back
5478 rather than the other way around. (Bug#2496)
5479
2ba8e008
SM
54802011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5481
5482 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
5483
20f53c69
CY
54842011-09-11 Chong Yidong <cyd@stupidchicken.com>
5485
5486 * minibuf.c (Fread_from_minibuffer): Doc fix.
5487
d562d7a4
EZ
54882011-09-11 Eli Zaretskii <eliz@gnu.org>
5489
5490 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
5491 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
5492
1c4d7f3d
LMI
54932011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5494
5495 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
5496 value for non-existent files.
5497
b885bf36
EZ
54982011-09-11 Eli Zaretskii <eliz@gnu.org>
5499
5500 * fileio.c (Finsert_file_contents): If the file cannot be opened,
5501 set its "size" to -1. This will set the modtime_size field of
5502 the corresponding buffer to -1, which is what
5503 verify-visited-file-modtime expects for files that do not exist.
5504 (Bug#9139)
5505
6612f0bf
PE
55062011-09-11 Paul Eggert <eggert@cs.ucla.edu>
5507
5508 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
5509 here ...
5510 * lisp.h: ... from here. push_key_description is no longer
5511 defined in keyboard.c, so its declaration should not be in
5512 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
5513 logically belongs with push_key_description.
5514
dfb3f755
PE
55152011-09-10 Paul Eggert <eggert@cs.ucla.edu>
5516
5517 * buffer.h: Include <sys/types.h> instead of <time.h>.
5518 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
5519 Problem reported by Herbert J. Skuhra.
5520
3134906c
LMI
55212011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
5522
5523 * xml.c (parse_region): Make the parsing work for
5524 non-comment-starting XML files again (bug#9144).
5525
8d903f4e
AS
55262011-09-10 Andreas Schwab <schwab@linux-m68k.org>
5527
5528 * image.c (gif_load): Fix calculation of bottom and right corner.
5529 (Bug#9468)
5530
80ad64f4
EZ
55312011-09-10 Eli Zaretskii <eliz@gnu.org>
5532
5533 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
5534 redisplay in small windows.
5535
208a048d
EZ
55362011-09-09 Eli Zaretskii <eliz@gnu.org>
5537
5538 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
5539
9b1c252e
MR
55402011-09-08 Martin Rudalics <rudalics@gmx.at>
5541
5542 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
5543 Operate on live windows only.
5544
2949f33b
JB
55452011-09-08 Juanma Barranquero <lekktu@gmail.com>
5546
5547 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
5548
e08dcafd
EZ
55492011-09-07 Eli Zaretskii <eliz@gnu.org>
5550
5551 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
5552 only under bidi iteration.
5553
115b96bd
JD
55542011-09-07 Jan Djärv <jan.h.d@swipnet.se>
5555
5556 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
5557
c8199d0f
PE
55582011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5559
5560 isnan: Fix porting problem to Solaris 10 with bundled gcc.
5561 Without this fix, the command to link temacs failed due to an
5562 undefined symbol __builtin_isnan. This is because
5563 /usr/include/iso/math_c99.h #defines isnan(x) to
5564 __builtin_isnan(x), but the bundled gcc, which identifies itself
5565 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
5566 a __builtin_isnan.
5567 * floatfns.c (isnan): #undef, and then #define to a clone of
5568 what's in data.c.
5569 (Fisnan): Always define, since it's always available now.
5570 (syms_of_floatfns): Always define isnan at the Lisp level.
5571
e39b275c 55722011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
5573
5574 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
5575
b2db44d9 55762011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 5577
f4af5137 5578 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
5579 The previous code assumed that file offsets (off_t values) fit in
5580 EMACS_INT variables, which is not true on typical 32-bit hosts.
5581 The code messed up by falsely reporting buffer overflow in cases
5582 such as (insert-file-contents "big" nil 1 2) into an empty buffer
5583 when "big" contains more than 2**29 bytes, even though this
5584 inserts just one byte and does not overflow the buffer.
5585 (Finsert_file_contents): Store file offsets as off_t
5586 values, not as EMACS_INT values. Check for overflow when
5587 converting between EMACS_INT and off_t. When checking for
5588 buffer overflow or for overlap, take the offsets into account.
5589 Don't use EMACS_INT for small values where int suffices.
5590 When checking for overlap, fix a typo: ZV was used where
5591 ZV_BYTE was intended.
5592 (Fwrite_region): Don't assume off_t fits into 'long'.
5593 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
5594
ecfc0a49
MA
55952011-09-05 Michael Albinus <michael.albinus@gmx.de>
5596
5597 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
5598
6511acf2 55992011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 5600
0999621a 5601 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
5602
5603 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 5604 (esprintf, exprintf, evxprintf): New functions.
62f19c19 5605 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 5606 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
5607 (modify_event_symbol): Do not assume that the length of
5608 name_alist_or_stem is safe to alloca and fits in int.
5609 (Fexecute_extended_command): Likewise for function name and binding.
5610 (Frecursion_depth): Wrap around reliably on integer overflow.
5611 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
5612 since some callers pass EMACS_INT values.
5613 (Fsingle_key_description): Don't crash if symbol name contains more
5614 than MAX_ALLOCA bytes.
5615 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
5616 (get_minibuffer): Arg is now EMACS_INT, not int.
5617 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 5618 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
5619 * window.h (command_loop_level, minibuf_level): Reflect API changes.
5620
2be7d702
PE
5621 * dbusbind.c (signature_cat): New function.
5622 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
5623 Do not overrun buffer; instead, report string overflow.
5624
9d1df220
PE
5625 * dispnew.c (add_window_display_history): Don't overrun buffer.
5626 Truncate instead; this is OK since it's just a log.
5627
33ef5c64
PE
5628 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
5629 even if the time zone offset is outlandishly large.
5630 Don't mishandle offset == INT_MIN.
5631
66c6fdd5
PE
5632 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
5633 when creating daemon; the previous buffer-overflow check was incorrect.
5634
d749b01b
PE
5635 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
5636 which has the guts of the old verror function.
5637
b5cd1905
PE
5638 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
5639 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
5640
6e1a67fb
PE
5641 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
5642 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 5643 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 5644 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
5645 length of string rather than counting it via multiple sprintfs;
5646 that's simpler and more reliable.
c21721cc
PE
5647 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
5648 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
5649 sprintf, in case result does not fit in int.
5650
c57b67fc
PE
5651 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
5652 (fontset_from_font): Print it.
5653
8a401434
PE
5654 * frame.c (tty_frame_count): Now printmax_t, not int.
5655 (make_terminal_frame, set_term_frame_name): Print it.
5656 (x_report_frame_params): In X, window IDs are unsigned long,
5657 not signed long, so print them as unsigned.
5658 (validate_x_resource_name): Check for implausibly long names,
5659 and don't assume name length fits in 'int'.
5660 (x_get_resource_string): Don't blindly alloca invocation name;
5661 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
5662 not fit in int.
5663
6e1a67fb
PE
5664 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
5665 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
5666 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
5667
0df02bf3
PE
5668 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
5669 Use esprintf, not sprintf, in case result does not fit in int.
5670
48e30793
PE
5671 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5672 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
5673 it as a large positive number.
5674 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
5675 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5676
a66ff6d8
PE
5677 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
5678 in case result does not fit in int.
5679
aca216ff
PE
5680 * print.c (float_to_string): Detect width overflow more reliably.
5681 (print_object): Make sprintf buffer a bit bigger, to avoid potential
5682 buffer overrun. Don't assume list length fits in 'int'. Treat
5683 print length of 0 as 0, not as infinity; to be consistent with other
5684 uses of print length in this function. Don't overflow print length
5685 index. Don't assume hash table size fits in 'long', or that
5686 vectorlike size fits in 'unsigned long'.
5687
31c286f7
PE
5688 * process.c (make_process): Use printmax_t, not int, to format
5689 process-name gensyms.
5690
55e5faa1
PE
5691 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
5692
80f2e268
PE
5693 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
5694 to avoid potential buffer overrun.
5695
670741ab
PE
5696 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
5697 if X resource line is longer than 512 bytes.
5698
b7163a50
PE
5699 * xfns.c (x_window): Make sprintf buffer a bit bigger
5700 to avoid potential buffer overrun.
5701
ae58ff1f
PE
5702 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
5703
c43c8a6a
PE
5704 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
5705
3f8236f4
PE
57062011-09-04 Paul Eggert <eggert@cs.ucla.edu>
5707
53e9fe90 5708 Integer overflow fixes for scrolling, etc.
6511acf2
PE
5709 Without these, Emacs silently mishandles large integers sometimes.
5710 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
5711 it were "C-u 1 M-x recenter" on a typical 64-bit host.
5712
6511acf2
PE
5713 * xdisp.c (try_window_id): Check Emacs fixnum range before
5714 converting to 'int'.
806add1d 5715
6511acf2 5716 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
5717 Check that an Emacs fixnum is in range before assigning it to 'int'.
5718 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
5719 values converted from Emacs fixnums.
5720 (Frecenter): Don't wrap around a line count if it is out of 'int'
5721 range; instead, treat it as an extreme value.
5722 (Fset_window_configuration, compare_window_configurations):
5723 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
5724
6511acf2
PE
5725 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
5726 that can exceed INT_MAX. Check that EMACS_INT value is in range
5727 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
5728 (match_limit): Don't assume that a fixnum can fit in 'int'.
5729
6511acf2 5730 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
5731 exceed INT_MAX.
5732
6511acf2 5733 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
5734 (Fvertical_motion): Don't wrap around LINES values that don't fit
5735 in 'int'. Instead, treat them as extreme values. This is good
5736 enough for windows, which can't have more than INT_MAX lines anyway.
5737
fcb901a7
LMI
57382011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5739
0f2f6b6d
LMI
5740 * Require libxml/parser.h to avoid compilation warning.
5741
fcb901a7
LMI
5742 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
5743
5744 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
5745 since this reportedly can destroy thread storage.
5746
6e20a0d4
CY
57472011-08-30 Chong Yidong <cyd@stupidchicken.com>
5748
5749 * syntax.c (find_defun_start): Update all cache variables if
5750 exiting early (Bug#9401).
5751
148ae00e
EZ
57522011-08-30 Eli Zaretskii <eliz@gnu.org>
5753
f6cfbd8f
EZ
5754 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
5755
148ae00e
EZ
5756 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
5757 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
5758 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
5759
5760 * term.c (tty_append_glyph): New function.
5761 (produce_stretch_glyph): Static function and its prototype deleted.
5762
a66cfb1c
SM
5763 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
5764 Add prototypes.
148ae00e 5765
c4a07a4c
PE
57662011-08-29 Paul Eggert <eggert@cs.ucla.edu>
5767
5768 * image.c (parse_image_spec): Check for nonnegative, not for positive,
5769 when checking :margin (Bug#9390).
5770 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 5771 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
5772 so that the name doesn't mislead. All uses changed.
5773
6bc8cd65
JB
57742011-08-28 Johan Bockgård <bojohan@gnu.org>
5775
5776 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
5777 set_tty_hooks.
5778
dca4927e
EZ
57792011-08-27 Eli Zaretskii <eliz@gnu.org>
5780
5781 * xdisp.c (move_it_to): Don't bail out early when reaching
5782 position beyond to_charpos, if we are scanning backwards.
5783 (move_it_vertically_backward): When DY == 0, make sure we get to
5784 the first character in the line after the newline.
5785
f2cad773
PE
57862011-08-27 Paul Eggert <eggert@cs.ucla.edu>
5787
5788 * ccl.c: Improve and simplify overflow checking (Bug#9196).
5789 (ccl_driver): Do not generate an out-of-range pointer.
5790 (Fccl_execute_on_string): Remove unnecessary check for
5791 integer overflow, noted by Stefan Monnier in
5792 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
5793 Remove a FIXME that didn't need fixing.
5794 Simplify the newly-introduced buffer reallocation code.
5795
0cae2cdb
JB
57962011-08-27 Juanma Barranquero <lekktu@gmail.com>
5797
5798 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
5799
5fc295a4 58002011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 5801
70c60eb2 5802 Integer and memory overflow issues (Bug#9196).
726e0ab1 5803
d31850da
PE
5804 * doc.c (get_doc_string): Rework so that
5805 get_doc_string_buffer_size is the actual buffer size, rather than
5806 being 1 less than the actual buffer size; this makes xpalloc more
5807 convenient.
5808
a69fbedb
PE
5809 * image.c (x_allocate_bitmap_record, cache_image):
5810 * xselect.c (Fx_register_dnd_atom):
5811 Simplify previous changes by using xpalloc.
5812
fe5c5d37
PE
5813 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
5814 since either will do and ptrdiff_t is convenient with xpalloc.
5815
0065d054
PE
5816 * charset.c (charset_table_size)
5817 (struct charset_sort_data.priority): Now ptrdiff_t.
5818 (charset_compare): Don't overflow if priorities differ greatly.
5819 (Fsort_charsets): Don't assume list length fits in int.
5820 Check for size-calculation overflow when allocating sort data.
5821 (syms_of_charset): Allocate an initial charset table that is
5822 just under 64 KiB, to avoid problems with glibc malloc and mmap.
5823
5824 * cmds.c (internal_self_insert): Check for size-calculation overflow.
5825
5826 * composite.h (struct composition.glyph_len): Now int, not unsigned.
5827 The actual value is always <= INT_MAX, and leaving it unsigned made
5828 overflow checking harder.
5829
5830 * dispextern.h (struct glyph_matrix.rows_allocated)
5831 (struct face_cache.size): Now ptrdiff_t, for convenience in use
5832 with xpalloc. The values are still always <= INT_MAX.
5833
5834 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
5835
5836 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
5837 (SAFE_NALLOCA): New macro.
5838
5839 * region-cache.c (struct boundary.pos, find_cache_boundary)
5840 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
5841 (set_cache_region, invalidate_region_cache)
5842 (revalidate_region_cache, know_region_cache, region_cache_forward)
5843 (region_cache_backward, pp_cache):
5844 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
5845 so that ptrdiff_t * can be passed to xpalloc.
5846 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
5847 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
5848 (pp_cache): Don't assume cache_len fits in int.
5849 * region-cache.h: Adjust extern decls to match.
5850
5851 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
5852 EMACS_INT, since either will do, for xpalloc.
5853
5854 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
5855 (xnmalloc, xnrealloc, xpalloc): New functions.
5856
726e0ab1
PE
5857 * bidi.c (bidi_shelve_header_size): New constant.
5858 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
5859 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
5860
51f30bc5 5861 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
5862 * buffer.c (overlays_at, overlays_in, record_overlay_string)
5863 (overlay_strings):
5864 Don't update size of array until after memory allocation succeeds,
5865 because xmalloc/xrealloc may not return.
0065d054
PE
5866 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
5867 now that we have proper integer overflow checking.
5868 (record_overlay_string, overlay_strings): Catch overflows when
5869 calculating size of overlay_str_buf.
726e0ab1 5870
0065d054
PE
5871 * callproc.c (Fcall_process): Check for size overflow when
5872 calculating size of args2.
5873 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
5874 Normally we prefer signed values, but sticking with ptrdiff_t would
5875 require adding more-complicated checks.
726e0ab1
PE
5876
5877 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
5878 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
5879 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 5880 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
5881
5882 * character.c (Fstring): Check for size-calculation overflow.
5883
5884 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
5885 unnecessary integer overflow. Check for size overflow.
5886 (encode_coding_object): Don't update size until xmalloc succeeds.
5887
5888 * composite.c (get_composition_id): Check for overflow in glyph
5889 length calculations.
5890
5891 Integer and memory overflow fixes for display code.
5892 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
5893 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
5894 (scrolling_window): Check for overflow in size calculations.
5895 (line_draw_cost, realloc_glyph_pool, add_row_entry):
5896 Don't assume glyph table len fits in int.
5897 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
5898 (row_table_size): Now ptrdiff_t, not int.
5899 (scrolling_window): Avoid overflow in size calculations.
5900 Don't update size until allocation succeeds.
5901 * fns.c (concat): Check for overflow in size calculations.
5902 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
5903 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5904 (NEXT_ALMOST_PRIME_LIMIT): New constant.
5905
5906 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
5907 (get_doc_string): Check for size calculation overflow.
5908 Don't update size until allocation succeeds.
5909 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
5910 EMACS_INT, where ptrdiff_t will do.
5911 (Fsubstitute_command_keys): Check for string overflow.
5912
5913 * editfns.c (set_time_zone_rule): Don't assume environment length
5914 fits in int.
5915 (message_length): Now ptrdiff_t, not int.
5916 (Fmessage_box): Don't update size until allocation succeeds.
5917 Don't assume message length fits in int.
5918 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
5919
0065d054
PE
5920 * emacs.c (main): Do not reallocate argv, since there is a null at
5921 the end that can be overwritten, and this way there's no need to
5922 worry about size-calculation overflow.
5923 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
5924
5925 * eval.c (init_eval_once, grow_specpdl): Don't update size until
5926 alloc succeeds.
5927 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
5928
5929 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
5930 (x_set_scroll_bar_width, x_figure_window_size):
5931 Check for integer overflow.
5932 (x_set_alpha): Do not assume XINT fits in int.
5933
5934 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
5935 This is for the members text_lines, text_cols, total_lines, total_cols,
5936 where the system imposes an 'int' limit.
5937
5938 * fringe.c (Fdefine_fringe_bitmap):
5939 Don't update size until alloc works.
5940
5941 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
5942 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
5943
5944 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
5945 Check for size-calculation overflow.
5946 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
5947 do, as we prefer signed integers.
5948 (id_to_widget.max_size, id_to_widget.used)
5949 (xg_store_widget_in_map, xg_remove_widget_from_map)
5950 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
5951 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
5952 Use and return ptrdiff_t, not int.
5953 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
5954 * gtkutil.h: Change prototypes to match the above.
5955
5956 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
5957 are duplicate now that they've been promoted to lisp.h.
5958 (x_allocate_bitmap_record, x_alloc_image_color)
5959 (make_image_cache, cache_image, xpm_load):
5960 Don't update size until alloc is done.
5961 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
5962 (x_detect_edges):
3256efce 5963 Check for size calculation overflow.
726e0ab1
PE
5964 (ct_colors_allocated_max): New constant.
5965 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
5966 overflow.
3256efce 5967
726e0ab1
PE
5968 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
5969 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
5970 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
5971 Use ptrdiff_t, not int, to count maps.
5972 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
5973 calculations. Don't update size until allocation succeeds.
5974 Redo calculations to avoid overflow.
726e0ab1
PE
5975 * keyboard.h: Change prototypes to match the above.
5976
5977 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
5978 to count maps.
5979 (current_minor_maps): Check for size calculation overflow.
5980 * keymap.h: Change prototypes to match the above.
5981
5982 * lread.c (read1, init_obarray): Don't update size until alloc done.
5983
5984 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
5985 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
5986
726e0ab1
PE
5987 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
5988 Now ptrdiff_t, not int.
5989 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
5990 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
5991
5992 * process.c (Fnetwork_interface_list): Check for overflow
5993 in size calculation.
5994
5995 * region-cache.c (move_cache_gap): Check for size calculation overflow.
5996
5997 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
5998 overflow. Don't bother calling xmalloc when xrealloc will do.
5999
6000 * search.c (Freplace_match): Check for size calculation overflow.
6001 (Fset_match_data): Don't assume list lengths fit in 'int'.
6002
6003 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
6004 for command line length. Do not attempt to address one before the
6005 beginning of an array, as that's not portable.
6006
6007 * term.c (max_frame_lines): Remove; unused.
6008 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
6009 not int.
6010 (encode_terminal_code, calculate_costs): Check for size
6011 calculation overflow.
6012 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
6013 table lengths and related sizes. Don't update size until alloc
6014 done. Redo calculations to avoid overflow.
6015 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
6016
6017 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
6018 subtracting pointers.
6019 (gobble_line): Check for overflow more carefully. Don't update size
6020 until alloc done.
6021
6022 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
6023 Don't update size until alloc done.
6024 Redo size calculations to avoid overflow.
6025 Check for size calculation overflow.
0065d054 6026 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
6027
6028 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
6029 Use ptrdiff_t, not int, for sizes.
6030 (store_mode_line_noprop_char): Don't update size until alloc done.
6031
0065d054
PE
6032 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
6033 Use ptrdiff_t, not int, for sizes.
6034 (Finternal_make_lisp_face, cache_face):
6035 Check for size calculation overflow.
6036 (cache_face): Treat size calculation overflows as if they were
6037 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
6038
6039 * xfns.c (x_encode_text, x_set_name_internal)
6040 (Fx_change_window_property): Use ptrdiff_t, not int, to count
6041 sizes, since they can exceed INT_MAX in size. Check for size
6042 calculation overflow.
6043
0065d054
PE
6044 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
6045 (xg_select): Check for size calculation overflow.
726e0ab1
PE
6046 Don't update size until alloc done.
6047
0065d054 6048 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 6049 as sprintf is limited to int lengths.
1d526e2f 6050
252c5ee1
PE
6051 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
6052 (X_LONG_MIN): New macros.
864d7ce7
PE
6053 Use them to make the following changes clearer.
6054 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
6055 This change doesn't affect the value now, but it may help remind
6056 future maintainers not to raise the value too much later.
6057 (SELECTION_QUANTUM): Remove, replacing with ...
6058 (selection_quantum): ... new function, which avoids overflow.
6059 All uses changed.
6060 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
6061 assumption that selection length fits in 'int'.
6062 (x_reply_selection_request, x_handle_selection_request)
6063 (x_get_window_property, receive_incremental_selection)
6064 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
6065 (lisp_data_to_selection_data, clean_local_selection_data):
6066 Use ptrdiff_t, not int, to record length of selection.
6067 (x_reply_selection_request, x_get_window_property)
6068 (receive_incremental_selection, x_property_data_to_lisp):
6069 Redo calculations to avoid overflow.
6070 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 6071 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
6072 something.
6073 (x_get_window_property, receive_incremental_selection)
6074 (lisp_data_to_selection_data, x_property_data_to_lisp):
6075 Check for size-calculation overflow.
6076 (x_get_window_property, receive_incremental_selection)
6077 (lisp_data_to_selection_data, Fx_register_dnd_atom):
6078 Don't store size until memory allocation succeeds.
6079 (x_get_window_property): Plug memory leak on memory exhaustion.
6080 Don't double-block input; malloc is safe here. Don't assume 2**34
6081 - 4 fits in unsigned long. Add an xassert to check
6082 XGetWindowProperty overflow. Be more careful about overflow
6083 calculations, and distinguish size from memory overflow better.
6084 (receive_incremental_selection): When tracing, don't assume
6085 unsigned int is less than INT_MAX.
6086 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
6087 harmful) conversions of unsigned short to int.
6088 (lisp_data_to_selection_data): Don't assume that integers
6089 in the range -65535 through -1 fit in an X unsigned short.
6090 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
6091 result parameters unless successful. Rely on cons_to_unsigned
6092 to report problems with elements; the old code wasn't right anyway.
6093 (x_check_property_data): Check for int overflow; we cannot use
6094 a wider type due to X limits.
6095 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
6096
726e0ab1 6097 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 6098
0065d054
PE
6099 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
6100 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
6101 (x_color_cells): Don't store size until memory allocation succeeds.
6102 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 6103 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
6104 (x_term_init): Don't assume length fits in int (sprintf is limited
6105 to int size).
bc18e09d 6106
ebfa62c0
PE
6107 Use ptrdiff_t for composition IDs.
6108 * character.c (lisp_string_width):
6109 * composite.c (composition_table_size, n_compositions)
6110 (get_composition_id, composition_gstring_from_id):
6111 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
6112 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
6113 * window.c (Frecenter):
6114 Use ptrdiff_t, not int, for composition IDs.
6115 * composite.c (get_composition_id): Check for integer overflow.
6116 * composite.h: Adjust prototypes to match the above changes.
6117
d3411f89
PE
6118 Use ptrdiff_t for hash table indexes.
6119 * category.c (hash_get_category_set):
6120 * ccl.c (ccl_driver):
6121 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
6122 * coding.c (coding_system_charset_list, detect_coding_system):
6123 * coding.h (struct coding_system.id):
6124 * composite.c (get_composition_id, gstring_lookup_cache):
6125 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
6126 * image.c (xpm_get_color_table_h):
6127 * lisp.h (hash_lookup, hash_put):
6128 * minibuf.c (Ftest_completion):
6129 Use ptrdiff_t for hash table indexes, not int (which is too
6130 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
6131 32-bit --with-wide-int hosts).
6132
e097a6fa
PE
6133 * charset.c (Fdefine_charset_internal): Check for integer overflow.
6134 Add a FIXME comment about memory leaks.
6135 (syms_of_charset): Don't assume xmalloc returns.
6136
5637687f
PE
6137 Don't assume that stated character widths fit in int.
6138 * character.c (Fchar_width, c_string_width, lisp_string_width):
6139 * character.h (CHAR_WIDTH):
6140 * indent.c (MULTIBYTE_BYTES_WIDTH):
6141 Use sanitize_char_width to avoid undefined and/or bad behavior
6142 with outlandish widths.
a66cfb1c 6143 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
6144 now that we have two such functions. All uses changed.
6145 (sanitize_char_width): New inline function.
6146
a2271ba2
PE
6147 Don't assume that tab-width fits in int.
6148 * character.h (sanitize_width): New inline function.
6149 (SANE_TAB_WIDTH): New macro.
6150 (ASCII_CHAR_WIDTH): Use it.
6151 * indent.c (sane_tab_width): Remove. All uses replaced by
6152 SANE_TAB_WIDTH (current_buffer).
6153 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
6154
18c52557
PE
6155 * fileio.c: Integer overflow issues with file modes.
6156 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
6157
caeeedc1
PE
6158 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
6159 Remove unreachable code.
6160 (read_hex, load_charset_map_from_file): Check for integer overflow.
6161
6df6ae42 6162 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
6163 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
6164 (x_send_scroll_bar_event): Likewise. Check that the size does not
6165 exceed limits imposed by XClientMessageEvent, as well as the usual
6166 ptrdiff_t and size_t limits.
6167
b13995db
PE
6168 * keyboard.c: Overflow, signedness and related fixes.
6169 (make_lispy_movement): Use same integer type in forward decl
6170 that is used in the definition.
6171 (read_key_sequence, keyremap_step):
6172 Change bufsize argument back to int, undoing my 2011-03-30 change.
6173 We prefer signed types, and int is wide enough here.
6174 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
6175 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
6176 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
6177 length, not size_t. Use ptrdiff_t for index, not int.
6178 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
6179 possibility of integer overflow.
6180
13464394
PE
6181 Overflow, signedness and related fixes for images.
6182
6183 * dispextern.h (struct it.stack[0].u.image.image_id)
6184 (struct_it.image_id, struct image.id, struct image_cache.size)
6185 (struct image_cache.used, struct image_cache.ref_count):
6186 * gtkutil.c (update_frame_tool_bar):
6187 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
6188 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
6189 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
6190 * nsmenu.m (update_frame_tool_bar):
6191 * xdisp.c (calc_pixel_width_or_height):
6192 * xfns.c (image_cache_refcount):
6193 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
6194 on typical 64-bit hosts.
6195
6196 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6197 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
6198 Omit unnecessary casts to int.
6199 (parse_image_spec): Check that integers fall into 'int' range
6200 when the callers expect that.
6201 (image_ascent): Redo ascent calculation to avoid int overflow.
6202 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
6203 (lookup_image): Remove unnecessary tests.
6204 (xbm_image_p): Locals are now of int, not EMACS_INT,
6205 since parse_image_check makes sure they fit into int.
6206 (png_load, gif_load, svg_load_image):
6207 Prefer int to unsigned where either will do.
6208 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
6209 old tiff_error_handler and tiff_warning_handler.
6210 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
6211 stack buffer overflows. It uses only the features of vsnprintf
6212 that are common to both POSIX and native Microsoft.
6213 (tiff_error_handler, tiff_warning_handler): Use it.
6214 (tiff_load, gif_load, imagemagick_load_image):
6215 Don't assume :index value fits in 'int'.
6216 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
6217 (imagemagick_load_image): Check that crop parameters fit into
6218 the integer types that MagickCropImage accepts. Don't assume
6219 Vimagemagick_render_type has a nonnegative value. Don't assume
6220 size_t fits in 'long'.
6221 (gs_load): Use printmax_t to print the widest integers possible.
6222 Check for integer overflow when computing image height and width.
6223
c11821d4
EZ
62242011-08-26 Eli Zaretskii <eliz@gnu.org>
6225
6226 * xdisp.c (redisplay_window): Don't force window start if point
6227 will be invisible in the resulting window. (Bug#9324)
6228
0c95fcf7
EZ
62292011-08-25 Eli Zaretskii <eliz@gnu.org>
6230
6231 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
6232 the display spec is of the form `(space ...)'.
6233 (handle_display_spec): Return the value returned by
6234 handle_single_display_spec, not just 1 or zero.
6235 (handle_single_display_spec): If the display spec is of the form
6236 `(space ...)', and specifies display in the text area, return 2
6237 rather than 1.
fee65a97 6238 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
6239 accurately, and prefer exact match for point under bidi.
6240 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
6241
6242 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
6243 into disp_prop; all users changed.
6244
6245 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
6246 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
6247 for the text covered by the display property.
6248
e4ed06f1
CY
62492011-08-25 Chong Yidong <cyd@stupidchicken.com>
6250
6251 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
6252 Change return value to nil.
6253 (Frecord_buffer): Delete unused function.
6254
f67cdd7f
EZ
62552011-08-24 Eli Zaretskii <eliz@gnu.org>
6256
5980d4c6
EZ
6257 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
6258 buffers, return left-to-right.
8610fe8b
EZ
6259 (set_cursor_from_row): Consider candidate row a win if its glyph
6260 represents a newline and point is on that newline. Fixes cursor
6261 positioning on the newline at EOL of R2L text within L2R
6262 paragraph, and vice versa.
6263 (try_cursor_movement): Check continued rows, in addition to
6264 continuation rows. Fixes unwarranted scroll when point enters a
6265 continued line of R2L text within an L2R paragraph, or vice versa.
6266 (cursor_row_p): Consider the case of point being equal to
6267 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
6268 from the end of a short line to the beginning of a continued line
6269 of R2L text within L2R paragraph.
6270 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
6271 composed characters.
5980d4c6 6272
f67cdd7f
EZ
6273 * bidi.c (bidi_check_type): Use xassert.
6274 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
6275 members.
6276
bca633fb
EZ
62772011-08-23 Eli Zaretskii <eliz@gnu.org>
6278
6279 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
6280 a character.
6281
4a5885a7
CY
62822011-08-23 Chong Yidong <cyd@stupidchicken.com>
6283
6284 * nsfont.m (ns_otf_to_script): Fix typo.
6285
0902a04e
KH
62862011-08-22 Kenichi Handa <handa@m17n.org>
6287
6288 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
6289 extra slot even if the purpose is char-code-property-table.
6290
1a2e6670
EZ
62912011-08-23 Eli Zaretskii <eliz@gnu.org>
6292
8ddde651
EZ
6293 * xdisp.c (redisplay_window): When computing centering_position,
6294 account for the height of the header line. (Bug#8874)
6295
425cc014
EZ
6296 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
6297 instead of CHAR_TO_BYTE. Fixes a crash when a completion
6298 candidate is selected by the mouse, and that candidate has a
6299 composed character under the mouse.
6300
1a2e6670
EZ
6301 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
6302 coordinates reported by pos-visible-in-window-p for a composed
6303 character in column zero.
6304
8b76d6f8
SM
63052011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
6306
6307 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
6308
dac347dd
EZ
63092011-08-22 Eli Zaretskii <eliz@gnu.org>
6310
6311 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
6312 consider it a hit if to_charpos is anywhere in the range of the
6313 composed buffer positions.
6314
e013fb34
CY
63152011-08-22 Chong Yidong <cyd@stupidchicken.com>
6316
6317 * image.c (gif_load): Don't assume that each subimage has the same
6318 dimensions as the base image. Handle disposal method that is
6319 "undefined" by the gif spec (Bug#9335).
6320
bd1ba3e8
CY
63212011-08-20 Chong Yidong <cyd@stupidchicken.com>
6322
6323 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 6324 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 6325
54a1215b
EZ
63262011-08-19 Eli Zaretskii <eliz@gnu.org>
6327
823564e5
EZ
6328 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
6329 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
6330 from an Org mode buffer to a Speedbar frame.
6331
54a1215b
EZ
6332 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
6333 a composition, take its buffer position from IT->cmp_it.charpos.
6334 Fixes cursor positioning at the beginning of a line that begins
6335 with a composed character.
6336
9778ebcc
EZ
63372011-08-18 Eli Zaretskii <eliz@gnu.org>
6338
0be6ee06
EZ
6339 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
6340 character bidirectional type, use STRONG_L instead. Fixes crashes
6341 in a buffer produced by `describe-categories'.
6342
9778ebcc
EZ
6343 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
6344 members before the level stack, so they would be saved and
6345 restored when copying iterator state. Fixes incorrect reordering
6346 around TABs covered by display properties.
6347
156bffbe
AS
63482011-08-18 Andreas Schwab <schwab@linux-m68k.org>
6349
6b02f655 6350 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 6351
72ad093b
CY
63522011-08-17 Chong Yidong <cyd@stupidchicken.com>
6353
6354 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
6355 (internal_condition_case_2, internal_condition_case_n):
6356 Remove unnecessary aborts (Bug#9081).
72ad093b 6357
35774242
EZ
63582011-08-17 Eli Zaretskii <eliz@gnu.org>
6359
6360 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
6361 has no `load' handler, try opening the file locally. (Bug#9311)
6362
db76dd85
KB
63632011-08-16 Ken Brown <kbrown@cornell.edu>
6364
6365 * gmalloc.c: Expand comment.
6366
b215eee5
EZ
63672011-08-16 Eli Zaretskii <eliz@gnu.org>
6368
6369 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
6370 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
6371
a4579d33
KB
63722011-08-16 Ken Brown <kbrown@cornell.edu>
6373
6374 Fix memory allocation problems in Cygwin build (Bug#9273).
6375
6376 * unexcw.c ( __malloc_initialized): Declare external variable.
6377 (fixup_executable): Force the dumped emacs to reinitialize malloc.
6378
8b76d6f8
SM
6379 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
6380 New variables.
a4579d33
KB
6381 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
6382 dumped emacs.
6383 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
6384 in the static heap.
6385 [CYGWIN] (special_realloc): New function.
6386 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
6387 requests to realloc storage in the static heap.
6388
3ebec551
PE
63892011-08-15 Paul Eggert <eggert@cs.ucla.edu>
6390
6391 * bidi.c (bidi_initialize): Remove unused local.
6392
9fd8be00
EZ
63932011-08-15 Eli Zaretskii <eliz@gnu.org>
6394
6b02f655
SM
6395 * bidimirror.h:
6396 * biditype.h: Remove file.
6397 * makefile.w32-in ($(BLD)/bidi.$(O)):
6398 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
6399
6400 * dispextern.h: Fix a typo in the comment to bidi_type_t.
6401
6402 * chartab.c: Improve commentary for the uniprop_table API.
6403
32413314
EZ
6404 * bidi.c (bidi_paragraph_init): Support zero value of
6405 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
6406 (bidi_initialize): Use uniprop_table instead of including
6407 biditype.h and bidimirror.h.
32413314 6408
9fd8be00
EZ
6409 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
6410 coordinates of the iterator when restoring from ppos_it.
6411 (Bug#9296)
6412
5cf2b69b
KH
64132011-08-14 Kenichi Handa <handa@m17n.org>
6414
6415 * process.c (create_process): Call setup_process_coding_systems
72ad093b 6416 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 6417
daf17d00
EZ
64182011-08-14 Eli Zaretskii <eliz@gnu.org>
6419
6420 * xdisp.c (move_it_in_display_line_to): Don't invoke
6421 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
6422 ppos_it. Fixes vertical cursor motion when line beginning is
6423 covered by an image. (Bug#9296)
6424
08e3161a
JD
64252011-08-14 Jan Djärv <jan.h.d@swipnet.se>
6426
6427 * nsterm.h (ns_run_ascript): Declare.
6428 (NSAPP_DATA2_RUNASSCRIPT): Define.
6429
6430 * nsfns.m (as_script, as_result, as_status): New static variables.
6431 (ns_run_ascript): New function.
5e617bc2 6432 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
6433 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
6434 the event loop. Get status from as_status (Bug#7276).
6435
6436 * nsterm.m (sendEvent): If event is NSApplicationDefined and
6437 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
6438 the event loop (Bug#7276).
6439
a3720aa2
AS
64402011-08-14 Andreas Schwab <schwab@linux-m68k.org>
6441
6442 * gnutls.c (QCgnutls_bootprop_priority)
6443 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
6444 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
6445 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
6446 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
6447 (QCgnutls_bootprop_verify_hostname_error)
6448 (QCgnutls_bootprop_callbacks_verify): Rename from
6449 Qgnutls_bootprop_..., all uses changed.
6450
6451 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
6452 uses changed.
6453
0a0d27fb
PE
64542011-08-14 Paul Eggert <eggert@cs.ucla.edu>
6455
19d5c50c
PE
6456 * xfaces.c (Qframe_set_background_mode): Now static.
6457 * dispextern.h (Qframe_set_background_mode): Remove decl.
6458
0a0d27fb
PE
6459 * process.c (Fnetwork_interface_info): Declare local only if needed.
6460
377538cb
JD
64612011-08-13 Jan Djärv <jan.h.d@swipnet.se>
6462
6463 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
6464 (Fnetwork_interface_list): Allocate in increments of bytes instead
6465 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
6466 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
6467 sockaddr.
6468 (struct ifflag_def): notrailers is smart on OSX.
6469 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
6470 Get hardware address with getifaddrs if available.
6471
08fff70c
EZ
64722011-08-12 Eli Zaretskii <eliz@gnu.org>
6473
6474 * xdisp.c (iterate_out_of_display_property): xassert that
6475 IT->position is set to within IT->object's boundaries. Break from
6476 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
6477 when IT->position is set up wrongly due to some bug.
6478 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
6479 (push_display_prop): Allow GET_FROM_STRING as IT->method on
6480 entry. Force push_it to save on the stack the current
6481 buffer/string position, to be restored by pop_it. Fix flags in
6482 the iterator structure wrt the object coming from a display
6483 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
6484 properties. (Bug#9284)
6485
7be1c708 64862011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 6487
7be1c708
CY
6488 * fontset.c (fontset_get_font_group): Add proper type checks.
6489 (Bug#9172)
aac0c6e3 6490
7be1c708 64912011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 6492
7be1c708
CY
6493 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
6494 and LC_VERSION_MIN_MACOSX.
6495 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
6496 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 6497
97bb72a6
EZ
64982011-08-08 Eli Zaretskii <eliz@gnu.org>
6499
6500 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
6501 no-display-properties-and-no-overlays under bidi display.
6502 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 6503 properties and overlays.
97bb72a6 6504
d5617611
CY
65052011-08-08 Chong Yidong <cyd@stupidchicken.com>
6506
37e11a63
CY
6507 * editfns.c (Fset_time_zone_rule): Document relationship with the
6508 setenv function.
6509
d5617611
CY
6510 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
6511 the font entity extracted from the cache (Bug#8109).
6512
58872834
CY
65132011-08-07 Chong Yidong <cyd@stupidchicken.com>
6514
6515 * composite.c (autocmp_chars): Don't reset point. That is done by
6516 restore_point_unwind (Bug#5984).
6517
75bfc667
JL
65182011-08-07 Juri Linkov <juri@jurta.org>
6519
6520 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
6521 to show the arg `TIME' instead of `TIMEVAL'.
6522
d1410150
EZ
65232011-08-06 Eli Zaretskii <eliz@gnu.org>
6524
6525 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
6526 display property strides EOL and includes a newline, as in
6527 longlines-mode. (Bug#9254)
75b771e4
EZ
6528 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
6529 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
6530
6531 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
6532 is non-zero, even if the data buffer is NULL. Fixes a crash in
6533 vertical-motion with longlines-mode. (Bug#9254)
6534
35928349
EZ
65352011-08-05 Eli Zaretskii <eliz@gnu.org>
6536
ec7cc85b
EZ
6537 * bidi.c <bidi_cache_total_alloc>: Now static.
6538 (bidi_initialize): Initialize bidi_cache_total_alloc.
6539
8b76d6f8 6540 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
6541 cache. (Bug#9221)
6542
6543 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
6544 amount allocated this far in `bidi_cache_total_alloc'.
6545 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
6546 non-zero, only free the data buffer without restoring the cache
6547 contents. All callers changed.
6548
6549 * dispextern.h (bidi_unshelve_cache): Update prototype.
6550
6551 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
6552 (move_it_in_display_line, move_it_to)
6553 (move_it_vertically_backward, move_it_by_lines): Replace the call
6554 to xfree to an equivalent call to bidi_unshelve_cache.
6555 (move_it_in_display_line_to): Fix logic of returning
412b6358 6556 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 6557
e2e2423b
EZ
65582011-08-05 Eli Zaretskii <eliz@gnu.org>
6559
6560 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
6561 came from a string character with a `cursor' property. (Bug#9229)
6562
ae9e757a
JD
65632011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6564
6565 * Makefile.in (LIB_PTHREAD): New variable.
6566 (LIBES): Add LIB_PTHREAD (Bug#9216).
6567
6568 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
6569 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
6570
213bd7f2
AS
65712011-08-04 Andreas Schwab <schwab@linux-m68k.org>
6572
6b02f655 6573 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 6574
99aaf75f
JD
65752011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6576
6577 * xterm.c (x_find_topmost_parent): New function.
6578 (x_set_frame_alpha): Find topmost parent window with
6579 x_find_topmost_parent and set the property there also (bug#9181).
6580 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
6581
c74e9d86
PE
65822011-08-04 Paul Eggert <eggert@cs.ucla.edu>
6583
6584 * callproc.c (Fcall_process): Avoid vfork clobbering
6585 the local vars buffer, coding_systems, current_dir.
6586
640c8776
SM
65872011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
6588
6589 * keymap.c (Fmake_composed_keymap): Move to subr.el.
6590
f26d0e4c
PE
65912011-08-03 Paul Eggert <eggert@cs.ucla.edu>
6592
8a10d76c
PE
6593 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
6594 so that it is not optimized away.
6595
f26d0e4c
PE
6596 * xdisp.c (compute_display_string_pos): Remove unused local.
6597
55439c61
EZ
65982011-08-02 Eli Zaretskii <eliz@gnu.org>
6599
6600 Fix slow cursor motion and scrolling in large buffers with
6601 selective display, like Org Mode buffers. (Bug#9218)
6602
6603 * dispextern.h (struct bidi_it): New member disp_prop_p.
6604
6605 * xdisp.c: Remove one-slot cache of display string positions.
6606 (compute_display_string_pos): Accept an additional argument
5e617bc2 6607 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
6608 for a display string or property. If found, set DISP_PROP_P
6609 non-zero.
6610
6611 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
6612 DISP_PROP_P, and pass it to compute_display_string_pos.
6613 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
6614 non-zero. All callers of bidi_fetch_char changed.
6615
fb33fa43
SM
66162011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
6617
6618 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
6619
b099e063
DM
66202010-12-03 Don March <don@ohspite.net>
6621
6622 * keymap.c (Fdefine_key): Fix non-prefix key error message when
6623 last character M-[char] is translated to ESC [char] (bug#7541).
6624
5cc7f7af
KH
66252011-08-02 Kenichi Handa <handa@m17n.org>
6626
d0fffa3f 6627 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
6628
6629 * chartab.c (uniprop_table): Make it non-static.
6630
525d5e6e
EZ
66312011-08-01 Eli Zaretskii <eliz@gnu.org>
6632
6633 * xdisp.c (forward_to_next_line_start): Accept additional argument
6634 BIDI_IT_PREV, and store into it the state of the bidi iterator had
6635 on the newline.
6636 (reseat_at_next_visible_line_start): Use the bidi iterator state
6637 returned by forward_to_next_line_start to restore the state of
6638 it->bidi_it after backing up to previous newline. (Bug#9212)
6639
31011111
AS
66402011-07-30 Andreas Schwab <schwab@linux-m68k.org>
6641
6642 * regex.c (re_comp): Protoize.
6643 (re_exec): Fix return type.
6644 (regexec): Fix type of `ret'. (Bug#9203)
6645
476371c4
PE
66462011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6647
e5d76069
PE
6648 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
6649 This is needed if max-image-size is a floating-point number.
6650
9a79b20c
AS
66512011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6652
6653 * print.c (print_object): Print empty symbol as ##.
6654
6655 * lread.c (read1): Read ## as empty symbol.
6656
d8c2fa78
AA
66572011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
6658
6659 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
6660 setting frame foreground color (Bug#9175).
6661 (x_set_background_color): Likewise.
6662
ffe57a7a
AA
6663 * nsmenu.m (-setText): Size tooltip dimensions precisely to
6664 contents (Bug#9176).
6665 (EmacsTooltip -init): Remove bezels and add shadows to
6666 tooltip windows.
6667
bf3492a5
AA
6668 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
6669 or scroll bar (Bug#8470).
6670
d55e9c53
AA
6671 * nsfont.m (nsfont_open): Remove assignment to voffset and
6672 unnecessary vars hshink, expand, hd, full_height, min_height.
6673 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
6674
6675 * nsterm.h (nsfont_info): Remove voffset field.
6676
d8c2fa78 66772011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
6678
6679 Implement strike-through and overline on NextStep (Bug#8863).
6680
6681 * nsfont.m (nsfont_open): Use underline position provided by font,
6682 instead of hard-coded value of 2.
6683 (nsfont_draw): Call ns_draw_text_decoration instead.
6684
6685 * nsterm.h: Add declaration for ns_draw_text_decoration.
6686
6687 * nsterm.m (ns_draw_text_decoration): New function for drawing
6688 underline, overline, and strike-through.
6689 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
6690 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 6691 accommodate underlining, etc.
4843aac3 6692
4cc60b9b
EZ
66932011-07-28 Eli Zaretskii <eliz@gnu.org>
6694
bc7ece87
EZ
6695 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
6696 default.
4cc60b9b 6697
476371c4
PE
66982011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6699
66606eea
PE
6700 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
6701 Without this fix, if a signal arrives just after memory fills up,
6702 'malloc' might be invoked reentrantly.
6703
476371c4
PE
6704 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
6705 In other words, assume that every image size is allowed, on non-X
6706 hosts. This assumption is probably wrong, but it lets Emacs compile.
6707
f3fcc40d
AS
67082011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6709
6710 * regex.c (re_iswctype): Convert return values to boolean.
6711
350c992f
EZ
67122011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
6713
6714 * xdisp.c (compute_display_string_pos): Don't use cached display
6715 string position if the buffer had its restriction changed.
6716 (Bug#9184)
6717
5266b4bb
PE
67182011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6719
6720 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
6721
2573a837 67222011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 6723
41f55ccd 6724 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 6725
39e378da
PE
6726 * bidi.c: Integer size and overflow fixes.
6727 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
6728 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
6729 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6730 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
6731 (bidi_find_other_level_edge):
6732 Use ptrdiff_t instead of EMACS_INT where either will do.
6733 This works better on 32-bit hosts configured --with-wide-int.
6734 (bidi_cache_ensure_space): Check for size-calculation overflow.
6735 Use % rather than repeated addition, for better worst-case speed.
6736 Don't set bidi_cache_size until after xrealloc returns, because it
6737 might not return.
6738 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
6739 (bidi_cache_ensure_space): Also check that the bidi cache size
6740 does not exceed that of the largest Lisp string or buffer. See Eli
6741 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 6742
5e927815
PE
6743 * alloc.c (__malloc_size_t): Remove.
6744 All uses replaced by size_t. See Andreas Schwab's note
6745 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
6746
ca4aa935
PE
6747 * image.c: Improve checking for integer overflow.
6748 (check_image_size): Assume that f is nonnull, since
6749 it is always nonnull in practice. This is one less thing to
6750 worry about when checking for integer overflow later.
6751 (x_check_image_size): New function, which checks for integer
6752 overflow issues inside X.
6753 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
6754 This removes the need for a memory_full check.
6755 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
6756 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
6757 (xbm_read_bitmap_data): Change locals back to 'int', since
6758 their values must fit in 'int'.
6759 (xpm_load_image, png_load, tiff_load):
6760 Invoke x_create_x_image_and_pixmap earlier,
6761 to avoid much needless work if the image is too large.
6762 (tiff_load): Treat overly large images as if
6763 x_create_x_image_and_pixmap failed, not as malloc failures.
6764 (gs_load): Use x_check_image_size.
6765
5f8f9cc2
PE
6766 * gtkutil.c: Omit integer casts.
6767 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
6768 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
6769
5adf60bc
PE
6770 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
6771
c8907a93
PE
6772 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
6773 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
6774 would wrongly return t on a 64-bit host.
6775
e3c25c68
PE
6776 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
6777 The plain *_OVERFLOW macros run afoul of GCC bug 49705
6778 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
6779 and therefore cause GCC to emit a bogus diagnostic in some cases.
6780
3f791afe
PE
6781 * image.c: Integer signedness and overflow and related fixes.
6782 This is not an exhaustive set of fixes, but it's time to
6783 record what I've got.
6784 (lookup_pixel_color, check_image_size): Remove redundant decls.
6785 (check_image_size): Don't assume that arbitrary EMACS_INT values
6786 fit in 'int', or that arbitrary 'double' values fit in 'int'.
6787 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
6788 (tiff_load, imagemagick_load_image):
6789 Check for overflow in size calculations.
6790 (x_create_x_image_and_pixmap): Remove unnecessary test for
6791 xmalloc returning NULL; that can't happen.
6792 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
6793 (xpm_color_bucket): Use better integer hashing function.
6794 (xpm_cache_color): Don't possibly over-allocate memory.
6795 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
6796 (gif_memory_source):
6797 Use ptrdiff_t, not int or size_t, to record sizes.
6798 (png_load): Don't assume values greater than 2**31 fit in 'int'.
6799 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
6800 either works, as we prefer signed integers.
6801 (tiff_read_from_memory, tiff_write_from_memory):
6802 Return tsize_t, not size_t, since that's what the TIFF API wants.
6803 (tiff_read_from_memory): Don't fail simply because the read would
6804 go past EOF; instead, return a short read.
6805 (tiff_load): Omit no-longer-needed casts.
6806 (Fimagemagick_types): Don't assume size fits into 'int'.
6807
3cc5a532
PE
6808 Improve hashing quality when configured --with-wide-int.
6809 * fns.c (hash_string): New function, taken from sxhash_string.
6810 Do not discard information about ASCII character case; this
6811 discarding is no longer needed.
6812 (sxhash-string): Use it. Change sig to match it. Caller changed.
6813 * lisp.h: Declare it.
6814 * lread.c (hash_string): Remove, since we now use fns.c's version.
6815 The fns.c version returns a wider integer if --with-wide-int is
6816 specified, so this should help the quality of the hashing a bit.
6817
b312a492
PE
6818 * emacs.c: Integer overflow minor fix.
6819 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
6820 Define only if GNU_LINUX.
6821 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
6822
dfd153ae
PE
6823 * dispnew.c: Integer signedness and overflow fixes.
6824 Remove unnecessary forward decls, that were a maintenance hassle.
6825 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
6826 All uses changed.
6827 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
6828 (scrolling_window): Use ptrdiff_t, not int, for byte count.
6829 (prepare_desired_row, line_draw_cost):
6830 Use int, not unsigned, where either works.
6831 (save_current_matrix, restore_current_matrix):
6832 Use ptrdiff_t, not size_t, where either works.
6833 (init_display): Check for overflow more accurately, and without
6834 relying on undefined behavior.
6835
a81d11a3
PE
6836 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
6837 Remove, replacing with the new symbols in lisp.h. All uses changed.
6838 * fileio.c (make_temp_name):
6839 * filelock.c (lock_file_1, lock_file):
6840 * xdisp.c (message_dolog):
6841 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
6842 Use pMd etc. instead.
6843 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
6844 replacing the pWIDE etc. symbols removed from editfns.c.
6845
3300e6fd
PE
6846 * keyboard.h (num_input_events): Now uintmax_t.
6847 This is (very slightly) less likely to mess up due to wraparound.
6848 All uses changed.
6849
fd05c7e9
PE
6850 * buffer.c: Integer signedness fixes.
6851 (alloc_buffer_text, enlarge_buffer_text):
6852 Use ptrdiff_t rather than size_t when either will do, as we prefer
6853 signed integers.
6854
903fe15d
PE
6855 * alloc.c: Integer signedness and overflow fixes.
6856 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
6857 (__malloc_size_t): Default to size_t, not to int.
6858 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
6859 (Fgarbage_collect, mark_object_loop_halt, mark_object):
6860 Prefer ptrdiff_t to size_t when either would do, as we prefer
6861 signed integers.
6862 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
6863 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
6864 Now const. Initialize with values that are in range even if char
6865 is signed.
6866 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
6867 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
6868 These functions do the right thing with sizes > 2**32.
6869 (check_depth): Now ptrdiff_t, not int.
6870 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
6871 Adjust to new way of storing sizes. Check for size overflow bugs
6872 in rest of code.
6873 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
6874 slightly wrong anyway, as it missed one instance of
6875 XMALLOC_OVERRUN_CHECK_OVERHEAD.
6876 (refill_memory_reserve): Omit needless cast to size_t.
6877 (mark_object_loop_halt): Mark as externally visible.
6878
ac82cc6a
PE
6879 * xselect.c: Integer signedness and overflow fixes.
6880 (Fx_register_dnd_atom, x_handle_dnd_message):
6881 Use ptrdiff_t, not size_t, since we prefer signed.
6882 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
6883 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
6884 x_dnd_atoms_size and x_dnd_atoms_length.
6885
c2d1e36d
PE
6886 * doprnt.c: Prefer signed to unsigned when either works.
6887 * eval.c (verror):
6888 * doprnt.c (doprnt):
6889 * lisp.h (doprnt):
6890 * xdisp.c (vmessage):
6891 Use ptrdiff_t, not size_t, when using or implementing doprnt,
6892 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
6893 prefer signed arithmetic to avoid comparison confusion.
6894 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
6895 but is a bit tricky.
6896
0e926e56
PE
6897 Assume freestanding C89 headers, string.h, stdlib.h.
6898 * data.c, doprnt.c, floatfns.c, print.c:
6899 Include float.h unconditionally.
6900 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
6901 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
6902 * regex.c: Likewise for stddef.h, string.h.
6903 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
6904 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
6905 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
6906 (STDC_HEADERS): Remove obsolete defines.
6907 * sysdep.c: Include limits.h unconditionally.
6908
9cfdb3ec
PE
6909 Assume support for memcmp, memcpy, memmove, memset.
6910 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
6911 * regex.c (memcmp, memcpy):
6912 Remove; we assume C89 now.
6913
6914 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
6915 (__malloc_safe_bcopy): Remove; no longer needed.
6916
cf950e6b 6917 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
6918 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
6919 well either way, and we prefer signed to unsigned.
6920
dbf38e02
LMI
69212011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
6922
6923 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
6924 closes the connection while we're reading (bug#9182).
6925
d6f0886c 69262011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 6927
d6f0886c
JD
6928 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
6929 are specified (Bug#9168).
24e0f6b1 6930
2eb1f9e6
PE
69312011-07-25 Paul Eggert <eggert@cs.ucla.edu>
6932
6933 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
6934 Found by GCC static checking and --with-wide-int on a 32-bit host.
6935
22381272 69362011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
6937
6938 * xdisp.c (compute_display_string_pos): Fix logic of caching
6939 previous display string position. Initialize cached_prev_pos to
6940 -1. Fixes slow-down at the beginning of a buffer.
6941
f25e39b4
EZ
69422011-07-24 Eli Zaretskii <eliz@gnu.org>
6943
6944 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
6945 for attrs[LFACE_FONTSET_INDEX].
6946
04c4b52e
PE
69472011-07-23 Paul Eggert <eggert@cs.ucla.edu>
6948
6949 * xml.c (parse_region): Remove unused local
6950 that was recently introduced.
6951
c1734fbd
EZ
69522011-07-23 Eli Zaretskii <eliz@gnu.org>
6953
be18c5a5
EZ
6954 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
6955 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
6956
c1734fbd
EZ
6957 * xdisp.c (move_it_in_display_line_to): Record the best matching
6958 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
6959 exit if none of the characters scanned was an exact match.
6960 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
6961 when exact match is impossible due to invisible text, and the
6962 lines are truncated.
6963
a258d627
JD
69642011-07-23 Jan Djärv <jan.h.d@swipnet.se>
6965
6966 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
6967 for OSX >= 10.7.
6968
b6d5a689
EZ
69692011-07-22 Eli Zaretskii <eliz@gnu.org>
6970
0f74f785
EZ
6971 Fix a significant slow-down of cursor motion with C-n, C-p,
6972 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
6973 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 6974 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
6975 (next_element_from_buffer): Call compute_stop_pos_backwards to
6976 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
6977 base_level_stop.
6978 (reseat): Don't look for prev_stop, as that could mean a very long
6979 run.
6980 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
6981 <cached_disp_overlay_modiff>: Cache for last found display string
6982 position.
551918c1 6983 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
6984 about the same buffer in the same area of character positions, and
6985 the buffer wasn't changed since the time the display string
6986 position was cached.
551918c1 6987
b2d0c91a
EZ
69882011-07-22 Eli Zaretskii <eliz@gnu.org>
6989
6990 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
6991 is an integer, which is important for empty lines. (Bug#9149)
6992
043604ee
CY
69932011-07-22 Chong Yidong <cyd@stupidchicken.com>
6994
6995 * frame.c (Fmodify_frame_parameters): In tty case, update the
6996 default face if necessary (Bug#4238).
6997
da4adb04
CY
69982011-07-21 Chong Yidong <cyd@stupidchicken.com>
6999
7000 * editfns.c (Fstring_to_char): No need to explain what a character
7001 is in the docstring (Bug#6576).
7002
9abd0532
LMI
70032011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7004
7005 * xml.c (parse_region): Make sure we always return a tree.
7006
36881d16
HK
70072011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
7008
7009 * xml.c (parse_region): If a document contains only comments,
7010 return that, too.
7011
1e98674d
LMI
70122011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7013
7014 * xml.c (make_dom): Return comments, too.
7015
590bd467
PE
70162011-07-19 Paul Eggert <eggert@cs.ucla.edu>
7017
7018 Port to OpenBSD.
7019 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
7020 and the surrounding thread.
7021 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
7022 rather than fgets, and retry after EINTR. Otherwise, 'emacs
7023 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
7024 timer goes off.
7025 * s/openbsd.h (BROKEN_SIGIO): Define.
7026 * unexelf.c (unexec) [__OpenBSD__]:
7027 Don't update the .mdebug section of the Alpha COFF symbol table.
7028
f41628b2
LMI
70292011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7030
7031 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
7032 (bug#8460).
7033
b59b67c5
PE
70342011-07-18 Paul Eggert <eggert@cs.ucla.edu>
7035
15e3a074
PE
7036 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
7037 This fixes some race conditions on the permissions of any newly
7038 created file.
7039
41bed37d
PE
7040 * alloc.c (valid_pointer_p): Use pipe, not open.
7041 This fixes some permissions issues when debugging.
7042
b59b67c5
PE
7043 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
7044 If fchown fails to set both uid and gid, try to set just gid,
7045 as that is sometimes allowed. Adjust the file's mode to eliminate
7046 setuid or setgid bits that are inappropriate if fchown fails.
7047
925a6be7
SM
70482011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7049
7050 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
7051 to compare Lisp_Objects.
7052 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
7053 global_gnutls_log_level, don't mistake it for a Lisp_Object.
7054 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
7055
52968808
AS
70562011-07-17 Andreas Schwab <schwab@linux-m68k.org>
7057
0a6a104b
AS
7058 * lread.c (read_integer): Unread even EOF character.
7059 (read1): Likewise. Properly record start position of symbol.
7060
52968808
AS
7061 * lread.c (read1): Read `#:' as empty uninterned symbol if no
7062 symbol character follows.
7063
9e381cdd
PE
70642011-07-17 Paul Eggert <eggert@cs.ucla.edu>
7065
7066 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
7067 This works around a problem with the previous change to Fcopy_file.
7068 Recent glibc declares fchown with __attribute__((warn_unused_result)),
7069 and without this change, GCC might complain about discarding
7070 fchown's return value.
7071
b5641435
JB
70722011-07-16 Juanma Barranquero <lekktu@gmail.com>
7073
7074 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
7075
a8031457
PE
70762011-07-16 Paul Eggert <eggert@cs.ucla.edu>
7077
7078 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
7079
dd889327
LMI
70802011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
7081
750c33f7
LMI
7082 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
7083 it's used from the C level.
7084
dd889327
LMI
7085 * process.c: Use the same condition for POLL_FOR_INPUT in both
7086 keyboard.c and process.c (bug#1858).
7087
87e86684
LM
70882011-07-09 Lawrence Mitchell <wence@gmx.li>
7089
7090 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
7091 (Fgnutls_boot): Use it.
7092
64348f40
AS
70932011-07-15 Andreas Schwab <schwab@linux-m68k.org>
7094
7095 * doc.c (Fsubstitute_command_keys): Revert last change.
7096
1d698799
LMI
70972011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
7098
f863868c
LMI
7099 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
7100 quotes the next character, and doesn't affect other longer
7101 sequences (bug#8935).
7102
1d698799
LMI
7103 * lread.c (syms_of_lread): Clarify that is isn't only
7104 `eval-buffer' and `eval-defun' that's affected by
7105 `lexical-binding' (bug#8460).
7106
aa4b6df6
EZ
71072011-07-15 Eli Zaretskii <eliz@gnu.org>
7108
7109 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 7110 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 7111
5d856da6
PE
71122011-07-14 Paul Eggert <eggert@cs.ucla.edu>
7113
ad6042bb
PE
7114 Fix minor problems found by static checking.
7115 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
7116 (elsz): Now a signed constant, not a size_t var. We prefer signed
7117 types to unsigned, to avoid integer comparison confusion. Without
7118 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
7119 "cannot optimize loop, the loop counter may overflow", a symptom
7120 of the confusion.
f00bbb22 7121 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
7122 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
7123
6468f31c
LMI
71242011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7125
49080b10
LMI
7126 * search.c (Fre_search_backward): Mention `case-fold-search' in
7127 all the re_search_* functions (bug#8138).
7128
6468f31c
LMI
7129 * keyboard.c (Fopen_dribble_file): Document when the file is
7130 closed (bug#8056).
7131
c965adc5
EZ
71322011-07-14 Eli Zaretskii <eliz@gnu.org>
7133
df9733bf
EZ
7134 * bidi.c (bidi_dump_cached_states): Fix format of displaying
7135 bidi_cache_idx.
7136
0bb23927
EZ
7137 Support bidi reordering of display and overlay strings.
7138 * xdisp.c (compute_display_string_pos)
7139 (compute_display_string_end): Accept additional argument STRING.
7140 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
7141 (reseat_to_string): Initialize bidi_it->string.s and
7142 bidi_it->string.schars.
7143 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
7144 NULL (avoids a crash in bidi_paragraph_init).
7145 Initialize itb.string.lstring.
0bb23927
EZ
7146 (init_iterator): Call bidi_init_it only of a valid
7147 buffer position was specified. Initialize paragraph_embedding to
7148 L2R.
7149 (reseat_to_string): Initialize the bidi iterator.
7150 (display_string): If we need to ignore text properties of
7151 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
7152 original value of -1 will not work with bidi.)
7153 (compute_display_string_pos): First arg is now struct
7154 `text_pos *'; all callers changed. Support display properties on
7155 Lisp strings.
7156 (compute_display_string_end): Support display properties on Lisp
7157 strings.
7158 (init_iterator, reseat_1, reseat_to_string): Initialize the
7159 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
7160 when iterating on a string not from display properties).
640c8776
SM
7161 (compute_display_string_pos, compute_display_string_end):
7162 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
7163 arrow keys.
7164 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
7165 base_level_stop; instead, set base_level_stop to BEGV.
7166 Fixes crashes in vertical-motion.
0bb23927
EZ
7167 (next_element_from_buffer): Improve commentary for when
7168 the iterator is before prev_stop.
7169 (init_iterator): Initialize bidi_p from the default value of
7170 bidi-display-reordering, not from buffer-local value. Use the
7171 buffer-local value only if initializing for buffer iteration.
7172 (handle_invisible_prop): Support invisible properties on strings
7173 that are being bidi-reordered.
7174 (set_iterator_to_next): Support bidi reordering of C strings and
7175 Lisp strings.
7176 (next_element_from_string): Support bidi reordering of Lisp
7177 strings.
7178 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
7179 (display_string): Support display of R2L glyph rows.
7180 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
7181 (init_iterator): Don't initialize it->bidi_p for strings
7182 here.
7183 (reseat_to_string): Initialize it->bidi_p for strings here.
7184 (next_element_from_string, next_element_from_c_string)
7185 (next_element_from_buffer): Add xassert's for correspondence
7186 between IT's object being iterated and it->bidi_it.string
7187 structure.
7188 (face_before_or_after_it_pos): Support bidi iteration.
7189 (next_element_from_c_string): Handle the case of the first string
7190 character that is not the first one in the visual order.
7191 (get_visually_first_element): New function, refactored from common
7192 parts of next_element_from_buffer, next_element_from_string, and
7193 next_element_from_c_string.
7194 (tool_bar_lines_needed, redisplay_tool_bar)
7195 (display_menu_bar): Force left-to-right direction. Add a FIXME
7196 comment for making that be controlled by a user option.
7197 (push_it, pop_it): Save and restore the state of the
7198 bidi iterator. Save and restore the bidi_p flag.
7199 (pop_it): Iterate out of display property for string iteration as
7200 well.
7201 (iterate_out_of_display_property): Support iteration over strings.
7202 (handle_single_display_spec): Set up it->bidi_it for iteration
7203 over a display string, and call bidi_init_it.
7204 (handle_single_display_spec, next_overlay_string)
7205 (get_overlay_strings_1, push_display_prop): Set up the bidi
7206 iterator for displaying display or overlay strings.
7207 (forward_to_next_line_start): Don't use the shortcut if
7208 bidi-iterating.
7209 (back_to_previous_visible_line_start): If handle_display_prop
7210 pushed the iterator stack, restore the internal state of the bidi
7211 iterator by calling bidi_pop_it same number of times.
7212 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
7213 and we are bidi-iterating, don't decrement the iterator position;
7214 instead, set the first_elt flag in the bidi iterator, to produce
7215 the same effect.
7216 (reseat_1): Remove redundant setting of string_from_display_prop_p.
7217 (push_display_prop): xassert that we are iterating a buffer.
7218 (push_it, pop_it): Save and restore paragraph_embedding member.
7219 (handle_single_display_spec, next_overlay_string)
7220 (get_overlay_strings_1, reseat_1, reseat_to_string)
7221 (push_display_prop): Set up the `unibyte' member of bidi_it.string
7222 correctly. Don't assume unibyte strings are not bidi-reordered.
7223 (compute_display_string_pos)
7224 (compute_display_string_end): Fix handling the case of C string.
7225 (push_it, pop_it): Save and restore from_disp_prop_p.
7226 (handle_single_display_spec, push_display_prop): Set the
7227 from_disp_prop_p flag.
7228 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
7229 (pop_it): Call iterate_out_of_display_property only if we are
7230 popping after iteration over a string that came from a display
7231 property. Fix a typo in popping stretch info. Add an assertion
7232 for verifying that the iterator position is in sync with the bidi
7233 iterator.
7234 (handle_single_display_spec, get_overlay_strings_1)
7235 (push_display_prop): Fix initialization of paragraph direction for
7236 string when that of the parent object is not yet determined.
7237 (reseat_1): Call bidi_init_it to resync the bidi
7238 iterator with IT's position. (Bug#7616)
7239 (find_row_edges): If ROW->start.pos gives position
7240 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
7241 (handle_stop, back_to_previous_visible_line_start, reseat_1):
7242 Reset the from_disp_prop_p flag.
7243 (SAVE_IT, RESTORE_IT): New macros.
7244 (pos_visible_p, face_before_or_after_it_pos)
7245 (back_to_previous_visible_line_start)
7246 (move_it_in_display_line_to, move_it_in_display_line)
7247 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7248 (try_scrolling, redisplay_window, display_line): Use them when
7249 saving a temporary copy of the iterator and restoring it back.
7250 (back_to_previous_visible_line_start, reseat_1)
7251 (init_iterator): Empty the bidi cache "stack".
7252 (move_it_in_display_line_to): If iterator ended up at
7253 EOL, but we never saw any buffer positions smaller than
7254 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
7255 motion in bidi-reordered lines.
7256 (move_it_in_display_line_to): Record prev_method and prev_pos
7257 immediately before the call to set_iterator_to_next. Fixes cursor
7258 motion in bidi-reordered lines with stretch glyphs and strings
7259 displayed in margins. (Bug#8133) (Bug#8867)
7260 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
7261 TO_CHARPOS.
640c8776
SM
7262 (pos_visible_p): Support positions in bidi-reordered lines.
7263 Save and restore bidi cache.
0bb23927
EZ
7264
7265 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
7266 (bidi_paragraph_info): Delete unused struct.
7267 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
7268 (bidi_cache_start): New variable.
7269 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
7270 to zero.
7271 (bidi_cache_fetch_state, bidi_cache_search)
7272 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7273 (bidi_cache_find, bidi_peek_at_next_level)
7274 (bidi_level_of_next_char, bidi_find_other_level_edge)
7275 (bidi_move_to_visually_next): Compare cache index with
7276 bidi_cache_start rather than with zero.
7277 (bidi_fetch_char): Accept new argument STRING; all callers
7278 changed. Support iteration over a string. Support strings with
7279 display properties. Support unibyte strings. Fix the type of
7280 `len' according to what STRING_CHAR_AND_LENGTH expects.
7281 (bidi_paragraph_init, bidi_resolve_explicit_1)
7282 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
7283 (bidi_level_of_next_char, bidi_move_to_visually_next):
7284 Support iteration over a string.
0bb23927
EZ
7285 (bidi_set_sor_type, bidi_resolve_explicit_1)
7286 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
7287 can now be zero (for strings); special values 0 and -1 were
7288 changed to -1 and -2, respectively.
7289 (bidi_char_at_pos): New function.
7290 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
7291 Call it instead of FETCH_MULTIBYTE_CHAR.
7292 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
7293 initialized to valid values.
7294 (bidi_init_it): Don't initialize charpos and bytepos with invalid
7295 values.
7296 (bidi_level_of_next_char): Allow the sentinel "position" to pass
7297 the test for valid cached positions. Fix the logic for looking up
7298 the sentinel state in the cache. GCPRO the Lisp string we are
7299 iterating.
7300 (bidi_push_it, bidi_pop_it): New functions.
7301 (bidi_initialize): Initialize the bidi cache start stack pointer.
7302 (bidi_cache_ensure_space): New function, refactored from part of
7303 bidi_cache_iterator_state. Don't assume the required size is just
7304 one BIDI_CACHE_CHUNK away.
7305 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
7306 (bidi_count_bytes, bidi_char_at_pos): New functions.
7307 (bidi_cache_search): Don't assume bidi_cache_last_idx is
7308 always valid if bidi_cache_idx is valid.
7309 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
7310 is valid if it's going to be used.
7311 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
7312 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
7313 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7314 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
7315 (bidi_find_other_level_edge, bidi_cache_start_stack):
7316 All variables related to cache indices are now EMACS_INT.
c965adc5 7317
0bb23927
EZ
7318 * dispextern.h (struct bidi_string_data): New structure.
7319 (struct bidi_it): New member `string'. Make flag members be 1-bit
7320 fields, and put them last in the struct.
640c8776
SM
7321 (compute_display_string_pos, compute_display_string_end):
7322 Update prototypes.
0bb23927
EZ
7323 (bidi_push_it, bidi_pop_it): Add prototypes.
7324 (struct iterator_stack_entry): New members bidi_p,
7325 paragraph_embedding, and from_disp_prop_p.
7326 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
7327 (bidi_shelve_cache, bidi_unshelve_cache):
7328 Declare prototypes.
0bb23927
EZ
7329
7330 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
7331 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
7332 and vector-like objects.
7333
7334 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
7335 cache around display iteration.
7336
7337 * window.c (Fwindow_end, window_scroll_pixel_based)
7338 (displayed_window_lines, Frecenter): Save and restore the bidi
7339 cache around display iteration.
7340
3bbd2265
LMI
73412011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7342
7343 * editfns.c (Fdelete_region): Clarify the use of the named
7344 parameters (bug#6788).
7345
adc47434
MR
73462011-07-14 Martin Rudalics <rudalics@gmx.at>
7347
7348 * indent.c (Fvertical_motion): Set and restore w->pointm when
7349 saving and restoring the window's buffer (Bug#9006).
7350
837c31f8
LMI
73512011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
7352
7353 * editfns.c (Fstring_to_char): Clarify just what is returned
7354 (bug#6576). Text by Eli Zaretskii.
7355
ac389d0c
JB
73562011-07-13 Juanma Barranquero <lekktu@gmail.com>
7357
7358 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
7359
0be0ce47
EZ
73602011-07-13 Eli Zaretskii <eliz@gnu.org>
7361
7362 * buffer.c (mmap_find): Fix a typo.
7363
cd18e7e3
JB
73642011-07-13 Johan Bockgård <bojohan@gnu.org>
7365
7366 Fix execution of x selection hooks.
7367 * xselect.c (Qx_lost_selection_functions)
7368 (Qx_sent_selection_functions): New vars.
7369 (syms_of_xselect): DEFSYM them.
7370 (x_handle_selection_request): Pass Qx_sent_selection_functions
7371 rather than Vx_sent_selection_functions to Frun_hook_with_args.
7372 (x_handle_selection_clear,x_clear_frame_selections):
7373 Pass Qx_lost_selection_functions rather than
7374 Vx_lost_selection_functions to Frun_hook_with_args.
7375
47ea7f44
PE
73762011-07-13 Paul Eggert <eggert@cs.ucla.edu>
7377
ac389d0c 7378 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
7379 The old code sometimes used this field without initializing it.
7380
47ea7f44
PE
7381 * alloc.c (gc_sweep): Don't read past end of array.
7382 In theory, the old code could also have corrupted Emacs internals,
7383 though it'd be very unlikely.
7384
bc985c87
AS
73852011-07-12 Andreas Schwab <schwab@linux-m68k.org>
7386
7387 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 7388 argument. (Bug#4026)
bc985c87 7389
0cf34688
LMI
73902011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
7391
b3dadd76
LMI
7392 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
7393 key" (bug#4257).
7394
0cf34688
LMI
7395 * window.c (Fset_window_start): Doc fix (bug#4199).
7396 (Fset_window_hscroll): Ditto.
7397
270768cd
PE
73982011-07-12 Paul Eggert <eggert@cs.ucla.edu>
7399
077e3dda 7400 Fix minor new problems caught by GCC 4.6.1.
270768cd 7401 * term.c (init_tty): Remove unused local.
490011a6 7402 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 7403 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 7404 not used otherwise.
270768cd 7405
b1f58454
CY
74062011-07-12 Chong Yidong <cyd@stupidchicken.com>
7407
7408 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
7409
22b9578d
LMI
74102011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7411
6e70ab07
LMI
7412 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
7413 are the mini-buffer and the echo area (bug#3320).
7414
22b9578d
LMI
7415 * term.c (init_tty): Remove support for supdup, c10 and perq
7416 terminals, which are no longer supported (bug#1482).
7417
8974cc9f
JB
74182011-07-10 Johan Bockgård <bojohan@gnu.org>
7419
7420 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
7421
a560d974
JD
74222011-07-10 Jan Djärv <jan.h.d@swipnet.se>
7423
7424 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
7425 for non-popups (Bug#3642).
7426
1dae0f0a
AS
74272011-07-10 Andreas Schwab <schwab@linux-m68k.org>
7428
268c2c36 7429 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 7430 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
7431 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
7432 * cm.c (losecursor): Likewise.
1dae0f0a
AS
7433 * data.c (fmod): Likewise.
7434 * dispnew.c (swap_glyphs_in_rows): Likewise.
7435 * emacs.c (memory_warning_signal): Likewise.
7436 * floatfns.c (float_error): Likewise.
7437 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
7438 (otf_open, font_otf_capability, generate_otf_features)
7439 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
7440 Likewise.
7441 * image.c (pbm_read_file): Likewise.
7442 * indent.c (string_display_width): Likewise.
7443 * intervals.c (check_for_interval, search_for_interval)
7444 (inc_interval_count, count_intervals, root_interval)
7445 (adjust_intervals_for_insertion, make_new_interval): Likewise.
7446 * lread.c (defalias): Likewise.
268c2c36 7447 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
7448 * regex.c (set_image_of_range_1, set_image_of_range)
7449 (regex_grow_registers): Likewise.
7450 * sysdep.c (strerror): Likewise.
7451 * termcap.c (valid_filename_p, tprint, main): Likewise.
7452 * tparam.c (main): Likewise.
7453 * unexhp9k800.c (run_time_remap, save_data_space)
7454 (update_file_ptrs, read_header, write_header, calculate_checksum)
7455 (copy_file, copy_rest, display_header): Likewise.
7456 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
7457 Likewise.
7458 * xdisp.c (check_it): Likewise.
7459 * xfaces.c (register_color, unregister_color, unregister_colors):
7460 Likewise.
7461 * xfns.c (print_fontset_result): Likewise.
7462 * xrdb.c (member, fatal, main): Likewise.
7463
99033785
PE
74642011-07-10 Paul Eggert <eggert@cs.ucla.edu>
7465
7466 Fix minor problems found by static checking (Bug#9031).
7467 * chartab.c (char_table_set_range, map_sub_char_table):
7468 Remove unused locals.
7469 (uniprop_table): Now static.
7470 * composite.c (_work_char): Remove unused static var.
7471
9cb2ac56
JB
74722011-07-09 Juanma Barranquero <lekktu@gmail.com>
7473
7474 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
7475
f25661f0
JD
74762011-07-09 Jan Djärv <jan.h.d@swipnet.se>
7477
7478 * gtkutil.c (qttip_cb): Remove code without function.
7479
8278c4fe
EZ
74802011-07-09 Eli Zaretskii <eliz@gnu.org>
7481
7482 * w32.c (pthread_sigmask): New stub.
7483
1692ae2d 74842011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 7485
8a6ebd58 7486 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
7487 sigprocmask is portable only for single-threaded applications, and
7488 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
7489 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
7490 (LIBES): Use it.
7491 * callproc.c (Fcall_process):
7492 * process.c (create_process):
7493 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
7494 Use pthread_sigmask, not sigprocmask.
123403e4 7495
1b854618
JD
74962011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7497
7498 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
7499 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
7500 wrong (Bug#8591).
7501
3fe4b549
JD
75022011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7503
0ce7e563
JD
7504 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
7505 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
7506 (xg_hide_tooltip): Fix comment.
7507
3fe4b549
JD
7508 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
7509 in registerServicesMenuSendTypes.
7510 (validRequestorForSendType): Don't check ns_return_types.
7511
7512 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
7513 ns_return_type.
7514
5df75e47
JR
75152011-07-08 Jason Rumney <jasonr@gnu.org>
7516
22610910
JR
7517 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
7518 SH_SHOW for hidden windows (Bug#5482).
7519
5df75e47
JR
7520 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
7521 frame struct members of non-existent frames (Bug#6284).
7522
699c10bd
JD
75232011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7524
4393663b
JD
7525 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
7526 variable firstTime not needed on OSX >= 10.6.
7527 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
7528 >= 10.5. Use setKnobProportion, setDoubleValue.
7529
7530 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
7531 (MAC_OS_X_VERSION_10_5): Define if not defined.
7532 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
7533 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
7534 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
7535
7536 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
7537 cString and lossyCString on OSX >= 10.4
7538
58179cce 7539 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
7540 sizeToFit on OSX >= 10.2.
7541
7542 * nsimage.m (allocInitFromFile): Don't use deprecated method
7543 bestRepresentationForDevice on OSX >= 10.6.
7544
7545 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
7546 to avoid warning.
7547
7548 * emacs.c: Declare unexec_init_emacs_zone.
7549
a63e0781
JD
7550 * nsgui.h: Fix compiler warning about gnulib redefining verify.
7551
699c10bd
JD
7552 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
7553
7554 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
7555 on svcsMenu (Bug#8842).
7556
7557 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
7558 ns_return_types.
7559 (Fns_list_services): Just return Qnil on 10.6, code not working there.
7560
7561 * nsterm.m (QUTF8_STRING): Declare.
7562 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
7563 (validRequestorForSendType): Return type is (id).
7564 Change indexOfObjectIdenticalTo to indexOfObject.
7565 Check if we have local selection before returning self (Bug#8842).
7566 (writeSelectionToPasteboard): Put local selection into paste board
7567 if we have a local selection (Bug#8842).
7568 (syms_of_nsterm): DEFSYM QUTF8_STRING.
7569
7570 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
7571 (ns_get_local_selection): Declare.
7572
54e10184
LMI
75732011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
7574
9888ff71
LMI
7575 * keymap.c (describe_map_tree): Don't insert a double newline at
7576 the end of the buffer (bug#1169) and return whether we inserted
7577 something.
7578
54e10184
LMI
7579 * callint.c (Fcall_interactively): Change "reading args" to
7580 "providing args" to try to clarify what it does (bug#1010).
7581
15fa4783
KH
75822011-07-07 Kenichi Handa <handa@m17n.org>
7583
7584 * composite.c (composition_compute_stop_pos): Ignore a static
7585 composition starting before CHARPOS (Bug#8915).
7586
7587 * xdisp.c (handle_composition_prop): Likewise.
7588
a8815b00
EZ
75892011-07-07 Eli Zaretskii <eliz@gnu.org>
7590
7591 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
7592 (Bug#9015)
7593
ef7b981d 75942011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
7595
7596 * character.h (unicode_category_t): New enum type.
7597
7598 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
7599 (Qchar_code_property_table): New variable.
7600 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
7601 (UNIPROP_COMPRESSED_FORM_P): New macros.
7602 (char_table_ascii): Uncompress the compressed values.
7603 (sub_char_table_ref): New arg is_uniprop. Callers changed.
7604 Uncompress the compressed values.
ac389d0c 7605 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
7606 (char_table_ref_and_range): Uncompress the compressed values.
7607 (sub_char_table_set): New arg is_uniprop. Callers changed.
7608 Uncompress the compressed values.
7609 (sub_char_table_set_range): Args changed. Callers changed.
7610 (char_table_set_range): Adjuted for the above change.
7611 (map_sub_char_table): Delete args default_val and parent. Add arg
7612 top. Give decoded values to a Lisp function.
640c8776 7613 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
7614 values to a Lisp function. Gcpro more variables.
7615 (uniprop_table_uncompress)
7616 (uniprop_decode_value_run_length): New functions.
7617 (uniprop_decoder, uniprop_decoder_count): New variables.
7618 (uniprop_get_decoder, uniprop_encode_value_character)
7619 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
7620 New functions.
7621 (uniprop_encoder, uniprop_encoder_count): New variables.
7622 (uniprop_get_encoder, uniprop_table)
7623 (Funicode_property_table_internal, Fget_unicode_property_internal)
7624 (Fput_unicode_property_internal): New functions.
7625 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
7626 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 7627 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
7628 char-code-property-alist.
7629
640c8776 7630 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
7631 Vunicode_category_table.
7632
640c8776 7633 * font.c (font_range): Adjust for the change of
c805dec0
KH
7634 Vunicode_category_table.
7635
76b397fb
DN
76362011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
7637
7638 * m/iris4d.h: Remove file, move contents ...
7639 * s/irix6-5.h: ... here.
7640
22b4128e
PE
76412011-07-06 Paul Eggert <eggert@cs.ucla.edu>
7642
7643 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
7644 * alloc.c (mark_buffer):
7645 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
7646 (clone_per_buffer_values): Don't assume that
22b4128e
PE
7647 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
7648 This isn't true in general, and it's particularly not true
7649 if Emacs is configured with --with-wide-int.
7650 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
7651 New macros, used in the buffer.c change.
7652
869795d6
JD
76532011-07-05 Jan Djärv <jan.h.d@swipnet.se>
7654
7655 * xsettings.c: Use both GConf and GSettings if both are available.
7656 (store_config_changed_event): Add comment.
7657 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
7658 (store_tool_bar_style_changed): New functions.
5e617bc2 7659 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
7660 (struct xsettings): Move font inside HAVE_XFT.
7661 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 7662 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 7663 Move inside HAVE_XFT.
640c8776 7664 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
7665 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
7666 also.
7667 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 7668 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 7669 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
7670 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
7671 (parse_settings): Move check for font inside HAVE_XFT.
7672 (read_settings, apply_xft_settings): Add comment.
7673 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
7674 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
7675 call store_font_name_changed.
7676 (xft_settings_event): Add comment.
7677 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
7678 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
7679 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
7680 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
7681 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
7682 (xsettings_get_system_font, xsettings_get_system_normal_font):
7683 Add comment.
869795d6 7684
d8ed26bd
PE
76852011-07-05 Paul Eggert <eggert@cs.ucla.edu>
7686
7687 Random fixes. E.g., (random) never returned negative values.
7688 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
7689 subseconds part to the entropy, as that's a bit more random.
7690 Prefer signed to unsigned, since the signedness doesn't matter and
7691 in general we prefer signed. When given a limit, use a
7692 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
7693 latter isn't right if USE_2_TAGS_FOR_INTS.
7694 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
7695 not 0..VALMASK. Don't discard "excess" bits that random () returns.
7696
cabf1cac
SM
76972011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7698
7699 * textprop.c (text_property_stickiness):
7700 Obey Vtext_property_default_nonsticky.
7701 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
7702 * w32fns.c (syms_of_w32fns):
7703 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
7704
6e9b2be9
PE
77052011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7706
7707 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
7708 This is more efficient than Ffile_directory_p and avoids a minor race.
7709
90186c68
LMI
77102011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
7711
7c301272
LMI
7712 * buffer.c (Foverlay_put): Say what the return value is
7713 (bug#7835).
7714
c4f2d8d4
LMI
7715 * fileio.c (barf_or_query_if_file_exists): Check first if the file
7716 is a directory before asking whether to use the file name
7717 (bug#7564).
ad637907
LMI
7718 (barf_or_query_if_file_exists): Make the "File is a directory"
7719 error be more correct.
c4f2d8d4 7720
90186c68
LMI
7721 * fns.c (Frequire): Remove the mention of the .gz files, since
7722 that's installation-specific, but keep the mention of
7723 `get-load-suffixes'.
7724
da64016e
PE
77252011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7726
7727 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
7728 Report string overflow if the output is too long.
7729
7d47b580
JB
77302011-07-04 Juanma Barranquero <lekktu@gmail.com>
7731
a555cb87
JB
7732 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
7733 (syms_of_gnutls): Remove duplicate DEFSYM for
7734 Qgnutls_bootprop_verify_hostname_error, an error for
7735 Qgnutls_bootprop_verify_error (which is no longer used).
7736
7d47b580
JB
7737 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
7738 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
7739 Also (re)move comments that are misplaced or no longer relevant.
7740
1e49bfab
LMI
77412011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7742
7743 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
7744
1485f4c0
CY
77452011-07-03 Chong Yidong <cyd@stupidchicken.com>
7746
7747 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
7748 and background color parameters if they have been changed.
7749
a9ab721e
LMI
77502011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7751
7752 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
7753
cf7cff57
PE
77542011-07-03 Paul Eggert <eggert@cs.ucla.edu>
7755
2e13213d
PE
7756 * xsettings.c (SYSTEM_FONT): Define only when used.
7757 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
7758
cf7cff57
PE
7759 * keymap.c (access_keymap_1): Now static.
7760
7a8e04f7
CY
77612011-07-02 Chong Yidong <cyd@stupidchicken.com>
7762
7763 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
7764 leave any prefix arg for the up event (Bug#1586).
7765
61352f62
LMI
77662011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
7767
69bb1ef7
LMI
7768 * lread.c (syms_of_lread): Mention single symbols defined by
7769 `defvar' or `defconst' (bug#7154).
7770
61352f62 7771 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 7772 (Frequire): Mention get-load-suffixes.
61352f62 7773
28545e04
MR
77742011-07-02 Martin Rudalics <rudalics@gmx.at>
7775
7776 * window.h (window): Remove clone_number slot.
7777 * window.c (Fwindow_clone_number, Fset_window_clone_number):
7778 Remove.
7779 (make_parent_window, make_window, saved_window)
7780 (Fset_window_configuration, save_window_save): Don't deal with
7781 clone numbers.
7782 * buffer.c (Qclone_number): Remove declaration.
7783 (sort_overlays, overlay_strings): Don't deal with clone numbers.
7784
3349e122
SM
77852011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
7786
7787 Add multiple inheritance to keymaps.
7788 * keymap.c (Fmake_composed_keymap): New function.
7789 (Fset_keymap_parent): Simplify.
7790 (fix_submap_inheritance): Remove.
7791 (access_keymap_1): New function extracted from access_keymap to handle
7792 embedded parents and handle lists of maps.
7793 (access_keymap): Use it.
7794 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
7795 (Fcopy_keymap): Handle embedded parents.
7796 (Fcommand_remapping, define_as_prefix): Simplify.
7797 (Fkey_binding): Simplify.
7798 (syms_of_keymap): Move minibuffer-local-completion-map,
7799 minibuffer-local-filename-completion-map,
7800 minibuffer-local-must-match-map, and
7801 minibuffer-local-filename-must-match-map to Elisp.
7802 (syms_of_keymap): Defsubr make-composed-keymap.
7803 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
7804 (parse_menu_item): Trivial simplification.
7805
3279eb87
GM
78062011-07-01 Glenn Morris <rgm@gnu.org>
7807
7808 * Makefile.in (SETTINGS_LIBS): Fix typo.
7809
4550efdf
KI
78102011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
7811
7812 * coding.c (Fencode_coding_string): Record the last coding system
7813 used, as the function doc string says (bug#8738).
7814
0949d2b6
JD
78152011-07-01 Jan Djärv <jan.h.d@swipnet.se>
7816
7817 * xsettings.c (store_monospaced_changed): Take new font as arg and
7818 check for change against current_mono_font.
7819 (EMACS_TYPE_SETTINGS): Remove this and related defines.
7820 (emacs_settings_constructor, emacs_settings_get_property)
7821 (emacs_settings_set_property, emacs_settings_class_init)
7822 (emacs_settings_init, gsettings_obj): Remove.
7823 (something_changedCB): New function for HAVE_GSETTINGS.
7824 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
7825 with value as argument.
7826 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
7827 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 7828 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
7829 "changed".
7830
7831 * xgselect.c: Add defined (HAVE_GSETTINGS).
7832 (xgselect_initialize): Ditto.
7833
7834 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
7835 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
7836 xg_select.
7837
bbc6b304
PE
78382011-07-01 Paul Eggert <eggert@cs.ucla.edu>
7839
7840 * eval.c (struct backtrace): Simplify and port the data structure.
7841 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
7842 signed bit field, as this assumption is not portable and it makes
7843 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
7844 "char debug_on_exit : 1" as this is not portable either; instead,
7845 use the portable "unsigned int debug_on_exit : 1". Remove unused
7846 member evalargs. Remove obsolete comments about cc bombing out.
7847
9851bfc5
JD
78482011-06-30 Jan Djärv <jan.h.d@swipnet.se>
7849
51bb811f 7850 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
7851 Let HAVE_GSETTINGS override HAVE_GCONF.
7852 (store_monospaced_changed): New function.
7853 (EMACS_SETTINGS): A new type derived from GObject to handle
7854 GSettings notifications.
7855 (emacs_settings_constructor, emacs_settings_get_property)
7856 (emacs_settings_set_property, emacs_settings_class_init):
7857 New functions.
7858 (gsettings_client, gsettings_obj): New variables.
7859 (GSETTINGS_SCHEMA): New define.
7860 (something_changedCB): Call store_monospaced_changed.
7861 (init_gsettings): New function.
7862 (xsettings_initialize): Call init_gsettings.
7863 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
7864 to NULL.
7865
640c8776 7866 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
7867 GCONF_CFLAGS/LIBS.
7868
5386012d
MR
78692011-06-29 Martin Rudalics <rudalics@gmx.at>
7870
7871 * window.c (resize_root_window, grow_mini_window)
7872 (shrink_mini_window): Rename Qresize_root_window to
7873 Qwindow_resize_root_window and Qresize_root_window_vertically to
7874 Qwindow_resize_root_window_vertically.
7875
f13e0b08
PE
78762011-06-28 Paul Eggert <eggert@cs.ucla.edu>
7877
7878 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
7879
94515237
JB
78802011-06-27 Juanma Barranquero <lekktu@gmail.com>
7881
7882 * makefile.w32-in: Redesign dependencies so they reflect more
7883 clearly which files are directly included by each source file,
7884 and not through other includes.
7885
e43b6e43
MR
78862011-06-27 Martin Rudalics <rudalics@gmx.at>
7887
7888 * buffer.c (Qclone_number): Declare static and DEFSYM it.
7889 (sort_overlays, overlay_strings): When an overlay's clone number
7890 matches the window's clone number process the overlay even if
7891 the overlay's window property doesn't match the current window.
7892
d68443dc
MR
7893 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
7894 (Fwindow_hchild): Rename to Fwindow_left_child.
7895 (Fwindow_next): Rename to Fwindow_next_sibling.
7896 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
7897 (resize_window_check): Rename to window_resize_check.
7898 (resize_window_apply): Rename to window_resize_apply.
7899 (Fresize_window_apply): Rename to Fwindow_resize_apply.
7900 (Fdelete_other_windows_internal, resize_frame_windows)
7901 (Fsplit_window_internal, Fdelete_window_internal)
7902 (grow_mini_window, shrink_mini_window)
7903 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 7904
c7e73be5
JD
79052011-06-26 Jan Djärv <jan.h.d@swipnet.se>
7906
7907 * emacsgtkfixed.h: State that this is only used with Gtk+3.
7908 (emacs_fixed_set_min_size): Remove.
7909 (emacs_fixed_new): Take frame as argument.
7910
7911 * emacsgtkfixed.c: State that this is only used with Gtk+3.
7912 (_EmacsFixedPrivate): Remove minwidth/height.
7913 Add struct frame *f.
7914 (emacs_fixed_init): Initialize priv->f.
7915 (get_parent_class, emacs_fixed_set_min_size): Remove.
7916 (emacs_fixed_new): Set priv->f to argument.
7917 (emacs_fixed_get_preferred_width)
7918 (emacs_fixed_get_preferred_height): Use min_width/height from
7919 frames size_hint to set minimum and natural (Bug#8919).
7920 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
7921 and use min_width/height from frames size_hint to set
7922 min_width/height (Bug#8919).
7923
7924 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
7925 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
7926 Fix indentation.
c7e73be5 7927
cf99dcf8
EZ
79282011-06-26 Eli Zaretskii <eliz@gnu.org>
7929
7930 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
7931 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
7932 called at ZV.
7933
029529ac
CY
79342011-06-26 Chong Yidong <cyd@stupidchicken.com>
7935
7936 * process.c (wait_reading_process_output): Bypass select if
7937 waiting for a cell while ignoring keyboard input, and input is
7938 pending. Suggested by Jan Djärv (Bug#8869).
7939
7a7ef429
PE
79402011-06-25 Paul Eggert <eggert@cs.ucla.edu>
7941
7942 Use gnulib's dup2 module instead of rolling our own.
7943 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
7944
11fdef7d 79452011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
7946
7947 * dispnew.c (scrolling_window): Before scrolling, turn off a
7948 mouse-highlight in the window being scrolled.
7949
cd3520a4
JB
79502011-06-24 Juanma Barranquero <lekktu@gmail.com>
7951
7952 Move DEFSYM to lisp.h and use everywhere.
7953
7954 * character.h (DEFSYM): Move declaration...
7955 * lisp.h (DEFSYM): ...here.
7956
7957 * gnutls.c:
7958 * minibuf.c:
7959 * w32menu.c:
7960 * w32proc.c:
7961 * w32select.c: Don't include character.h.
7962
7963 * alloc.c (syms_of_alloc):
7964 * buffer.c (syms_of_buffer):
7965 * bytecode.c (syms_of_bytecode):
7966 * callint.c (syms_of_callint):
7967 * casefiddle.c (syms_of_casefiddle):
7968 * casetab.c (init_casetab_once):
7969 * category.c (init_category_once, syms_of_category):
7970 * ccl.c (syms_of_ccl):
7971 * cmds.c (syms_of_cmds):
7972 * composite.c (syms_of_composite):
7973 * dbusbind.c (syms_of_dbusbind):
7974 * dired.c (syms_of_dired):
7975 * dispnew.c (syms_of_display):
7976 * doc.c (syms_of_doc):
7977 * editfns.c (syms_of_editfns):
7978 * emacs.c (syms_of_emacs):
7979 * eval.c (syms_of_eval):
7980 * fileio.c (syms_of_fileio):
7981 * fns.c (syms_of_fns):
7982 * frame.c (syms_of_frame):
7983 * fringe.c (syms_of_fringe):
7984 * insdel.c (syms_of_insdel):
7985 * keymap.c (syms_of_keymap):
7986 * lread.c (init_obarray, syms_of_lread):
7987 * macros.c (syms_of_macros):
7988 * msdos.c (syms_of_msdos):
7989 * print.c (syms_of_print):
7990 * process.c (syms_of_process):
7991 * search.c (syms_of_search):
7992 * sound.c (syms_of_sound):
7993 * syntax.c (init_syntax_once, syms_of_syntax):
7994 * terminal.c (syms_of_terminal):
7995 * textprop.c (syms_of_textprop):
7996 * undo.c (syms_of_undo):
7997 * w32.c (globals_of_w32):
7998 * window.c (syms_of_window):
7999 * xdisp.c (syms_of_xdisp):
8000 * xfaces.c (syms_of_xfaces):
8001 * xfns.c (syms_of_xfns):
8002 * xmenu.c (syms_of_xmenu):
8003 * xsettings.c (syms_of_xsettings):
8004 * xterm.c (syms_of_xterm): Use DEFSYM.
8005
4228cf16
TZ
80062011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
8007
cd3520a4 8008 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 8009
7fcccf1e
PE
80102011-06-23 Paul Eggert <eggert@cs.ucla.edu>
8011
7efb4e0e
PE
8012 Integer and buffer overflow fixes (Bug#8873).
8013
ff5844ad
PE
8014 * print.c (printchar, strout): Check for string overflow.
8015 (PRINTPREPARE, printchar, strout):
8016 Don't set size unless allocation succeeds.
8017
90532f02
PE
8018 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
8019 for sizes. Check for string overflow more accurately.
8020 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
8021
6d84508d
PE
8022 * macros.c: Integer and buffer overflow fixes.
8023 * keyboard.h (struct keyboard.kbd_macro_bufsize):
8024 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
8025 Use ptrdiff_t, not int, for sizes.
8026 Don't increment bufsize until after realloc succeeds.
8027 Check for size-calculation overflow.
8028 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
8029
437b2cb4
PE
8030 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
8031
8b9ac8b4
PE
8032 * lread.c: Integer overflow fixes.
8033 (read_integer): Radix is now EMACS_INT, not int,
8034 to improve quality of diagnostics for out-of-range radices.
8035 Calculate buffer size correctly for out-of-range radices.
8036 (read1): Check for integer overflow in radices, and in
8037 read-circle numbers.
82cb60d3
PE
8038 (read_escape): Avoid int overflow.
8039 (Fload, openp, read_buffer_size, read1)
8040 (substitute_object_recurse, read_vector, read_list, map_obarray):
8041 Use ptrdiff_t, not int, for sizes.
8042 (read1): Use EMACS_INT, not int, for sizes.
20270765 8043 Check for size overflow.
8b9ac8b4 8044
7fcccf1e
PE
8045 * image.c (cache_image): Check for size arithmetic overflow.
8046
bfbbd7e7
PE
8047 * lread.c: Integer overflow issues.
8048 (saved_doc_string_size, saved_doc_string_length)
8049 (prev_saved_doc_string_size, prev_saved_doc_string_length):
8050 Now ptrdiff_t, not int.
8051 (read1): Don't assume doc string length fits in int. Check for
8052 out-of-range doc string lengths.
8053 (read_list): Don't assume file position fits in int.
39019e54 8054 (read_escape): Check for hex character overflow.
bfbbd7e7 8055
4e323265
LL
80562011-06-22 Leo Liu <sdl.web@gmail.com>
8057
8058 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
8059 Move to minibuffer.el.
8060
85fece3e
PE
80612011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8062
20b84ce9 8063 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
8064 The following patches are for when GLYPH_DEBUG && !XASSERT.
8065 * dispextern.h (trace_redisplay_p, dump_glyph_string):
8066 * dispnew.c (flush_stdout):
8067 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
8068 Mark as externally visible.
8069 * dispnew.c (check_window_matrix_pointers): Now static.
8070 * dispnew.c (window_to_frame_vpos):
8071 * xfns.c (unwind_create_frame):
8072 * xterm.c (x_check_font): Remove unused local.
8073 * scroll.c (CHECK_BOUNDS):
8074 * xfaces.c (cache_fache): Rename local to avoid shadowing.
8075 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
8076 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
8077 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
8078 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
8079 Now static.
8080 (debug_method_add): Use va_list and vsprintf rather than relying
8081 on undefined behavior with wrong number of arguments.
8082 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
8083 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
8084 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
8085 since we're not interested in debugging glyphs with old libraries.
8086 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
8087 GCC 4.6.0's static checking.
8088
0766b489
PE
80892011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8090
31fd4b32
PE
8091 Integer overflow and signedness fixes (Bug#8873).
8092 A few related buffer overrun fixes, too.
8093
b79e8648
PE
8094 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
8095
0766b489
PE
8096 * dispextern.h (struct face.stipple):
8097 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
8098 (x_bitmap_mask, x_allocate_bitmap_record)
8099 (x_create_bitmap_from_data, x_create_bitmap_from_file)
8100 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
8101 (x_create_bitmap_from_xpm_data):
8102 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
8103 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
8104 (.bitmaps_last):
8105 * xfaces.c (load_pixmap):
8106 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
8107 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
8108 (.bitmaps_last, struct x_output.icon_bitmap):
8109 Use ptrdiff_t, not int, for bitmap indexes.
8110 (x_allocate_bitmap_record): Check for size overflow.
8111 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
8112
b081724f
PE
8113 Use ptrdiff_t, not int, for overlay counts.
8114 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
8115 * editfns.c (overlays_around, get_pos_property):
8116 * textprop.c (get_char_property_and_overlay):
8117 * xdisp.c (next_overlay_change, note_mouse_highlight):
8118 * xfaces.c (face_at_buffer_position):
21514da7
PE
8119 * buffer.c (OVERLAY_COUNT_MAX): New macro.
8120 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
8121 (Fnext_overlay_change, Fprevious_overlay_change)
8122 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 8123 Use ptrdiff_t, not int, for sizes.
21514da7 8124 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 8125
3de73e5e
PE
8126 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
8127
2606c57b
PE
8128 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
8129 (x_session_initialize): Do not assume string length fits in int.
8130
aaafe47a
PE
8131 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
8132 This is unlikely, but can occur if DPI is outlandish.
8133
2674ddc8 8134 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
8135 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
8136
28154962
PE
8137 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
8138 * xrdb.c (magic_file_p, search_magic_path):
8139 Omit last arg SUFFIX; it was always 0. All callers changed.
8140 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
8141
7de51af5
PE
8142 * xfont.c (xfont_match): Avoid need for strlen.
8143
25ed6cc3
PE
8144 * xfns.c: Don't assume strlen fits in int.
8145 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
8146
4eab31dd
PE
8147 * xdisp.c (message_log_check_duplicate): Return intmax_t,
8148 not unsigned long, as we prefer signed integers. All callers changed.
8149 Detect integer overflow in repeat count.
8150 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 8151 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 8152
171e2a58
PE
8153 * termcap.c: Don't assume sizes fit in int and never overflow.
8154 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
8155 (gobble_line): Check for size-calculation overflow.
8156
ad39faca 8157 * minibuf.c (Fread_buffer):
6e5bb2dc 8158 * lread.c (intern, intern_c_string):
74ca2eb3
PE
8159 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
8160 Don't assume string length fits in int.
8161
52c61c22 8162 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
8163 * gtkutil.c (style_changed_cb): Avoid need for strlen.
8164
b5b8c9e5
PE
8165 * font.c: Don't assume string length fits in int.
8166 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
8167 Use ptrdiff_t, not int.
ccd6111c
PE
8168 (font_intern_prop): Don't assume string length fits in int.
8169 Don't assume integer property fits in fixnum.
8170 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 8171
882f0d81 8172 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 8173 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
8174 Reformulate so as not to need the command string.
8175 Invoke gzip -cd rather than gunzip, as it's more portable.
8176 (lock_info_type, lock_file_1, lock_file):
8177 Don't assume pid_t and time_t fit in unsigned long.
8178 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
8179 (current_lock_owner): Prefer signed type for sizes.
8180 Use memcpy, not strncpy, where memcpy is what is really wanted.
8181 Don't assume (via atoi) that time_t and pid_t fit in int.
8182 Check for time_t and/or pid_t out of range, e.g., via a network share.
8183 Don't alloca where an auto var works fine.
8184
93f4cf88
PE
8185 * fileio.c: Fix some integer overflow issues.
8186 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
8187 Don't assume string length fits in int.
8188 (directory_file_name): Don't assume string length fits in long.
8189 (make_temp_name): Don't assume pid fits in int, or that its print
8190 length is less than 20.
8191
f3e92b69
PE
8192 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
8193
1bfdaf10
PE
8194 * coding.c (make_subsidiaries): Don't assume string length fits in int.
8195
35016e9a
PE
8196 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
8197
3d1e65a1
PE
8198 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
8199 We prefer signed integers, even for size calculations.
8200
0b963a93
PE
8201 * emacs.c: Don't assume string length fits in 'int'.
8202 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
8203 (main): Don't invoke strlen when not needed.
8204
573f4b54
PE
8205 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
8206 (XD_DEBUG_MESSAGE): Don't waste a byte.
8207
989f33ba
PE
8208 * callproc.c (getenv_internal_1, getenv_internal)
8209 (Fgetenv_internal):
965d34eb
PE
8210 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
8211
e4d29b33
PE
8212 * lread.c (invalid_syntax): Omit length argument.
8213 All uses changed. This doesn't fix a bug, but it simplifies the
8214 code away from its former Hollerith-constant appearance, and it's
8215 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 8216 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 8217
eb49b136
PE
8218 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
8219 This didn't break anything, but it didn't help either.
8220 It's confusing to put a bogus integer in a place where the actual
8221 value does not matter.
9f62aeb1 8222 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 8223 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 8224
15375a22
PE
8225 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
8226 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
8227 implementation.
b61cc01c
PE
8228 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
8229 We prefer signed types, and the value cannot exceed the EMACS_INT
8230 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
8231 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
8232 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
8233 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 8234
53b2623d
PE
8235 * indent.c (sane_tab_width): New function.
8236 (current_column, scan_for_column, Findent_to, position_indentation)
8237 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 8238 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 8239
51cab52b 8240 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 8241
f2ed8a70
PE
8242 * lisp.h (lint_assume): New macro.
8243 * composite.c (composition_gstring_put_cache):
8244 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
8245
abe80cc6
PE
8246 * editfns.c, insdel.c:
8247 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 8248
b02c740e
PE
8249 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
8250
ebc96716
PE
8251 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
8252
b4e50fa0 8253 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 8254 Use much-faster test for byte-length change.
311d5d7c 8255 Don't assume string byte-length fits in 'int'.
a4cf38e4 8256 Check that character arg fits in 'int'.
85461888 8257 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 8258
c0c1ee9f
PE
8259 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
8260
a498d7f4
PE
8261 * fns.c (concat): Catch string overflow earlier.
8262 Do not rely on integer wraparound.
8263
51cab52b
PE
8264 * dispextern.h (struct it.overlay_strings_charpos)
8265 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
8266 * xdisp.c (forward_to_next_line_start)
8267 (back_to_previous_visible_line_start)
8268 (reseat_at_next_visible_line_start, next_element_from_buffer):
8269 Don't arbitrarily truncate the value of 'selective' to int.
8270
76031fad
PE
8271 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
8272
5eb55db9
PE
8273 * composite.c: Don't truncate sizes to 'int'.
8274 (composition_gstring_p, composition_reseat_it)
8275 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
8276 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
8277 not EMACS_UINT, for indexes.
5eb55db9 8278
0703a717
PE
8279 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
8280
d6202519
PE
8281 * buffer.c: Include <verify.h>.
8282 (struct sortvec.priority, struct sortstr.priority):
8961a454 8283 Now EMACS_INT, not int.
c20998a7 8284 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
8285 (struct sortstr.size, record_overlay_string)
8286 (struct sortstrlist.size, struct sortlist.used):
8287 Don't truncate size to int.
8288 (record_overlay_string): Check for size-calculation overflow.
d6202519 8289 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 8290
d5a19415
JM
82912011-06-22 Jim Meyering <meyering@redhat.com>
8292
029529ac 8293 Don't leak an XBM-image-sized buffer
d5a19415
JM
8294 * image.c (xbm_load): Free the image buffer after using it.
8295
a9041e6c
PE
82962011-06-21 Paul Eggert <eggert@cs.ucla.edu>
8297
8298 Port to Sun C.
8299 * composite.c (find_automatic_composition): Omit needless 'return 0;'
8300 that Sun C diagnosed.
8301 * fns.c (secure_hash): Fix pointer signedness issue.
8302 * intervals.c (static_offset_intervals): New function.
8303 (offset_intervals): Use it.
8304
7f3f739f
LL
83052011-06-21 Leo Liu <sdl.web@gmail.com>
8306
8307 * deps.mk (fns.o):
8308 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
8309 sha512.h.
8310
8311 * fns.c (secure_hash): Rename from crypto_hash_function and change
8312 the first arg to accept symbols.
5b66d427 8313 (Fsecure_hash): New primitive.
7f3f739f
LL
8314 (syms_of_fns): New symbols.
8315
76147d94
DD
83162011-06-20 Deniz Dogan <deniz@dogan.se>
8317
8318 * process.c (Fset_process_buffer): Clarify return value in
8319 docstring.
8320
7d7d0045
CY
83212011-06-18 Chong Yidong <cyd@stupidchicken.com>
8322
8323 * dispnew.c (add_window_display_history): Use BVAR.
8324
8325 * xdisp.c (debug_method_add): Use BVAR.
8326 (check_window_end, dump_glyph_matrix, dump_glyph)
8327 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
8328
8329 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
8330 Likewise.
8331
8332 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
8333 check till after the cache is created in init_frame_faces.
8334
ff2bc410
SM
83352011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
8336
8337 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
8338
28177add
PE
83392011-06-16 Paul Eggert <eggert@cs.ucla.edu>
8340
dd3482fe
PE
8341 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
8342 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
8343 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
8344
393d71f3 8345 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
8346 * fileio.c (Finsert_file_contents):
8347 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
8348 Remove the old (too-loose) buffer overflow checks.
8349 They weren't needed, since make_gap checks for buffer overflow.
8350 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
8351 The old code merely checked for Emacs fixnum overflow, and relied
8352 on undefined (wraparound) behavior. The new code avoids undefined
8353 behavior, and also checks for ptrdiff_t and/or size_t overflow.
8354
2e6813b0 8355 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
8356 Tune. Don't use wider integers than needed. Don't use alloca.
8357 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 8358
599a9e4f
PE
8359 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
8360
99561444
PE
8361 * insdel.c, lisp.h (buffer_overflow): New function.
8362 (insert_from_buffer_1, replace_range, replace_range_2):
8363 * insdel.c (make_gap_larger):
8364 * editfns.c (Finsert_char):
8365 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
8366
28177add
PE
8367 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
8368
e69dafad
PE
83692011-06-15 Paul Eggert <eggert@cs.ucla.edu>
8370
4baa020d 8371 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 8372
b1c46f02
PE
8373 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
8374 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
8375
e69dafad
PE
8376 * fileio.c: Don't assume EMACS_INT fits in off_t.
8377 (emacs_lseek): New static function.
8378 (Finsert_file_contents, Fwrite_region): Use it.
8379 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
8380
566684ea
PE
8381 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
8382
e6966cd6
PE
8383 * fns.c: Don't overflow int when computing a list length.
8384 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
8385 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
8386 truncation on 64-bit hosts. Check for QUIT every
8387 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
8388 faster and is responsive enough.
8389 (Flength): Report an error instead of overflowing an integer.
8390 (Fsafe_length): Return a float if the value is not representable
8391 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 8392 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 8393 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 8394
dd0b0efb
PE
8395 * alloc.c: Check that resized vectors' lengths fit in fixnums.
8396 (header_size, word_size): New constants.
8397 (allocate_vectorlike): Don't check size overflow here.
8398 (allocate_vector): Check it here instead, since this is the only
8399 caller of allocate_vectorlike that could cause overflow.
8400 Check that the new vector's length is representable as a fixnum.
8401
86fe5cfe
PE
8402 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
8403 The previous code was bogus. For example, next_almost_prime (32)
8404 returned 39, which is undesirable as it is a multiple of 3; and
8405 next_almost_prime (24) returned 25, which is a multiple of 5 so
8406 why was the code bothering to check for multiples of 7?
8407
80e88859
PE
8408 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
8409
4a2f0ad6
PE
8410 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
8411
f66c7cf8
PE
8412 Variadic C functions now count arguments with ptrdiff_t.
8413 This partly undoes my 2011-03-30 change, which replaced int with size_t.
8414 Back then I didn't know that the Emacs coding style prefers signed int.
8415 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
8416 were being counted with int, which may truncate counts on 64-bit
8417 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
8418 * lisp.h (struct Lisp_Subr.function.aMANY)
8419 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
8420 Arg counts are now ptrdiff_t, not size_t.
8421 All variadic functions and their callers changed accordingly.
8422 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
8423 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
8424 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
8425 * callint.c (Fcall_interactively): Check arg count for overflow,
8426 to avoid potential buffer overrun. Use signed char, not 'int',
8427 for 'varies' array, so that we needn't bother to check its size
8428 calculation for overflow.
8429 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
8430 * eval.c (apply_lambda):
8431 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
8432 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
8433 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
8434
a1759b76
PE
8435 * callint.c (Fcall_interactively): Don't use index var as event count.
8436
d96be9fc
PE
8437 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
8438 * mem-limits.h (SIZE): Remove; no longer used.
8439
a690a978 8440 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 8441
578c21e6
PE
8442 Remove unnecessary casts.
8443 * xterm.c (x_term_init):
8444 * xfns.c (x_set_border_pixel):
8445 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
8446 These aren't needed now that we assume ANSI C.
8447
96f53c6c
PE
8448 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
8449 It's more likely to cause problems (due to unsigned overflow)
8450 than to cure them.
8451
83c77d31
PE
8452 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
8453
ee2079f1
PE
8454 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
8455
6da65536
PE
8456 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
8457
7147c4a4
PE
8458 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
8459
193e32d9
PE
8460 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
8461
e5533da6
PE
8462 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
8463
9910e595
PE
8464 GLYPH_CODE_FACE returns EMACS_INT, not int.
8465 * dispextern.h (merge_faces):
8466 * xfaces.c (merge_faces):
01103c44
PE
8467 * xdisp.c (get_next_display_element, next_element_from_display_vector):
8468 Don't assume EMACS_INT fits in int.
9910e595 8469
2638320e
PE
8470 * character.h (CHAR_VALID_P): Remove unused parameter.
8471 * fontset.c, lisp.h, xdisp.c: All uses changed.
8472
045eb8d9
PE
8473 * editfns.c (Ftranslate_region_internal): Omit redundant test.
8474
c1f134b5
PE
8475 * fns.c (concat): Minor tuning based on overflow analysis.
8476 This doesn't fix any bugs. Use int to hold character, instead
8477 of constantly refetching from Emacs object. Use XFASTINT, not
8478 XINT, for value known to be a character. Don't bother comparing
8479 a single byte to 0400, as it's always less.
8480
395fcb93 8481 * floatfns.c (Fexpt):
327eeec8
PE
8482 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
8483
abbd3d23
PE
8484 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
8485 for characters.
8486
684a03ef
PE
8487 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
8488
0fed43f3
PE
8489 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
8490 Without this fix, on a 64-bit host (aset S 0 4294967386) would
8491 incorrectly succeed when S was a string, because 4294967386 was
8492 truncated before it was used.
8493
8fd02eb7
PE
8494 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
8495 Otherwise, an out-of-range integer could cause undefined behavior
8496 on a 64-bit host.
8497
f8c86b69
PE
8498 * composite.c: Use int, not EMACS_INT, for characters.
8499 (fill_gstring_body, composition_compute_stop_pos): Use int, not
8500 EMACS_INT, for values that are known to be in character range.
8501 This doesn't fix any bugs but is the usual style inside Emacs and
8502 may generate better code on 32-bit machines.
8503
34206dd2
PE
8504 Make sure a 64-bit char is never passed to ENCODE_CHAR.
8505 This is for reasons similar to the recent CHAR_STRING fix.
8506 * charset.c (Fencode_char): Check that character arg is actually
8507 a character. Pass an int to ENCODE_CHAR.
8508 * charset.h (ENCODE_CHAR): Verify that the character argument is no
8509 wider than 'int', as a compile-time check to prevent future regressions
8510 in this area.
8511
c5958d4c 8512 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
8513
8514 Make sure a 64-bit char is never passed to CHAR_STRING.
8515 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
8516 by silently ignoring the top 32 bits, allowing some values
8517 that were far too large to be valid characters.
8518 * character.h: Include <verify.h>.
8519 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
8520 arguments are no wider than unsigned, as a compile-time check
8521 to prevent future regressions in this area.
8522 * data.c (Faset):
01103c44 8523 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
8524 (Fsubst_char_in_region):
8525 * fns.c (concat):
8526 * xdisp.c (decode_mode_spec_coding):
8527 Adjust to CHAR_STRING's new requirement.
8528 * editfns.c (Finsert_char, Fsubst_char_in_region):
8529 * fns.c (concat): Check that character args are actually
8530 characters. Without this test, these functions did the wrong
8531 thing with wildly out-of-range values on 64-bit hosts.
8532
d37ca623
PE
8533 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
8534 These casts should not be needed on 32-bit hosts, either.
8535 * keyboard.c (read_char):
8536 * lread.c (Fload): Remove casts to unsigned.
8537
ea204efb
PE
8538 * lisp.h (UNSIGNED_CMP): New macro.
8539 This fixes comparison bugs on 64-bit hosts.
8540 (ASCII_CHAR_P): Use it.
8541 * casefiddle.c (casify_object):
01103c44 8542 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
8543 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
8544 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
8545 * dispextern.h (FACE_FROM_ID):
8546 * keyboard.c (read_char): Use UNSIGNED_CMP.
8547
41cb286c
PE
8548 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
8549 not to EMACS_INT, to avoid GCC warning.
8550
4a1b9832
PE
8551 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
8552
55daad71
PE
8553 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
8554 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
8555 isn't needed on 32-bit machines.
8f95c75c 8556
01103c44
PE
8557 * buffer.c (Fgenerate_new_buffer_name):
8558 Use EMACS_INT for count, not int.
0ceccced 8559 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
8560
8561 * data.c (Qcompiled_function): Now static.
8562
c6f072e7
PE
8563 * window.c (window_body_lines): Now static.
8564
20ce5912
PE
8565 * image.c (gif_load): Rename local to avoid shadowing.
8566
9c4c5f81
PE
8567 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
8568 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
8569 * alloc.c (make_save_value): Integer argument is now of type
8570 ptrdiff_t, not int.
8571 (mark_object): Use ptrdiff_t, not int.
8572 * lisp.h (pD): New macro.
8573 * print.c (print_object): Use it.
8574
c0c5c8ae
PE
8575 * alloc.c: Use EMACS_INT, not int, to count objects.
8576 (total_conses, total_markers, total_symbols, total_vector_size)
8577 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
8578 (total_free_floats, total_floats, total_free_intervals)
8579 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
8580 Now EMACS_INT, not int. All uses changed.
8581 (Fgarbage_collect): Compute overall total using a double, so that
8582 integer overflow is less likely to be a problem. Check for overflow
8583 when converting back to an integer.
5a25e253
PE
8584 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
8585 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
8586 These were 'int' variables that could overflow on 64-bit hosts;
8587 they were never used, so remove them instead of repairing them.
211a0b2a 8588 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
8589 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
8590 Previously, this ceilinged at INT_MAX, but that doesn't work on
8591 64-bit machines.
e46bb31a 8592 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 8593
c78baabf 8594 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 8595 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
8596 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
8597 when a (possibly-narrower) signed value would do just as well.
8598 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 8599
c9d624c6
PE
8600 * alloc.c: Catch some string size overflows that we were missing.
8601 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
8602 for convenience in STRING_BYTES_MAX.
8603 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
8604 The definition here is exact; the one in lisp.h was approximate.
8605 (allocate_string_data): Check for string overflow. This catches
8606 some instances we weren't catching before. Also, it catches
8607 size_t overflow on (unusual) hosts where SIZE_MAX <= min
8608 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
8609 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 8610
c9d624c6
PE
8611 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
8612 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 8613 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 8614
353032ce
PE
8615 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
8616
2bccce07
PE
8617 * alloc.c (Fmake_string): Check for out-of-range init.
8618
0ac30604
SM
86192011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
8620
8621 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
8622
c195f2de
JD
86232011-06-14 Jan Djärv <jan.h.d@swipnet.se>
8624
8625 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
8626 xg_get_default_scrollbar_width.
8627
8628 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
8629 (int_gtk_range_get_value): Move to the scroll bar part of the file.
8630 (style_changed_cb): Call update_theme_scrollbar_width and call
8631 x_set_scroll_bar_default_width and xg_frame_set_char_size for
8632 all frames (Bug#8505).
8633 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
8634 Call gtk_window_set_resizable if HAVE_GTK3.
8635 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
8636 and height if HAVE_GTK3 (Bug#8505).
8637 (scroll_bar_width_for_theme): New variable.
8638 (update_theme_scrollbar_width): New function.
8639 (xg_get_default_scrollbar_width): Move code to
8640 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
8641 (xg_initialize): Call update_theme_scrollbar_width.
8642
8643 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
8644
8645 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
8646
e10ac9f1
MR
86472011-06-12 Martin Rudalics <rudalics@gmx.at>
8648
8649 * frame.c (make_frame): Call other_buffer_safely instead of
8650 other_buffer.
8651
8652 * window.c (temp_output_buffer_show): Call display_buffer with
8653 second argument Vtemp_buffer_show_specifiers and reset latter
8654 immediately after the call.
8655 (Vtemp_buffer_show_specifiers): New variable.
8656 (auto_window_vscroll_p, next_screen_context_lines)
8657 (Vscroll_preserve_screen_position): Remove leading asterisks from
8658 doc-strings.
8659
2d3c217e 86602011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 8661
7b7f97e8 8662 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
8663 * buffer.c (Qclone_number): Remove for now, as it's unused.
8664 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
8665 (record_buffer): Remove unused local.
8666 * frame.c (other_visible_frames, frame_buffer_list): Now static.
8667 (set_frame_buffer_list): Remove; unused.
8668 * frame.h (other_visible_frames): Remove decl.
8669 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
8670 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
8671 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
8672 if HAVE_GPM.
8673 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
8674 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
8675 Define only if HAVE_GPM.
8676 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
8677 (update_hints_inhibit): Remove; never set. All uses removed.
8678 * widgetprv.h (emacsFrameClassRec): Remove decl.
8679 * window.c (delete_deletable_window): Now returns void, since it
8680 wasn't returning anything.
8681 (compare_window_configurations): Remove unused locals.
8682 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
8683 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
8684 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
8685 the same widths as pointers. This follows up on the 2011-05-06 patch.
8686 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
8687 * xterm.h: Likewise.
8688 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
8689
1384b89e
JB
86902011-06-12 Juanma Barranquero <lekktu@gmail.com>
8691
8692 * makefile.w32-in: Update dependencies.
8693 (LISP_H): Add lib/intprops.h.
8694
1100a63c
CY
86952011-06-11 Chong Yidong <cyd@stupidchicken.com>
8696
8697 * image.c (gif_load): Add animation frame delay to the metadata.
8698 (syms_of_image): Use DEFSYM. New symbol `delay'.
8699
6198ccd0
MR
87002011-06-11 Martin Rudalics <rudalics@gmx.at>
8701
8702 * window.c (delete_deletable_window): Re-add.
8703 (Fset_window_configuration): Rewrite to handle dead buffers and
8704 consequently deletable windows.
8705 (window_tree, Fwindow_tree): Remove. Supply functionality in
8706 window.el.
8707 (compare_window_configurations): Simplify code.
8708
b6e3633c
AS
87092011-06-11 Andreas Schwab <schwab@linux-m68k.org>
8710
1ab0dee5
AS
8711 * image.c (imagemagick_load_image): Fix type mismatch.
8712 (Fimagemagick_types): Likewise.
8713
b6e3633c
AS
8714 * window.h (replace_buffer_in_windows): Declare.
8715
9397e56f
MR
87162011-06-11 Martin Rudalics <rudalics@gmx.at>
8717
8718 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
8719 Qclone_number. Remove external declaration of Qdelete_window.
8720 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
8721 code.
640c8776
SM
8722 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
8723 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
8724 (Fother_buffer): Rewrite doc-string. Major rewrite for new
8725 buffer list implementation.
8726 (other_buffer_safely): New function.
8727 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
8728 calls to replace_buffer_in_windows and
8729 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
8730 if allowed.
8731 (record_buffer): Inhibit quitting and rewrite using quittable
8732 functions. Run Qbuffer_list_update_hook if allowed.
8733 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
8734 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
8735 Move switch-to-buffer to window.el.
9397e56f
MR
8736 (bury-buffer): Move to window.el.
8737 (Vbuffer_list_update_hook): New variable.
8738
8739 * lisp.h (other_buffer_safely): Add prototype in buffer.c
8740 section.
8741
8742 * window.h (resize_frame_windows): Move up in code.
8743 (Fwindow_frame): Remove EXFUN.
8744 (replace_buffer_in_all_windows): Remove prototype.
8745 (replace_buffer_in_windows_safely): Add prototype.
8746
8747 * window.c: Declare Qdelete_window static again. Move down
8748 declaration of select_count.
8749 (Fnext_window, Fprevious_window): Rewrite doc-strings.
8750 (Fother_window): Move to window.el.
8751 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
8752 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
8753 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
8754 window.el.
8755 (replace_buffer_in_windows): Implement by calling
8756 Qreplace_buffer_in_windows.
8757 (replace_buffer_in_all_windows): Remove with some functionality
8758 moved into replace_buffer_in_windows_safely.
8759 (replace_buffer_in_windows_safely): New function.
8760 (select_window_norecord, select_frame_norecord): Move in front
8761 of run_window_configuration_change_hook. Remove now obsolete
8762 declarations.
640c8776
SM
8763 (Fset_window_buffer): Rewrite doc-string.
8764 Call Qrecord_window_buffer.
9397e56f
MR
8765 (keys_of_window): Move binding for other-window to window.el.
8766
b50691aa
CY
87672011-06-11 Chong Yidong <cyd@stupidchicken.com>
8768
8769 * dispextern.h (struct image): Replace data member, whose int_val
8770 and ptr_val fields were not used by anything, with a single
8771 lisp_val object.
8772
8773 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
8774 (gif_clear_image, gif_load, imagemagick_load_image)
8775 (gs_clear_image, gs_load): Callers changed.
8776
3f754b86
PE
87772011-06-10 Paul Eggert <eggert@cs.ucla.edu>
8778
cca69397
PE
8779 * buffer.h: Include <time.h>, for time_t.
8780 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
8781
109e28d0
PE
8782 Fix minor problems found by static checking.
8783
60737f02
PE
8784 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
8785
4b66faf3
PE
8786 Make identifiers static if they are not used in other modules.
8787 * data.c (Qcompiled_function, Qframe, Qvector):
8788 * image.c (QimageMagick, Qsvg):
8789 * minibuf.c (Qmetadata):
8790 * window.c (resize_window_check, resize_root_window): Now static.
8791 * window.h (resize_window_check, resize_root_window): Remove decls.
8792
109e28d0
PE
8793 * window.c (window_deletion_count, delete_deletable_window):
8794 Remove; unused.
46a4ce9e
PE
8795 (window_body_lines): Now static.
8796 (Fdelete_other_windows_internal): Mark vars as initialized.
8797 Make sure 'resize_failed' is initialized.
8798 (run_window_configuration_change_hook): Rename local to avoid shadowing.
8799 (resize_window_apply): Remove unused local.
8800 * window.h (delete_deletable_window): Remove decl.
8801
109e28d0 8802 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
8803 (imagemagick_load_image): Fix pointer signedness problem by changing
8804 last arg from unsigned char * to char *. All uses changed.
8805 Also, fix a local for similar reasons.
8806 Remove unused locals. Remove locals to avoid shadowing.
8807 (fn_rsvg_handle_free): Remove; unused.
8808 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 8809 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 8810
3f754b86
PE
8811 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
8812
2547adb1
CY
88132011-06-10 Chong Yidong <cyd@stupidchicken.com>
8814
8815 * image.c (gif_load): Fix omitted cast error introduced by
8816 2011-06-06 change.
8817
2c8e37d4
MR
88182011-06-10 Martin Rudalics <rudalics@gmx.at>
8819
8820 * window.h (resize_proportionally, orig_total_lines)
8821 (orig_top_line): Remove from window structure.
8822 (set_window_height, set_window_width, change_window_heights)
8823 (Fdelete_window): Remove prototypes.
8824 (resize_frame_windows): Remove duplicate declaration.
8825
440a42e3
EZ
88262011-06-10 Eli Zaretskii <eliz@gnu.org>
8827
8828 * window.h (resize_frame_windows, resize_window_check)
8829 (delete_deletable_window, resize_root_window)
8830 (resize_frame_windows): Declare prototypes.
8831
8832 * window.c (resize_window_apply): Make definition be "static" to
8833 match the prototype.
8834
562dd5e9
MR
88352011-06-10 Martin Rudalics <rudalics@gmx.at>
8836
8837 * window.c: Remove declarations of Qwindow_size_fixed,
8838 window_min_size_1, window_min_size_2, window_min_size,
8839 size_window, window_fixed_size_p, enlarge_window, delete_window.
8840 Remove static from declaration of Qdelete_window, it's
8841 temporarily needed by Fbury_buffer.
8842 (replace_window): Don't assign orig_top_line and
8843 orig_total_lines.
8844 (Fdelete_window, delete_window): Remove. Window deletion is
8845 handled by window.el.
640c8776
SM
8846 (window_loop): Remove DELETE_OTHER_WINDOWS case.
8847 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
8848 (Fdelete_other_windows): Remove. Deleting other windows is
8849 handled by window.el.
8850 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
8851 handled in window.el.
8852 (window_min_size_2, window_min_size_1, window_min_size): Remove.
8853 Window minimum sizes are handled in window.el.
8854 (shrink_windows, size_window, set_window_height)
8855 (set_window_width, change_window_heights, window_height)
8856 (window_width, CURBEG, CURSIZE, enlarge_window)
8857 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
8858 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
8859 handled in window.el.
8860 (make_dummy_parent): Rename to make_parent_window and give it a
8861 second argument horflag.
8862 (make_window): Don't set resize_proportionally any more.
8863 (Fsplit_window): Remove. Windows are split in window.el.
8864 (save_restore_action, save_restore_orig_size)
8865 (shrink_window_lowest_first, save_restore_orig_size): Remove.
8866 Resize mini windows in window.el.
8867 (grow_mini_window, shrink_mini_window): Implement by calling
8868 Qresize_root_window_vertically, resize_window_check and
8869 resize_window_apply.
640c8776
SM
8870 (saved_window, Fset_window_configuration, save_window_save):
8871 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
8872 resize_proportionally.
8873 (window_min_height, window_min_width): Move to window.el.
8874 (keys_of_window): Move bindings for delete-other-windows,
8875 split-window, delete-window and enlarge-window to window.el.
8876
8877 * buffer.c: Temporarily extern Qdelete_window.
8878 (Fbury_buffer): Temporarily call Qdelete_window instead of
8879 Fdelete_window (Fbury_buffer will move to window.el soon).
8880
8881 * frame.c (set_menu_bar_lines_1): Remove code handling
8882 orig_top_line and orig_total_lines.
8883
8884 * dispnew.c (adjust_frame_glyphs_initially): Don't use
8885 set_window_height but set heights directly.
8886 (change_frame_size_1): Use resize_frame_windows.
8887
8888 * xdisp.c (init_xdisp): Don't use set_window_height but set
8889 heights directly.
8890
640c8776
SM
8891 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
8892 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
8893 run_window_configuration_change_hook.
8894
8895 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
8896 instead of change_window_heights and run
8897 run_window_configuration_change_hook.
8898
1a13852e
MR
88992011-06-09 Martin Rudalics <rudalics@gmx.at>
8900
8901 * window.c (replace_window): Rename second argument REPLACEMENT to
8902 NEW. New third argument SETFLAG. Rewrite.
8903 (delete_window, make_dummy_parent): Call replace_window with
8904 third argument 1.
8905 (window_list_1): Move down in code.
8906 (run_window_configuration_change_hook): Move set_buffer part
8907 before select_frame_norecord part in order to unwind correctly.
8908 Rename count1 to count.
8909 (recombine_windows, delete_deletable_window, resize_root_window)
8910 (Fdelete_other_windows_internal)
8911 (Frun_window_configuration_change_hook, make_parent_window)
8912 (resize_window_check, resize_window_apply, Fresize_window_apply)
8913 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
8914 (Fdelete_window_internal, Fresize_mini_window_internal):
8915 New functions.
1a13852e
MR
8916 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
8917
f3d1777e
MR
89182011-06-08 Martin Rudalics <rudalics@gmx.at>
8919
496e208e
MR
8920 * window.h (window): Add some new members to window structure -
8921 normal_lines, normal_cols, new_total, new_normal, clone_number,
8922 splits, nest, prev_buffers, next_buffers.
8923 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 8924 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 8925
f3d1777e
MR
8926 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
8927 Remove.
496e208e
MR
8928 (make_dummy_parent): Set new members of windows structure.
8929 (make_window): Move down in code. Handle new members of window
8930 structure.
8931 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
8932 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
8933 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
8934 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
8935 (Fset_window_next_buffers, Fset_window_clone_number):
8936 New functions.
496e208e
MR
8937 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
8938 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
8939 Doc-string fixes.
8940 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
8941 Argument WINDOW can be now internal window too.
8942 (Fwindow_use_time): Move up in code.
8943 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
8944 Rewrite doc-string.
8945 (Fset_window_configuration, saved_window)
8946 (Fcurrent_window_configuration, save_window_save): Handle new
8947 members of window structure.
b9e809c2
MR
8948 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
8949 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
8950 (syms_of_window): New Lisp objects Qrecord_window_buffer,
8951 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
8952 Qget_mru_window, Qresize_root_window,
8953 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
8954 Qauto_buffer_name; staticpro them.
f3d1777e 8955
abde8f8c
MR
89562011-06-07 Martin Rudalics <rudalics@gmx.at>
8957
8958 * window.c (Fwindow_total_size, Fwindow_left_column)
8959 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
8960 (Fwindow_list_1): New functions.
8961 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
8962 (Fwindow_width, Fscroll_left, Fscroll_right):
8963 Use window_body_cols instead of window_box_text_cols.
8964 (delete_window, Fset_window_configuration):
8965 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
8966 (delete_all_subwindows): Take a window as argument and not a
8967 structure. Rewrite.
190b47e6
MR
8968 (window_loop): Remove handling of GET_LRU_WINDOW and
8969 GET_LARGEST_WINDOW.
8970 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
8971
8972 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
8973 window_box_text_cols. delete_all_subwindows now takes a
8974 Lisp_Object as argument.
abde8f8c 8975
640c8776
SM
8976 * indent.c (compute_motion, Fcompute_motion):
8977 Use window_body_cols instead of window_box_text_cols.
abde8f8c 8978
fa8a67e6
MR
8979 * frame.c (delete_frame): Call delete_all_subwindows with root
8980 window as argument.
8981
a54e3482
DC
89822011-06-07 Daniel Colascione <dan.colascione@gmail.com>
8983
8984 * fns.c (Fputhash): Document return value.
8985
60002bf5
CY
89862011-06-06 Chong Yidong <cyd@stupidchicken.com>
8987
8988 * image.c (gif_load): Implement gif89a spec "no disposal" method.
8989
0c671da6 89902011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 8991
b862a52a 8992 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 8993
be44ca6c
PE
8994 Check for overflow when converting integer to cons and back.
8995 * charset.c (Fdefine_charset_internal, Fdecode_char):
8996 Use cons_to_unsigned to catch overflow.
8997 (Fencode_char): Use INTEGER_TO_CONS.
8998 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
8999 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
9000 * data.c (long_to_cons, cons_to_long): Remove.
9001 (cons_to_unsigned, cons_to_signed): New functions.
9002 These signal an error for invalid or out-of-range values.
9003 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
9004 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
9005 * font.c (Ffont_variation_glyphs):
9006 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
9007 * lisp.h: Include <intprops.h>.
9008 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
9009 (cons_to_signed, cons_to_unsigned): New decls.
9010 (long_to_cons, cons_to_long): Remove decls.
9011 * undo.c (record_first_change): Use INTEGER_TO_CONS.
9012 (Fprimitive_undo): Use CONS_TO_INTEGER.
9013 * xfns.c (Fx_window_property): Likewise.
9014 * xselect.c: Include <limits.h>.
9015 (x_own_selection, selection_data_to_lisp_data):
9016 Use INTEGER_TO_CONS.
9017 (x_handle_selection_request, x_handle_selection_clear)
9018 (x_get_foreign_selection, Fx_disown_selection_internal)
9019 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
9020 (lisp_data_to_selection_data): Use cons_to_unsigned.
9021 (x_fill_property_data): Use cons_to_signed.
9022 Report values out of range.
9023
d1f3d2af
PE
9024 Check for buffer and string overflow more precisely.
9025 * buffer.h (BUF_BYTES_MAX): New macro.
9026 * lisp.h (STRING_BYTES_MAX): New macro.
9027 * alloc.c (Fmake_string):
9028 * character.c (string_escape_byte8):
9029 * coding.c (coding_alloc_by_realloc):
9030 * doprnt.c (doprnt):
9031 * editfns.c (Fformat):
9032 * eval.c (verror):
9033 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
9034 since they may not be the same number.
9035 * editfns.c (Finsert_char):
9036 * fileio.c (Finsert_file_contents):
9037 Likewise for BUF_BYTES_MAX.
9038
dd52fcea
PE
9039 * image.c: Use ptrdiff_t, not int, for sizes.
9040 (slurp_file): Switch from int to ptrdiff_t.
9041 All uses changed.
9042 (slurp_file): Check that file size fits in both size_t (for
9043 malloc) and ptrdiff_t (for sanity and safety).
9044
7f9bbdbb
PE
9045 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
9046 if b->modtime has its maximal value.
9047
dfe18f82
PE
9048 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
9049
84acfcf0
PE
9050 Don't assume time_t can fit into int.
9051 * buffer.h (struct buffer.modtime): Now time_t, not int.
9052 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
9053 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
9054
ccd9a01a
PE
9055 Minor fixes for signed vs unsigned integers.
9056 * character.h (MAYBE_UNIFY_CHAR):
9057 * charset.c (maybe_unify_char):
9058 * keyboard.c (read_char, reorder_modifiers):
9059 XINT -> XFASTINT, since the integer must be nonnegative.
9060 * ftfont.c (ftfont_spec_pattern):
9061 * keymap.c (access_keymap, silly_event_symbol_error):
9062 XUINT -> XFASTINT, since the integer must be nonnegative.
9063 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
9064 since it makes no difference and we prefer signed.
9065 * keyboard.c (record_char): Use XUINT when all the neighbors do.
9066 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
9067 nonnegative.
9068
d6d100dd
SM
90692011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
9070
9071 * window.h (Fwindow_frame): Declare.
9072
2b6148e4
PE
90732011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9074
9075 * alloc.c: Simplify handling of large-request failures (Bug#8800).
9076 (SPARE_MEMORY): Always define.
9077 (LARGE_REQUEST): Remove.
9078 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
9079
f230ecc9
MR
90802011-06-06 Martin Rudalics <rudalics@gmx.at>
9081
727e958e
MR
9082 * lisp.h: Move EXFUNS for Fframe_root_window,
9083 Fframe_first_window and Fset_frame_selected_window to window.h.
9084
9085 * window.h: Move EXFUNS for Fframe_root_window,
9086 Fframe_first_window and Fset_frame_selected_window here from
9087 lisp.h.
9088
9089 * frame.c (Fwindow_frame, Fframe_first_window)
9090 (Fframe_root_window, Fframe_selected_window)
9091 (Fset_frame_selected_window): Move to window.c.
9092 (Factive_minibuffer_window): Move to minibuf.c.
9093 (Fother_visible_frames_p): New function.
9094
9095 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
9096
f230ecc9
MR
9097 * window.c (decode_window, decode_any_window): Move up in code.
9098 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
9099 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
9100 (Fwindow_buffer): Move up and rewrite doc-string.
9101 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
9102 (Fwindow_prev): New functions.
727e958e
MR
9103 (Fwindow_frame): Move here from frame.c. Accept any window as
9104 argument.
9105 (Fframe_root_window, Fframe_first_window)
9106 (Fframe_selected_window): Move here from frame.c. Accept frame
9107 or arbitrary window as argument. Update doc-strings.
9108 (Fminibuffer_window): Move up in code.
9109 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
9110 (Fset_frame_selected_window): Move here from frame.c.
9111 Marginal rewrite.
727e958e
MR
9112 (Fselected_window, select_window, Fselect_window): Move up in
9113 code. Minor doc-string fixes.
f230ecc9 9114
4d09bcf6
PE
91152011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9116
9117 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
9118 Do not assume that spare memory exists; that assumption is valid
9119 only if SYSTEM_MALLOC.
9120 (LARGE_REQUEST): New macro, so that the issue of large requests
9121 is separated from the issue of spare memory.
9122
810928a2
AS
91232011-06-05 Andreas Schwab <schwab@linux-m68k.org>
9124
172418ad
AS
9125 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
9126 format. (Bug#8806)
9127
43f862f7
AS
9128 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
9129
810928a2
AS
9130 * xfns.c (x_set_scroll_bar_default_width): Move declarations
9131 before statements.
9132
a059fe24
JD
91332011-06-05 Jan Djärv <jan.h.d@swipnet.se>
9134
9135 * gtkutil.c (xg_get_default_scrollbar_width): New function.
9136
9137 * gtkutil.h: Declare xg_get_default_scrollbar_width.
9138
9139 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
9140 min width by calling x_set_scroll_bar_default_width (Bug#8505).
9141
989bf368
JB
91422011-06-05 Juanma Barranquero <lekktu@gmail.com>
9143
9144 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
9145
4b80f674
CY
91462011-06-04 Chong Yidong <cyd@stupidchicken.com>
9147
9148 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
9149 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
9150 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
9151 New error handlers.
4b80f674
CY
9152 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
9153 Obey Vx_select_enable_clipboard_manager. Catch errors in
9154 x_clipboard_manager_save (Bug#8779).
9155 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 9156 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 9157
99a33b77 91582011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
9159
9160 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
9161
99a33b77 91622011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
9163
9164 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
9165 in the current matrix if keep_current_p is non-zero.
9166
8264569d
EZ
91672011-06-04 Eli Zaretskii <eliz@gnu.org>
9168
9169 * bidi.c (bidi_level_of_next_char): Fix last change.
9170
57f97249
EZ
91712011-06-03 Eli Zaretskii <eliz@gnu.org>
9172
fec2107c 9173 Support bidi reordering of text covered by display properties.
57f97249 9174
fec2107c
EZ
9175 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
9176 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
9177 (bidi_cache_search, bidi_cache_iterator_state)
9178 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
9179 (bidi_level_of_next_char, bidi_move_to_visually_next):
9180 Support character positions inside a run of characters covered by a
fec2107c
EZ
9181 display string.
9182 (bidi_paragraph_init, bidi_resolve_explicit_1)
9183 (bidi_level_of_next_char): Call bidi_fetch_char and
9184 bidi_fetch_char_advance instead of FETCH_CHAR and
9185 FETCH_CHAR_ADVANCE.
9186 (bidi_init_it): Initialize new members.
9187 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
9188 definitions.
9189 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
9190 instead of using explicit *_CHAR codes.
d6d100dd
SM
9191 (bidi_resolve_explicit, bidi_resolve_weak):
9192 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
9193 bidirectional text is supported only in multibyte buffers.
9194 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
9195 it to initialize the frame_window_p member of struct bidi_it.
9196 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
9197 (bidi_resolve_explicit, bidi_resolve_weak)
9198 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
9199 bidi_it->nchars is non-positive.
9200 (bidi_level_of_next_char): Don't try to lookup the cache for the
9201 next/previous character if nothing is cached there yet, or if we
9202 were just reseat()'ed to a new position.
c40e2fb2 9203
0e14fe90
EZ
9204 * xdisp.c (set_cursor_from_row): Set start and stop points
9205 according to the row's direction when priming the loop that looks
9206 for the glyph on which to display cursor.
9207 (single_display_spec_intangible_p): Function deleted.
9208 (display_prop_intangible_p): Reimplement to call
9209 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
9210 Accept 3 additional arguments needed by handle_display_spec.
9211 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
9212 values: lists, `(when COND...)' forms, etc.
9213 (single_display_spec_string_p): Support property values that are
9214 lists with the argument STRING its top-level element.
9215 (display_prop_string_p): Fix the condition for processing a
9216 property that is a list to be consistent with handle_display_spec.
fec2107c 9217 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
9218 last portion of handle_display_prop.
9219 (compute_display_string_pos): Accept additional argument
9220 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
9221 value of a `display' property is a "replacing spec".
9222 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
9223 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
9224 the display property, but just return a value indicating whether
9225 the display property will replace the characters it covers.
9226 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
9227 frame_window_p members of struct bidi_it.
d6d100dd
SM
9228 (compute_display_string_pos, compute_display_string_end):
9229 New functions.
fec2107c
EZ
9230 (push_it): Accept second argument POSITION, where pop_it should
9231 jump to continue iteration.
9232 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 9233
fec2107c
EZ
9234 * keyboard.c (adjust_point_for_property): Adjust the call to
9235 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
9236
9237 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
9238 (bidi_init_it): Update prototypes.
9239 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
9240 (compute_display_string_pos, compute_display_string_end):
9241 Declare prototypes.
fec2107c
EZ
9242 (struct bidi_it): New members nchars and disp_pos. ch_len is now
9243 EMACS_INT.
fc6f18ce 9244
40087514 92452011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 9246
57f53182
PE
9247 Malloc failure behavior now depends on size of allocation.
9248 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
9249 * lisp.h: Change signatures accordingly.
9250 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
9251 All callers changed. (Bug#8762)
9252
9253 * gnutls.c: Use Emacs's memory allocators.
9254 Without this change, the gnutls library would invoke malloc etc.
9255 directly, which causes problems on non-SYNC_INPUT hosts, and which
9256 runs afoul of improving memory_full behavior. (Bug#8761)
9257 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
9258 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
9259 xfree instead of the default malloc, realloc, free.
9260 (Fgnutls_boot): No need to check for memory allocation failure,
9261 since xmalloc does that for us.
9262
ac32cd99 9263 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
9264 * category.c (hash_get_category_set):
9265 * ccl.c (ccl_driver):
9266 * charset.c (Fdefine_charset_internal):
9267 * charset.h (struct charset.hash_index):
9268 * composite.c (get_composition_id, gstring_lookup_cache)
9269 (composition_gstring_put_cache):
9270 * composite.h (struct composition.hash_index):
9271 * dispextern.h (struct image.hash):
9272 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
9273 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
9274 (hashfn_equal, hashfn_user_defined, make_hash_table)
9275 (maybe_resize_hash_table, hash_lookup, hash_put)
9276 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
9277 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
9278 (Fsxhash, Fgethash, Fputhash, Fmaphash):
9279 * image.c (make_image, search_image_cache, lookup_image)
9280 (xpm_put_color_table_h):
9281 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 9282 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 9283 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 9284 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
9285 * alloc.c (allocate_vectorlike):
9286 Check for overflow in vector size calculations.
9287 * ccl.c (ccl_driver):
9288 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
9289 * fns.c, image.c: Remove unnecessary static decls that would otherwise
9290 need to be updated by these changes.
40087514
PE
9291 * fns.c (make_hash_table, maybe_resize_hash_table):
9292 Check for integer overflow with large hash tables.
0de4bb68
PE
9293 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
9294 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
9295 (SXHASH_REDUCE): New macro.
9296 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
9297 Use it instead of discarding useful hash info with large hash values.
9298 (sxhash_float): New function.
9299 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
9300 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
9301 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
9302 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
9303 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
9304 Adjust signatures to match updated version of code.
9305 (consing_since_gc): Now EMACS_INT, since a single hash table can
9306 use more than INT_MAX bytes.
9307
698d32e2
DN
93082011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
9309
9310 Make it possible to build with GCC-4.6+ -O2 -flto.
9311
9312 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
9313
fd6fa53f
SM
93142011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
9315
9316 * minibuf.c (get_minibuffer, read_minibuf_unwind):
9317 Call minibuffer-inactive-mode.
9318
864db017
JB
93192011-05-31 Juanma Barranquero <lekktu@gmail.com>
9320
9321 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
9322 Update dependencies.
9323
2ad0baf4
DN
93242011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9325
9326 * data.c (init_data): Remove code for UTS, this system is not
9327 supported anymore.
9328
4fcc2638
DN
93292011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9330
9331 Don't force ./temacs to start in terminal mode.
9332
9333 * frame.c (make_initial_frame): Initialize faces in all cases, not
9334 only when CANNOT_DUMP is defined.
9335 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
9336
c56e0fd5
DN
93372011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9338
9339 * dispnew.c (add_window_display_history): Use const for the string
9340 pointer. Remove declaration, not needed.
9341
333d54da 93422011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 9343
55d4c1b2 9344 Use 'inline', not 'INLINE'.
333d54da 9345 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
9346 * alloc.c, fontset.c (INLINE): Remove.
9347 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
9348 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
9349 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
9350 * gmalloc.c (register_heapinfo): Use inline unconditionally.
9351 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
9352
738db178
DN
93532011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9354
9355 Make it possible to run ./temacs.
9356
9357 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
9358 syms_of_callproc does the same thing. Remove test for
9359 "initialized", do it in the caller.
9360 * emacs.c (main): Avoid calling set_initial_environment when dumping.
9361
620c53a6
SM
93622011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
9363
9364 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
9365 (read_minibuf): Use get_minibuffer.
9366 (syms_of_minibuf): Use DEFSYM.
9367 (Qmetadata): New var.
9368 * data.c (Qbuffer): Don't make it static.
9369 (syms_of_data): Use DEFSYM.
9370
e003a292
PE
93712011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9372
9373 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
9374 (CCL_CODE_MIN): New macro.
9375
ed008a6d
PE
93762011-05-30 Paul Eggert <eggert@cs.ucla.edu>
9377
3687c2ef
PE
9378 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
9379
ed008a6d
PE
9380 * eval.c (Qdebug): Now static.
9381 * lisp.h (Qdebug): Remove decl. This reverts a part of the
9382 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
9383 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
9384
d66c4c7c
CY
93852011-05-29 Chong Yidong <cyd@stupidchicken.com>
9386
9387 * image.c: Various fixes to ImageMagick code comments.
9388 (Fimagemagick_types): Doc fix.
9389
5fbc2025
PE
93902011-05-29 Paul Eggert <eggert@cs.ucla.edu>
9391
0196f88a
PE
9392 Minor fixes prompted by GCC 4.6.0 warnings.
9393
9394 * xselect.c (converted_selections, conversion_fail_tag): Now static.
9395
5fbc2025
PE
9396 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
9397 (x_clipboard_manager_save_all): Move extern decl to ...
9398 * xterm.h: ... here, so that it can be checked for consistency.
9399
1dd3c2d9
CY
94002011-05-29 Chong Yidong <cyd@stupidchicken.com>
9401
9402 * xselect.c (x_clipboard_manager_save_frame)
9403 (x_clipboard_manager_save_all): New functions.
9404 (Fx_clipboard_manager_save): Lisp function deleted.
9405
9406 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
9407 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
9408
9409 * xterm.h: Update prototype.
9410
5ba6571d
WX
94112011-05-28 William Xu <william.xwl@gmail.com>
9412
9413 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
9414 exiting (Bug#8239).
9415
3eaff834
JM
94162011-05-28 Jim Meyering <meyering@redhat.com>
9417
e1900994 9418 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
9419 * fns.c (to_uchar): Define.
9420 (crypto_hash_function): Use it to convert some newly-signed
9421 variables to unsigned, to avoid sign-extension bugs. For example,
9422 without this change, (md5 "truc") would evaluate to
9423 45723a2aff78ff4fff7fff1114760e62 rather than the expected
9424 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 9425 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 9426
0f6990a7
PE
94272011-05-27 Paul Eggert <eggert@cs.ucla.edu>
9428
9429 Integer overflow fixes.
c8a9ca5a 9430
08686060
PE
9431 * dbusbind.c: Serial number integer overflow fixes.
9432 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
9433 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
9434 to hold a serial number that is too large for a fixnum.
9435 (Fdbus_method_return_internal, Fdbus_method_error_internal):
9436 Check for serial numbers out of range. Decode any serial number
59568bf0 9437 that was so large that it became a float. (Bug#8722)
08686060 9438
2d1fc3c7
PE
9439 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
9440 (Fdbus_call_method, Fdbus_call_method_asynchronously):
9441 Use XFASTINT rather than XUINT when numbers are nonnegative.
9442 (xd_append_arg, Fdbus_method_return_internal):
9443 (Fdbus_method_error_internal): Likewise. Also, for unsigned
9444 arguments, check that Lisp number is nonnegative, rather than
59568bf0 9445 silently wrapping negative numbers around. (Bug#8722)
30217ff0 9446 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 9447 (Bug#8722)
2d1fc3c7 9448
c8a9ca5a
PE
9449 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
9450
519e1d69
PE
9451 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
9452
6df6ae42 9453 ccl: Add integer overflow checks.
30569699
PE
9454 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
9455 (IN_INT_RANGE): New macros.
9456 (ccl_driver): Use them to check for integer overflow when
9457 decoding a CCL program. Many of the new checks are whether XINT (x)
9458 fits in int; it doesn't always, on 64-bit hosts. The new version
9459 doesn't catch all possible integer overflows, but it's an
847044ea 9460 improvement. (Bug#8719)
30569699 9461
c11285dc
PE
9462 * alloc.c (make_event_array): Use XINT, not XUINT.
9463 There's no need for unsigned here.
9464
fdccd48e
PE
9465 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
9466 This follows up to the 2011-05-06 change that substituted uintptr_t
9467 for EMACS_INT. This case wasn't caught back then.
9468
37910ab2
PE
9469 Rework Fformat to avoid integer overflow issues.
9470 * editfns.c: Include <float.h> unconditionally, as it's everywhere
9471 now (part of C89). Include <verify.h>.
9472 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
9473 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
9474 (Fformat): Avoid the prepass trying to compute sizes; it was only
9475 approximate and thus did not catch overflow reliably. Instead, walk
9476 through the format just once, formatting and computing sizes as we go,
9477 checking for integer overflow at every step, and allocating a larger
9478 buffer as needed. Keep track separately whether the format is
9479 multibyte. Keep only the most-recently calculated precision, rather
9480 than them all. Record whether each argument has been converted to
9481 string. Use EMACS_INT, not int, for byte and char and arg counts.
9482 Support field widths and precisions larger than INT_MAX. Avoid
9483 sprintf's undefined behavior with conversion specifications such as %#d
9484 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
9485 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
9486 formatting out-of-range floating point numbers with int
9173deec 9487 formats. (Bug#8668)
37910ab2 9488
2e6578fb
PE
9489 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
9490
0ae6bdee
PE
9491 * data.c: Avoid integer truncation in expressions involving floats.
9492 * data.c: Include <intprops.h>.
9493 (arith_driver): When there's an integer overflow in an expression
9494 involving floating point, convert the integers to floating point
9495 so that the resulting value does not suffer from catastrophic
9496 integer truncation. For example, on a 64-bit host (* 4
9497 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
9498 Do not rely on undefined behavior after integer overflow.
9499
de883a70
PE
9500 merge count_size_as_multibyte, parse_str_to_multibyte
9501 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 9502 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
9503 Check for integer overflow.
9504 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
9505 since it's now a duplicate of the other. This is more of
9506 a character than a buffer op, so better that it's in character.c.
9507 * fns.c, print.c: Adjust to above changes.
9508
2ff916cb
PE
95092011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
9510
9511 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
9512
f1b54466
PE
95132011-05-27 Paul Eggert <eggert@cs.ucla.edu>
9514
fb1ac845
PE
9515 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
9516 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
9517 (x_clipboard_manager_save): Now static.
9518 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
9519
f1b54466
PE
9520 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
9521 (crypto_hash_function): Now static.
9522 Fix pointer signedness problems. Avoid unnecessary initializations.
9523
a9f737ee
CY
95242011-05-27 Chong Yidong <cyd@stupidchicken.com>
9525
9526 * termhooks.h (Vselection_alist): Make it terminal-local.
9527
9528 * terminal.c (create_terminal): Initialize it.
9529
9530 * xselect.c: Support for clipboard managers.
9531 (Vselection_alist): Move to termhooks.h as terminal-local var.
9532 (LOCAL_SELECTION): New macro.
9533 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
9534 (symbol_to_x_atom): Remove gratuitous arg.
9535 (x_handle_selection_request, lisp_data_to_selection_data)
9536 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
9537 (x_own_selection, x_get_local_selection, x_convert_selection):
9538 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
9539 (some_frame_on_display): Delete unused function.
9540 (Fx_own_selection_internal, Fx_get_selection_internal)
9541 (Fx_disown_selection_internal, Fx_selection_owner_p)
9542 (Fx_selection_exists_p): New optional frame arg.
9543 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
9544 (x_handle_selection_clear): Don't treat other terminals with the
9545 same keyboard specially. Use the terminal-local Vselection_alist.
9546 (x_clear_frame_selections): Use Frun_hook_with_args.
9547
9548 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
9549
9550 * xterm.h: Add support for those atoms.
9551
e067f0c1
CY
95522011-05-26 Chong Yidong <cyd@stupidchicken.com>
9553
9554 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
9555 (converted_selections, conversion_fail_tag): New global variables.
9556 (x_selection_request_lisp_error): Free the above.
9557 (x_get_local_selection): Remove unnecessary code.
9558 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
9559 of converted selections stored in converted_selections.
9560 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
9561 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
9562 (x_convert_selection): New function.
9563 (x_handle_selection_event): Simplify.
9564 (x_get_foreign_selection): Don't ignore incoming requests while
9565 waiting for an answer; this will fail when we implement
9566 SAVE_TARGETS, and seems unnecessary anyway.
9567 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
9568 (Vx_sent_selection_functions): Doc fix.
9569
0f4aebc0
LL
95702011-05-26 Leo Liu <sdl.web@gmail.com>
9571
9572 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
9573
e61124cd
YM
95742011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9575
9576 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
9577
9578 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
9579 for fringe update if it has periodic bitmap.
ac389d0c 9580 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
9581 and fringe_bitmap_periodic_p.
9582
9583 * fringe.c (get_fringe_bitmap_data): New function.
9584 (draw_fringe_bitmap_1, update_window_fringes): Use it.
9585 (update_window_fringes): Record periodicity of fringe bitmap in glyph
9586 row. Mark glyph row for fringe update if periodicity changed.
9587
9588 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
9589 for fringe update unless it has periodic bitmap.
9590
f16d9837
KH
95912011-05-25 Kenichi Handa <handa@m17n.org>
9592
9593 * xdisp.c (get_next_display_element): Set correct it->face_id for
9594 a static composition.
9595
e1b90ef6
LL
95962011-05-24 Leo Liu <sdl.web@gmail.com>
9597
9598 * deps.mk (fns.o):
9599 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
9600
9601 * fns.c (crypto_hash_function, Fsha1): New function.
9602 (Fmd5): Use crypto_hash_function.
9603 (syms_of_fns): Add Ssha1.
9604
7400048f
PE
96052011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9606
9607 * gnutls.c: Remove unused macros.
9608 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
9609 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
9610 Remove macros that are defined and never used.
9611 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
9612
abb71cf4
CY
96132011-05-22 Chong Yidong <cyd@stupidchicken.com>
9614
9615 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
9616 (Fx_get_selection_internal): Minor cleanup.
9617 (Fx_own_selection_internal): Rename arguments for consistency with
9618 select.el.
9619
6307db39
PE
96202011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9621
9622 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
9623
f3d4e0a4
CY
96242011-05-22 Chong Yidong <cyd@stupidchicken.com>
9625
9626 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
9627
4d8ade89
YM
96282011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9629
9630 * dispnew.c (scrolling_window): Don't exclude the case that the
9631 last enabled row in the desired matrix touches the bottom boundary.
9632
32078c8d
GM
96332011-05-21 Glenn Morris <rgm@gnu.org>
9634
9635 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
9636 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
9637 and add some more files.
32078c8d 9638
7285dc67
EZ
96392011-05-20 Eli Zaretskii <eliz@gnu.org>
9640
9641 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
9642 report_file_error introduced by the change from 2011-05-07.
9643
89d1bd22
PE
96442011-05-20 Paul Eggert <eggert@cs.ucla.edu>
9645
9646 * systime.h (Time): Define only if emacs is defined.
9647 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
9648 where the include path doesn't have X11/X.h by default. See
9649 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
9650
cd394be1 96512011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
9652
9653 * composite.c (find_automatic_composition): Fix previous change.
9654
b9704ad9
GM
96552011-05-20 Glenn Morris <rgm@gnu.org>
9656
9657 * lisp.mk: New file, split from Makefile.in.
9658 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
9659 (shortlisp): Remove.
9660 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
9661
4a720484
GM
96622011-05-19 Glenn Morris <rgm@gnu.org>
9663
9664 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
9665 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
9666 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
9667 (lisp): Set the order to that of loadup.el.
9668 (shortlisp): Make it a copy of $lisp.
9669 (SOME_MACHINE_LISP): Remove.
9670 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
9671 Use just $shortlisp, not $SOME_MACHINE_LISP too.
9672
a28d4396
KH
96732011-05-18 Kenichi Handa <handa@m17n.org>
9674
9675 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
9676 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
9677 (find_automatic_composition): Mostly rewrite for efficiency.
9678
a2b1fa8e
JB
96792011-05-18 Juanma Barranquero <lekktu@gmail.com>
9680
9681 * makefile.w32-in: Update dependencies.
9682
8e1f5610
CS
96832011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
9684
9685 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 9686 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 9687
7025ee00 96882011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 9689
cdfa6eab
PE
9690 Fix some integer overflow issues, such as string length overflow.
9691
06d6db33
PE
9692 * insdel.c (count_size_as_multibyte): Check for string overflow.
9693
2b4560a8
PE
9694 * character.c (lisp_string_width): Check for string overflow.
9695 Use EMACS_INT, not int, for string indexes and lengths; in
9696 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
9697 the resulting string length overflows an EMACS_INT; instead,
9698 report a string overflow if no precision given. When checking for
9699 precision exhaustion, use a check that cannot possibly have
9700 integer overflow. (Bug#8675)
9701 * character.h (lisp_string_width): Adjust to new signature.
9702
cb93f9be
PE
9703 * alloc.c (string_overflow): New function.
9704 (Fmake_string): Use it. This doesn't change behavior, but saves
9705 a few bytes and will simplify future changes.
9706 * character.c (string_escape_byte8): Likewise.
9707 * lisp.h (string_overflow): New decl.
9708
1a1f3366
PE
9709 Fixups, following up to the user-interface timestamp change.
9710 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
9711 for UI timestamps, instead of unsigned long.
9fbd6841
PE
9712 * msdos.c (mouse_get_pos): Likewise.
9713 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
9714 * w32gui.h (Time): Define by including "systime.h" rather than by
9715 declaring it ourselves. (Bug#8664)
9716
d4e3e4d3
PE
9717 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
9718 * image.c (clear_image_cache): Likewise.
9719
f6a24d19
PE
9720 * term.c (term_mouse_position): Don't assume time_t wraparound.
9721
08dc5ae6
PE
9722 Be more systematic about user-interface timestamps.
9723 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
9724 and sometimes 'EMACS_UINT', to represent these timestamps.
9725 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
9726 This makes the code easier to follow, and makes it easier to catch
9727 integer overflow bugs such as Bug#8664.
9728 * frame.c (Fmouse_position, Fmouse_pixel_position):
9729 Use Time, not unsigned long, for user-interface timestamps.
9730 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
9731 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
9732 * keyboard.h (last_event_timestamp): Likewise.
9733 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
9734 * menu.h (xmenu_show): Likewise.
9735 * term.c (term_mouse_position): Likewise.
9736 * termhooks.h (struct input_event.timestamp): Likewise.
9737 (struct terminal.mouse_position_hook): Likewise.
9738 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
9739 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
9740 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
9741 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
9742 what it was before.
9743 * menu.h, termhooks.h: Include "systime.h", for Time.
9744
8e55734a
PE
9745 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
9746 Don't assume that the difference between two unsigned long values
9747 can fit into an integer. At this point, we know button_down_time
9748 <= event->timestamp, so the difference must be nonnegative, so
9749 there's no need to cast the result if double-click-time is
9750 nonnegative, as it should be; check that it's nonnegative, just in
9751 case. This bug is triggered when events are more than 2**31 ms
86db42d2 9752 apart (about 25 days). (Bug#8664)
8e55734a 9753
841f1b75 9754 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 9755 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 9756
3e26f69c
PE
9757 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
9758 that always fit in int. Use a sentinel instead of a counter, to
9759 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
9760 * frame.h (struct frame): Use int for menu_bar_items_used
9761 instead of EMACS_INT, since it always fits in int.
3e26f69c 9762
5cc152c0
PE
9763 * menu.c (grow_menu_items): Check for int overflow.
9764
d89eb65e
PE
9765 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
9766
5235bd3e
PE
9767 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
9768 Before, the code was not consistent. These values cannot exceed
9769 2**31 - 1 so there's no need to make them unsigned.
9770 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
9771 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
9772 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
9773 as modifiers.
9774 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
9775
bc827e23
PE
9776 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
9777 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
9778 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
9779 presumably because the widths might not match.
9780
78eb494e
PE
9781 * window.c (size_window): Avoid needless test at loop start.
9782
04f2d78b
CB
97832011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
9784
9785 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
9786
d2fc7e3d 97872011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
9788
9789 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
9790
d2fc7e3d 97912011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
9792
9793 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
9794 `width' to `bar_area_x' and `bar_area_width', respectively.
9795 (x_scroll_run): Take account of fringe background extension.
9796
04f2d78b
CB
9797 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
9798 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
9799 `bar_area_width', respectively.
9800 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
9801 background extension.
9802
79b70037
GM
98032011-05-10 Jim Meyering <meyering@redhat.com>
9804
9805 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
9806
2f142cc5
JB
98072011-05-10 Juanma Barranquero <lekktu@gmail.com>
9808
9809 * image.c (Finit_image_library): Return t for built-in image types,
9810 like pbm and xbm. (Bug#8640)
9811
57679c86
AS
98122011-05-09 Andreas Schwab <schwab@linux-m68k.org>
9813
9814 * w32menu.c (set_frame_menubar): Fix submenu allocation.
9815
888c9e86
EZ
98162011-05-07 Eli Zaretskii <eliz@gnu.org>
9817
b0512a1d
EZ
9818 * w32console.c (Fset_screen_color): Doc fix.
9819 (Fget_screen_color): New function.
9820 (syms_of_ntterm): Defsubr it.
9821
7285dc67
EZ
9822 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
9823 unlink the temporary file if Fcall_process didn't create it in the
9824 first place.
9825 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
9826 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
9827 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
9828 cue to call_process_cleanup not to close that handle.
9829
4d3fcc8e
BK
98302011-05-07 Ben Key <bkey76@gmail.com>
9831
9832 * makefile.w32-in: The bootstrap-temacs rule now makes use of
9833 one of two shell specific rules, either bootstrap-temacs-CMD or
9834 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
9835 to the previous implementation of the bootstrap-temacs rule.
9836 The bootstrap-temacs-CMD rule is similar to the previous
9837 implementation of the bootstrap-temacs rule except that it
9838 makes use of the ESC_CFLAGS variable instead of the CFLAGS
9839 variable.
9840
9841 These changes, along with some changes to nt/configure.bat,
9842 nt/gmake.defs, and nt/nmake.defs, are required to extend my
9843 earlier fix to add support for --cflags and --ldflags options
9844 that include quotes so that it works whether make uses cmd or
9845 sh as the shell.
9846
b4289b64
MA
98472011-05-06 Michael Albinus <michael.albinus@gmx.de>
9848
9849 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
9850 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
9851 is a constant.
9852 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
9853 a string. Handle both cases.
9854 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
9855 (Fdbus_register_method): Use Qinvalid_function.
9856
af4c0e28
JB
98572011-05-06 Juanma Barranquero <lekktu@gmail.com>
9858
9859 * makefile.w32-in: Update dependencies.
9860 (LISP_H): Add inttypes.h and stdin.h.
9861 (PROCESS_H): Add unistd.h.
9862
c51453d9
EZ
98632011-05-06 Eli Zaretskii <eliz@gnu.org>
9864
9865 * lread.c: Include limits.h (fixes the MS-Windows build broken by
9866 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
9867
8ff0ac3c 98682011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 9869
4c4b566b
PE
9870 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
9871
aab2b9b5
PE
9872 * term.c (vfatal): Remove stray call to va_end.
9873 It's not needed and the C Standard doesn't allow it here anyway.
9874
c378da0b
PE
9875 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
9876 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
9877
288b08c7
PE
9878 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
9879 bytes.
9880
e3601888
PE
9881 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
9882
db6c0e74
PE
9883 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9884
dd5963ea
PE
9885 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
9886
88c9450f
PE
9887 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
9888
2f9442b8
PE
9889 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
9890
c032b5f8
PE
9891 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
9892 * charset.c (Fdefine_charset_internal): Don't initialize
9893 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 9894 32-bit int (Bug#8600).
a108c10b
PE
9895
9896 * lread.c (read_integer): Be more consistent with string-to-number.
9897 Use string_to_number to do the actual conversion; this avoids
9898 rounding errors and fixes some other screwups. Without this fix,
9899 for example, #x1fffffffffffffff was misread as -2305843009213693952.
9900 (digit_to_number): Move earlier, for benefit of read_integer.
9901 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 9902 not a digit in any supported base. (Bug#8602)
a108c10b 9903
ad5f9eea
PE
9904 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
9905
aec1708a
PE
9906 * dispnew.c (scrolling_window): Return 1 if we scrolled,
9907 to match comment at start of function. This also removes a
9908 GCC warning about overflow in a 32+64-bit port.
9909
47be4ab5
PE
9910 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
9911
371cac43
PE
9912 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
9913 Reported by Stefan Monnier in
9914 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
9915 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9916 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 9917
d01a7826
PE
9918 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
9919 (EMACS_UINTPTR): Likewise, with uintptr_t.
9920
7fd47d5c
PE
9921 * lisp.h: Prefer 64-bit EMACS_INT if available.
9922 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
9923 on 32-bit hosts that have 64-bit int, so that they can access
9924 large files.
122b0c86
PE
9925 However, temporarily disable this change unless the temporary
9926 symbol WIDE_EMACS_INT is defined.
7fd47d5c 9927
8727937b
PE
9928 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
9929
8ac068ac
PE
9930 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
9931 This removes an assumption that EMACS_INT and long are the same
9932 width as pointers. The assumption is true for Emacs porting targets
9933 now, but we want to make other targets possible.
9934 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
9935 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
9936 In the rest of the code, change types of integers that hold casted
9937 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
9938 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
9939 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
9940 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
9941 No need to cast type when ORing.
9942 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
9943 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
9944 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
9945 assume EMACS_INT is the same width as char *.
9946 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
9947 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
9948 Remove no-longer-needed casts.
9949 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
9950 (xg_tool_bar_help_callback, xg_make_tool_item):
9951 Use EMACS_INTPTR to hold an integer
9952 that will be cast to void *; this can avoid a GCC warning
9953 if EMACS_INT is not the same width as void *.
9954 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
9955 * xdisp.c (display_echo_area_1, resize_mini_window_1):
9956 (current_message_1, set_message_1):
9957 Use a local to convert to proper width without a cast.
9958 * xmenu.c (dialog_selection_callback): Likewise.
9959
ede49d71
PE
9960 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
9961 Also, don't assume VALBITS / RAND_BITS is less than 5,
9962 and don't rely on undefined behavior when shifting a 1 left into
9963 the sign bit.
9964 * lisp.h (get_random): Change signature to match.
9965
2f30ecd0
PE
9966 * lread.c (hash_string): Use size_t, not int, for hash computation.
9967 Normally we prefer signed values; but hashing is special, because
9968 it's better to use unsigned division on hash table sizes so that
9969 the remainder is nonnegative. Also, size_t is the natural width
9970 for hashing into memory. The previous code used 'int', which doesn't
9971 retain enough info to hash well into very large tables.
9972 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
9973
2a866e7b
PE
9974 * dbusbind.c: Don't possibly lose pointer info when converting.
9975 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9976 Use XPNTR rather than XHASH, so that the high-order bits of
9977 the pointer aren't lost when converting through void *.
9978
51639eac
PE
9979 * eval.c (Fautoload): Don't double-shift a pointer.
9980
92394119
PE
9981 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
9982
dbdb9a7c
JB
99832011-05-06 Juanma Barranquero <lekktu@gmail.com>
9984
9985 * gnutls.c (DEF_GNUTLS_FN):
9986 * image.c (DEF_IMGLIB_FN): Make function pointers static.
9987
db7a0b4f
AS
99882011-05-05 Andreas Schwab <schwab@linux-m68k.org>
9989
9990 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
9991 marker. (Bug#8610)
9992
cd394be1 99932011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
9994
9995 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
9996 New version that can reserve upto 2GB of heap space.
9997
f7ff1b0f 99982011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
9999
10000 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
10001
639c109b
TZ
100022011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
10003
10004 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
10005 `gnutls_certificate_set_x509_key_file'.
10006
d2127135
JB
100072011-05-05 Juanma Barranquero <lekktu@gmail.com>
10008
10009 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
10010 Update dependencies.
10011
e968f4f3
JB
100122011-05-04 Juanma Barranquero <lekktu@gmail.com>
10013
10014 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
10015 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10016 Remove unused parameter `fildes'.
10017 * process.c (read_process_output, send_process): Don't pass it.
10018
84d358f0
JB
100192011-05-04 Juanma Barranquero <lekktu@gmail.com>
10020
10021 Fix previous change: the library cache is defined in w32.c.
10022 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
10023 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
10024
0898ca10
JB
100252011-05-04 Juanma Barranquero <lekktu@gmail.com>
10026
10027 Implement dynamic loading of GnuTLS on Windows.
10028
10029 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
10030 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
10031 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10032 Declare.
10033
10034 * gnutls.c (Qgnutls_dll): Define.
10035 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
10036 (gnutls_*): Declare function pointers.
10037 (init_gnutls_functions): New function to initialize function pointers.
10038 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
10039 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
10040 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10041 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
10042 (emacs_gnutls_write, emacs_gnutls_read)
10043 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
10044 (Fgnutls_available_p): New function.
10045 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
10046 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
10047 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
10048
10049 * image.c: Include w32.h.
10050 (Vimage_type_cache): Delete.
10051 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
10052 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
10053 (w32_delayed_load): Move to w32.c.
10054
10055 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
10056
10057 * w32.c (QCloaded_from, Vlibrary_cache): Define.
10058 (w32_delayed_load): Move from image.c. When loading a library, record
10059 its filename in the :loaded-from property of the library id.
10060 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
10061 Initialize and staticpro them.
10062 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
10063
10064 * process.c: Include lisp.h before w32.h, not after.
10065 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
10066 instead of gnutls_record_check_pending.
10067
10068 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
10069
ff4de4aa
TZ
100702011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
10071
10072 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
10073 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
10074 as passed in.
10075
abe95abb
JD
100762011-05-03 Jan Djärv <jan.h.d@swipnet.se>
10077
10078 * xterm.c (x_set_frame_alpha): Do not set property on anything
10079 else than FRAME_X_OUTER_WINDOW (Bug#8608).
10080
e16e55d4
JB
100812011-05-02 Juanma Barranquero <lekktu@gmail.com>
10082
10083 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
10084
bafcf6a5
JB
100852011-05-02 Juanma Barranquero <lekktu@gmail.com>
10086
10087 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
10088 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
10089 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
10090 (gnutls_global_initialized, Qgnutls_bootprop_priority)
10091 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
10092 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
10093 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
10094 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
10095 (Qgnutls_bootprop_callbacks_verify): Make static.
10096
e7a6747f
AS
100972011-05-01 Andreas Schwab <schwab@linux-m68k.org>
10098
19ed11ba
AS
10099 * callproc.c: Indentation fixup.
10100
e7a6747f 10101 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
10102 (wait_for_termination, interruptible_wait_for_termination):
10103 Move after wait_for_termination_1.
e7a6747f 10104
1ef14cb4
LMI
101052011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
10106
10107 * sysdep.c (interruptible_wait_for_termination): New function
10108 which is like wait_for_termination, but allows keyboard
10109 interruptions.
10110
10111 * callproc.c (Fcall_process): Add (:file "file") as an option for
10112 the STDOUT buffer.
10113 (Fcall_process_region): Ditto.
10114
330d880c
EZ
101152011-04-30 Eli Zaretskii <eliz@gnu.org>
10116
8db90b73
EZ
10117 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
10118 rather than `XVECTOR (FOO)->size'.
10119
330d880c
EZ
10120 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
10121 inttypes.h, as a gnulib replacement is used if it not available in
10122 system headers.
10123
15cbd324
EZ
101242011-04-21 Eli Zaretskii <eliz@gnu.org>
10125
10126 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
10127 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
10128 of MOST_POSITIVE_FIXNUM. (Bug#8528)
10129
10130 * coding.c (coding_alloc_by_realloc): Error out if destination
10131 will grow beyond MOST_POSITIVE_FIXNUM.
10132 (decode_coding_emacs_mule): Abort if there isn't enough place in
10133 charbuf for the composition carryover bytes. Reserve an extra
10134 space for up to 2 characters produced in a loop.
10135 (decode_coding_iso_2022): Abort if there isn't enough place in
10136 charbuf for the composition carryover bytes.
10137
101382011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 10139
ae940cca
EZ
10140 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
10141 aborting when %lld or %lll format is passed.
10142 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
10143 %llo or %llx format is passed. (Bug#8545)
10144
03ab8921
EZ
10145 * window.c (window_scroll_line_based): Use a marker instead of
10146 simple variables to record original value of point. (Bug#7952)
10147
afda1437
EZ
10148 * doprnt.c (doprnt): Fix the case where a multibyte sequence
10149 produced by %s or %c overflows available buffer space. (Bug#8545)
10150
f76dee0c
PE
101512011-04-28 Paul Eggert <eggert@cs.ucla.edu>
10152
10153 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 10154 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 10155
fdc5744d
JB
101562011-04-28 Juanma Barranquero <lekktu@gmail.com>
10157
10158 * w32.c (init_environment): Warn about defaulting HOME to C:\.
10159
638f053a
JB
101602011-04-28 Juanma Barranquero <lekktu@gmail.com>
10161
10162 * keyboard.c (Qdelayed_warnings_hook): Define.
10163 (command_loop_1): Run `delayed-warnings-hook'
10164 if Vdelayed_warnings_list is non-nil.
10165 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
10166 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
10167
d178f871
EZ
101682011-04-28 Eli Zaretskii <eliz@gnu.org>
10169
10170 * doprnt.c (doprnt): Don't return value smaller than the buffer
10171 size if the message was truncated. (Bug#8545).
10172
b124fd93
JB
101732011-04-28 Juanma Barranquero <lekktu@gmail.com>
10174
10175 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
10176 (Fx_window_property): #if-0 the whole functions, not just the bodies.
10177
e810457d
PE
101782011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10179
10180 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
10181
ea51cceb
JB
101822011-04-27 Juanma Barranquero <lekktu@gmail.com>
10183
10184 * makefile.w32-in: Update dependencies.
10185
94dcfacf
EZ
101862011-04-27 Eli Zaretskii <eliz@gnu.org>
10187
10188 Improve `doprnt' and its usage. (Bug#8545)
10189 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
10190 `format_end'. Remove support for %l as a conversion specifier.
10191 Don't use xrealloc. Improve diagnostics when the %l size modifier
10192 is used. Update the commentary.
10193
10194 * eval.c (verror): Simplify calculation of size_t.
10195
10196 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
10197 messages.
10198
f61f41d7
PE
101992011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
10200
10201 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
10202 change.
10203
96fb4434
PE
102042011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10205
10206 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
10207 This makes this file independent of the recent pseudovector change.
10208
671875da 102092011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 10210
69e9b5a3
PE
10211 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
10212
b5f869a7 10213 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 10214 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 10215 Remove unused local.
c8926152 10216 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 10217
841a1577 10218 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
10219 GCC 4.6.0 optimizes based on type-based alias analysis.
10220 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
10221 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
10222 != &v->size, and therefore "v->size = 1; b->size = 2; return
10223 v->size;" must therefore return 1. This assumption is incorrect
10224 for Emacs, since it type-puns struct Lisp_Vector * with many other
10225 types. To fix this problem, this patch adds a new type struct
f904488f 10226 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
10227 and pseudovectors, and helps optimizing compilers not get fooled
10228 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
10229 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
10230 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
10231 the size member.
eab3844f
PE
10232 (XSETPVECTYPE): Rewrite in terms of new macro.
10233 (XSETPVECTYPESIZE): New macro, specifying both type and size.
10234 This is a bit clearer, and further avoids the possibility of
10235 undesirable aliasing.
10236 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 10237 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
10238 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
10239 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
10240 (ASIZE): Now uses header.size rather than size.
10241 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
10242 to avoid the hassle of writing XVECTOR (foo)->header.size.
10243 (struct vectorlike_header): New type.
eab3844f
PE
10244 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
10245 object, to help avoid aliasing.
10246 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
10247 (SUBRP): Likewise, since Lisp_Subr is a special case.
10248 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
10249 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
10250 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 10251 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
10252 changed to be "header.size" and "header.next".
10253 * buffer.h (struct buffer): Likewise.
10254 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
10255 * frame.h (struct frame): Likewise.
10256 * process.h (struct Lisp_Process): Likewise.
10257 * termhooks.h (struct terminal): Likewise.
10258 * window.c (struct save_window_data, struct saved_window): Likewise.
10259 * window.h (struct window): Likewise.
10260 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
10261 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
10262 * buffer.c (init_buffer_once): Likewise.
10263 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
10264 special case.
10265 * process.c (Fformat_network_address): Use local var for size,
10266 for brevity.
10267
0df1eac5
PE
10268 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
10269
847ab9d1 10270 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
10271 * data.c (atof): Remove decl; no longer used or needed.
10272 (digit_to_number): Move to lread.c.
10273 (Fstring_to_number): Use new string_to_number function, to be
10274 consistent with how the Lisp reader treats infinities and NaNs.
10275 Do not assume that floating-point numbers represent EMACS_INT
10276 without losing information; this is not true on most 64-bit hosts.
10277 Avoid double-rounding errors, by insisting on integers when
10278 parsing non-base-10 numbers, as the documentation specifies.
10279 * lisp.h (string_to_number): New decl, replacing ...
10280 (isfloat_string): Remove.
bc0a5c13 10281 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 10282 (read1): Do not accept +. and -. as integers; this
452f4150
PE
10283 appears to have been a coding error. Similarly, do not accept
10284 strings like +-1e0 as floating point numbers. Do not report
10285 overflow for integer overflows unless the base is not 10 which
10286 means we have no simple and reliable way to continue.
10287 Break out the floating-point parsing into a new
10288 function string_to_number, so that Fstring_to_number parses
10289 floating point numbers consistently with the Lisp reader.
04f2d78b 10290 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
10291 (E_CHAR, EXP_INT): Remove, replacing with ...
10292 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
10293 (string_to_number): New function, replacing isfloat_string.
10294 This function checks for valid syntax and produces the resulting
10295 Lisp float number too. Rework it so that string-to-number
bc0a5c13 10296 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
10297 so that overflow for non-base-10 numbers is reported only when
10298 there's no portable and simple way to convert to floating point.
452f4150 10299
67769ffc
PE
10300 * textprop.c (set_text_properties_1): Rewrite for clarity,
10301 and to avoid GCC warning about integer overflow.
10302
c20db43f
PE
10303 * intervals.h (struct interval): Use EMACS_INT for members
10304 where EMACS_UINT might cause problems. See
10305 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
10306 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
10307 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
10308 All uses changed.
37aa2f85
PE
10309 (offset_intervals): Tell GCC not to worry about length overflow
10310 when negating a negative length.
c20db43f 10311
2538aa2f
PE
10312 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
10313 (overrun_check_free): Likewise.
10314
f2d3008d
PE
10315 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
10316 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
10317 word size.
10318
ec8df744
PE
10319 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10320 (gnutls_make_error): Rename local to avoid shadowing.
10321 (gnutls_emacs_global_deinit): ifdef out; not used.
10322 (Fgnutls_boot): Use const for pointer to readonly storage.
10323 Comment out unused local. Fix pointer signedness problems.
10324
640ee02d
PE
10325 * lread.c (openp): Don't stuff size_t into an 'int'.
10326 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
10327 about possible signed overflow.
10328
6048fb2a
PE
10329 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10330 (GDK_KEY_g): Don't define if already defined.
10331 (xg_prepare_tooltip): Avoid pointer signedness problem.
10332 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
10333
fa3c87e1
PE
10334 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
10335 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
10336
2172544b
PE
10337 * xfns.c (Fx_window_property): Simplify a bit,
10338 to make a bit faster and to avoid GCC 4.6.0 warning.
10339 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
10340
9b821a21
PE
10341 * fns.c (internal_equal): Don't assume size_t fits in int.
10342
3c616cfa
PE
10343 * alloc.c (compact_small_strings): Tighten assertion a little.
10344
c2982e87
PE
10345 Replace pEd with more-general pI, and fix some printf arg casts.
10346 * lisp.h (pI): New macro, generalizing old pEd macro to other
10347 conversion specifiers. For example, use "...%"pI"d..." rather
10348 than "...%"pEd"...".
10349 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 10350 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
10351 * alloc.c (check_pure_size): Don't overflow by converting size to int.
10352 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
10353 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
10354 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
10355 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
10356 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
10357 64-bit hosts.
10358 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
10359 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
10360 * print.c (safe_debug_print, print_object): Likewise.
10361 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
10362 to int.
6f04d126
PE
10363 Use pI instead of if-then-else-abort. Use %p to avoid casts,
10364 avoiding the 0 flag, which is not portable.
c2982e87
PE
10365 * process.c (Fmake_network_process): Use pI to avoid cast.
10366 * region-cache.c (pp_cache): Likewise.
10367 * xdisp.c (decode_mode_spec): Likewise.
10368 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
10369 behavior on 64-bit hosts with printf arg.
6f04d126 10370 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
10371 (x_stop_queuing_selection_requests): Likewise.
10372 (x_get_window_property): Don't truncate byte count to an 'int'
10373 when tracing.
0b432f21 10374
5e073ec7
PE
10375 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
10376 here, since it parses constructs like leading '-' and spaces,
10377 which are not wanted; and it overflows with large numbers.
10378 Instead, simply match F[0-9]+, which is what is wanted anyway.
10379
36372bf9
PE
10380 * alloc.c: Remove unportable assumptions about struct layout.
10381 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
10382 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
10383 (allocate_vectorlike, make_pure_vector): Use the new macros,
10384 plus offsetof, to remove unportable assumptions about struct layout.
10385 These assumptions hold on all porting targets that I know of, but
10386 they are not guaranteed, they're easy to remove, and removing them
10387 makes further changes easier.
10388
0b432f21
PE
10389 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
10390 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
10391 (string_overrun_cookie): Now const. Use initializers that
10392 don't formally overflow signed char, to avoid warnings.
000098c1
PE
10393 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
10394 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
10395 (allocate_buffer): Don't assume sizeof (struct buffer) is a
10396 multiple of sizeof (EMACS_INT); it need not be, if
10397 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 10398 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 10399
895009e1
JB
104002011-04-26 Juanma Barranquero <lekktu@gmail.com>
10401
10402 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
10403
6a7a1b0b
TZ
104042011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
10405
10406 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 10407 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
10408 Reported by Paul Eggert <eggert@cs.ucla.edu>.
10409
841a1577 104102011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
10411
10412 * lisp.h (Qdebug): List symbol.
895009e1 10413 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
10414 * keyboard.c (debug-on-event): New variable.
10415 (handle_user_signal): Break into debugger when debug-on-event
10416 matches the current signal symbol.
10417
f2d3ba6f
DN
104182011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
10419
10420 * alloc.c (check_sblock, check_string_bytes)
10421 (check_string_free_list): Convert to standard C.
10422
42ce4c63
TZ
104232011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
10424
10425 * w32.c (emacs_gnutls_push): Fix typo.
10426
825cd63c
EZ
104272011-04-25 Eli Zaretskii <eliz@gnu.org>
10428
fb11d64d
EZ
10429 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
10430 "cast to pointer from integer of different size".
10431
825cd63c
EZ
10432 Improve doprnt and its use in verror. (Bug#8545)
10433 * doprnt.c (doprnt): Document the set of format control sequences
10434 supported by the function. Use SAFE_ALLOCA instead of always
10435 using `alloca'.
10436
10437 * eval.c (verror): Don't limit the buffer size at size_max-1, that
10438 is one byte too soon. Don't use xrealloc; instead xfree and
10439 xmalloc anew.
10440
e061a11b
TZ
104412011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
10442
10443 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
10444 callbacks stage.
10445
10446 * gnutls.c: Renamed global_initialized to
10447 gnutls_global_initialized. Added internals for the
10448 :verify-hostname-error, :verify-error, and :verify-flags
10449 parameters of `gnutls-boot' and documented those parameters in the
10450 docstring. Start callback support.
9173deec
JB
10451 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
10452 unless a fatal error occurred. Call gnutls_alert_send_appropriate
10453 on error. Return error code.
e061a11b
TZ
10454 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
10455 (emacs_gnutls_read): Likewise.
10456 (Fgnutls_boot): Return handshake error code.
10457 (emacs_gnutls_handle_error): New function.
10458 (wsaerror_to_errno): Likewise.
10459
10460 * w32.h (emacs_gnutls_pull): Add prototype.
10461 (emacs_gnutls_push): Likewise.
10462
10463 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
10464 (emacs_gnutls_push): Likewise.
10465
104662011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
10467
10468 * process.c (wait_reading_process_output): Check if GnuTLS
10469 buffered some data internally if no FDs are set for TLS
10470 connections.
10471
10472 * makefile.w32-in (OBJ2): Add gnutls.$(O).
10473 (LIBS): Link to USER_LIBS.
10474 ($(BLD)/gnutls.$(0)): New target.
10475
fa6996bc
EZ
104762011-04-24 Eli Zaretskii <eliz@gnu.org>
10477
eb35682e
EZ
10478 * xdisp.c (handle_single_display_spec): Rename the
10479 display_replaced_before_p argument into display_replaced_p, to
10480 make it consistent with the commentary. Fix typos in the
10481 commentary.
10482
e2ad650c
EZ
10483 * textprop.c (syms_of_textprop): Remove dead code.
10484 (copy_text_properties): Delete obsolete commentary about an
10485 interface that was deleted long ago. Fix typos in the description
10486 of arguments.
10487
1b2de274
EZ
10488 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
10489 to changes in oldXMenu/XMenu.h from 2011-04-16.
10490 <menu_help_message, prev_menu_help_message>: Constify.
10491 (IT_menu_make_room): menu->help_text is now `const char **';
10492 adjust.
10493
10494 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
10495 to changes in oldXMenu/XMenu.h from 2011-04-16.
10496 (struct XMenu): Declare `help_text' `const char **'.
10497
10498 * xfaces.c <Qunspecified>: Make extern again.
10499
10500 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 10501 required by POSIX.
1b2de274 10502
762b15be
EZ
10503 * doc.c (get_doc_string): Improve the format passed to `error'.
10504
10505 * doprnt.c (doprnt): Improve commentary.
10506
10507 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
10508
10509 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
10510 them with etags.
10511
f1052e5d
EZ
10512 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
10513 changes in globals.h immediately force recompilation.
762b15be
EZ
10514 (TAGS): Depend on $(CURDIR)/m/intel386.h and
10515 $(CURDIR)/s/ms-w32.h.
10516 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 10517
fa6996bc
EZ
10518 * character.c (Fchar_direction): Function deleted.
10519 (syms_of_character): Don't defsubr it.
10520 <char-direction-table>: Deleted.
10521
e6c3da20
EZ
105222011-04-23 Eli Zaretskii <eliz@gnu.org>
10523
10524 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
10525 * doprnt.c: Include limits.h.
10526 (SIZE_MAX): New macro.
04f2d78b
CB
10527 (doprnt): Return a size_t value. 2nd arg is now size_t.
10528 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
10529 Improve overflow protection. Support `l' modifier for integer
10530 conversions. Support %l conversion. Don't assume an EMACS_INT
10531 argument for integer conversions and for %c.
10532
10533 * lisp.h (doprnt): Restore prototype.
10534
10535 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
10536 $(SRC)/character.h.
10537
10538 * Makefile.in (base_obj): Add back doprnt.o.
10539
10540 * deps.mk (doprnt.o): Add back prerequisites.
10541 (callint.o): Depend on character.h.
10542
10543 * eval.c (internal_lisp_condition_case): Include the handler
10544 representation in the error message.
10545 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
10546 when breaking from the loop.
10547
10548 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
10549
10550 * callint.c (Fcall_interactively): When displaying error message
10551 about invalid control letter, pass the character's codepoint, not
10552 a pointer to its multibyte form. Improve display of the character
10553 in octal and display also its hex code.
10554
10555 * character.c (char_string): Use %x to display the (unsigned)
10556 codepoint of an invalid character, to avoid displaying a bogus
10557 negative value.
10558
10559 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
10560 `error', not SYMBOL_NAME itself.
10561
10562 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
10563 character arguments to `error'.
10564
10565 * charset.c (check_iso_charset_parameter): Fix incorrect argument
10566 to `error' in error message about FINAL_CHAR argument. Make sure
10567 FINAL_CHAR is a character, and use %c when it is passed as
10568 argument to `error'.
10569
4ffd0d6b 105702011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
10571
10572 * s/ms-w32.h (localtime): Redirect to sys_localtime.
10573
10574 * w32.c: Include <time.h>.
10575 (sys_localtime): New function.
10576
4ffd0d6b 105772011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
10578
10579 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
10580
4ffd0d6b 10581 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 10582
4ffd0d6b 105832011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 10584
4ffd0d6b
GM
10585 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
10586 zombies (Bug#8467).
aac0c6e3 10587
04c56954
EZ
105882011-04-19 Eli Zaretskii <eliz@gnu.org>
10589
10590 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
10591 gl_state.e_property when gl_state.object is Qt.
10592
10593 * insdel.c (make_gap_larger): Remove limitation of buffer size
10594 to <= INT_MAX.
10595
16a43933
CY
105962011-04-18 Chong Yidong <cyd@stupidchicken.com>
10597
10598 * xdisp.c (lookup_glyphless_char_display)
10599 (produce_glyphless_glyph): Handle cons cell entry in
10600 glyphless-char-display.
10601 (Vglyphless_char_display): Document it.
10602
10603 * term.c (produce_glyphless_glyph): Handle cons cell entry in
10604 glyphless-char-display.
10605
4581706e
CY
106062011-04-17 Chong Yidong <cyd@stupidchicken.com>
10607
10608 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
10609
10610 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
10611
10612 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
10613 definition for no-X builds.
10614
4887c6e2 106152011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 10616
fd35b6f9
PE
10617 Static checks with GCC 4.6.0 and non-default toolkits.
10618
5c1ccb01
PE
10619 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
10620
006c5daa
PE
10621 * process.c (keyboard_bit_set): Define only if SIGIO.
10622 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
10623 (send_process): Repair possible setjmp clobbering.
10624
efc736d3
PE
10625 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
10626
4e2fe2e6
PE
10627 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
10628
f97334a2
PE
10629 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
10630
4e75f29d
PE
10631 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
10632 Define only if needed.
10633
90efadd1
PE
10634 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
10635 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 10636 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 10637
3c647824
PE
10638 * dispextern.h (struct redisplay_interface): Rename param
10639 to avoid shadowing.
e264f262 10640 * termhooks.h (struct terminal): Likewise.
761383f4 10641 * xterm.c (xembed_send_message): Likewise.
3c647824 10642
b58c5c4a
PE
10643 * insdel.c (make_gap_smaller): Define only if
10644 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
10645
cad59032
PE
10646 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
10647 it.
10648
c339dc2e
PE
10649 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
10650 so that we aren't warned about unused symbols.
10651
91a3e27b
PE
10652 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
10653
399c71d3 10654 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 10655
8ffc96f5
PE
10656 * xfns.c (x_real_positions): Mark locals as initialized.
10657
eef9bc79
PE
10658 * xmenu.c (xmenu_show): Don't use uninitialized vars.
10659
098db9dd
PE
10660 * xterm.c: Fix problems found by static analysis with other toolkits.
10661 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
10662 (x_dispatch_event): Declare static if USE_GTK, and
10663 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 10664 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 10665 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
10666 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
10667 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 10668
eb18f6cc
PE
10669 * xmenu.c (menu_help_callback): Pointer type fixes.
10670 Use const pointers when pointing at readonly data. Avoid pointer
10671 signedness clashes.
10672 (FALSE): Remove unused macro.
10673 (update_frame_menubar): Remove unused decl.
10674
1fe72bf8
PE
10675 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
10676
60d9e1db
PE
10677 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
10678 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
10679 (single_menu_item): Rename local to avoid shadowing.
10680
39261c26
PE
10681 * keyboard.c (make_lispy_event): Remove unused local var.
10682
018c5e19
PE
10683 * frame.c, frame.h (x_get_resource_string): Bring this back, but
10684 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
10685
63d2b86e
PE
10686 * bitmaps: Change bitmaps from unsigned char back to the X11
10687 compatible char. Avoid the old compiler warnings about
10688 out-of-range initializers by using, for example, '\xab' rather
10689 than 0xab.
10690
aefd87e1
PE
10691 * xgselect.c (xgselect_initialize): Check vs interface
10692 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
10693
bf501fb9
PE
10694 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
10695
e9829fdf
PE
10696 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
10697 to read-only memory.
10698
1086c095
PE
10699 * fns.c (vector): Remove; this old hack is no longer needed.
10700
2baccd04 10701 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 10702 Remove unused var.
dde42981 10703 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 10704
72391843 10705 * xrdb.c (x_load_resources): Omit unused local.
3565b346 10706
436c16df 10707 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 10708 (x_window): Rename locals to avoid shadowing.
dc5ddd85 10709 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 10710
92bb796d 10711 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 10712 (x_term_init): Remove local to avoid shadowing.
92bb796d 10713
764430a3 10714 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
10715
10716 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
10717 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
10718
d1dfb56c
EZ
107192011-04-16 Eli Zaretskii <eliz@gnu.org>
10720
c4354cb4
EZ
10721 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
10722
d1dfb56c
EZ
10723 Fix regex.c, syntax.c and friends for buffers > 2GB.
10724 * syntax.h (struct gl_state_s): Declare character position members
10725 EMACS_INT.
10726
10727 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
10728
04f2d78b
CB
10729 * textprop.c (verify_interval_modification, interval_of):
10730 Declare arguments EMACS_INT.
d1dfb56c
EZ
10731
10732 * intervals.c (adjust_intervals_for_insertion): Declare arguments
10733 EMACS_INT.
10734
10735 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
10736
10737 * indent.c (Fvertical_motion): Local variable it_start is now
10738 EMACS_INT.
10739
10740 * regex.c (re_match, re_match_2, re_match_2_internal)
10741 (bcmp_translate, regcomp, regexec, print_double_string)
10742 (group_in_compile_stack, re_search, re_search_2, regex_compile)
10743 (re_compile_pattern, re_exec): Declare arguments and local
10744 variables `size_t' and `ssize_t' and return values `regoff_t', as
10745 appropriate.
10746 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
10747 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
10748 <compile_stack_type>: `size' and `avail' are now `size_t'.
10749
10750 * regex.h <regoff_t>: Use ssize_t, not int.
10751 (re_search, re_search_2, re_match, re_match_2): Arguments that
10752 specify buffer/string position and length are now ssize_t and
10753 size_t. Return type is regoff_t.
10754
613052cd
BK
107552011-04-16 Ben Key <bkey76@gmail.com>
10756
10757 * nsfont.m: Fixed bugs in ns_get_family and
10758 ns_descriptor_to_entity that were caused by using free to
10759 deallocate memory blocks that were allocated by xmalloc (via
10760 xstrdup). This caused Emacs to crash when compiled with
10761 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
10762 --enable-checking=xmallocoverrun). xfree is now used to
10763 deallocate these memory blocks.
10764
4170f62f 107652011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 10766
71b41406
PE
10767 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
10768
9587a89d
PE
10769 emacs_write: Accept and return EMACS_INT for sizes.
10770 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
10771 et seq.
10772 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
10773 Accept and return EMACS_INT.
10774 (emacs_gnutls_write): Return the number of bytes written on
10775 partial writes.
10776 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
10777 (emacs_read, emacs_write): Remove check for negative size, as the
10778 Emacs source code has been audited now.
9587a89d
PE
10779 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
10780 (emacs_read, emacs_write): Use it.
273a5f82
PE
10781 * process.c (send_process): Adjust to the new signatures of
10782 emacs_write and emacs_gnutls_write. Do not attempt to store
10783 a byte offset into an 'int'; it might overflow.
9587a89d 10784 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 10785
3e047f51
PE
10786 * sound.c: Don't assume sizes fit in 'int'.
10787 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 10788 Return EMACS_INT, not int.
3e047f51 10789 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
10790 Accept EMACS_INT, not int.
10791 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
10792 record read return values.
10793
cc39a9db
BK
107942011-04-15 Ben Key <bkey76@gmail.com>
10795
c9d0ec6d
JB
10796 * keyboard.c (Qundefined): Don't declare static since it is used
10797 in nsfns.m.
10798 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
10799 static since they are used in nsfont.m.
cc39a9db 10800
6c60eb9f
SM
108012011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
10802
10803 * process.c (Qprocessp): Don't declare static.
10804 * lisp.h (Qprocessp): Declare again.
10805
7990b61a
JB
108062011-04-15 Juanma Barranquero <lekktu@gmail.com>
10807
10808 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
10809
5d4cb038
PE
108102011-04-14 Paul Eggert <eggert@cs.ucla.edu>
10811
8bd7b830 10812 Improve C-level modularity by making more things 'static'.
cd64ea1d 10813
e3b27b31
PE
10814 Don't publish debugger-only interfaces to other modules.
10815 * lisp.h (safe_debug_print, debug_output_compilation_hack):
10816 (verify_bytepos, count_markers): Move decls to the only modules
10817 that need them.
10818 * region-cache.h (pp_cache): Likewise.
10819 * window.h (check_all_windows): Likewise.
10820 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
10821
5d4cb038
PE
10822 * sysdep.c (croak): Now static, if
10823 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
10824 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
10825
10826 * alloc.c (refill_memory_reserve): Now static if
10827 !defined REL_ALLOC || defined SYSTEM_MALLOC.
10828 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 10829
e87b6180
PE
10830 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
10831 Define only if USE_LUCID.
10832
ac64929e
PE
10833 * xrdb.c (x_customization_string, x_rm_string): Now static.
10834
6f37259d
PE
10835 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
10836 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
10837
1683e3ab
PE
10838 * xdisp.c (draw_row_with_mouse_face): Now static.
10839 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
10840
de9c2632
PE
10841 * window.h (check_all_windows): Mark externally visible.
10842
2b96acb7
PE
10843 * window.c (window_deletion_count): Now static.
10844
10845 * undo.c: Make symbols static if they're not exported.
10846 (last_undo_buffer, last_boundary_position, pending_boundary):
10847 Now static.
10848
50436f33
PE
10849 * textprop.c (interval_insert_behind_hooks): Now static.
10850 (interval_insert_in_front_hooks): Likewise.
10851
64520e5c
PE
10852 * term.c: Make symbols static if they're not exported.
10853 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
10854 (max_frame_lines, tty_set_terminal_modes):
10855 (tty_reset_terminal_modes, tty_turn_off_highlight):
10856 (get_tty_terminal): Now static.
10857 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
10858 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 10859 HAVE_WINDOW_SYSTEM.
64520e5c
PE
10860 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
10861 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
10862
1fa53021
PE
10863 * sysdep.c: Make symbols static if they're not exported.
10864 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
10865 Now static.
10866 (sigprocmask_set, full_mask): Remove; unused.
10867 (wait_debugging): Mark as visible.
10868 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
10869 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
10870
d4b43b22
PE
10871 * syntax.c (syntax_temp): Define only if !__GNUC__.
10872
b7c513d0
PE
10873 * sound.c (current_sound_device, current_sound): Now static.
10874
989b29ad
PE
10875 * search.c (searchbufs, searchbuf_head): Now static.
10876
13a55a78
PE
10877 * scroll.c (scroll_cost): Remove; unused.
10878 * dispextern.h (scroll_cost): Remove decl.
10879
de68a1fc
PE
10880 * region-cache.h (pp_cache): Mark as externally visible.
10881
40ccffa6
PE
10882 * process.c: Make symbols static if they're not exported.
10883 (process_tick, update_tick, create_process, chan_process):
10884 (Vprocess_alist, proc_buffered_char, datagram_access):
10885 (fd_callback_data, send_process_frame, process_sent_to): Now static.
10886 (deactivate_process): Mark defn as static, as well as decl.
10887 * lisp.h (create_process): Remove decl.
10888 * process.h (chan_process, Vprocess_alist): Remove decls.
10889
ad64fc97
PE
10890 * print.c: Make symbols static if they're not exported.
10891 (print_depth, new_backquote_output, being_printed, print_buffer):
10892 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
10893 (print_interval, print_number_index, initial_stderr_stream):
10894 Now static.
10895 * lisp.h (Fprinc): Remove decl.
10896 (debug_output_compilation_hack): Mark as externally visible.
10897
adddb265
PE
10898 * sysdep.c (croak): Move decl from here to syssignal.h.
10899 * syssignal.h (croak): Put it here, so the API can be checked when
10900 'croak' is called from dissociate_if_controlling_tty.
10901
1717ede2
PE
10902 * minibuf.c: Make symbols static if they're not exported.
10903 (minibuf_save_list, choose_minibuf_frame): Now static.
10904 * lisp.h (choose_minibuf_frame): Remove decl.
10905
fa5fb2bc
PE
10906 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
10907
1e3890d1
PE
10908 * lread.c: Make symbols static if they're not exported.
10909 (read_objects, initial_obarray, oblookup_last_bucket_number):
10910 Now static.
10911 (make_symbol): Remove; unused.
10912 * lisp.h (initial_obarray, make_symbol): Remove decls.
10913
8a1414fa
PE
10914 * keyboard.c: Make symbols static if they're not exported.
10915 (single_kboard, recent_keys_index, total_keys, recent_keys):
10916 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
10917 (this_single_command_key_start, echoing, last_auto_save):
10918 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
10919 (command_loop, echo_now, keyboard_init_hook, help_char_p):
10920 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
10921 (Vlispy_mouse_stem, double_click_count):
10922 Now static.
10923 (force_auto_save_soon): Define only if SIGDANGER.
10924 (ignore_mouse_drag_p): Now static if
10925 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
10926 (print_help): Remove; unused.
10927 (stop_character, last_timer_event): Mark as externally visible.
10928 * keyboard.h (ignore_mouse_drag_p): Declare only if
10929 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
10930 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
10931 * lisp.h (echoing): Remove decl.
10932 (force_auto_save_soon): Declare only if SIGDANGER.
10933 * xdisp.c (redisplay_window): Simplify code, to make it more
10934 obvious that ignore_mouse_drag_p is not accessed if !defined
10935 USE_GTK && !defined HAVE_NS.
10936
93ea6e8f
PE
10937 * intervals.c: Make symbols static if they're not exported.
10938 (merge_properties_sticky, merge_interval_right, delete_interval):
10939 Now static.
10940 * intervals.h (merge_interval_right, delete_interval): Remove decls.
10941
77382fcc
PE
10942 * insdel.c: Make symbols static if they're not exported.
10943 However, leave prepare_to_modify_buffer alone. It's never
10944 called from outside this function, but that appears to be a bug.
10945 (combine_after_change_list, combine_after_change_buffer):
4889fc82 10946 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
10947 (adjust_after_replace_noundo): Remove; unused.
10948 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 10949 (signal_before_change): Remove decls.
77382fcc 10950
9306c32e
PE
10951 * indent.c (val_compute_motion, val_vmotion): Now static.
10952
cd44d2eb
PE
10953 * image.c: Make symbols static if they're not exported.
10954 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
10955 if USE_GTK.
10956 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
10957 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
10958
ad9a7a06
PE
10959 * fringe.c (standard_bitmaps): Now static.
10960 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
10961
81626931
PE
10962 * frame.c: Make symbols static if they're not exported.
10963 (x_report_frame_params, make_terminal_frame): Now static.
10964 (get_frame_param): Now static, unless HAVE_NS.
10965 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
10966 (x_get_resource_string): Remove; not used.
10967 * frame.h (make_terminal_frame, x_report_frame_params):
10968 (x_get_resource_string); Remove decls.
10969 (x_fullscreen_adjust): Declare only if WINDOWSNT.
10970 * lisp.h (get_frame_param): Declare only if HAVE_NS.
10971
239f9db9
PE
10972 * font.c, fontset.c: Make symbols static if they're not exported.
10973 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
10974 (FACE_SUITABLE_FOR_CHAR_P): Use it.
10975 * font.c (font_close_object): Now static.
10976 * font.h (font_close_object): Remove.
10977 * fontset.c (FONTSET_OBJLIST): Remove.
10978 (free_realized_fontset) #if-0 the body, which does nothing.
10979 (face_suitable_for_char_p): #if-0, as it's never called.
10980 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
10981 * xfaces.c (face_at_string_position):
10982 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
10983 since 0 is always ASCII.
10984
dfcf3579
PE
10985 * fns.c (weak_hash_tables): Now static.
10986
5045092b
PE
10987 * fileio.c: Make symbols static if they're not exported.
10988 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
10989 (Vwrite_region_annotation_buffers): Now static.
10990
57a96f5c
PE
10991 * eval.c: Make symbols static if they're not exported.
10992 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
10993 * lisp.h (backtrace_list): Remove decl.
10994
35f08c38
PE
10995 * emacs.c: Make symbols static if they're not exported.
10996 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
10997 (fatal_error_code, fatal_error_signal_hook, standard_args):
10998 Now static.
10999 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
11000 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
11001 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
11002 * lisp.h (fatal_error_signal_hook): Remove decl.
11003 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
11004
f44bd759
PE
11005 * editfns.c: Move a (normally-unused) function to its only use.
11006 * editfns.c, lisp.h (get_operating_system_release): Remove.
11007 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
11008 worth the hassle of breaking this out.
11009
b532497d
PE
11010 * xterm.c: Make symbols static if they're not exported.
11011 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
11012 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
11013 (x_destroy_window, x_delete_display):
11014 Now static.
11015 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
11016 (x_mouse_leave): Remove; unused.
11017 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
11018 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
11019 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
11020 Remove decls.
11021 (x_mouse_leave): Declare only if WINDOWSNT.
11022 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
11023 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
11024 USE_X_TOOLKIT.
11025
1675728f
PE
11026 * ftxfont.c: Make symbols static if they're not exported.
11027 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
11028 HAVE_FREETYPE.
11029 * font.h (ftxfont_driver): Likewise.
11030
e4cebfca
PE
11031 * xfns.c: Make symbols static if they're not exported.
11032 (x_last_font_name, x_display_info_for_name):
11033 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
11034 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
11035 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
11036 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
11037 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
11038 (last_show_tip_args): Now static.
11039 (xic_defaut_fontset, xic_create_fontsetname): Define only if
11040 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
11041 (x_screen_planes): Remove; unused.
11042 * dispextern.h (x_screen_planes): Remove decl.
11043
5bf46f05
PE
11044 * dispnew.c: Make symbols static if they're not exported.
11045 * dispextern.h (redraw_garbaged_frames, scrolling):
11046 (increment_row_positions): Remove.
11047 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
11048 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
11049 Now static.
11050 (redraw_garbaged_frames): Remove; unused.
11051
435f4c28
PE
11052 * xfaces.c: Make symbols static if they're not exported.
11053 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
11054 Remove decls.
11055 * xterm.h (defined_color): Remove decls.
11056 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
11057 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
11058 (menu_face_changed_default, defined_color, free_realized_face):
11059 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
11060 (ascii_face_of_lisp_face): Remove; unused.
11061
8524aef3
PE
11062 * xdisp.c: Make symbols static if they're not exported.
11063 * dispextern.h (scratch_glyph_row, window_box_edges):
11064 (glyph_to_pixel_coords, set_cursor_from_row):
11065 (get_next_display_element, set_iterator_to_next):
11066 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
11067 (show_mouse_face): Remove decls
11068 * frame.h (message_buf_print): Likewise.
11069 * lisp.h (pop_message, set_message, check_point_in_composition):
11070 Likewise.
11071 * xterm.h (set_vertical_scroll_bar): Likewise.
11072 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
11073 (message_buf_print, scratch_glyph_row, displayed_buffer):
11074 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
11075 (get_next_display_element, show_mouse_face, window_box_edges):
11076 (frame_to_window_pixel_xy, check_point_in_composition):
11077 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
11078 (glyph_to_pixel_coords): Remove; unused.
11079
16390cd2
PE
11080 * dired.c (file_name_completion): Now static.
11081
11082 * dbusbind.c (xd_in_read_queued_messages): Now static.
11083
a25f4dfa
PE
11084 * lisp.h (circular_list_error, FOREACH): Remove; unused.
11085 * data.c (circular_list_error): Remove.
11086
14a9c8df
PE
11087 * commands.h (last_point_position, last_point_position_buffer):
11088 (last_point_position_window): Remove decls.
11089 * keyboard.c: Make these variables static.
11090
04f2d78b
CB
11091 * coding.h (coding, code_convert_region, encode_coding_gap):
11092 Remove decls.
74ab6df5
PE
11093 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
11094 (iso_code_class, detect_coding, code_convert_region): Now static.
11095 (encode_coding_gap): Remove; unused.
11096
38dfbee1
PE
11097 * chartab.c (chartab_chars, chartab_bits): Now static.
11098
a2cb4e63
PE
11099 * charset.h (charset_iso_8859_1): Remove decl.
11100 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
11101 Now static.
11102
127198fd
PE
11103 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
11104 * ccl.c (Vccl_program_table): Now static.
11105 (check_ccl_update): Remove; unused.
11106
d85b608f
PE
11107 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
11108 * category.h: ... from here.
11109 * category.c (check_category_table, set_category_set): Now static.
11110
31cd66f3
PE
11111 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
11112 * lisp.h: Remove these decls.
11113
c358e587
PE
11114 * buffer.c (buffer_count): Remove unused var.
11115
e78aecca
PE
11116 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
11117 so that it's not optimized away.
11118 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
11119 * dispextern.h (bidi_dump_cached_states): Remove, since it's
11120 exported only to the debugger.
11121
e192d7d3 11122 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 11123 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 11124
92470028
PE
11125 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
11126 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
11127 was inaccessible from Lisp.
11128 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
11129 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
11130
244ed907
PE
11131 alloc.c: Import and export fewer symbols, and remove unused items.
11132 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
11133 is defined.
11134 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
11135 it's not optimized away by whole-program optimization.
11136 (message_enable_multibyte, free_misc): Remove.
11137 (catchlist, handlerlist, mark_backtrace):
11138 Declare only if BYTE_MARK_STACK.
11139 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
11140 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
11141 (message_enable_multibyte): Remove decl.
11142 (free_misc, interval_free_list, float_block, float_block_index):
11143 (n_float_blocks, float_free_list, cons_block, cons_block_index):
11144 (cons_free_list, last_marked_index):
11145 Now static.
11146 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
11147 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
11148 (mark_backtrace): Define only if BYTE_MARK_STACK.
11149 * xdisp.c (message_enable_multibyte): Now static.
11150
61c2b50e 11151 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
11152 This makes it easier for human readers (and static analyzers)
11153 to see whether these variables are used from other modules.
11154 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
11155 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
11156 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
11157 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
11158 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
11159 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
11160 * xmenu.c, xselect.c:
11161 Declare Q* vars static if they are not used in other modules.
11162 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
11163 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
11164 Remove decls of unexported vars.
11165 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
11166
95c82688
PE
11167 * lisp.h (DEFINE_FUNC): Make sname 'static'.
11168
16a97296
PE
11169 Make Emacs functions such as Fatom 'static' by default.
11170 This makes it easier for human readers (and static analyzers)
11171 to see whether these functions can be called from other modules.
11172 DEFUN now defines a static function. To make the function external
11173 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
11174 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
11175 (Finit_image_library):
16a97296
PE
11176 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
11177 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
11178 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
11179 Remove decls, since these functions are now static.
11180 (Funintern, Fget_internal_run_time): New decls, since these functions
11181 were already external.
95c82688 11182
16a97296
PE
11183 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
11184 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
11185 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
11186 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
11187 * keyboard.c, keymap.c, lread.c:
11188 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
11189 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
11190 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
11191 Mark functions with DEFUE instead of DEFUN,
11192 if they are used in other modules.
11193 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
11194 decls for now-static functions.
11195 * buffer.h (Fdelete_overlay): Remove decl.
11196 * callproc.c (Fgetenv_internal): Mark as internal.
11197 * composite.c (Fremove_list_of_text_properties): Remove decl.
11198 (Fcomposition_get_gstring): New forward static decl.
11199 * composite.h (Fcomposite_get_gstring): Remove decl.
11200 * dired.c (Ffile_attributes): New forward static decl.
11201 * doc.c (Fdocumntation_property): New forward static decl.
11202 * eval.c (Ffetch_bytecode): New forward static decl.
11203 (Funintern): Remove extern decl; now in .h file where it belongs.
11204 * fileio.c (Fmake_symbolic_link): New forward static decl.
11205 * image.c (Finit_image_library): New forward static decl.
11206 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
11207 * intervals.h (Fprevious_property_change):
11208 (Fremove_list_of_text_properties): Remove decls.
11209 * keyboard.c (Fthis_command_keys): Remove decl.
11210 (Fcommand_execute): New forward static decl.
11211 * keymap.c (Flookup_key): New forward static decl.
11212 (Fcopy_keymap): Now static.
11213 * keymap.h (Flookup_key): Remove decl.
11214 * process.c (Fget_process): New forward static decl.
11215 (Fprocess_datagram_address): Mark as internal.
11216 * syntax.c (Fsyntax_table_p): New forward static decl.
11217 (skip_chars): Remove duplicate decl.
11218 * textprop.c (Fprevious_property_change): New forward static decl.
11219 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
11220 Now internal.
11221 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
11222 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
11223
785bbd42
PE
11224 * editfns.c (Fformat): Remove unreachable code.
11225
8b913b57
AS
112262011-04-14 Andreas Schwab <schwab@linux-m68k.org>
11227
11228 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
11229 change. (Bug#8496)
11230
a6744a35
EZ
112312011-04-13 Eli Zaretskii <eliz@gnu.org>
11232
11233 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
11234 when at ZV. (Bug#8487)
11235
e7974947
AS
112362011-04-12 Andreas Schwab <schwab@linux-m68k.org>
11237
baad03f0
AS
11238 * charset.c (Fclear_charset_maps): Use xfree instead of free.
11239 (Bug#8437)
11240 * keyboard.c (parse_tool_bar_item): Likewise.
11241 * sound.c (sound_cleanup, alsa_close): Likewise.
11242 * termcap.c (tgetent): Likewise.
11243 * xfns.c (x_default_font_parameter): Likewise.
11244 * xsettings.c (read_and_apply_settings): Likewise.
11245
e7974947
AS
11246 * alloc.c (overrun_check_malloc, overrun_check_realloc)
11247 (overrun_check_free): Protoize.
11248
28272684
PE
112492011-04-12 Paul Eggert <eggert@cs.ucla.edu>
11250
11251 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
11252 since callers should never pass a negative size.
11253 Change the signature to match that of plain 'read' and 'write'; see
11254 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
11255 * lisp.h: Update prototypes of emacs_write and emacs_read.
11256
11997c76
EZ
112572011-04-11 Eli Zaretskii <eliz@gnu.org>
11258
11259 * xdisp.c (redisplay_window): Don't try to determine the character
11260 position of the scroll margin if the window start point w->startp
e896f03c 11261 is outside the buffer's accessible region. (Bug#8468)
11997c76 11262
8a2cbd72
EZ
112632011-04-10 Eli Zaretskii <eliz@gnu.org>
11264
11265 Fix write-region and its subroutines for buffers > 2GB.
11266 * fileio.c (a_write, e_write): Modify declaration of arguments and
11267 local variables to support buffers larger than 2GB.
11268 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
11269
11270 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
11271 argument, local variables, and return value.
11272
11273 * lisp.h: Update prototypes of emacs_write and emacs_read.
11274
11275 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
11276
4073e537 112772011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 11278
1ebfdcb6
PE
11279 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
11280
b2ded58d
PE
11281 Fix more problems found by GCC 4.6.0's static checks.
11282
7d66342c
PE
11283 * xdisp.c (vmessage): Use a better test for character truncation.
11284
bbf47d44
PE
11285 * charset.c (load_charset_map): <, not <=, for optimization,
11286 and to avoid potential problems with integer overflow.
9248994d 11287 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 11288 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 11289 * editfns.c (Fformat): Likewise.
1e69125e 11290 * syntax.c (skip_chars): Likewise.
3befa583 11291
e3019616
PE
11292 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
11293 This also lets GCC 4.6.0 generate slightly better loop code.
11294
becfa255
PE
11295 * callint.c (Fcall_interactively): <, not <=, for optimization.
11296 (Fcall_interactively): Count the number of arguments produced,
11297 not the number of arguments given. This is simpler and lets GCC
11298 4.6.0 generate slightly better code.
11299
dae0cd48
PE
11300 * ftfont.c: Distingish more carefully between FcChar8 and char.
11301 The previous code passed unsigned char * to a functions like
11302 strlen and xstrcasecmp that expect char *, which does not
11303 conform to the C standard.
11304 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
11305 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
11306 char * when the C standard requires it.
11307
76032d70
PE
11308 * keyboard.c (read_char): Remove unused var.
11309
eb3f1cc8
PE
11310 * eval.c: Port to Windows vsnprintf (Bug#8435).
11311 Include <limits.h>.
11312 (SIZE_MAX): Define if the headers do not.
11313 (verror): Do not give up if vsnprintf returns a negative count.
11314 Instead, grow the buffer. This ports to Windows vsnprintf, which
11315 does not conform to C99. Problem reported by Eli Zaretskii.
11316 Also, simplify the allocation scheme, by avoiding the need for
11317 calling realloc, and removing the ALLOCATED variable.
11318
70476b54
PE
11319 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
11320
12020a9e
PE
11321 Remove invocations of doprnt, as Emacs now uses vsnprintf.
11322 But keep the doprint source code for now, as we might revamp it
11323 and use it again (Bug#8435).
ea6c7ae6
PE
11324 * lisp.h (doprnt): Remove.
11325 * Makefile.in (base_obj): Remove doprnt.o.
11326 * deps.mk (doprnt.o): Remove.
11327
5fdb398c
PE
11328 error: Print 32- and 64-bit integers portably (Bug#8435).
11329 Without this change, on typical 64-bit hosts error ("...%d...", N)
11330 was used to print both 32- and 64-bit integers N, which relied on
11331 undefined behavior.
61bdb816 11332 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
11333 * lisp.h (error, verror): Mark as printf-like functions.
11334 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
11335 Report overflow in size calculations when allocating printf buffer.
11336 Do not truncate output string at its first null byte.
11337 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
11338 Truncate the output at a character boundary, since vsnprintf does not
11339 do that.
11340 * charset.c (check_iso_charset_parameter): Convert internal
11341 character to string before calling 'error', since %c now has the
11342 printf meaning.
11343 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
11344 overflow when computing char to be passed to 'error'. Do not
11345 pass Lisp_Object to 'error'; pass the integer instead.
11346 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
11347 formatted with plain %d.
11348
b189fa66
PE
11349 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
11350
bff87ef0
PE
11351 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
11352
7e2cac20
PE
11353 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
11354
ce4d90b5
PE
11355 * xterm.c (x_catch_errors): Remove duplicate declaration.
11356
266c9547
PE
11357 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
11358
79c49ad2
PE
11359 * xdisp.c, lisp.h (message_nolog): Remove; unused.
11360
368f4090
JM
113612011-04-10 Jim Meyering <meyering@redhat.com>
11362
11363 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
11364 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
11365 return ssize_t not "int", and use size_t as the buffer length.
11366 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
11367 * gnutls.h: Update declarations.
11368 * process.c (read_process_output): Use ssize_t, to match.
11369 (send_process): Likewise.
11370
a32d4040
CY
113712011-04-09 Chong Yidong <cyd@stupidchicken.com>
11372
11373 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
11374
8546720e 113752011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 11376
04f2d78b
CB
11377 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
11378 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 11379
8546720e
GM
11380 * xterm.c (handle_one_xevent):
11381 * xmenu.c (create_and_show_popup_menu):
11382 * xselect.c (x_decline_selection_request)
11383 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 11384
0a2f5c1a 113852011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
11386
11387 Fix some uses of `int' instead of EMACS_INT.
11388 * search.c (string_match_1, fast_string_match)
11389 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
11390 (scan_buffer, find_next_newline_no_quit)
11391 (find_before_next_newline, search_command, Freplace_match)
11392 (Fmatch_data): Make some `int' variables be EMACS_INT.
11393
11394 * xdisp.c (display_count_lines): 3rd argument and return value now
11395 EMACS_INT. All callers changed.
11396 (pint2hrstr): Last argument is now EMACS_INT.
11397
11398 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
11399 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11400 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
11401 (decode_coding_utf_16, decode_coding_emacs_mule)
11402 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
11403 (decode_coding_ccl, decode_coding_charset)
11404 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
11405 (decode_coding_iso_2022, decode_coding_emacs_mule)
11406 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
11407 <char_offset, last_offset>: Declare EMACS_INT.
11408 (encode_coding_utf_8, encode_coding_utf_16)
11409 (encode_coding_emacs_mule, encode_invocation_designation)
11410 (encode_designation_at_bol, encode_coding_iso_2022)
11411 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
11412 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
11413 Declare EMACS_INT.
11414 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
11415 (encode_invocation_designation): Last argument P_NCHARS is now
11416 EMACS_INT.
11417 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
11418 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
11419
11420 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
11421 All users changed.
11422
11423 * ccl.c (Fccl_execute_on_string): Declare some variables
11424 EMACS_INT.
11425
8546720e 114262011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
11427
11428 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
11429
4e19a977
CS
114302011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
11431
11432 * process.c (Fformat_network_address): Doc fix.
11433
87302331
R
114342011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
11435
ee7683eb 11436 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 11437
cbb59342
CY
114382011-04-08 Chong Yidong <cyd@stupidchicken.com>
11439
11440 * keyboard.c (read_char): Call Lisp function help-form-show,
11441 instead of using internal_with_output_to_temp_buffer.
11442 (Qhelp_form_show): New var.
e0d38eeb 11443 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
11444
11445 * print.c (internal_with_output_to_temp_buffer): Function deleted.
11446
11447 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
11448
e67a13ab
CY
114492011-04-06 Chong Yidong <cyd@stupidchicken.com>
11450
04f2d78b
CB
11451 * process.c (Flist_processes): Remove to Lisp.
11452 (list_processes_1): Delete.
e67a13ab 11453
973f782d
EZ
114542011-04-06 Eli Zaretskii <eliz@gnu.org>
11455
7c106b1e
EZ
11456 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
11457
973f782d
EZ
11458 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
11459
41cf7d1a 114602011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 11461
ca23cc88
PE
11462 Fix more problems found by GCC 4.6.0's static checks.
11463
f390e2d5
PE
11464 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
11465
42eea0d0
PE
11466 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
11467
b69769da 11468 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 11469
f9541e84
PE
11470 * xdisp.c (vmessage): Mark as a printf-like function.
11471
13841b55
PE
11472 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
11473
c136c10f
PE
11474 * sound.c (sound_warning): Don't crash if arg contains a printf format.
11475
5e2d4a30
PE
11476 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
11477 printf-like functions.
11478 (tiff_load): Add casts to remove these marks before passing them
11479 to system-supplied API.
11480
583f48b9
PE
11481 * eval.c (Fsignal): Remove excess argument to 'fatal'.
11482
b25d760e
PE
11483 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
11484 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
11485 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
11486 directly, rather than having caller test rule sign. This avoids
11487 some unnecessary tests.
11488 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
11489 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
11490 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 11491
bc7b6697 11492 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 11493 (xfont_open): Avoid unnecessary tests.
bc7b6697 11494
27ccc379
PE
11495 * composite.c (composition_gstring_put_cache): Use unsigned integer.
11496
dcd5c89a
PE
11497 * composite.h, composite.c (composition_gstring_put_cache):
11498 Use EMACS_INT, not int, for length.
11499
b13a45c6
PE
11500 * composite.h (COMPOSITION_DECODE_REFS): New macro,
11501 breaking out part of COMPOSITION_DECODE_RULE.
11502 (COMPOSITION_DECODE_RULE): Use it.
11503 * composite.c (get_composition_id): Remove unused local vars,
11504 by using the new macro.
11505
1e792e4d
PE
11506 * textprop.c (set_text_properties_1): Change while to do-while,
11507 since the condition is always true at first.
11508
dc6c6455 11509 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
11510 (interval_deletion_adjustment): Return unsigned value.
11511 All uses changed.
dc6c6455 11512
aba7731a
PE
11513 * process.c (list_processes_1, create_pty, read_process_output):
11514 (exec_sentinel): Remove vars that were set but not used.
afd4052b 11515 (create_pty): Remove unnecessary "volatile"s.
bc57d757 11516 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 11517 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 11518 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 11519
fdfc4bf3
PE
11520 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
11521
fca8fe46 11522 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 11523 (update_syntax_table): Use unsigned instead of int.
fca8fe46 11524
06a0259a 11525 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 11526 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 11527 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 11528
e7b9e80f
PE
11529 * print.c (print_error_message): Avoid int overflow.
11530
56201685
PE
11531 * font.c (font_list_entities): Redo for clarity,
11532 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
11533
78834453 11534 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 11535 (font_score): Avoid potential overflow in diff calculation.
78834453 11536
0bc0b309 11537 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 11538 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 11539
e610eaca
PE
11540 * eval.c (funcall_lambda): Rename local to avoid shadowing.
11541
b895abce
PE
11542 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
11543 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
11544 can always succeed if overflow has undefined behavior.
11545
1f1d9321 11546 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 11547 (wordify): Omit three unnecessary tests.
1f1d9321 11548
c59478bc
PE
11549 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
11550 All callers changed. This avoids the need for an unused var.
11551
79b73827
PE
11552 * casefiddle.c (casify_region): Remove var that is set but not used.
11553
a4db5dfe
PE
11554 * dired.c (file_name_completion): Remove var that is set but not used.
11555
43aae36e
PE
11556 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
11557
2a47c44d 11558 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 11559 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 11560
a37c69bf
PE
11561 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
11562 Check for integer overflow on size calculations.
11563
328ab8e7
PE
11564 * buffer.c (Fprevious_overlay_change): Remove var that is set
11565 but not used.
11566
e5a2a5cb
PE
11567 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
11568 Remove vars that are set but not used.
8d84a6eb 11569 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 11570 (timer_check_2): Mark vars as initialized.
e5a2a5cb 11571
a60e5f68
PE
11572 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
11573
f661cb61 11574 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 11575 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 11576
f0397f5a
PE
11577 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
11578 that are set but not used.
11579
8664db06 11580 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 11581 if XCreateBitmapFromData fails (Bug#8410).
8664db06 11582
6abdaa4a
PE
11583 * xselect.c (x_get_local_selection, x_handle_property_notify):
11584 Remove vars that are set but not used.
11585
0ce7538d 11586 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 11587 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 11588
9ae848fc
PE
11589 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
11590 Remove var that is set but not used.
0b918413
PE
11591 (scroll_bar_windows_size): Now size_t, not int.
11592 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
11593 Check for overflow.
9ae848fc 11594
a5a62657
PE
11595 * xfaces.c (realize_named_face): Remove vars that are set but not used.
11596 (map_tty_color) [!defined MSDOS]: Likewise.
11597
5c5cdd39
PE
11598 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
11599
66ebf983
PE
11600 * coding.c: Remove vars that are set but not used.
11601 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
11602 All callers changed.
11603 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
11604 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
11605 (decode_coding_charset): Remove vars that are set but not used.
11606
1be4d761
PE
11607 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
11608 that is set but not used.
11609
47553fa8
PE
11610 * print.c (print_object): Remove var that is set but not used.
11611
1f7196bf 11612 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
11613 The gnulib version avoids calling malloc in the usual case,
11614 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
11615 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
11616 * filelock.c (current_lock_owner): Likewise.
11617 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
11618 * sysdep.c: Include allocator.h, careadlinkat.h.
11619 (emacs_no_realloc_allocator): New static constant.
11620 (emacs_readlink): New function.
fdb61804
PE
11621 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
11622 ../lib/careadlinkat.h.
d1fdcab7 11623
f84c17c7
SM
116242011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
11625
11626 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
11627 first non-nil return value).
11628
ef3862ad
JD
116292011-04-03 Jan Djärv <jan.h.d@swipnet.se>
11630
11631 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
11632 if not defined (Bug#8403).
11633
376a7006
JB
116342011-04-02 Juanma Barranquero <lekktu@gmail.com>
11635
11636 * xdisp.c (display_count_lines): Remove parameter `start',
11637 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11638 (get_char_face_and_encoding): Remove parameter `multibyte_p',
11639 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11640 (fill_stretch_glyph_string): Remove parameters `row' and `area',
11641 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
11642 and thereabouts. All callers changed.
11643 (get_per_char_metric): Remove parameter `f', unused since
11644 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11645
6ca3801d
JM
116462011-04-02 Jim Meyering <meyering@redhat.com>
11647
11648 do not dereference NULL upon failed strdup
11649 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
11650 (ns_get_family): Likewise.
11651
d8e2b5ba
JB
116522011-04-02 Juanma Barranquero <lekktu@gmail.com>
11653
11654 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
11655
8c74fcbd
JD
116562011-04-02 Jan Djärv <jan.h.d@swipnet.se>
11657
11658 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
11659 later (Bug#8403).
11660
7200d79c
SM
116612011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
11662
03408648 11663 Add lexical binding.
7200d79c 11664
03408648
SM
11665 * window.c (Ftemp_output_buffer_show): New fun.
11666 (Fsave_window_excursion):
11667 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
11668
11669 * lread.c (lisp_file_lexically_bound_p): New function.
11670 (Fload): Bind Qlexical_binding.
11671 (readevalloop): Remove `evalfun' arg.
11672 Bind Qinternal_interpreter_environment.
11673 (Feval_buffer): Bind Qlexical_binding.
11674 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
11675 Mark as dynamic.
11676 (syms_of_lread): Declare `lexical-binding'.
11677
11678 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
11679
11680 * keyboard.c (eval_dyn): New fun.
11681 (menu_item_eval_property): Use it.
ca105506
SM
11682
11683 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 11684
03408648
SM
11685 * fns.c (concat, mapcar1): Accept byte-code-functions.
11686
11687 * eval.c (Fsetq): Handle lexical vars.
11688 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
11689 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
11690 (FletX, Flet): Obey lexical binding.
11691 (Fcommandp): Handle closures.
11692 (Feval): New `lexical' arg.
11693 (eval_sub): New function extracted from Feval. Use it almost
11694 everywhere where Feval was used. Look up vars in lexical env.
11695 Handle closures.
11696 (Ffunctionp): Move from subr.el.
11697 (Ffuncall): Handle closures.
11698 (apply_lambda): Remove `eval_flags'.
11699 (funcall_lambda): Handle closures and new byte-code-functions.
11700 (Fspecial_variable_p): New function.
11701 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
11702 but without exporting it to Lisp.
23aba0ea 11703
23aba0ea 11704 * doc.c (Fdocumentation, store_function_docstring):
03408648 11705 * data.c (Finteractive_form): Handle closures.
23aba0ea 11706
03408648
SM
11707 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
11708 interactive spec.
ba83908c 11709
04f2d78b
CB
11710 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
11711 New byte-codes.
03408648
SM
11712 (exec_byte_code): New function extracted from Fbyte_code to handle new
11713 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 11714
03408648 11715 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 11716
03408648 11717 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 11718
e2abce01
JB
117192011-03-31 Juanma Barranquero <lekktu@gmail.com>
11720
11721 * xdisp.c (redisplay_internal): Fix prototype.
11722
63696a73 117232011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 11724
63696a73 11725 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
11726 (try_scrolling): Use it when setting scroll_limit.
11727 Limit scrolling to 100 screen lines.
63696a73
EZ
11728 (redisplay_window): Even when falling back on "recentering",
11729 position point in the window according to scroll-conservatively,
11730 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
11731
11732 (try_scrolling): When point is above the window, allow searching
11733 as far as scroll_max, or one screenful, to compute vertical
11734 distance from PT to the scroll margin position. This prevents
11735 try_scrolling from unnecessarily failing when
11736 scroll-conservatively is set to a value slightly larger than the
11737 window height. Clean up the case of PT below the margin at bottom
11738 of window: scroll_max can no longer be INT_MAX. When aggressive
11739 scrolling is in use, don't let point enter the opposite scroll
11740 margin as result of the scroll.
11741 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
11742 threshold of 100 lines for never-recentering scrolling.
11743
e4cc2dfc
JB
117442011-03-31 Juanma Barranquero <lekktu@gmail.com>
11745
11746 * dispextern.h (move_it_by_lines):
11747 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
11748 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
11749 (message_log_check_duplicate): Remove parameters `prev_bol' and
11750 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11751 (redisplay_internal): Remove parameter `preserve_echo_area',
11752 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
11753
11754 * indent.c (Fvertical_motion):
11755 * window.c (window_scroll_pixel_based, Frecenter):
11756 Don't pass `need_y_p' to `move_it_by_lines'.
11757
1c470562
SM
117582011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
11759
44f230aa
SM
11760 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
11761 steal a few bits to be more compact.
11762 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
11763 Remove unneeded casts.
11764
1c470562
SM
11765 * bytecode.c (Fbyte_code): CAR and CDR can GC.
11766
888adce9
ZK
117672011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
11768
11769 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
11770 binding" message (bug#7967).
11771
f838ed7b
PE
117722011-03-30 Paul Eggert <eggert@cs.ucla.edu>
11773
77861b95
PE
11774 Fix more problems found by GCC 4.6.0's static checks.
11775
de6dbc14
PE
11776 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
11777 Remove unused local var.
11778
f838ed7b
PE
11779 * editfns.c (Fmessage_box): Remove unused local var.
11780
792c7b2b
PE
11781 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
11782 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11783 Omit unused local vars.
c499e557 11784 * window.c (shrink_windows): Omit unused local var.
b01a1c29 11785 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
11786 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
11787 Omit unused local var.
11788
ba0165e1
PE
11789 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
11790 Don't assume string length fits in int.
32ad8845 11791 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 11792 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 11793
3c59b4c9
PE
11794 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
11795 instead of alloca (Bug#8344).
11796
a3eed478 11797 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 11798 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 11799
eb4d412d
PE
11800 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
11801
1658b401
PE
11802 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
11803 concerns.
11804
11805 * term.c (produce_glyphless_glyph): Remove unnecessary test.
11806
11807 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 11808
9a2c6e05
PE
11809 * keyboard.c (syms_of_keyboard): Use the same style as later
11810 in this function when indexing through an array. This also
11811 works around GCC bug 48267.
11812
03d0a109
PE
11813 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
11814
44f730c8
PE
11815 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
11816
fe75f926
PE
11817 * chartab.c (sub_char_table_ref_and_range): Redo for slight
11818 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
11819
ffa8c828
PE
11820 * keyboard.c, keyboard.h (num_input_events): Now size_t.
11821 This avoids undefined behavior on integer overflow, and is a bit
11822 more convenient anyway since it is compared to a size_t variable.
11823
c5101a77
PE
11824 Variadic C functions now count arguments with size_t, not int.
11825 This avoids an unnecessary limitation on 64-bit machines, which
11826 caused (substring ...) to crash on large vectors (Bug#8344).
11827 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
11828 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 11829 All variadic functions and their callers changed accordingly.
c5101a77
PE
11830 (struct gcpro.nvars): Now size_t, not int. All uses changed.
11831 * data.c (arith_driver, float_arith_driver): Likewise.
11832 * editfns.c (general_insert_function): Likewise.
11833 * eval.c (struct backtrace.nargs, interactive_p)
11834 (internal_condition_case_n, run_hook_with_args, apply_lambda)
11835 (funcall_lambda, mark_backtrace): Likewise.
11836 * fns.c (concat): Likewise.
11837 * frame.c (x_set_frame_parameters): Likewise.
11838 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
11839 0 if not found, not -1. All callers changed.
11840
dd3f25f7
PE
11841 * alloc.c (garbage_collect): Don't assume stack size fits in int.
11842 (stack_copy_size): Now size_t, not int.
11843 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
11844
461c2ab9
JB
118452011-03-28 Juanma Barranquero <lekktu@gmail.com>
11846
11847 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
11848 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11849 All callers changed.
11850
11851 * lisp.h (multibyte_char_to_unibyte):
11852 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
11853 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11854 * character.h (CHAR_TO_BYTE8):
11855 * cmds.c (internal_self_insert):
11856 * editfns.c (general_insert_function):
11857 * keymap.c (push_key_description):
11858 * search.c (Freplace_match):
11859 * xdisp.c (message_dolog, set_message_1): All callers changed.
11860
f6d62986
SM
118612011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11862
11863 * keyboard.c (safe_run_hook_funcall): New function.
11864 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
11865 don't set the hook to nil, but remove the offending function instead.
11866 (Qcommand_hook_internal): Remove, unused.
11867 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
11868 Vcommand_hook_internal.
11869
11870 * eval.c (enum run_hooks_condition): Remove.
11871 (funcall_nil, funcall_not): New functions.
11872 (run_hook_with_args): Call each function through a `funcall' argument.
11873 Remove `cond' argument, now redundant.
11874 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
11875 (Frun_hook_with_args_until_failure): Adjust accordingly.
11876 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
11877
1db5b1ad
JB
118782011-03-28 Juanma Barranquero <lekktu@gmail.com>
11879
11880 * dispextern.h (string_buffer_position): Remove declaration.
11881
11882 * print.c (strout): Remove parameter `multibyte', unused since
11883 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
11884
11885 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
11886 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
11887 All callers changed.
11888
11889 * w32.c (_wsa_errlist): Use braces for struct initializers.
11890
11891 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
11892 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
11893 All callers changed.
11894 (string_buffer_position): Likewise. Also, make static (it's never
11895 used outside xdisp.c).
11896 (cursor_row_p): Remove parameter `w', unused since
11897 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
11898 (decode_mode_spec): Remove parameter `precision', introduced during
11899 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
11900 All callers changed.
11901
5ffb62aa
JD
119022011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11903
11904 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
11905
461c2ab9 119062011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
11907
11908 * nsterm.m (ns_menu_bar_is_hidden): New variable.
11909 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
11910 (ns_update_auto_hide_menu_bar): New functions.
11911 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
11912 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
11913 ns_constrain_all_frames.
11914 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
11915 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
11916
5c380ffb
JD
119172011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11918
11919 * nsmenu.m (runDialogAt): Remove argument to timer_check.
11920
9af30bdf
GM
119212011-03-27 Glenn Morris <rgm@gnu.org>
11922
11923 * syssignal.h: Replace RETSIGTYPE with void.
11924 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
11925 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
11926 Replace SIGTYPE with void everywhere.
11927 * s/usg5-4-common.h (SIGTYPE): Remove definition.
11928 * s/template.h (SIGTYPE): Remove commented out definition.
11929
e2abce01
JB
119302011-03-26 Eli Zaretskii <eliz@gnu.org>
11931
11932 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
11933 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
11934
f868cd8a
JB
119352011-03-26 Juanma Barranquero <lekktu@gmail.com>
11936
59eb0929
JB
11937 * w32.c (read_unc_volume): Use parameter `henum', instead of
11938 global variable `wget_enum_handle'.
11939
11940 * keymap.c (describe_vector): Remove parameters `indices' and
11941 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
11942 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
11943
f868cd8a
JB
11944 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
11945
11946 * keyboard.c (timer_check): Remove parameter `do_it_now',
11947 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
11948 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
11949 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
11950
11951 * keyboard.c (read_char):
11952 * w32menu.c (w32_menu_display_help):
11953 * xmenu.c (show_help_event, menu_help_callback):
11954 Adjust calls to `show_help_echo'.
11955
11956 * gtkutil.c (xg_maybe_add_timer):
11957 * keyboard.c (readable_events):
11958 * process.c (wait_reading_process_output):
11959 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
11960
11961 * insdel.c (adjust_markers_gap_motion):
11962 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
11963 (gap_left, gap_right): Don't call it.
11964
2ecf6fdb
CY
119652011-03-25 Chong Yidong <cyd@stupidchicken.com>
11966
11967 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
11968 incurred during fontification.
11969
6b1f9ba4
JB
119702011-03-25 Juanma Barranquero <lekktu@gmail.com>
11971
11972 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
11973 (DEFVAR_PER_BUFFER): Don't pass it.
11974
11975 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
11976 (scrolling_window): Don't pass it.
11977
0f4a96b5
JB
119782011-03-25 Juanma Barranquero <lekktu@gmail.com>
11979
11980 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
11981
11982 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
11983 and `suffix'.
11984 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
11985 of variables specific to SELinux and computation of `encoded_absname'.
11986
11987 * image.c (XPutPixel): Remove unused variable `height'.
11988
11989 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
11990
11991 * unexw32.c (get_section_info): Remove unused variable `section'.
11992
11993 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
11994 (system_process_attributes): Remove unused variable `sess'.
11995 (sys_read): Remove unused variable `err'.
11996
11997 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
11998 (w32_wnd_proc): Remove unused variable `isdead'.
11999 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
12000 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
12001 (x_create_tip_frame): Remove unused variable `tem'.
12002
12003 * w32inevt.c (w32_console_read_socket):
12004 Remove unused variable `no_events'.
12005
12006 * w32term.c (x_draw_composite_glyph_string_foreground):
12007 Remove unused variable `width'.
12008
1149507c
JB
120092011-03-24 Juanma Barranquero <lekktu@gmail.com>
12010
12011 * w32term.c (x_set_glyph_string_clipping):
12012 Don't pass uninitialized region to CombineRgn.
12013
9c88f339
JB
120142011-03-23 Juanma Barranquero <lekktu@gmail.com>
12015
12016 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
12017 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
12018 (Fx_close_connection): Remove unused variable `i'.
12019
12020 * w32font.c (w32font_draw): Return number of glyphs.
12021 (w32font_open_internal): Remove unused variable `i'.
12022 (w32font_driver): Add missing initializer.
12023
12024 * w32menu.c (utf8to16): Remove unused variable `utf16'.
12025 (fill_in_menu): Remove unused variable `items_added'.
12026
12027 * w32term.c (last_mouse_press_frame): Remove static global variable.
12028 (w32_clip_to_row): Remove unused variable `f'.
12029 (x_delete_terminal): Remove unused variable `i'.
12030
12031 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
12032 (NOTHING): Remove unused static global variable.
12033 (uniscribe_check_otf): Remove unused variable `table'.
12034 (uniscribe_font_driver): Add missing initializers.
12035
dee091a3
JD
120362011-03-23 Julien Danjou <julien@danjou.info>
12037
12038 * term.c (Fsuspend_tty, Fresume_tty):
12039 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
12040 * window.c (temp_output_buffer_show):
12041 * insdel.c (signal_before_change):
12042 * frame.c (Fhandle_switch_frame):
12043 * fileio.c (Fdo_auto_save):
12044 * emacs.c (Fkill_emacs):
12045 * editfns.c (save_excursion_restore):
12046 * cmds.c (internal_self_insert):
12047 * callint.c (Fcall_interactively):
12048 * buffer.c (Fkill_all_local_variables):
12049 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
12050 Use Frun_hooks.
0f4a96b5 12051 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 12052 unconditionally since it does the check itself.
dee091a3 12053
2c520ab5 120542011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 12055
c9c49752
PE
12056 Fix more problems found by GCC 4.5.2's static checks.
12057
8abc3f12
PE
12058 * coding.c (encode_coding_raw_text): Avoid unnecessary test
12059 the first time through the loop, since we know p0 < p1 then.
12060 This also avoids a gcc -Wstrict-overflow warning.
12061
a2d26660
PE
12062 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
12063 leading to a memory leak, possible in functions like
12064 load_charset_map_from_file that can allocate an unbounded number
b12ef411 12065 of objects (Bug#8318).
a2d26660 12066
916c72e9
PE
12067 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
12068 that could (at least in theory) be that large.
12069
19ab8a18
PE
12070 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
12071 This is less likely to overflow, and avoids undefined behavior if
12072 overflow does occur. All callers changed. Use strtoul to scan
12073 for the unsigned long integer.
b7cbbd6f
PE
12074 (pint2hrstr): Simplify and tune code slightly.
12075 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 12076
f0641eff
PE
12077 * scroll.c (do_scrolling): Work around GCC bug 48228.
12078 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
12079
7f650bb9
PE
12080 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
12081 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
12082 (validate_x_resource_name): Simplify count usage.
12083 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 12084
37dd57d1
PE
12085 * fileio.c (Fcopy_file): Report error if fchown or fchmod
12086 fail (Bug#8306).
81e56e61 12087
699979fc 12088 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 12089
401bf9b4
PE
12090 * process.c (Fmake_network_process): Use socklen_t, not int,
12091 where POSIX says socklen_t is required in portable programs.
12092 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 12093 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
12094 (Fmake_network_process, server_accept_connection):
12095 (wait_reading_process_output, read_process_output):
12096 Likewise.
12097
b93aacde
PE
12098 * process.c: Rename or move locals to avoid shadowing.
12099 (list_processes_1, Fmake_network_process):
12100 (read_process_output_error_handler, exec_sentinel_error_handler):
12101 Rename or move locals.
4dc343ee 12102 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 12103 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 12104 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 12105 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 12106 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 12107
af8a867c 12108 Make tparam.h and terminfo.c consistent.
44f230aa
SM
12109 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
12110 Include tparam.h instead, since it declares them.
af8a867c
PE
12111 * cm.h (PC): Remove extern decl; tparam.h now does this.
12112 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
12113 * terminfo.c: Include tparam.h, to check interfaces.
12114 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
12115 (tparam): Adjust signature to match interface in tparam.h;
12116 this removes some undefined behavior. Check that outstring and len
12117 are zero, which they always are with Emacs.
12118 * tparam.h (PC, BC, UP): New extern decls.
12119
0248044d 12120 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 12121 (xftfont_open): Rename locals to avoid shadowing.
0248044d 12122
8ff096c1 12123 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
12124 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
12125 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 12126 (ftfont_list): Remove unused local.
49eaafba
PE
12127 (get_adstyle_property, ftfont_pattern_entity):
12128 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
12129 Rename locals to avoid shadowing.
8ff096c1 12130
e2be39f6
PE
12131 * xfont.c (xfont_list_family): Mark var as initialized.
12132
c9735e30
PE
12133 * xml.c (make_dom): Now static.
12134
8f5201ae
PE
12135 * composite.c (composition_compute_stop_pos): Rename local to
12136 avoid shadowing.
b246f932
PE
12137 (composition_reseat_it): Remove unused locals.
12138 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 12139 (composition_update_it): Mark var as initialized.
11b61122
PE
12140 (find_automatic_composition): Mark vars as initialized,
12141 with a FIXME (Bug#8290).
8f5201ae 12142
760fbc2c
PE
12143 character.h: Rename locals to avoid shadowing.
12144 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
12145 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
12146 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
12147 (BUF_DEC_POS): Be more systematic about renaming local temporaries
12148 to avoid shadowing.
12149
ff08eb85
PE
12150 * textprop.c (property_change_between_p): Remove; unused.
12151
fc7bf025
PE
12152 * intervals.c (interval_start_pos): Now static.
12153
235d7abc
PE
12154 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
12155
44f230aa
SM
12156 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
12157 Rename locals to avoid shadowing.
3e7d6594 12158
50060332
PE
12159 * sound.c (wav_play, au_play, Fplay_sound_internal):
12160 Fix pointer signedness.
d01f234b 12161 (alsa_choose_format): Remove unused local var.
c83b8872
PE
12162 (wav_play): Initialize a variable to 0, to prevent undefined
12163 behavior (Bug#8278).
50060332 12164
c4fc4e30
PE
12165 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
12166
918436ed
PE
12167 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
12168
c939f91b
PE
12169 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
12170 clobbering (Bug#8298).
b9c7f648
PE
12171 * sysdep.c (sys_subshell): Likewise.
12172 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 12173
6bd8c144
PE
12174 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
12175 This should get cleaned up, so that child_setup has the
12176 same signature on all platforms.
12177
7710357c 12178 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 12179 (relocate_fd): Rename locals to avoid shadowing.
7710357c 12180
c59da222
CY
121812011-03-22 Chong Yidong <cyd@stupidchicken.com>
12182
12183 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
12184 not to be necessary, and produces flickering.
12185
66b87493
GM
121862011-03-20 Glenn Morris <rgm@gnu.org>
12187
12188 * config.in: Remove file.
12189
45b6f6d5
JB
121902011-03-20 Juanma Barranquero <lekktu@gmail.com>
12191
12192 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
12193 are now in src/globals.h.
12194 (syms_of_minibuf): Remove spurious & from previous change.
12195
cd394be1 121962011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
12197
12198 * minibuf.c (completing-read-function): New variable.
12199 (completing-read-default): Rename from completing-read.
12200 (completing-read): Call completing-read-function.
12201
b14e3e21
CY
122022011-03-19 Juanma Barranquero <lekktu@gmail.com>
12203
12204 * xfaces.c (Fx_load_color_file):
12205 Read color file from absolute filename (bug#8250).
12206
f2b726e6
JB
122072011-03-19 Juanma Barranquero <lekktu@gmail.com>
12208
12209 * makefile.w32-in: Update dependencies.
12210
09f6ff02
EZ
122112011-03-17 Eli Zaretskii <eliz@gnu.org>
12212
12213 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
12214
29a6015a
PE
122152011-03-17 Paul Eggert <eggert@cs.ucla.edu>
12216
a3a6c54e
PE
12217 Fix more problems found by GCC 4.5.2's static checks.
12218
b766f867
PE
12219 * process.c (make_serial_process_unwind, send_process_trap):
12220 (sigchld_handler): Now static.
12221
be02381c
PE
12222 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
12223 That way, the code declares only the vars that it needs.
12224 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
12225 * s/cygwin.h (PTY_ITERATION): Likewise.
12226 * s/darwin.h (PTY_ITERATION): Likewise.
12227 * s/gnu-linux.h (PTY_ITERATION): Likewise.
12228
57048744
PE
12229 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
12230 * process.c (allocate_pty): Don't declare stb unless it's needed.
12231
7914961c 12232 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
12233 (CONSTANTLIM): Remove; unused.
12234 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
12235 Define only if needed.
7914961c 12236
b3967b18
PE
12237 * unexelf.c (unexec): Name an expression,
12238 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
12239 Use a different way to cause a compilation error if anyone uses
12240 n rather than nn, a way that does not involve shadowing.
73366a00 12241 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 12242
29a6015a
PE
12243 * deps.mk (unexalpha.o): Remove; unused.
12244
43cfc33e 12245 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 12246 * unexec.h: New file.
ce701a33
PE
12247 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
12248 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
12249 Depend on unexec.h.
12250 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
12251 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
12252 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 12253 Change as necessary to match prototype in unexec.h.
ce701a33 12254
01f44d5a
PE
12255 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
12256 shadowing.
4f63c6bb 12257 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 12258
a6670b0b
PE
12259 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
12260 Rename locals to avoid shadowing.
12261
cef2010d 12262 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 12263 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 12264
d4d7173a
PE
12265 * print.c (Fredirect_debugging_output): Fix pointer signedess.
12266
f08b802a
PE
12267 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
12268 warning when compiling print.c.
12269
3ddb0639
PE
12270 * font.c (font_unparse_fcname): Abort in an "impossible" situation
12271 instead of using an uninitialized var.
5ad03b97 12272 (font_sort_entities): Mark var as initialized.
3ddb0639 12273
170a2692
PE
12274 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
12275
e663c700
PE
12276 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
12277 pointers to constants.
89bc529a 12278 (font_parse_fcname): Remove unused vars.
7b81e2d0 12279 (font_delete_unmatched): Now static.
ea838e10 12280 (font_get_spec): Remove; unused.
13a547c6
PE
12281 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
12282 (font_update_drivers, Ffont_get_glyphs, font_add_log):
12283 Rename or move locals to avoid shadowing.
e663c700 12284
2a80c887 12285 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 12286 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 12287
1384fa33 12288 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 12289 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 12290
8b2c52e9
PE
12291 * alloc.c (mark_backtrace): Move decl from here ...
12292 * lisp.h: ... to here, so that it can be checked.
12293
475545b5 12294 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 12295 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
12296 (lisp_indirect_variable): Name an expression,
12297 to avoid gcc -Wbad-function-cast warning.
1faed8ae 12298 (Fdefvar): Rename locals to avoid shadowing.
475545b5 12299
b1349114 12300 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 12301 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 12302 Use const pointer when appropriate.
b1349114 12303
a2928364
PE
12304 * lisp.h (get_system_name, get_operating_system_release):
12305 Move decls here, to check interfaces.
12306 * process.c (get_operating_system_release): Move decl to lisp.h.
12307 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
12308 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
12309 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
12310 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
12311 (Fformat_time_string, Fencode_time, Finsert_char):
12312 (Ftranslate_region_internal, Fformat):
12313 Rename or remove local vars to avoid shadowing.
9710023e 12314 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 12315
a415e694
PE
12316 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
12317 avoid shadowing.
12318
8ef4622d
PE
12319 * lisp.h (eassert): Check that the argument compiles, even if
12320 ENABLE_CHECKING is not defined.
12321
946f9a5b
PE
12322 * data.c (Findirect_variable): Name an expression, to avoid
12323 gcc -Wbad-function-cast warning.
112396d6 12324 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 12325 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
12326 (Fmake_variable_buffer_local, Fmake_local_variable):
12327 Mark variables as initialized.
52746918 12328 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 12329
e5aab7e7 12330 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
12331 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
12332 Rename locals to avoid shadowing.
dff45157
PE
12333 (mark_stack): Move local variables into the #ifdef region where
12334 they're used.
7bc26fdb
PE
12335 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
12336 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
12337 needed otherwise.
12338 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
12339 (GC_STRING_CHARS): Remove; not used.
d40d4be1 12340 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 12341
e5aab7e7
PE
12342 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
12343 avoids undefined behavior in theory.
12344
4da60324
PE
12345 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
12346
88043301
PE
12347 Use functions, not macros, for up- and down-casing (Bug#8254).
12348 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
12349 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
12350 to use the following functions instead of these macros.
12351 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
12352 EMACS_INT, since callers assume the returned value fits in int.
12353 (upcase1): Likewise, for UPCASE_TABLE.
12354 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 12355 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 12356 the race-condition problem in the old DOWNCASE.
88043301 12357
19ed5445
PE
12358 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
12359 Rename locals to avoid shadowing.
12360 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
12361 (regex_compile, re_search_2, re_match_2_internal):
12362 Remove unused local vars.
952db0d7
PE
12363 (FREE_VAR): Rewrite so as not to use empty "else",
12364 which gcc can warn about.
da053e48 12365 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
12366 (RETALLOC_IF): Define only if needed.
12367 (WORDCHAR_P): Likewise. This one is never needed, but is used
12368 only in a comment talking about a compiler bug, so put inside
12369 the #if 0 of that comment.
12370 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
12371 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
12372 Remove; unused.
19ed5445 12373
1f3561e4 12374 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
12375 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
12376 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 12377
ded6f8f7
PE
12378 * search.c (simple_search): Remove unused var.
12379
dbd37a95
PE
12380 * dired.c (compile_pattern): Move decl from here ...
12381 * lisp.h: ... to here, so that it can be checked.
12382 (struct re_registers): New forward decl.
12383
7e47afad
PE
12384 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
12385
85f24f61
PE
12386 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
12387 All uses changed.
12388 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
12389 Rename locals to avoid shadowing.
5671df8f 12390 (Fvertical_motion): Mark locals as initialized.
85f24f61 12391
181aa2be 12392 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 12393 (casify_region): Mark local as initialized.
181aa2be 12394
930d429c
PE
12395 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
12396
7082eac6
PE
12397 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
12398 New macros, so that the caller can use some names other than
12399 gcpro1, gcpro2, etc.
12400 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
12401 of the new macros.
12402 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
12403 argument, for consistency with GCPRO2_VAR, etc: it is now the
12404 prefix of the variable, not the variable itself. All uses
12405 changed.
38b2c076
PE
12406 * dired.c (directory_files_internal, file_name_completion):
12407 Rename locals to avoid shadowing.
12408
15206ed9
PE
12409 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
12410 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
12411 dired.c's scmp function, had undefined behavior.
12412 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
12413 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
12414 * buffer.h: ... to here, because these macros use current_buffer,
12415 and the new implementation with inline functions needs to have
12416 current_buffer in scope now, rather than later when the macros
12417 are used.
12418 (downcase, upcase1): New static inline functions.
12419 (DOWNCASE, UPCASE1): Reimplement using these functions.
12420 This avoids undefined behavior in expressions like
12421 DOWNCASE (x) == DOWNCASE (y), which previously suffered
12422 from race conditions in accessing the global variables
12423 case_temp1 and case_temp2.
12424 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
12425 * lisp.h (case_temp1, case_temp2): Remove their decls.
12426 * character.h (ASCII_CHAR_P): Move from here ...
12427 * lisp.h: ... to here, so that the inline functions mentioned
12428 above can use them.
12429
4a6bea26
PE
12430 * dired.c (directory_files_internal_unwind): Now static.
12431
f14b7e14
PE
12432 * fileio.c (file_name_as_directory, directory_file_name):
12433 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
12434 Now static.
2893f146
PE
12435 (file_name_as_directory): Use const pointers when appropriate.
12436 (Fexpand_file_name): Likewise. In particular, newdir might
12437 point at constant storage, so make it a const pointer.
fd4ead52 12438 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
12439 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
12440 signedness issues.
f839df0c
PE
12441 (Fset_file_times, Finsert_file_contents, auto_save_error):
12442 Rename locals to avoid shadowing.
f14b7e14 12443
5716756e 12444 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
12445 (Ftry_completion, Fall_completions): Rename or remove locals
12446 to avoid shadowing.
5716756e 12447
b4c3046a
PE
12448 * marker.c (bytepos_to_charpos): Remove; unused.
12449
b45db522
PE
12450 * lisp.h (verify_bytepos, count_markers): New decls,
12451 so that gcc does not warn that these functions aren't declared.
12452
85876d07
PE
12453 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
12454 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 12455 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 12456 (copy_text): Remove unused local var.
85876d07 12457
03d78a21 12458 * filelock.c (within_one_second): Now static.
b3dd38ab 12459 (lock_file_1): Rename local to avoid shadowing.
03d78a21 12460
5df8f01b
PE
12461 * buffer.c (fix_overlays_before): Mark locals as initialized.
12462 (fix_start_end_in_overlays): Likewise. This function should be
12463 simplified by using pointers-to-pointers, but that's a different
12464 matter.
b1d876f1 12465 (switch_to_buffer_1): Now static.
8f54f30a
PE
12466 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
12467 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 12468
a70072c9 12469 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 12470 Fix pointer signedness issue.
edced198
PE
12471 (sys_subshell): Mark local as volatile if checking for lint,
12472 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 12473 (MAXPATHLEN): Define only if needed.
a70072c9 12474
a0977c44
PE
12475 * process.c (serial_open, serial_configure): Move decls from here ...
12476 * systty.h: ... to here, so that they can be checked.
12477
a884fdcc
PE
12478 * fns.c (get_random, seed_random): Move extern decls from here ...
12479 * lisp.h: ... to here, so that they can be checked.
12480
604efe86 12481 * sysdep.c (reset_io): Now static.
b8950c94 12482 (wait_for_termination_signal): Remove; unused.
604efe86 12483
38fc62d9
PE
12484 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
12485 (copy_keymap_item, append_key, push_text_char_description):
12486 Now static.
1004a21a 12487 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 12488 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
12489 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
12490 (describe_map_tree):
12491 Rename locals to avoid shadowing.
38fc62d9 12492
2f2650da
PE
12493 * keyboard.c: Declare functions static if they are not used elsewhere.
12494 (echo_char, echo_dash, cmd_error, top_level_2):
12495 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
12496 (read_char, kbd_buffer_get_event, make_lispy_position):
12497 (make_lispy_event, make_lispy_movement, apply_modifiers):
12498 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
12499 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
12500 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 12501 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 12502 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 12503
a053e86c 12504 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
12505 (mark_kboards): Move decl here ...
12506 * alloc.c (mark_kboards): ... from here.
a053e86c 12507
4752793e
PE
12508 * lisp.h (force_auto_save_soon): New decl.
12509
74f10ca7 12510 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
12511 (DEFINE_DUMMY_FUNCTION): New macro.
12512 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
12513 Use it.
c03cd23f
PE
12514 (main): Add casts to avoid warnings
12515 if GCC considers string literals to be constants.
74f10ca7 12516
022e70d4
PE
12517 * lisp.h (fatal_error_signal): Add decl, since it's exported.
12518
59d6fe83
PE
12519 * dbusbind.c: Pointer signedness fixes.
12520 (xd_signature, xd_append_arg, xd_initialize):
12521 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12522 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12523 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
12524 (Fdbus_register_signal): Use SSDATA when the context wants char *.
12525
78320123
PE
12526 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
12527 if GCC considers string literals to be constants.
49cebcca 12528 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 12529
35ac2a97
SM
125302011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
12531
fb103ca9
SM
12532 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
12533 (print_preprocess, print_object): New macro to fix last change.
12534
35ac2a97
SM
12535 * print.c (print_preprocess): Don't forget font objects.
12536
62973b41
JB
125372011-03-16 Juanma Barranquero <lekktu@gmail.com>
12538
12539 * emacs.c (USAGE3): Doc fixes.
12540
0e48bb22
AS
125412011-03-15 Andreas Schwab <schwab@linux-m68k.org>
12542
12543 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
12544 structure.
12545
7684e57b
JB
125462011-03-14 Juanma Barranquero <lekktu@gmail.com>
12547
12548 * lisp.h (VWindow_system, Qfile_name_history):
12549 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
12550 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
12551 (w32_system_caret_x, w32_system_caret_y): Declare extern.
12552
12553 * w32select.c: Don't #include "keyboard.h".
c96bbc66 12554 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
12555
12556 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
12557 * w32console.c (detect_input_pending, read_input_pending)
12558 (encode_terminal_code):
12559 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
12560 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
12561 (w32_system_caret_y, Qfile_name_history):
12562 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
12563 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
12564 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
12565 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
12566 * w32proc.c (Qlocal, report_file_error):
12567 * w32term.c (Vwindow_system, updating_frame):
12568 * w32uniscribe.c (initialized, uniscribe_font_driver):
12569 Remove unneeded extern declarations.
12570
2aa46d6c
CY
125712011-03-14 Chong Yidong <cyd@stupidchicken.com>
12572
c96bbc66 12573 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 12574
cffc6f3b
CY
125752011-03-13 Chong Yidong <cyd@stupidchicken.com>
12576
12577 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
12578 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
12579 These macros can no longer be used for assignment.
12580
44f230aa
SM
12581 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12582 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
12583 (record_buffer_markers, fetch_buffer_markers): New functions for
12584 recording and fetching special buffer markers.
12585 (set_buffer_internal_1, set_buffer_temp): Use them.
12586
12587 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
12588
12589 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
12590
12591 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
12592 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
12593
12594 * xdisp.c (hscroll_window_tree):
12595 (reconsider_clip_changes): Use PT instead of BUF_PT.
12596
d251f04b
EZ
125972011-03-13 Eli Zaretskii <eliz@gnu.org>
12598
12599 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
12600 $(EMACS_ROOT)/lib/intprops.h.
12601
f0c77cd1
PE
126022011-03-13 Paul Eggert <eggert@cs.ucla.edu>
12603
3eca4629
PE
12604 Fix more problems found by GCC 4.5.2's static checks.
12605
7c86ee98
PE
12606 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
12607 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
12608 (xg_free_frame_widgets): Make it clear that a local variable is
12609 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
12610 (gdk_window_get_screen): Make it clear that this macro is needed
12611 only if USE_GTK_TOOLTIP.
1e5524e7
PE
12612 (int_gtk_range_get_value): New function, which avoids a diagnostic
12613 from gcc -Wbad-function-cast.
12614 (xg_set_toolkit_scroll_bar_thumb): Use it.
12615 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
12616 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
12617 (get_utf8_string, xg_get_file_with_chooser):
12618 Rename locals to avoid shadowing.
12619 (create_dialog): Move locals to avoid shadowing.
7c86ee98 12620
41729b81
PE
12621 * xgselect.c (xg_select): Remove unused var.
12622
f0c77cd1
PE
12623 * image.c (four_corners_best): Mark locals as initialized.
12624 (gif_load): Initialize transparent_p to zero (Bug#8238).
12625 Mark another local as initialized.
ec6cf4c6 12626 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 12627
ce0ad53d 12628 * image.c (clear_image_cache): Now static.
d5d5a617 12629 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 12630 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
12631 (x_edge_detection): Remove unnecessary cast that
12632 gcc -Wbad-function-cast diagnoses.
2037898d 12633 (gif_load): Fix pointer signedness.
6ae141d6
PE
12634 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
12635 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 12636
33383987 126372011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 12638
d32df629
PE
12639 Improve quality of tests for time stamp overflow.
12640 For example, without this patch (encode-time 0 0 0 1 1
12641 1152921504606846976) returns the obviously-bogus value (-948597
12642 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
12643 reports time overflow. See
12644 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
12645 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
12646 * editfns.c: Include limits.h and intprops.h.
12647 (TIME_T_MIN, TIME_T_MAX): New macros.
12648 (time_overflow): Move earlier, to before first use.
12649 (hi_time, lo_time): New functions, for an accurate test for
12650 out-of-range times.
12651 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
12652 (Fget_internal_run_time): Don't assume time_t fits in int.
12653 (make_time): Use list2 instead of Fcons twice.
12654 (Fdecode_time): More accurate test for out-of-range times.
12655 (check_tm_member): New function.
12656 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
12657 (lisp_time_argument): Don't rely on undefined left-shift and
12658 right-shift behavior when checking for time stamp overflow.
8be6f318 12659
fe31d94c
PE
12660 * editfns.c (time_overflow): New function, refactoring common code.
12661 (Fformat_time_string, Fdecode_time, Fencode_time):
12662 (Fcurrent_time_string): Use it.
12663
8be6f318
PE
12664 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
12665 * dired.c (make_time): Move to ...
12666 * editfns.c (make_time): ... here.
12667 * systime.h: Note the move.
12668
09d9db2c 126692011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 12670
126bc0dc
YM
12671 * fringe.c (update_window_fringes): Remove unused variables.
12672
c47cbdfd
YM
12673 * unexmacosx.c (copy_data_segment): Also copy __got section.
12674 (Bug#8223)
12675
7ac80be9
EZ
126762011-03-12 Eli Zaretskii <eliz@gnu.org>
12677
c96bbc66 12678 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
12679 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
12680 Constify `char *' arguments and their references according to
12681 prototypes in tparam.h.
12682
ecb0f94d 12683 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 12684
7ac80be9
EZ
12685 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
12686 Adapt all references accordingly.
12687
12688 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
12689
ef1fd07e
TT
126902011-03-11 Tom Tromey <tromey@redhat.com>
12691
12692 * buffer.c (syms_of_buffer): Remove obsolete comment.
12693
7ef4b50c
EZ
126942011-03-11 Eli Zaretskii <eliz@gnu.org>
12695
12696 * termhooks.h (encode_terminal_code): Declare prototype.
12697
12698 * msdos.c (encode_terminal_code): Don't declare prototype.
12699
12700 * term.c (encode_terminal_code): Now external again, used by
12701 w32console.c and msdos.c.
12702
44f230aa
SM
12703 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
12704 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 12705
4b1ec863 127062011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 12707
1714f52b 12708 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 12709
4b1ec863
PE
12710 * fringe.c (update_window_fringes): Mark locals as initialized
12711 (Bug#8227).
12712 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 12713
524c7aa6
PE
12714 * alloc.c (mark_fringe_data): Move decl from here ...
12715 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
12716 to check its interface.
12717 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
12718
a5c0af81 12719 * fontset.c (free_realized_fontset): Now static.
7519b8cd 12720 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 12721 (fontset_font): Mark local as initialized.
a9a06e0b 12722 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 12723
b4716021
PE
12724 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
12725
811e9bac 12726 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 12727 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
12728 (x_own_selection, Fx_disown_selection_internal): Rename locals
12729 to avoid shadowing.
12730 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 12731
7e3ab302
PE
12732 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
12733 so that the caller can use some name other than gcpro1.
12734 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
12735 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12736 (Fx_backspace_delete_keys_p):
12737 Use them to avoid shadowing, and rename vars to avoid shadowing.
12738 (x_decode_color, x_set_name, x_window): Now static.
6b437900 12739 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 12740 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
12741 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
12742 Remove unused locals.
7e3ab302
PE
12743 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12744 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
12745 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
12746 macros.
f78faa98 12747
e2b13473
PE
12748 * xterm.h (x_mouse_leave): New decl.
12749
77f23912
PE
12750 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
12751 Remove unused functions.
cdf4ba58
PE
12752 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
12753 (x_calc_absolute_position): Now static.
7411c686 12754 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 12755 Don't declare local "event" unless it's used.
ed7bf3a5
PE
12756 (x_iconify_frame, x_free_frame_resources): Don't declare locals
12757 unless they are used.
38d0b34a
PE
12758 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
12759 (x_fatal_error_signal): Remove; not used.
a6067996
PE
12760 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
12761 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
12762 (x_error_catcher, x_connection_closed, x_error_handler):
12763 (x_error_quitter, xembed_send_message, x_iconify_frame):
12764 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 12765 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 12766 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 12767
44f230aa
SM
12768 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
12769 Rename or move locals to avoid shadowing.
6b463e58 12770 (tty_defined_color, merge_face_heights): Now static.
5967d051 12771 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
12772 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
12773 does not deduce is never used uninitialized.
73719eba
PE
12774 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
12775 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 12776
426994c3 12777 * terminal.c (store_terminal_param): Now static.
5489860b 12778
032f1620 12779 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 12780 (set_frame_menubar): Remove unused local.
d4323972 12781 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
12782 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
12783 since they might point to immutable storage.
281585b0
PE
12784 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
12785 since it's unused otherwise.
032f1620 12786
367c19e5 12787 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 12788 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
12789 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
12790 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 12791 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
12792 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
12793 does not deduce are never used uninitialized.
70739cbe 12794
07b48fa9
PE
12795 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
12796
8868a238 12797 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
12798 * window.c (window_loop, size_window):
12799 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 12800
7e5cf297 12801 * window.c (display_buffer): Now static.
d6550a9f
PE
12802 (size_window): Mark variables that gcc -Wuninitialized
12803 does not deduce are never used uninitialized.
a586633d
PE
12804 * window.h (check_all_windows): New decl, to forestall
12805 gcc -Wmissing-prototypes diagnostic.
5b555da1 12806 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 12807
f6095868
PE
12808 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
12809 shadowing.
12810 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
12811 Include <limits.h>.
12812 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
12813 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
12814 (load_charset_map): Mark variables that gcc -Wuninitialized
12815 does not deduce are never used uninitialized.
53df7c11 12816 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 12817
f38b440c
PE
12818 * coding.c (coding_set_source, coding_set_destination):
12819 Use "else { /* comment */ }" rather than "else /* comment */;"
12820 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
12821 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
12822 a block, when the outer 'i' will do.
12823 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
12824 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
12825 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
12826 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
12827 (Fdecode_sjis_char, Fdefine_coding_system_internal):
12828 Rename locals to avoid shadowing.
12829 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
12830 * coding.c (emacs_mule_char, encode_invocation_designation):
12831 Now static, since they're not used elsewhere.
413bb2db 12832 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 12833 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
12834 (decode_coding_emacs_mule): Mark variables that gcc
12835 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
12836 (detect_coding_iso_2022): Initialize a local variable that might
12837 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 12838 this initialization is needed. (Bug#8211)
5f58e762
PE
12839 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
12840 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
12841 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
12842 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
12843 Remove unused macros.
f38b440c 12844
232b38b9 12845 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 12846 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 12847 * character.c (string_count_byte8): Likewise.
232b38b9 12848
fb90da1b
PE
12849 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
12850 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
12851
fb93dbc2
PE
12852 * chartab.c (copy_sub_char_table): Now static, since it's not used
12853 elsewhere.
5c156ace
PE
12854 (sub_char_table_ref_and_range, char_table_ref_and_range):
12855 Rename locals to avoid shadowing.
bbcd0949 12856 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 12857
7d3b3862 12858 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 12859 (BIDI_BOB): Remove unused macro.
7d3b3862 12860
6be7d3da
PE
12861 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
12862 deduce are never used uninitialized.
c2ed9c8b 12863 * term.c (encode_terminal_code): Likewise.
6be7d3da 12864
75f8807f 12865 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 12866
50938595
PE
12867 * tparam.h: New file.
12868 * term.c, tparam.h: Include it.
12869 * deps.mk (term.o, tparam.o): Depend on tparam.h.
12870 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
12871 Move these decls to tparam.h, and make them agree with what
12872 is actually in tparam.c. The previous trick of using incompatible
12873 decls in different modules does not conform to the C standard.
12874 All callers of tparam changed to use tparam's actual API.
12875 * tparam.c (tparam1, tparam, tgoto):
12876 Use const pointers where appropriate.
12877
fbceeba2
PE
12878 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
12879 * cm.h (struct cm): Likewise.
12880 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
12881 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
12882 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
12883 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
12884 (turn_on_face, init_tty): Likewise.
12885 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 12886
7f3f1250
PE
12887 * term.c (term_mouse_position): Rename local to avoid shadowing.
12888
e6ca6543
PE
12889 * alloc.c (mark_ttys): Move decl from here ...
12890 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
12891
c40f8d15
AS
128922011-03-11 Andreas Schwab <schwab@linux-m68k.org>
12893
12894 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
12895
cfe0661d
JB
128962011-03-09 Juanma Barranquero <lekktu@gmail.com>
12897
12898 * search.c (compile_pattern_1): Remove argument regp, unused since
12899 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
12900 (compile_pattern): Don't pass it.
12901
0afb4571
J
129022011-03-08 Jan Djärv <jan.h.d@swipnet.se>
12903
12904 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
12905 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
12906 for ! HAVE_GTK3.
12907 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
12908
12909 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
12910
12911 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
12912 gdk_window_get_screen, gdk_window_get_geometry,
12913 gdk_x11_window_lookup_for_display and GDK_KEY_g.
12914 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
12915 (xg_get_pixbuf_from_pixmap): New function.
12916 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
12917 to Pixmap, take frame as parameter, remove GdkColormap parameter.
12918 Call xg_get_pixbuf_from_pixmap instead of
12919 gdk_pixbuf_get_from_drawable.
12920 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
12921 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
12922 (xg_check_special_colors): Use GtkStyleContext and its functions
12923 for HAVE_GTK3.
12924 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
12925 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
12926 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
12927 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
12928 Call gtk_widget_get_preferred_size.
0afb4571
J
12929 (xg_frame_resized): gdk_window_get_geometry only takes 5
12930 parameters.
44f230aa
SM
12931 (xg_win_to_widget, xg_event_is_for_menubar):
12932 Call gdk_x11_window_lookup_for_display.
0afb4571
J
12933 (xg_set_widget_bg): New function.
12934 (delete_cb): New function.
895009e1 12935 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 12936 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
12937 (xg_set_background_color): Call xg_set_widget_bg.
12938 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
12939 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
12940 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
12941 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
12942 if ! HAVE_GTK3.
12943 (update_frame_tool_bar): Call gtk_widget_hide.
12944 (xg_initialize): Use GDK_KEY_g.
12945
12946 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
12947 if ! HAVE_GTK3
12948 (x_session_initialize): Call gdk_x11_set_sm_client_id.
12949
12950 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
12951 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
12952 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
12953
1c2cc4ef
JB
129542011-03-08 Juanma Barranquero <lekktu@gmail.com>
12955
12956 * w32xfns.c (select_palette): Check success of RealizePalette against
12957 GDI_ERROR, not zero.
12958
33383987 12959See ChangeLog.11 for earlier changes.
aac0c6e3
MR
12960
12961;; Local Variables:
12962;; coding: utf-8
aac0c6e3
MR
12963;; End:
12964
2f097256 12965 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
12966
12967 This file is part of GNU Emacs.
12968
12969 GNU Emacs is free software: you can redistribute it and/or modify
12970 it under the terms of the GNU General Public License as published by
12971 the Free Software Foundation, either version 3 of the License, or
12972 (at your option) any later version.
12973
12974 GNU Emacs is distributed in the hope that it will be useful,
12975 but WITHOUT ANY WARRANTY; without even the implied warranty of
12976 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12977 GNU General Public License for more details.
12978
12979 You should have received a copy of the GNU General Public License
12980 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.